From 11aae952cb4c3e713f31a2de95803ce378366027 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 25 Jan 2016 11:13:41 +0200 Subject: [PATCH] Show 'read only' in title of window if a pattern file in read only state. --HG-- branch : feature --- src/app/valentina/mainwindow.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index a7f3f7165..643bf4511 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4164,7 +4164,7 @@ QString MainWindow::GetPatternFileName() { shownName = StrippedName(curFile); } - shownName += "[*]"; + shownName += QLatin1Literal("[*]"); return shownName; } @@ -4177,15 +4177,15 @@ QString MainWindow::GetMeasurementFileName() } else { - QString shownName = " ["; + QString shownName(" ["); shownName += StrippedName(AbsoluteMPath(curFile, doc->MPath())); if(mChanges) { - shownName += "*"; + shownName += QLatin1Literal("*"); } - shownName += "]"; + shownName += QLatin1Literal("]"); return shownName; } } @@ -4193,7 +4193,14 @@ QString MainWindow::GetMeasurementFileName() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::UpdateWindowTitle() { - setWindowTitle(GetPatternFileName()+GetMeasurementFileName()); + if (not patternReadOnly) + { + setWindowTitle(GetPatternFileName()+GetMeasurementFileName()); + } + else + { + setWindowTitle(GetPatternFileName()+GetMeasurementFileName() + " " + tr("(read only)")); + } setWindowFilePath(curFile); #if defined(Q_OS_MAC)