GUI: Set project filename to main window caption.

When project file is closed the caption is emptied.
This commit is contained in:
Kimmo Varis 2010-08-17 18:06:17 +03:00
parent d4210f4fc0
commit aef0aeb974
1 changed files with 8 additions and 0 deletions

View File

@ -692,6 +692,10 @@ void MainWindow::OpenProjectFile()
if (!filepath.isEmpty())
{
QFileInfo inf(filepath);
const QString filename = inf.fileName();
FormatAndSetTitle(tr("Project:") + QString(" ") + filename);
mUI.mActionCloseProjectFile->setEnabled(true);
mUI.mActionEditProjectFile->setEnabled(true);
mProject = new Project(filepath, this);
@ -714,6 +718,9 @@ void MainWindow::NewProjectFile()
{
mUI.mActionCloseProjectFile->setEnabled(true);
mUI.mActionEditProjectFile->setEnabled(true);
QFileInfo inf(filepath);
const QString filename = inf.fileName();
FormatAndSetTitle(tr("Project:") + QString(" ") + filename);
if (mProject)
delete mProject;
@ -729,6 +736,7 @@ void MainWindow::CloseProjectFile()
mProject = NULL;
mUI.mActionCloseProjectFile->setEnabled(false);
mUI.mActionEditProjectFile->setEnabled(false);
FormatAndSetTitle();
}
void MainWindow::EditProjectFile()