Commit 2b94a3c0 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use action texts for buttons of decision/confirmation dialogs

parent 644b9ed5
Pipeline #94377 failed with stage
in 5 minutes and 26 seconds
......@@ -190,8 +190,8 @@ void IncidenceAttachment::removeSelectedAttachments()
if (KMessageBox::questionYesNo(nullptr,
xi18nc("@info", "Do you really want to remove these attachments?<nl/>%1", labelsStr),
i18nc("@title:window", "Remove Attachments?"),
KStandardGuiItem::yes(),
KStandardGuiItem::no(),
KStandardGuiItem::remove(),
KStandardGuiItem::cancel(),
QStringLiteral("calendarRemoveAttachments"))
!= KMessageBox::Yes) {
return;
......
......@@ -207,7 +207,9 @@ void IncidenceAttendee::save(const KCalendarCore::Incidence::Ptr &incidence)
"%1 does not look like a valid email address. "
"Are you sure you want to invite this participant?",
attendee.email()),
i18nc("@title:window", "Invalid Email Address"))
i18nc("@title:window", "Invalid Email Address"),
KGuiItem(i18nc("@action:button", "Invite"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Invite"), QStringLiteral("dialog-cancel")))
!= KMessageBox::Yes) {
skip = true;
}
......@@ -782,7 +784,10 @@ void IncidenceAttendee::slotOrganizerChanged(const QString &newOrganizer)
i18nc("@option",
"You are changing the organizer of this event. "
"Since the organizer is also attending this event, would you "
"like to change the corresponding attendee as well?"));
"like to change the corresponding attendee as well?"),
QString(),
KGuiItem(i18nc("@action:button", "Change Attendee"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Change"), QStringLiteral("dialog-cancel")));
} else {
answer = KMessageBox::Yes;
}
......
......@@ -429,7 +429,12 @@ void IncidenceDialogPrivate::handleItemSaveFail(EditorItemManager::SaveAction, c
"Unable to store the incidence in the calendar. Try again?\n\n "
"Reason: %1",
errorMessage);
retry = (KMessageBox::warningYesNo(q, message) == KMessageBox::Yes);
const int answer = KMessageBox::warningYesNo(q,
message,
QString(),
KGuiItem(i18nc("@action:button", "Retry"), QStringLiteral("dialog-ok")),
KStandardGuiItem::cancel());
retry = (answer == KMessageBox::Yes);
}
if (retry) {
......@@ -455,13 +460,13 @@ void IncidenceDialogPrivate::handleItemSaveFinish(EditorItemManager::SaveAction
"<para>Would you like to set your default events calendar to "
"<resource>%1</resource>?</para>",
collectionName);
if (KMessageBox::questionYesNo(q,
message,
i18nc("@title:window", "Set Default Calendar?"),
KStandardGuiItem::yes(), // Make collectionName My Default Calendar
KStandardGuiItem::no(), // Do Not Set a Default Calendar at this Time"
QStringLiteral("setDefaultCalendarCollection"))
== KMessageBox::Yes) {
const int answer = KMessageBox::questionYesNo(q,
message,
i18nc("@title:window", "Set Default Calendar?"),
KGuiItem(i18nc("@action:button", "Set As Default"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Set"), QStringLiteral("dialog-cancel")),
QStringLiteral("setDefaultCalendarCollection"));
if (answer == KMessageBox::Yes) {
CalendarSupport::KCalPrefs::instance()->setDefaultCalendarId(mItem.storageCollectionId());
}
}
......@@ -745,7 +750,11 @@ void IncidenceDialog::slotButtonClicked(QAbstractButton *button)
d->mItemManager->save();
} else if (d->mUi->buttonBox->button(QDialogButtonBox::Cancel) == button) {
if (d->isDirty()
&& KMessageBox::questionYesNo(this, i18nc("@info", "Do you really want to cancel?"), i18nc("@title:window", "KOrganizer Confirmation"))
&& KMessageBox::questionYesNo(this,
i18nc("@info", "Do you really want to cancel?"),
i18nc("@title:window", "KOrganizer Confirmation"),
KGuiItem(i18nc("@action:button", "Cancel Editing"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Cancel"), QStringLiteral("dialog-cancel")))
== KMessageBox::Yes) {
QDialog::reject(); // Discard current changes
} else if (!d->isDirty()) {
......@@ -762,7 +771,11 @@ void IncidenceDialog::reject()
{
Q_D(IncidenceDialog);
if (d->isDirty()
&& KMessageBox::questionYesNo(this, i18nc("@info", "Do you really want to cancel?"), i18nc("@title:window", "KOrganizer Confirmation"))
&& KMessageBox::questionYesNo(this,
i18nc("@info", "Do you really want to cancel?"),
i18nc("@title:window", "KOrganizer Confirmation"),
KGuiItem(i18nc("@action:button", "Cancel Editing"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Cancel"), QStringLiteral("dialog-cancel")))
== KMessageBox::Yes) {
QDialog::reject(); // Discard current changes
} else if (!d->isDirty()) {
......@@ -774,7 +787,11 @@ void IncidenceDialog::closeEvent(QCloseEvent *event)
{
Q_D(IncidenceDialog);
if (d->isDirty()
&& KMessageBox::questionYesNo(this, i18nc("@info", "Do you really want to cancel?"), i18nc("@title:window", "KOrganizer Confirmation"))
&& KMessageBox::questionYesNo(this,
i18nc("@info", "Do you really want to cancel?"),
i18nc("@title:window", "KOrganizer Confirmation"),
KGuiItem(i18nc("@action:button", "Cancel Editing"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Cancel"), QStringLiteral("dialog-cancel")))
== KMessageBox::Yes) {
QDialog::reject(); // Discard current changes
QDialog::closeEvent(event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment