Show appropriate button text when file is read only.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-06-18 18:09:18 +03:00
parent 174b1fbfd6
commit 458d7be6b2

View File

@ -3318,11 +3318,12 @@ bool MainWindow::MaybeSave()
messageBox->setDefaultButton(QMessageBox::Yes); messageBox->setDefaultButton(QMessageBox::Yes);
messageBox->setEscapeButton(QMessageBox::Cancel); 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->setButtonText(QMessageBox::No, tr("Don't Save"));
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
const QMessageBox::StandardButton ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)
{ {