Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KAlarm
Commits
460bd3a4
Commit
460bd3a4
authored
Aug 24, 2014
by
David Jarvie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge 99ca0fbf08670ed2c243089486a4b6e6db9f61b9 from KDE/4.14
parent
8ce53d76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
9 deletions
+72
-9
kalarmapp.cpp
kalarmapp.cpp
+6
-5
lib/messagebox.cpp
lib/messagebox.cpp
+4
-1
lib/messagebox.h
lib/messagebox.h
+62
-3
No files found.
kalarmapp.cpp
View file @
460bd3a4
...
...
@@ -658,18 +658,19 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
void
KAlarmApp
::
doQuit
(
QWidget
*
parent
)
{
qDebug
();
if
(
KAMessageBox
::
warningContinue
Cancel
(
parent
,
KMessageBox
::
Cancel
,
if
(
KAMessageBox
::
warningC
ancelC
ontinue
(
parent
,
i18nc
(
"@info"
,
"Quitting will disable alarms (once any alarm message windows are closed)."
),
QString
(),
KStandardGuiItem
::
quit
(),
Preferences
::
QUIT_WARN
)
!=
KMessageBox
::
Yes
)
QString
(),
KStandardGuiItem
::
quit
(),
KStandardGuiItem
::
cancel
(),
Preferences
::
QUIT_WARN
)
!=
KMessageBox
::
Continue
)
return
;
if
(
!
KAlarm
::
checkRtcWakeConfig
(
true
).
isEmpty
())
{
// A wake-on-suspend alarm is set
if
(
KAMessageBox
::
warningContinue
Cancel
(
parent
,
KMessageBox
::
Cancel
,
if
(
KAMessageBox
::
warningC
ancelC
ontinue
(
parent
,
i18nc
(
"@info"
,
"Quitting will cancel the scheduled Wake from Suspend."
),
QString
(),
KStandardGuiItem
::
quit
()
)
!=
KMessageBox
::
Yes
)
)
!=
KMessageBox
::
Continue
)
return
;
mCancelRtcWake
=
true
;
}
...
...
lib/messagebox.cpp
View file @
460bd3a4
/*
* messagebox.cpp - enhanced KMessageBox class
* Program: kalarm
* Copyright © 2004,2005,2007,2008,2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2004,2005,2007,2008,2011
,2014
by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -56,6 +56,7 @@ KMessageBox::ButtonCode KAMessageBox::getContinueDefault(const QString& dontAskA
}
/******************************************************************************
<<<<<<< HEAD
* Continue/cancel message box with the option as to which button is the default.
* If 'dontAskAgainName' is specified, the message box will only be suppressed
* if the user chose Continue last time.
...
...
@@ -84,6 +85,8 @@ int KAMessageBox::warningContinueCancel(QWidget* parent, KMessageBox::ButtonCode
}
/******************************************************************************
=======
>>>>>>> 99ca0fbf08670ed2c243089486a4b6e6db9f61b9
* If there is no current setting for whether a non-yes/no message box should be
* shown, set it to 'defaultShow'.
* If a continue/cancel message box has Cancel as the default button, either
...
...
lib/messagebox.h
View file @
460bd3a4
/*
* messagebox.h - enhanced KMessageBox class
* Program: kalarm
* Copyright © 2004,2007,2011 by David Jarvie <djarvie@kde.org>
* Copyright © 2004,2007,2011
,2014
by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -58,6 +58,7 @@ class KAMessageBox
* @param dontAskAgainName The identifier controlling whether the message box is suppressed.
* @param defaultButton The default button for the message box. Valid values are Continue or Cancel.
*/
<<<<<<<
HEAD
static
void
setContinueDefault
(
const
QString
&
dontAskAgainName
,
KMessageBox
::
ButtonCode
defaultButton
);
/** Displays a Continue/Cancel message box with the option as to which button is the default.
* @param parent Parent widget
...
...
@@ -72,6 +73,9 @@ class KAMessageBox
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonContinue
=
KStandardGuiItem
::
cont
(),
const
QString
&
dontAskAgainName
=
QString
());
=======
static
void
setContinueDefault
(
const
QString
&
dontAskAgainName
,
ButtonCode
defaultButton
);
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
/** If there is no current setting for whether a non-Yes/No message box should be
* shown, sets it to @p defaultShow.
* If a Continue/Cancel message box has Cancel as the default button, either
...
...
@@ -105,13 +109,23 @@ class KAMessageBox
/** Same as KMessageBox::detailedError() except that it defaults to window-modal,
* not application-modal. */
static
void
detailedError
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
details
,
<<<<<<<
HEAD
const
QString
&
caption
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
caption
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
KMessageBox
::
detailedError
(
parent
,
text
,
details
,
caption
,
options
);
}
/** Same as KMessageBox::detailedSorry() except that it defaults to window-modal,
* not application-modal. */
static
void
detailedSorry
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
details
,
<<<<<<<
HEAD
const
QString
&
caption
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
caption
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
KMessageBox
::
detailedSorry
(
parent
,
text
,
details
,
caption
,
options
);
}
/** Same as KMessageBox::error() except that it defaults to window-modal,
...
...
@@ -123,7 +137,12 @@ class KAMessageBox
/** Same as KMessageBox::information() except that it defaults to window-modal,
* not application-modal. */
static
void
information
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
<<<<<<<
HEAD
const
QString
&
dontShowAgainName
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
dontShowAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
KMessageBox
::
information
(
parent
,
text
,
caption
,
dontShowAgainName
,
options
);
}
/** Same as KMessageBox::sorry() except that it defaults to window-modal,
...
...
@@ -137,7 +156,12 @@ class KAMessageBox
static
int
questionYesNo
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonYes
=
KStandardGuiItem
::
yes
(),
const
KGuiItem
&
buttonNo
=
KStandardGuiItem
::
no
(),
<<<<<<<
HEAD
const
QString
&
dontAskAgainName
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
dontAskAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
return
KMessageBox
::
questionYesNo
(
parent
,
text
,
caption
,
buttonYes
,
buttonNo
,
dontAskAgainName
,
options
);
}
/** Same as KMessageBox::questionYesNoCancel() except that it defaults
...
...
@@ -145,16 +169,46 @@ class KAMessageBox
static
int
questionYesNoCancel
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonYes
=
KStandardGuiItem
::
yes
(),
const
KGuiItem
&
buttonNo
=
KStandardGuiItem
::
no
(),
<<<<<<<
HEAD
const
KGuiItem
&
buttonCancel
=
KStandardGuiItem
::
cancel
(),
const
QString
&
dontAskAgainName
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
KGuiItem
&
buttonCancel
=
KStandardGuiItem
::
cancel
(),
const
QString
&
dontAskAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
return
KMessageBox
::
questionYesNoCancel
(
parent
,
text
,
caption
,
buttonYes
,
buttonNo
,
buttonCancel
,
dontAskAgainName
,
options
);
}
/** Same as KMessageBox::warningContinueCancel() except that it defaults to window-modal,
* not application-modal. */
/** Same as KMessageBox::warningContinueCancel() except that the
* default button is Cancel, and it defaults to window-modal, not
* application-modal.
* @param parent Parent widget
* @param defaultButton The default button for the message box. Valid values are Continue or Cancel.
* @param text Message string
* @param caption Caption (window title) of the message box
* @param buttonContinue The text for the first button (default = "Continue")
* @param buttonCancel The text for the second button (default = "Cancel")
* @param dontAskAgainName If specified, the message box will only be suppressed
* if the user chose Continue last time.
*/
static
int
warningCancelContinue
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonContinue
=
KStandardGuiItem
::
cont
(),
const
KGuiItem
&
buttonCancel
=
KStandardGuiItem
::
cancel
(),
const
QString
&
dontAskAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
{
return
KMessageBox
::
warningContinueCancel
(
parent
,
text
,
caption
,
buttonContinue
,
buttonCancel
,
dontAskAgainName
,
Options
(
options
|
Dangerous
));
}
/** Same as KMessageBox::warningContinueCancel() except that it
* defaults to window-modal, not application-modal. */
static
int
warningContinueCancel
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonContinue
=
KStandardGuiItem
::
cont
(),
const
KGuiItem
&
buttonCancel
=
KStandardGuiItem
::
cancel
(),
<<<<<<<
HEAD
const
QString
&
dontAskAgainName
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
dontAskAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
return
KMessageBox
::
warningContinueCancel
(
parent
,
text
,
caption
,
buttonContinue
,
buttonCancel
,
dontAskAgainName
,
options
);
}
/** Same as KMessageBox::warningYesNo() except that it defaults to window-modal,
...
...
@@ -162,7 +216,12 @@ class KAMessageBox
static
int
warningYesNo
(
QWidget
*
parent
,
const
QString
&
text
,
const
QString
&
caption
=
QString
(),
const
KGuiItem
&
buttonYes
=
KStandardGuiItem
::
yes
(),
const
KGuiItem
&
buttonNo
=
KStandardGuiItem
::
no
(),
<<<<<<<
HEAD
const
QString
&
dontAskAgainName
=
QString
(),
KMessageBox
::
Options
options
=
KMessageBox
::
Options
(
KMessageBox
::
Notify
|
KMessageBox
::
Dangerous
|
KMessageBox
::
WindowModal
))
=======
const
QString
&
dontAskAgainName
=
QString
(),
Options
options
=
Options
(
Notify
|
Dangerous
|
WindowModal
))
>>>>>>>
99
ca0fbf08670ed2c243089486a4b6e6db9f61b9
{
return
KMessageBox
::
warningYesNo
(
parent
,
text
,
caption
,
buttonYes
,
buttonNo
,
dontAskAgainName
,
options
);
}
/** Shortcut to represent Options(Notify | WindowModal). */
...
...
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