Changeset View
Changeset View
Standalone View
Standalone View
src/kmessagebox.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 96 | case QMessageBox::Information: | |||
---|---|---|---|---|---|
97 | icon_name = QStringLiteral("dialog-information"); | 97 | icon_name = QStringLiteral("dialog-information"); | ||
98 | break; | 98 | break; | ||
99 | case QMessageBox::Warning: | 99 | case QMessageBox::Warning: | ||
100 | icon_name = QStringLiteral("dialog-warning"); | 100 | icon_name = QStringLiteral("dialog-warning"); | ||
101 | break; | 101 | break; | ||
102 | case QMessageBox::Critical: | 102 | case QMessageBox::Critical: | ||
103 | icon_name = QStringLiteral("dialog-error"); | 103 | icon_name = QStringLiteral("dialog-error"); | ||
104 | break; | 104 | break; | ||
105 | case QMessageBox::Question: | ||||
106 | icon_name = QStringLiteral("dialog-question"); | ||||
107 | break; | ||||
105 | default: | 108 | default: | ||
106 | break; | 109 | break; | ||
107 | } | 110 | } | ||
108 | 111 | | |||
109 | QIcon ret = QIcon::fromTheme(icon_name); | 112 | QIcon ret = QIcon::fromTheme(icon_name); | ||
110 | 113 | | |||
111 | if (ret.isNull()) { | 114 | if (ret.isNull()) { | ||
112 | return QMessageBox::standardIcon(icon); | 115 | return QMessageBox::standardIcon(icon); | ||
▲ Show 20 Lines • Show All 375 Lines • ▼ Show 20 Line(s) | 477 | { | |||
488 | QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); | 491 | QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); | ||
489 | buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); | 492 | buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); | ||
490 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), buttonYes); | 493 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), buttonYes); | ||
491 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), buttonNo); | 494 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), buttonNo); | ||
492 | 495 | | |||
493 | applyOptions(dialog, options); | 496 | applyOptions(dialog, options); | ||
494 | 497 | | |||
495 | bool checkboxResult = false; | 498 | bool checkboxResult = false; | ||
496 | const int result = createKMessageBox(dialog, buttonBox, QMessageBox::Information, text, strlist, | 499 | const int result = createKMessageBox(dialog, buttonBox, QMessageBox::Question, text, strlist, | ||
497 | dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"), | 500 | dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"), | ||
498 | &checkboxResult, options); | 501 | &checkboxResult, options); | ||
499 | res = (result == QDialogButtonBox::Yes ? Yes : No); | 502 | res = (result == QDialogButtonBox::Yes ? Yes : No); | ||
500 | 503 | | |||
501 | if (checkboxResult) { | 504 | if (checkboxResult) { | ||
502 | saveDontShowAgainYesNo(dontAskAgainName, res); | 505 | saveDontShowAgainYesNo(dontAskAgainName, res); | ||
503 | } | 506 | } | ||
504 | return res; | 507 | return res; | ||
Show All 38 Lines | 530 | { | |||
543 | buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); | 546 | buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); | ||
544 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), buttonYes); | 547 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Yes), buttonYes); | ||
545 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), buttonNo); | 548 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::No), buttonNo); | ||
546 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), buttonCancel); | 549 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), buttonCancel); | ||
547 | 550 | | |||
548 | applyOptions(dialog, options); | 551 | applyOptions(dialog, options); | ||
549 | 552 | | |||
550 | bool checkboxResult = false; | 553 | bool checkboxResult = false; | ||
551 | const int result = createKMessageBox(dialog, buttonBox, QMessageBox::Information, | 554 | const int result = createKMessageBox(dialog, buttonBox, QMessageBox::Question, | ||
552 | text, QStringList(), | 555 | text, QStringList(), | ||
553 | dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"), | 556 | dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"), | ||
554 | &checkboxResult, options); | 557 | &checkboxResult, options); | ||
555 | 558 | | |||
556 | if (result == QDialogButtonBox::Yes) { | 559 | if (result == QDialogButtonBox::Yes) { | ||
557 | res = Yes; | 560 | res = Yes; | ||
558 | } else if (result == QDialogButtonBox::No) { | 561 | } else if (result == QDialogButtonBox::No) { | ||
559 | res = No; | 562 | res = No; | ||
▲ Show 20 Lines • Show All 613 Lines • Show Last 20 Lines |