Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Contacts
Commits
19f0404c
Commit
19f0404c
authored
Nov 04, 2021
by
Friedrich W. H. Kossebau
Browse files
Use action texts for buttons of decision/confirmation dialogs
parent
3647fe62
Pipeline
#94072
passed with stage
in 11 minutes and 48 seconds
Changes
6
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/akonadi-contacts/contacteditordialog.cpp
View file @
19f0404c
...
...
@@ -175,8 +175,12 @@ AkonadiContactEditor *ContactEditorDialog::editor() const
void
ContactEditorDialog
::
accept
()
{
if
(
d
->
mEditor
->
hasNoSavedData
())
{
if
(
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Location was not saved. Do you want to close editor?"
),
i18nc
(
"@title:window"
,
"Confirmation"
))
==
KMessageBox
::
No
)
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Location was not saved. Do you want to close editor?"
),
i18nc
(
"@title:window"
,
"Confirmation"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Close Editor"
),
QStringLiteral
(
"dialog-close"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Close"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
No
)
{
return
;
}
}
...
...
@@ -188,7 +192,13 @@ void ContactEditorDialog::accept()
void
ContactEditorDialog
::
reject
()
{
if
(
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Do you really want to cancel?"
),
i18nc
(
"@title:window"
,
"Confirmation"
))
==
KMessageBox
::
Yes
)
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Do you really want to cancel?"
),
i18nc
(
"@title:window"
,
"Confirmation"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Cancel Editing"
),
QStringLiteral
(
"dialog-ok"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Cancel"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
Yes
)
{
QDialog
::
reject
();
// Discard current changes
}
}
...
...
src/akonadi-contacts/contactgroupeditordialog.cpp
View file @
19f0404c
...
...
@@ -157,7 +157,13 @@ void ContactGroupEditorDialog::slotAccepted()
void
ContactGroupEditorDialog
::
reject
()
{
if
(
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Do you really want to cancel?"
),
i18nc
(
"@title:window"
,
"Confirmation"
))
==
KMessageBox
::
Yes
)
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Do you really want to cancel?"
),
i18nc
(
"@title:window"
,
"Confirmation"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Cancel Editing"
),
QStringLiteral
(
"dialog-ok"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Cancel"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
Yes
)
{
QDialog
::
reject
();
// Discard current changes
}
}
...
...
src/akonadi-contacts/job/addemailaddressjob.cpp
View file @
19f0404c
...
...
@@ -119,7 +119,9 @@ public:
if
(
nbItemCollection
==
0
)
{
if
(
KMessageBox
::
questionYesNo
(
mParentWidget
,
i18nc
(
"@info"
,
"You must create an address book before adding a contact. Do you want to create an address book?"
),
i18nc
(
"@title:window"
,
"No Address Book Available"
))
i18nc
(
"@title:window"
,
"No Address Book Available"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Create Address Book"
),
QStringLiteral
(
"address-book-new"
)),
KStandardGuiItem
::
cancel
())
==
KMessageBox
::
Yes
)
{
QPointer
<
Akonadi
::
AgentTypeDialog
>
dlg
=
new
Akonadi
::
AgentTypeDialog
(
mParentWidget
);
dlg
->
setWindowTitle
(
i18nc
(
"@title:window"
,
"Add Address Book"
));
...
...
@@ -221,7 +223,12 @@ public:
"<para>Do you want to edit this new contact now?</para>"
,
mCompleteAddress
);
if
(
KMessageBox
::
questionYesNo
(
mParentWidget
,
text
,
QString
(),
KStandardGuiItem
::
yes
(),
KStandardGuiItem
::
no
(),
QStringLiteral
(
"addedtokabc"
))
if
(
KMessageBox
::
questionYesNo
(
mParentWidget
,
text
,
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Edit"
),
QStringLiteral
(
"document-edit"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Finish"
),
QStringLiteral
(
"dialog-ok-apply"
)),
QStringLiteral
(
"addedtokabc"
))
==
KMessageBox
::
Yes
)
{
QPointer
<
Akonadi
::
ContactEditorDialog
>
dlg
=
new
Akonadi
::
ContactEditorDialog
(
Akonadi
::
ContactEditorDialog
::
EditMode
,
mParentWidget
);
dlg
->
setContact
(
mItem
);
...
...
src/akonadi-contacts/job/addemaildisplayjob.cpp
View file @
19f0404c
...
...
@@ -158,7 +158,9 @@ public:
if
(
nbItemCollection
==
0
)
{
if
(
KMessageBox
::
questionYesNo
(
mParentWidget
,
i18nc
(
"@info"
,
"You must create an address book before adding a contact. Do you want to create an address book?"
),
i18nc
(
"@title:window"
,
"No Address Book Available"
))
i18nc
(
"@title:window"
,
"No Address Book Available"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Create Address Book"
),
QStringLiteral
(
"address-book-new"
)),
KStandardGuiItem
::
cancel
())
==
KMessageBox
::
Yes
)
{
QPointer
<
Akonadi
::
AgentTypeDialog
>
dlg
=
new
Akonadi
::
AgentTypeDialog
(
mParentWidget
);
dlg
->
setWindowTitle
(
i18nc
(
"@title:window"
,
"Add Address Book"
));
...
...
src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
View file @
19f0404c
...
...
@@ -64,7 +64,11 @@ AddressesLocationWidget::AddressesLocationWidget(QWidget *parent)
auto
action
=
menu
.
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)),
i18n
(
"Remove Address"
));
action
->
setEnabled
(
!
mReadOnly
);
connect
(
action
,
&
QAction
::
triggered
,
this
,
[
this
,
idx
]()
{
const
auto
result
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Do you really want to delete this address?"
));
const
auto
result
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Do you really want to delete this address?"
),
QString
(),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
result
==
KMessageBox
::
Yes
)
{
mAddressModel
->
removeAddress
(
idx
.
row
());
}
...
...
src/contact-editor/editor/addresseditor/addresslocationwidget.cpp
View file @
19f0404c
...
...
@@ -289,7 +289,11 @@ void AddressLocationWidget::slotUpdateAddress()
void
AddressLocationWidget
::
slotRemoveAddress
()
{
if
(
mCurrentMode
==
ModifyAddress
)
{
const
auto
result
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Do you really want to delete this address?"
));
const
auto
result
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Do you really want to delete this address?"
),
QString
(),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
result
==
KMessageBox
::
Yes
)
{
Q_EMIT
removeAddress
(
mCurrentAddress
);
reset
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment