1 #include "shutdowndlg.h"
2 #include <kcmdlineargs.h>
3 #include <kaboutdata.h>
4 #include <kapplication.h>
5 #include <kiconloader.h>
6 #include <kworkspace.h>
9 main(int argc
, char *argv
[])
11 KAboutData
about("kapptest", 0, ki18n("kapptest"), "version");
12 KCmdLineArgs::init(argc
, argv
, &about
);
14 KCmdLineOptions options
;
16 options
.add("type <name>", ki18n("The type of shutdown to emulate: Default, None, Reboot, Halt or Logout"), "None");
17 KCmdLineArgs::addCmdLineOptions(options
);
19 KCmdLineArgs
*args
= KCmdLineArgs::parsedArgs();
22 KIconLoader::global()->addAppDir("ksmserver");
23 KSMShutdownFeedback::start();
25 QString sdtypeOption
= args
->getOption("type").toLower();
27 KWorkSpace::ShutdownType sdtype
= KWorkSpace::ShutdownTypeNone
;
28 if (sdtypeOption
== "default") {
29 sdtype
= KWorkSpace::ShutdownTypeDefault
;
30 } else if (sdtypeOption
== "reboot") {
31 sdtype
= KWorkSpace::ShutdownTypeReboot
;
32 } else if (sdtypeOption
== "halt") {
33 sdtype
= KWorkSpace::ShutdownTypeReboot
;
34 } else if (sdtypeOption
== "logout") {
35 sdtype
= KWorkSpace::ShutdownTypeReboot
;
39 (void)KSMShutdownDlg::confirmShutdown( true, sdtype
, bopt
);
40 /* (void)KSMShutdownDlg::confirmShutdown( false, sdtype, bopt ); */
42 KSMShutdownFeedback::stop();