From 458d7be6b25059aace573c2afb4f54880312df91 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 18 Jun 2016 18:09:18 +0300 Subject: [PATCH] Show appropriate button text when file is read only. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index bda8aad7b..f5a583892 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3318,11 +3318,12 @@ bool MainWindow::MaybeSave() messageBox->setDefaultButton(QMessageBox::Yes); messageBox->setEscapeButton(QMessageBox::Cancel); - messageBox->setButtonText(QMessageBox::Yes, curFile.isEmpty() ? tr("Save...") : tr("Save")); + messageBox->setButtonText(QMessageBox::Yes, + curFile.isEmpty() || doc->IsReadOnly() ? tr("Save...") : tr("Save")); messageBox->setButtonText(QMessageBox::No, tr("Don't Save")); messageBox->setWindowModality(Qt::ApplicationModal); - const QMessageBox::StandardButton ret = static_cast(messageBox->exec()); + const auto ret = static_cast(messageBox->exec()); switch (ret) {