From 1d9af2dcc003cc9af18d3fbfcb59c7a28f1b5251 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sat, 31 Oct 2015 05:44:21 +0200 Subject: [PATCH] Resolved issue #397. Display the currently open measurement file name in the top menu of Valentina --HG-- branch : feature --- src/app/valentina/mainwindow.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 5ceb060bd..c8ec4b2e6 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -359,6 +359,14 @@ bool MainWindow::LoadMeasurements(const QString &path) } return false; } + QString shownName = strippedName(curFile); + if (curFile.isEmpty()) + { + shownName = tr("untitled.val"); + } + shownName += "[*]"; + shownName += " [" + strippedName(path) + "[*]]"; + setWindowTitle(shownName); return true; } @@ -1195,6 +1203,14 @@ void MainWindow::UnloadMeasurements() ui->actionShowM->setEnabled(false); ui->actionUnloadMeasurements->setDisabled(true); helpLabel->setText(tr("Measurements unloaded")); + + QString shownName = strippedName(curFile); + if (curFile.isEmpty()) + { + shownName = tr("untitled.val"); + } + shownName += "[*]"; + setWindowTitle(shownName); } else { @@ -2855,6 +2871,12 @@ void MainWindow::setCurrentFile(const QString &fileName) settings->SetRestoreFileList(restoreFiles); } shownName+="[*]"; + + QString path = AbsoluteMPath(fileName, doc->MPath()); + if(not path.isEmpty()) + { + shownName += " [" + strippedName(path) + "[*]]"; + } setWindowTitle(shownName); }