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
KOrganizer
Commits
5390a590
Commit
5390a590
authored
Apr 18, 2020
by
Allen Winter
Browse files
alarmdialog - remove Suspend Duration save/restore/set/reset
never worked as I had imagined and is more pain than gain.
parent
58650666
Changes
2
Hide whitespace changes
Inline
Side-by-side
korgac/alarmdialog.cpp
View file @
5390a590
...
...
@@ -2,7 +2,7 @@
This file is part of the KDE reminder agent.
Copyright (c) 2000,2003 Cornelius Schumacher <schumacher@kde.org>
Copyright (c) 2008-200
9
Allen Winter <winter@kde.org>
Copyright (c) 2008-20
2
0 Allen Winter <winter@kde.org>
Copyright (c) 2009-2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
This program is free software; you can redistribute it and/or modify
...
...
@@ -71,7 +71,6 @@
#include
<KConfigGroup>
#include
<QDialogButtonBox>
#include
<QPushButton>
#include
<QToolButton>
#include
<QHeaderView>
using
namespace
KIdentityManagement
;
...
...
@@ -144,9 +143,8 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
// Ok => Suspend
if
(
calendar
)
{
connect
(
calendar
.
data
(),
&
Akonadi
::
ETMCalendar
::
calendarChanged
,
this
,
&
AlarmDialog
::
slotCalendarChanged
);
connect
(
calendar
.
data
(),
&
Akonadi
::
ETMCalendar
::
calendarChanged
,
this
,
&
AlarmDialog
::
slotCalendarChanged
);
Akonadi
::
IncidenceChanger
*
changer
=
calendar
->
incidenceChanger
();
changer
->
setShowDialogsOnError
(
false
);
}
...
...
@@ -167,11 +165,10 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
}
defSuspendVal
=
generalConfig
.
readEntry
(
"DefaultSuspendValue"
,
defSuspendVal
);
int
suspendVal
=
generalConfig
.
readEntry
(
"SuspendValue"
,
defSuspendVal
);
defSuspendUnit
=
generalConfig
.
readEntry
(
"DefaultSuspendUnit"
,
defSuspendUnit
);
SuspendUnit
suspendUnit
=
static_cast
<
SuspendUnit
>
(
generalConfig
.
readEntry
(
"SuspendUnit"
,
defSuspendUnit
));
int
suspendVal
=
defSuspendVal
;
int
suspendUnit
=
defSuspendUnit
;
QWidget
*
topBox
=
new
QWidget
(
this
);
setWindowTitle
(
i18nc
(
"@title:window"
,
"Reminders"
));
...
...
@@ -179,7 +176,7 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
addWidget
(
topBox
);
mOkButton
=
new
Q
Tool
Button
;
mOkButton
=
new
Q
Push
Button
;
mOkButton
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
mUser1Button
=
new
QPushButton
;
mUser1Button
->
setDefault
(
false
);
...
...
@@ -321,28 +318,7 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
"Each reminder for the selected incidences will be suspended "
"using this time unit. You can set the number of time units "
"in the adjacent number entry input."
));
mSuspendUnit
->
setCurrentIndex
(
static_cast
<
int
>
(
suspendUnit
));
mSuspendMenu
=
new
QMenu
();
mSuspendMenu
->
setToolTipsVisible
(
true
);
mOkButton
->
setMenu
(
mSuspendMenu
);
QAction
*
mResetSuspendAction
=
new
QAction
(
i18nc
(
"@action:inmenu"
,
"Reset"
));
connect
(
mResetSuspendAction
,
&
QAction
::
triggered
,
this
,
&
AlarmDialog
::
resetSuspend
);
mResetSuspendAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Reset the suspend time to the default value"
));
mResetSuspendAction
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Reset the suspend time to the default value"
));
mSuspendMenu
->
addAction
(
mResetSuspendAction
);
QAction
*
mSetDefaultSuspendAction
=
new
QAction
(
i18nc
(
"@action:inmenu"
,
"Set as Default"
));
connect
(
mSetDefaultSuspendAction
,
&
QAction
::
triggered
,
this
,
&
AlarmDialog
::
setDefaultSuspend
);
mSetDefaultSuspendAction
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Set the current suspend time as the new default"
));
mSetDefaultSuspendAction
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Press this button to set the current suspend "
"time as the new default value"
));
mSuspendMenu
->
addAction
(
mSetDefaultSuspendAction
);
mSuspendUnit
->
setCurrentIndex
(
suspendUnit
);
connect
(
&
mSuspendTimer
,
&
QTimer
::
timeout
,
this
,
&
AlarmDialog
::
wakeUp
);
...
...
@@ -732,9 +708,8 @@ void AlarmDialog::eventNotification()
QString
program
=
alarm
->
programFile
();
// if the program name contains spaces escape it
if
(
program
.
contains
(
QLatin1Char
(
' '
))
&&
!
(
program
.
startsWith
(
QLatin1Char
(
'\"'
))
&&
program
.
endsWith
(
QLatin1Char
(
'\"'
))))
{
if
(
program
.
contains
(
QLatin1Char
(
' '
))
&&
!
(
program
.
startsWith
(
QLatin1Char
(
'\"'
))
&&
program
.
endsWith
(
QLatin1Char
(
'\"'
))))
{
program
=
QLatin1Char
(
'\"'
)
+
program
+
QLatin1Char
(
'\"'
);
}
...
...
@@ -898,8 +873,6 @@ void AlarmDialog::slotSave()
generalConfig
.
writeEntry
(
"Size"
,
mRect
.
size
());
generalConfig
.
writeEntry
(
"DefaultSuspendValue"
,
defSuspendVal
);
generalConfig
.
writeEntry
(
"DefaultSuspendUnit"
,
defSuspendUnit
);
generalConfig
.
writeEntry
(
"SuspendValue"
,
mSuspendSpin
->
value
());
generalConfig
.
writeEntry
(
"SuspendUnit"
,
mSuspendUnit
->
currentIndex
());
config
->
sync
();
}
...
...
korgac/alarmdialog.h
View file @
5390a590
...
...
@@ -29,7 +29,6 @@
#include
<KCalendarCore/Incidence>
#include
<QDialog>
#include
<QMenu>
#include
<QTimer>
namespace
Akonadi
{
...
...
@@ -52,7 +51,6 @@ class QDateTime;
class
QTreeWidget
;
class
QTreeWidgetItem
;
class
QSpinBox
;
class
QToolButton
;
class
AlarmDialog
:
public
QDialog
{
Q_OBJECT
...
...
@@ -110,17 +108,18 @@ protected:
void
showEvent
(
QShowEvent
*
event
)
override
;
private
Q_SLOTS
:
void
slotDBusNotificationsPropertiesChanged
(
const
QString
&
interface
,
const
QVariantMap
&
changedProperties
,
const
QStringList
&
invalidatedProperties
);
void
slotDBusNotificationsPropertiesChanged
(
const
QString
&
interface
,
const
QVariantMap
&
changedProperties
,
const
QStringList
&
invalidatedProperties
);
private:
void
update
();
void
updateButtons
();
typedef
QList
<
ReminderTreeItem
*>
ReminderList
;
static
Q_REQUIRED_RESULT
QDateTime
triggerDateForIncidence
(
const
KCalendarCore
::
Incidence
::
Ptr
&
inc
,
const
QDateTime
&
reminderAt
,
QString
&
displayStr
);
static
Q_REQUIRED_RESULT
QDateTime
triggerDateForIncidence
(
const
KCalendarCore
::
Incidence
::
Ptr
&
inc
,
const
QDateTime
&
reminderAt
,
QString
&
displayStr
);
// Removes each Incidence-X group that has one of the specified uids
void
removeFromConfig
(
const
QList
<
Akonadi
::
Item
::
Id
>
&
);
...
...
@@ -149,15 +148,12 @@ private:
QRect
mRect
;
QSpinBox
*
mSuspendSpin
=
nullptr
;
KComboBox
*
mSuspendUnit
=
nullptr
;
QMenu
*
mSuspendMenu
=
nullptr
;
QAction
*
mResetSuspendAction
=
nullptr
;
QAction
*
mSetDefaultSuspendAction
=
nullptr
;
QTimer
mSuspendTimer
;
QTreeWidgetItem
*
mLastItem
=
nullptr
;
QPushButton
*
mUser1Button
=
nullptr
;
QPushButton
*
mUser2Button
=
nullptr
;
QPushButton
*
mUser3Button
=
nullptr
;
Q
Tool
Button
*
mOkButton
=
nullptr
;
Q
Push
Button
*
mOkButton
=
nullptr
;
};
#endif
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