Show 'read only' in title of window if a pattern file in read only state.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-01-25 11:13:41 +02:00
parent 1f624ec69b
commit 11aae952cb

View file

@ -4164,7 +4164,7 @@ QString MainWindow::GetPatternFileName()
{ {
shownName = StrippedName(curFile); shownName = StrippedName(curFile);
} }
shownName += "[*]"; shownName += QLatin1Literal("[*]");
return shownName; return shownName;
} }
@ -4177,23 +4177,30 @@ QString MainWindow::GetMeasurementFileName()
} }
else else
{ {
QString shownName = " ["; QString shownName(" [");
shownName += StrippedName(AbsoluteMPath(curFile, doc->MPath())); shownName += StrippedName(AbsoluteMPath(curFile, doc->MPath()));
if(mChanges) if(mChanges)
{ {
shownName += "*"; shownName += QLatin1Literal("*");
} }
shownName += "]"; shownName += QLatin1Literal("]");
return shownName; return shownName;
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::UpdateWindowTitle() void MainWindow::UpdateWindowTitle()
{
if (not patternReadOnly)
{ {
setWindowTitle(GetPatternFileName()+GetMeasurementFileName()); setWindowTitle(GetPatternFileName()+GetMeasurementFileName());
}
else
{
setWindowTitle(GetPatternFileName()+GetMeasurementFileName() + " " + tr("(read only)"));
}
setWindowFilePath(curFile); setWindowFilePath(curFile);
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)