Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KAlarm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KAlarm
Commits
473c8c05
Commit
473c8c05
authored
Apr 29, 2011
by
David Jarvie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add command line option to start KAlarm with alarms disabled.
parent
bc5f5b8a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletion
+13
-1
commandoptions.cpp
commandoptions.cpp
+8
-1
commandoptions.h
commandoptions.h
+2
-0
kalarmapp.cpp
kalarmapp.cpp
+2
-0
main.cpp
main.cpp
+1
-0
No files found.
commandoptions.cpp
View file @
473c8c05
...
...
@@ -49,7 +49,8 @@ CommandOptions::CommandOptions()
mReminderMinutes
(
0
),
mAudioVolume
(
-
1
),
mFromID
(
0
),
mFlags
(
KAEvent
::
DEFAULT_FONT
)
mFlags
(
KAEvent
::
DEFAULT_FONT
),
mDisableAll
(
false
)
{
mArgs
=
KCmdLineArgs
::
parsedArgs
();
#ifndef NDEBUG
...
...
@@ -195,6 +196,12 @@ CommandOptions::CommandOptions()
if
(
mArgs
->
count
())
mText
=
mArgs
->
arg
(
0
);
}
if
(
mArgs
->
isSet
(
"disable-all"
))
{
if
(
mCommand
==
TRIGGER_EVENT
)
setErrorIncompatible
(
"--disable-all"
,
mCommandName
);
mDisableAll
=
true
;
}
// Check that other options are only specified for the
// correct main command options.
...
...
commandoptions.h
View file @
473c8c05
...
...
@@ -68,6 +68,7 @@ class CommandOptions
QString
subject
()
const
{
return
mSubject
;
}
uint
fromID
()
const
{
return
mFromID
;
}
int
flags
()
const
{
return
mFlags
;
}
bool
disableAll
()
const
{
return
mDisableAll
;
}
#ifndef NDEBUG
KDateTime
simulationTime
()
const
{
return
mSimulationTime
;
}
#endif
...
...
@@ -108,6 +109,7 @@ class CommandOptions
QString
mSubject
;
// NEW: email subject
uint
mFromID
;
// NEW: email sender ID
int
mFlags
;
// NEW: event flags
bool
mDisableAll
;
// disable all alarm monitoring
#ifndef NDEBUG
KDateTime
mSimulationTime
;
// system time to be simulated, or invalid if none
#endif
...
...
kalarmapp.cpp
View file @
473c8c05
...
...
@@ -310,6 +310,8 @@ int KAlarmApp::newInstance()
KAlarm
::
setSimulatedSystemTime
(
options
.
simulationTime
());
#endif
CommandOptions
::
Command
command
=
options
.
command
();
if
(
options
.
disableAll
())
setAlarmsEnabled
(
false
);
// disable alarm monitoring
switch
(
command
)
{
case
CommandOptions
::
TRIGGER_EVENT
:
...
...
main.cpp
View file @
473c8c05
...
...
@@ -62,6 +62,7 @@ int main(int argc, char *argv[])
options
.
add
(
"cancelEvent <eventID>"
,
ki18n
(
"Cancel alarm with the specified event ID"
));
options
.
add
(
"d"
);
options
.
add
(
"disable"
,
ki18n
(
"Disable the alarm"
));
options
.
add
(
"disable-all"
,
ki18n
(
"Disable monitoring of all alarms"
));
options
.
add
(
"e"
);
options
.
add
(
"!exec <commandline>"
,
ki18n
(
"Execute a shell command line"
));
options
.
add
(
"E"
);
...
...
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