forked from qt-creator/qt-creator
VCS/macOS: Fix message box when closing submit editor
When using the "Close" and "Cancel" standard buttons, it is no longer possible to change the button text on macOS. Additionally, the behavior on pressing <esc> is broken when using QtC in german (it should just close the dialog == cancel, but in german it triggers "close"). Task-number: QTBUG-118241 Change-Id: Ia35e6a29cd97fb91552dc5600f91be8b8e443f39 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -39,18 +39,19 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QCompleter>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
#include <QSet>
|
||||
#include <QStringListModel>
|
||||
#include <QStyle>
|
||||
#include <QToolBar>
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QCompleter>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@@ -472,13 +473,12 @@ bool VcsBaseSubmitEditor::promptSubmit(VcsBasePluginPrivate *plugin)
|
||||
mb.setWindowTitle(plugin->commitAbortTitle());
|
||||
mb.setIcon(QMessageBox::Warning);
|
||||
mb.setText(plugin->commitAbortMessage());
|
||||
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);
|
||||
QPushButton *closeButton = mb.addButton(Tr::tr("&Close"), QMessageBox::AcceptRole);
|
||||
QPushButton *keepButton = mb.addButton(Tr::tr("&Keep Editing"), QMessageBox::RejectRole);
|
||||
mb.setDefaultButton(keepButton);
|
||||
mb.setEscapeButton(keepButton);
|
||||
mb.exec();
|
||||
return mb.result() == QMessageBox::Close;
|
||||
return mb.clickedButton() == closeButton;
|
||||
}
|
||||
|
||||
QString VcsBaseSubmitEditor::promptForNickName()
|
||||
|
||||
Reference in New Issue
Block a user