- Wrapped "fossil close"

- Fixed invalid window title when closing a workspace


FossilOrigin-Name: c449a826c83c98c4e33e7adb31841684b4ed6084
This commit is contained in:
kostas 2015-04-26 17:40:58 +00:00
parent c43c638b91
commit 1c728c9146
5 changed files with 31 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Wrapped\s"fossil\sopen"\sand\s"fossil\snew"
D 2015-04-26T17:31:26.309
C -\sWrapped\s"fossil\sclose"\n-\sFixed\sinvalid\swindow\stitle\swhen\sclosing\sa\sworkspace\n
D 2015-04-26T17:40:58.322
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
@ -184,8 +184,8 @@ F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
F rsrc/resources.qrc 4098be128fd6c045db933d041fe8844b14643a6f
F src/Bridge.cpp 60aeda77aa45d0392882163ebb2a76c180887edf
F src/Bridge.h ed662224c9e1dfcefce7b20e61bf9233d4658739
F src/Bridge.cpp 0dbac79acbd9d0d4a324a36a81ccfa17ab78724a
F src/Bridge.h 991532ea29129af8212b2c6993d45f29f9e55098
F src/BrowserWidget.cpp 8b8f545cdff4a4188edc698a1b4777f5df46f056
F src/BrowserWidget.h 764d66aa9a93b890298bd0301097739cb4e16597
F src/CloneDialog.cpp 812ef7d361c16da21540b7047c9d4d5e74f18539
@ -200,7 +200,7 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
F src/MainWindow.cpp 1a566742892c79d9ae82c9ecd30a7104f3fd7dda
F src/MainWindow.cpp b76f75859164a1f6466d698f6de2e287cbb7d220
F src/MainWindow.h 3e19e5af60fa9bf0b7049fce70e2f030f8514ac9
F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4
F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43
@ -215,7 +215,7 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7
F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b
P 02a7b672e1d634b703ee5f30258153c3f4610886
R 9b9bafb1d1fed894392a7cd8221a1f0d
P edf97efd4a0adc050076296c896e68371ecb0be0
R 248142aaf1fb4256b0aef0b34c37e023
U kostas
Z 8897bdc7ab9789c2ea95847e8892a35c
Z 80bf5b981b23e692892835541310d2c6

View File

@ -1 +1 @@
edf97efd4a0adc050076296c896e68371ecb0be0
c449a826c83c98c4e33e7adb31841684b4ed6084

View File

@ -85,6 +85,17 @@ bool Bridge::newRepository(const QString& repositoryPath)
return true;
}
//------------------------------------------------------------------------------
bool Bridge::closeRepository()
{
if(!runFossil(QStringList() << "close"))
return false;
stopUI();
setCurrentWorkspace("");
return true;
}
//------------------------------------------------------------------------------
static QString ParseFossilQuery(QString line)
{

View File

@ -84,6 +84,7 @@ public:
bool openRepository(const QString &repositoryPath, const QString& workspacePath);
bool newRepository(const QString &repositoryPath);
bool closeRepository();
bool uiRunning() const;
bool startUI(const QString &httpPort);

View File

@ -498,14 +498,20 @@ void MainWindow::on_actionCloseRepository_triggered()
return;
// Close Repo
#ifndef BRIDGE_ENABLED
if(!runFossil(QStringList() << "close"))
#else
if(!bridge.closeRepository())
#endif
{
QMessageBox::critical(this, tr("Error"), tr("Cannot close the workspace.\nAre there still uncommitted changes available?"), QMessageBox::Ok );
return;
}
#ifdef BRIDGE_ENABLED
stopUI();
setCurrentWorkspace("");
#endif
refresh();
}
@ -647,6 +653,8 @@ void MainWindow::enableActions(bool on)
//------------------------------------------------------------------------------
bool MainWindow::refresh()
{
QString title = "Fuel";
// Load repository info
RepoStatus st = getRepoStatus();
@ -656,6 +664,7 @@ bool MainWindow::refresh()
enableActions(false);
repoFileModel.removeRows(0, repoFileModel.rowCount());
repoDirModel.clear();
setWindowTitle(title);
return false;
}
else if(st==REPO_OLD_SCHEMA)
@ -664,6 +673,7 @@ bool MainWindow::refresh()
enableActions(false);
repoFileModel.removeRows(0, repoFileModel.rowCount());
repoDirModel.clear();
setWindowTitle(title);
return true;
}
@ -672,8 +682,6 @@ bool MainWindow::refresh()
setStatus("");
enableActions(true);
QString title = "Fuel";
if(!getProjectName().isEmpty())
title += " - " + getProjectName();