- Wrapped "fossil close"
- Fixed invalid window title when closing a workspace FossilOrigin-Name: c449a826c83c98c4e33e7adb31841684b4ed6084
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user