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
KMail
Commits
ae14d237
Commit
ae14d237
authored
Nov 05, 2021
by
Friedrich W. H. Kossebau
Committed by
Laurent Montel
Nov 07, 2021
Browse files
Use action texts for buttons of decision/confirmation dialogs
parent
1b8f8e46
Pipeline
#95350
canceled with stage
Changes
8
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
agents/archivemailagent/archivemailwidget.cpp
View file @
ae14d237
...
...
@@ -219,8 +219,11 @@ bool ArchiveMailWidget::save() const
void
ArchiveMailWidget
::
slotDeleteItem
()
{
const
QList
<
QTreeWidgetItem
*>
listItems
=
mWidget
.
treeWidget
->
selectedItems
();
if
(
KMessageBox
::
warningYesNo
(
parentWidget
(),
i18n
(
"Do you want to delete the selected items?"
),
i18nc
(
"@title:window"
,
"Delete Items"
))
==
KMessageBox
::
No
)
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
parentWidget
(),
i18n
(
"Do you want to delete the selected items?"
),
i18nc
(
"@title:window"
,
"Delete Items"
),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
No
)
{
return
;
}
...
...
agents/followupreminderagent/followupreminderinfowidget.cpp
View file @
ae14d237
...
...
@@ -205,11 +205,13 @@ void FollowUpReminderInfoWidget::deleteItems(const QList<QTreeWidgetItem *> &mai
if
(
mailItemLst
.
isEmpty
())
{
qCDebug
(
FOLLOWUPREMINDERAGENT_LOG
)
<<
"Not item selected"
;
}
else
{
if
(
KMessageBox
::
Yes
==
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete this selected item?"
,
"Do you want to delete these %1 selected items?"
,
mailItemLst
.
count
()),
i18nc
(
"@title:window"
,
"Delete Items"
)))
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete this selected item?"
,
"Do you want to delete these %1 selected items?"
,
mailItemLst
.
count
()),
i18nc
(
"@title:window"
,
"Delete Items"
),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
Yes
)
{
for
(
QTreeWidgetItem
*
item
:
mailItemLst
)
{
auto
mailItem
=
static_cast
<
FollowUpReminderInfoItem
*>
(
item
);
mListRemoveId
<<
mailItem
->
info
()
->
uniqueIdentifier
();
...
...
agents/sendlateragent/sendlaterconfigurewidget.cpp
View file @
ae14d237
...
...
@@ -197,20 +197,21 @@ void SendLaterWidget::slotDeleteItem()
return
;
}
const
int
numberOfItems
(
listItems
.
count
());
if
(
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete the selected item?"
,
"Do you want to delete the selected items?"
,
numberOfItems
),
i18nc
(
"@title:window"
,
"Delete Items"
))
==
KMessageBox
::
No
)
{
int
answer
=
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete the selected item?"
,
"Do you want to delete the selected items?"
,
numberOfItems
),
i18nc
(
"@title:window"
,
"Delete Items"
),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
No
)
{
return
;
}
bool
deleteMessage
=
false
;
if
(
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete the message as well?"
,
"Do you want to delete the messages as well?"
,
numberOfItems
),
i18nc
(
"@title:window"
,
"Delete Messages"
))
==
KMessageBox
::
Yes
)
{
deleteMessage
=
true
;
}
answer
=
KMessageBox
::
warningYesNo
(
this
,
i18np
(
"Do you want to delete the message as well?"
,
"Do you want to delete the messages as well?"
,
numberOfItems
),
i18nc
(
"@title:window"
,
"Delete Messages"
),
KStandardGuiItem
::
del
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Delete"
),
QStringLiteral
(
"dialog-cancel"
)));
const
bool
deleteMessage
=
(
answer
==
KMessageBox
::
Yes
);
for
(
QTreeWidgetItem
*
item
:
listItems
)
{
if
(
deleteMessage
)
{
...
...
agents/sendlateragent/sendlatermanager.cpp
View file @
ae14d237
...
...
@@ -186,12 +186,18 @@ void SendLaterManager::sendError(MessageComposer::SendLaterInfo *info, ErrorType
break
;
case
TooManyItemFound
:
case
CanNotFetchItem
:
case
CanNotCreateTransport
:
if
(
KMessageBox
::
No
==
KMessageBox
::
questionYesNo
(
nullptr
,
i18n
(
"An error was found. Do you want to resend it?"
),
i18n
(
"Error found"
)))
{
case
CanNotCreateTransport
:
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
i18n
(
"An error was found. Do you want to resend it?"
),
i18n
(
"Error found"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Resend"
),
QStringLiteral
(
"mail-send"
)),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
No
)
{
removeLaterInfo
(
info
);
}
break
;
}
}
}
recreateSendList
();
}
...
...
src/identity/identityeditvcarddialog.cpp
View file @
ae14d237
...
...
@@ -55,7 +55,12 @@ void IdentityEditVcardDialog::slotDeleteCurrentVCard()
if
(
mVcardFileName
.
isEmpty
())
{
return
;
}
if
(
KMessageBox
::
Yes
==
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Are you sure you want to delete this vCard?"
),
i18n
(
"Delete vCard"
)))
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
this
,
i18n
(
"Are you sure you want to delete this vCard?"
),
i18n
(
"Delete vCard"
),
KStandardGuiItem
::
del
(),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
Yes
)
{
if
(
mVcardFileName
.
startsWith
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericConfigLocation
)))
{
deleteCurrentVcard
(
true
);
}
else
{
...
...
@@ -117,7 +122,12 @@ QString IdentityEditVcardDialog::saveVcard() const
void
IdentityEditVcardDialog
::
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/job/opencomposerjob.cpp
View file @
ae14d237
...
...
@@ -112,8 +112,12 @@ void OpenComposerJob::slotOpenComposer()
for
(
QList
<
QUrl
>::
ConstIterator
it
=
attachURLs
.
constBegin
();
it
!=
endAttachment
;
++
it
)
{
QMimeDatabase
mimeDb
;
if
(
mimeDb
.
mimeTypeForUrl
(
*
it
).
name
()
==
QLatin1String
(
"inode/directory"
))
{
if
(
KMessageBox
::
questionYesNo
(
nullptr
,
i18n
(
"Do you want to attach this folder
\"
%1
\"
?"
,
(
*
it
).
toDisplayString
()),
i18n
(
"Attach Folder"
))
==
KMessageBox
::
No
)
{
const
int
answer
=
KMessageBox
::
questionYesNo
(
nullptr
,
i18n
(
"Do you want to attach this folder
\"
%1
\"
?"
,
(
*
it
).
toDisplayString
()),
i18n
(
"Attach Folder"
),
KGuiItem
(
i18nc
(
"@action:button"
,
"Attach"
),
QStringLiteral
(
"dialog-ok"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Attach"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
No
)
{
continue
;
}
}
...
...
src/kmmainwidget.cpp
View file @
ae14d237
...
...
@@ -308,8 +308,13 @@ KMMainWidget::KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient, KActionCo
if
(
kmkernel
->
firstStart
())
{
const
QStringList
listOfMailerFound
=
MailCommon
::
Util
::
foundMailer
();
if
(
!
listOfMailerFound
.
isEmpty
())
{
if
(
KMessageBox
::
questionYesNoList
(
this
,
i18n
(
"Another mailer was found on system. Do you want to import data from it?"
),
listOfMailerFound
)
==
KMessageBox
::
Yes
)
{
const
int
answer
=
KMessageBox
::
questionYesNoList
(
this
,
i18n
(
"Another mailer was found on system. Do you want to import data from it?"
),
listOfMailerFound
,
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Import"
),
QStringLiteral
(
"document-import"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Do Not Import"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
Yes
)
{
const
QString
path
=
QStandardPaths
::
findExecutable
(
QStringLiteral
(
"akonadiimportwizard"
));
if
(
!
QProcess
::
startDetached
(
path
,
QStringList
()))
{
KMessageBox
::
error
(
this
,
...
...
src/tests/searchmailertest.cpp
View file @
ae14d237
...
...
@@ -15,7 +15,10 @@ int main(int argc, char **argv)
if
(
!
listOfMailerFound
.
isEmpty
())
{
if
(
KMessageBox
::
questionYesNoList
(
nullptr
,
QStringLiteral
(
"Another mailer was found on system. Do you want to import data from it?"
),
listOfMailerFound
)
listOfMailerFound
,
QString
(),
KGuiItem
(
QStringLiteral
(
"Import"
),
QStringLiteral
(
"document-import"
)),
KGuiItem
(
QStringLiteral
(
"Do Not Import"
),
QStringLiteral
(
"dialog-cancel"
)))
==
KMessageBox
::
Yes
)
{
qDebug
()
<<
" launch importwizard"
;
}
else
{
...
...
Write
Preview
Supports
Markdown
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