Fixed issue with incosistent UI state when closing a workspace
Simplified workspace refresh logic FossilOrigin-Name: 2e0cbf44fd99ae2c1155857c79d0c09be9897483
This commit is contained in:
parent
dc072a8219
commit
73731923d3
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C CloneDialog:\sFixed\sincorrect\sparsing\sfor\slocal\srepositories\nCloneDialog:\sFixed\sincorrect\smissing\ssuffix\sdetection\nWe\snow\spass\slocal\srepository\surls\sas\slocal\spaths\sto\sfossil,\sin\sorder\sto\sovercome\sbuggy\sbehavior\sof\sQUrl\sfor\sWindows\spaths
|
C Fixed\sissue\swith\sincosistent\sUI\sstate\swhen\sclosing\sa\sworkspace\nSimplified\sworkspace\srefresh\slogic
|
||||||
D 2015-08-26T19:56:14.906
|
D 2015-08-26T20:28:00.267
|
||||||
F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76
|
F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76
|
||||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||||
@ -232,8 +232,8 @@ F src/FslSettingsDialog.cpp e00907d493fba469e48a008aecda88426350b5ac
|
|||||||
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
|
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
|
||||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||||
F src/MainWindow.cpp 47aa96182c3a005d27295ef52e351f57a79721da
|
F src/MainWindow.cpp 28f0155821d42c645c99fdd5214344c177cea3bc
|
||||||
F src/MainWindow.h f4cffbe4d360d30aa2eeaa25fc6d50d0a39c617f
|
F src/MainWindow.h 15f703522d1d6cd6239c8c8f037d158870b6b0b9
|
||||||
F src/RemoteDialog.cpp 8540cc5e2e41c4127ed8a028d84691604fa6ecac
|
F src/RemoteDialog.cpp 8540cc5e2e41c4127ed8a028d84691604fa6ecac
|
||||||
F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d
|
F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d
|
||||||
F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79
|
F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79
|
||||||
@ -261,7 +261,7 @@ F ui/MainWindow.ui e2a18caa7482b3ee0dff477592cdc9574b35fe4f
|
|||||||
F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b
|
F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b
|
||||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||||
F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1
|
F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1
|
||||||
P e574454625a7701da9d1959fa72e54036d5ab7c3
|
P afa9b2538a0bfa258104a979eadce28c099e9848
|
||||||
R edb709028da6b5b7318a59278b5a9c29
|
R 8e7f8d9d9b9c83f269cd7044b0450be8
|
||||||
U Kostas
|
U Kostas
|
||||||
Z 791f9cfa7aba39378f947f3aabef881e
|
Z 3db267354ced0e1a65fb38289663a642
|
||||||
|
@ -1 +1 @@
|
|||||||
afa9b2538a0bfa258104a979eadce28c099e9848
|
2e0cbf44fd99ae2c1155857c79d0c09be9897483
|
@ -648,65 +648,72 @@ void MainWindow::enableActions(bool on)
|
|||||||
ui->actionCreateBranch,
|
ui->actionCreateBranch,
|
||||||
ui->actionMergeBranch,
|
ui->actionMergeBranch,
|
||||||
ui->actionFossilSettings,
|
ui->actionFossilSettings,
|
||||||
|
ui->actionViewAll,
|
||||||
|
ui->actionViewAsFolders,
|
||||||
|
ui->actionViewAsList,
|
||||||
|
ui->actionViewIgnored,
|
||||||
|
ui->actionViewModifedOnly,
|
||||||
|
ui->actionViewModified,
|
||||||
|
ui->actionViewUnchanged,
|
||||||
|
ui->actionViewUnknown
|
||||||
};
|
};
|
||||||
|
|
||||||
for(size_t i=0; i<COUNTOF(actions); ++i)
|
for(size_t i=0; i<COUNTOF(actions); ++i)
|
||||||
actions[i]->setEnabled(on);
|
actions[i]->setEnabled(on);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
bool MainWindow::refresh()
|
bool MainWindow::refresh()
|
||||||
{
|
{
|
||||||
QString title = "Fuel";
|
QString title = "Fuel";
|
||||||
|
|
||||||
// Load repository info
|
|
||||||
RepoStatus st = fossil().getRepoStatus();
|
|
||||||
|
|
||||||
if(st==REPO_NOT_FOUND)
|
|
||||||
{
|
|
||||||
setStatus(tr("No workspace detected."));
|
|
||||||
enableActions(false);
|
|
||||||
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
|
||||||
getWorkspace().getTreeModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
|
||||||
setWindowTitle(title);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(st==REPO_OLD_SCHEMA)
|
|
||||||
{
|
|
||||||
setStatus(tr("Old repository schema detected. Consider running 'fossil rebuild'"));
|
|
||||||
enableActions(false);
|
|
||||||
getWorkspace().getFileModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
|
||||||
getWorkspace().getTreeModel().removeRows(0, getWorkspace().getFileModel().rowCount());
|
|
||||||
setWindowTitle(title);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
loadFossilSettings();
|
loadFossilSettings();
|
||||||
scanWorkspace();
|
|
||||||
setStatus("");
|
|
||||||
enableActions(true);
|
|
||||||
|
|
||||||
|
bool valid = scanWorkspace();
|
||||||
|
if(valid)
|
||||||
|
{
|
||||||
const QString &project_name = getWorkspace().getProjectName();
|
const QString &project_name = getWorkspace().getProjectName();
|
||||||
if(!project_name.isEmpty())
|
if(!project_name.isEmpty())
|
||||||
title += " - " + project_name;
|
title += " - " + project_name;
|
||||||
|
|
||||||
setWindowTitle(title);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enableActions(valid);
|
||||||
|
setWindowTitle(title);
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void MainWindow::scanWorkspace()
|
bool MainWindow::scanWorkspace()
|
||||||
{
|
{
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
|
bool valid = true;
|
||||||
|
|
||||||
|
// Load repository info
|
||||||
|
RepoStatus st = fossil().getRepoStatus();
|
||||||
|
QString status;
|
||||||
|
|
||||||
|
if(st==REPO_NOT_FOUND)
|
||||||
|
{
|
||||||
|
status = tr("No workspace detected.");
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
else if(st==REPO_OLD_SCHEMA)
|
||||||
|
{
|
||||||
|
status = tr("Old repository schema detected. Consider running 'fossil rebuild'");
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
versionList.clear();
|
||||||
|
selectedTags.clear();
|
||||||
|
selectedBranches.clear();
|
||||||
|
|
||||||
|
if(valid)
|
||||||
|
{
|
||||||
|
// Determine ignored file patterns
|
||||||
|
QStringList ignore_patterns;
|
||||||
|
{
|
||||||
static const QRegExp REGEX_GLOB_LIST(",|\\n", Qt::CaseSensitive);
|
static const QRegExp REGEX_GLOB_LIST(",|\\n", Qt::CaseSensitive);
|
||||||
|
|
||||||
QStringList ignore_patterns;
|
|
||||||
|
|
||||||
// Determine ignored file patterns
|
|
||||||
{
|
|
||||||
QString ignore_list = settings.GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString().trimmed();
|
QString ignore_list = settings.GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString().trimmed();
|
||||||
|
|
||||||
// Read patterns from versionable file if it exists
|
// Read patterns from versionable file if it exists
|
||||||
@ -732,21 +739,21 @@ void MainWindow::scanWorkspace()
|
|||||||
uiCallback,
|
uiCallback,
|
||||||
operationAborted
|
operationAborted
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Build default versions list
|
||||||
|
versionList += getWorkspace().getBranches();
|
||||||
|
versionList += getWorkspace().getTags().keys();
|
||||||
|
lblTags->setText(" " + getWorkspace().getActiveTags().join(" ") + " ");
|
||||||
|
}
|
||||||
|
|
||||||
updateWorkspaceView();
|
updateWorkspaceView();
|
||||||
updateFileView();
|
updateFileView();
|
||||||
|
|
||||||
// Build default versions list
|
setStatus(status);
|
||||||
versionList.clear();
|
lblTags->setVisible(valid);
|
||||||
versionList += getWorkspace().getBranches();
|
|
||||||
versionList += getWorkspace().getTags().keys();
|
|
||||||
|
|
||||||
selectedTags.clear();
|
|
||||||
selectedBranches.clear();
|
|
||||||
|
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
setStatus("");
|
return valid;
|
||||||
lblTags->setText(" " + getWorkspace().getActiveTags().join(" ") + " ");
|
|
||||||
lblTags->setVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -26,7 +26,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool refresh();
|
bool refresh();
|
||||||
void scanWorkspace();
|
bool scanWorkspace();
|
||||||
void applySettings();
|
void applySettings();
|
||||||
void updateSettings();
|
void updateSettings();
|
||||||
void updateRevision(const QString& revision);
|
void updateRevision(const QString& revision);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user