Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KNotes
Commits
aa2b02c2
Commit
aa2b02c2
authored
Nov 05, 2021
by
Friedrich W. H. Kossebau
Browse files
Use action texts for buttons of decision/confirmation dialogs
parent
71b0742e
Pipeline
#94304
passed with stage
in 7 minutes and 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
notesagent/notesagentalarmdialog.cpp
View file @
aa2b02c2
...
...
@@ -142,7 +142,12 @@ void NotesAgentAlarmDialog::slotShowNote()
void
NotesAgentAlarmDialog
::
slotRemoveAlarm
()
{
if
(
KMessageBox
::
Yes
==
KMessageBox
::
warningYesNo
(
this
,
i18n
(
"Are you sure to remove alarm?"
),
i18nc
(
"@title:window"
,
"Remove Alarm"
)))
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
this
,
i18n
(
"Are you sure to remove alarm?"
),
i18nc
(
"@title:window"
,
"Remove Alarm"
),
KStandardGuiItem
::
remove
(),
KStandardGuiItem
::
cancel
());
if
(
answer
==
KMessageBox
::
Yes
)
{
const
Akonadi
::
Item
::
Id
id
=
mListWidget
->
currentItemId
();
if
(
id
!=
-
1
)
{
Akonadi
::
Item
item
(
id
);
...
...
noteshared/src/job/createnewnotejob.cpp
View file @
aa2b02c2
...
...
@@ -91,8 +91,12 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
{
if
(
job
->
error
())
{
qCDebug
(
NOTESHARED_LOG
)
<<
" Error during fetch: "
<<
job
->
errorString
();
if
(
KMessageBox
::
Yes
==
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"An error occurred during fetching. Do you want to select a new default collection?"
)))
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"An error occurred during fetching. Do you want to select a new default collection?"
),
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Select New Default"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Ignore"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
Yes
)
{
Q_EMIT
selectNewCollection
();
}
else
{
deleteLater
();
...
...
@@ -102,8 +106,12 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
auto
fetchCollection
=
qobject_cast
<
Akonadi
::
CollectionFetchJob
*>
(
job
);
if
(
fetchCollection
->
collections
().
isEmpty
())
{
qCDebug
(
NOTESHARED_LOG
)
<<
"No collection fetched"
;
if
(
KMessageBox
::
Yes
==
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"An error occurred during fetching. Do you want to select a new default collection?"
)))
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"An error occurred during fetching. Do you want to select a new default collection?"
),
QString
(),
KGuiItem
(
i18nc
(
"@action:button"
,
"Select New Default"
)),
KGuiItem
(
i18nc
(
"@action:button"
,
"Ignore"
),
QStringLiteral
(
"dialog-cancel"
)));
if
(
answer
==
KMessageBox
::
Yes
)
{
Q_EMIT
selectNewCollection
();
}
else
{
deleteLater
();
...
...
@@ -113,9 +121,13 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
Akonadi
::
Collection
col
=
fetchCollection
->
collections
().
at
(
0
);
if
(
col
.
isValid
())
{
if
(
!
col
.
hasAttribute
<
NoteShared
::
ShowFolderNotesAttribute
>
())
{
if
(
KMessageBox
::
Yes
==
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"Collection is hidden. New note will be stored but not displayed. Do you want to show collection?"
)))
{
const
int
answer
=
KMessageBox
::
warningYesNo
(
nullptr
,
i18n
(
"Collection is hidden. New note will be stored but not displayed. Do you want to show collection?"
),
QString
(),
KGuiItem
(
i18nc
(
"@action::button"
,
"Show Collection"
)),
KGuiItem
(
i18nc
(
"@action::button"
,
"Do Not Show"
,
QStringLiteral
(
"dialog-cancel"
))));
if
(
answer
==
KMessageBox
::
Yes
)
{
col
.
addAttribute
(
new
NoteShared
::
ShowFolderNotesAttribute
());
auto
modifyJob
=
new
Akonadi
::
CollectionModifyJob
(
col
);
connect
(
modifyJob
,
&
Akonadi
::
CollectionModifyJob
::
result
,
this
,
&
CreateNewNoteJob
::
slotCollectionModifyFinished
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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