Fix consistency of default button in messageboxes between Qt and KDE builds.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
1. Dont display codec settings in copy dialog unless we are copying to a
|
||||
device, or from an AudioCD.
|
||||
2. Save size of Track Organiser, Tag Editor, and ReplayGain dialogs.
|
||||
3. Fix consistency of default button in messageboxes between Qt and KDE builds.
|
||||
|
||||
1.0.2.1
|
||||
-------
|
||||
|
||||
@@ -48,15 +48,17 @@ MessageBox::ButtonCode MessageBox::questionYesNoCancel(QWidget *parent, const QS
|
||||
if (yesText.text.isEmpty() && noText.text.isEmpty()) {
|
||||
return map(isWarning
|
||||
? QMessageBox::warning(parent, title.isEmpty() ? i18n("Warning") : title, message,
|
||||
QMessageBox::Yes|QMessageBox::No|(showCancel ? QMessageBox::Cancel : QMessageBox::NoButton))
|
||||
QMessageBox::Yes|QMessageBox::No|(showCancel ? QMessageBox::Cancel : QMessageBox::NoButton),
|
||||
showCancel ? QMessageBox::Yes : QMessageBox::No)
|
||||
: QMessageBox::question(parent, title.isEmpty() ? i18n("Question") : title, message,
|
||||
QMessageBox::Yes|QMessageBox::No|(showCancel ? QMessageBox::Cancel : QMessageBox::NoButton))
|
||||
QMessageBox::Yes|QMessageBox::No|(showCancel ? QMessageBox::Cancel : QMessageBox::NoButton),
|
||||
QMessageBox::Yes)
|
||||
);
|
||||
} else {
|
||||
QMessageBox box(isWarning ? QMessageBox::Warning : QMessageBox::Question, title.isEmpty() ? (isWarning ? i18n("Warning") : i18n("Question")) : title,
|
||||
message, QMessageBox::Yes|QMessageBox::No|(showCancel ? QMessageBox::Cancel : QMessageBox::NoButton), parent);
|
||||
|
||||
box.setDefaultButton(QMessageBox::Yes);
|
||||
box.setDefaultButton(isWarning && !showCancel ? QMessageBox::No : QMessageBox::Yes);
|
||||
if (!yesText.text.isEmpty()) {
|
||||
QAbstractButton *btn=box.button(QMessageBox::Yes);
|
||||
btn->setText(yesText.text);
|
||||
|
||||
Reference in New Issue
Block a user