forked from qt-creator/qt-creator
VCS: Recover clearer actions when closing commit editor
Amends commitd63bfa4a29
, and recovers the actions that were introduced in15b176e30c
(relates to QTCREATORBUG-18799). I keep being confused by these Yes/No myself :) Change-Id: I0429ef9c25231b96bd595a1bfb6808b621db54e5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
1a4badb705
commit
10dc4f93f4
@@ -481,10 +481,18 @@ bool VcsBaseSubmitEditor::promptSubmit(VcsBasePluginPrivate *plugin)
|
||||
return true;
|
||||
|
||||
const QString commitName = plugin->commitDisplayName();
|
||||
return QMessageBox::question(Core::ICore::dialogParent(),
|
||||
Tr::tr("Close %1 %2 Editor").arg(plugin->displayName(), commitName),
|
||||
Tr::tr("Closing this editor will abort the %1. Are you sure?")
|
||||
.arg(commitName.toLower())) == QMessageBox::Yes;
|
||||
QMessageBox mb(Core::ICore::dialogParent());
|
||||
mb.setWindowTitle(Tr::tr("Close %1 %2 Editor").arg(plugin->displayName(), commitName));
|
||||
mb.setIcon(QMessageBox::Warning);
|
||||
mb.setText(Tr::tr("Closing this editor will abort the %1.")
|
||||
.arg(commitName.toLower()));
|
||||
mb.setStandardButtons(QMessageBox::Close | QMessageBox::Cancel);
|
||||
// On Windows there is no mnemonic for Close. Set it explicitly.
|
||||
mb.button(QMessageBox::Close)->setText(Tr::tr("&Close"));
|
||||
mb.button(QMessageBox::Cancel)->setText(Tr::tr("&Keep Editing"));
|
||||
mb.setDefaultButton(QMessageBox::Cancel);
|
||||
mb.exec();
|
||||
return mb.result() == QMessageBox::Close;
|
||||
}
|
||||
|
||||
QString VcsBaseSubmitEditor::promptForNickName()
|
||||
|
Reference in New Issue
Block a user