-rw-r--r-- | korganizer/main.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4194d12..2481ca4 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,106 +1,109 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #endif | 14 | #endif |
15 | #include <qtextcodec.h> | 15 | #include <qtextcodec.h> |
16 | 16 | ||
17 | #include <qdir.h> | 17 | #include <qdir.h> |
18 | #include <kstandarddirs.h> | 18 | #include <kstandarddirs.h> |
19 | #include <kglobal.h> | 19 | #include <kglobal.h> |
20 | #include <stdio.h> | 20 | #include <stdio.h> |
21 | #include "mainwindow.h" | 21 | #include "mainwindow.h" |
22 | #include <libkdepim/kpimglobalprefs.h> | ||
22 | void dumpMissing(); | 23 | void dumpMissing(); |
23 | int main( int argc, char **argv ) | 24 | int main( int argc, char **argv ) |
24 | { | 25 | { |
25 | #ifndef DESKTOP_VERSION | 26 | #ifndef DESKTOP_VERSION |
26 | QPEApplication a( argc, argv ); | 27 | QPEApplication a( argc, argv ); |
27 | a.setKeepRunning (); | 28 | a.setKeepRunning (); |
28 | #else | 29 | #else |
29 | QApplication a( argc, argv ); | 30 | QApplication a( argc, argv ); |
30 | QApplication::setStyle( new QPlatinumStyle ()); | 31 | QApplication::setStyle( new QPlatinumStyle ()); |
31 | QString hdir = QDir::homeDirPath(); | 32 | QString hdir = QDir::homeDirPath(); |
32 | // there is a bug when creating dirs for WIN 98 | 33 | // there is a bug when creating dirs for WIN 98 |
33 | // it is difficult to fix, because we have no WIN 98 runnung | 34 | // it is difficult to fix, because we have no WIN 98 runnung |
34 | // such that we try it to create the dirs at startup here | 35 | // such that we try it to create the dirs at startup here |
35 | if ( hdir == "C:\\" ) { // win 98 or ME | 36 | if ( hdir == "C:\\" ) { // win 98 or ME |
36 | QDir app_dir; | 37 | QDir app_dir; |
37 | if ( !app_dir.exists("C:\\kdepim") ) | 38 | if ( !app_dir.exists("C:\\kdepim") ) |
38 | app_dir.mkdir ("C:\\kdepim"); | 39 | app_dir.mkdir ("C:\\kdepim"); |
39 | if ( !app_dir.exists("C:\\kdepim\\apps") ) | 40 | if ( !app_dir.exists("C:\\kdepim\\apps") ) |
40 | app_dir.mkdir ("C:\\kdepim\\apps"); | 41 | app_dir.mkdir ("C:\\kdepim\\apps"); |
41 | if ( !app_dir.exists("C:\\kdepim\\config") ) | 42 | if ( !app_dir.exists("C:\\kdepim\\config") ) |
42 | app_dir.mkdir ("C:\\kdepim\\config"); | 43 | app_dir.mkdir ("C:\\kdepim\\config"); |
43 | if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) | 44 | if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) |
44 | app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); | 45 | app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); |
45 | } | 46 | } |
46 | #endif | 47 | #endif |
47 | bool exitHelp = false; | 48 | bool exitHelp = false; |
48 | if ( argc > 1 ) { | 49 | if ( argc > 1 ) { |
49 | QString command = argv[1]; | 50 | QString command = argv[1]; |
50 | if ( command == "-help" ){ | 51 | if ( command == "-help" ){ |
51 | printf("KO/Pi command line commands:\n"); | 52 | printf("KO/Pi command line commands:\n"); |
52 | printf(" no command: Start KO/Pi in usual way\n"); | 53 | printf(" no command: Start KO/Pi in usual way\n"); |
53 | printf(" -help: This output\n"); | 54 | printf(" -help: This output\n"); |
54 | printf("Next Option: Open or Show after start:\n"); | 55 | printf("Next Option: Open or Show after start:\n"); |
55 | printf(" -newTodo: New Todo dialog\n"); | 56 | printf(" -newTodo: New Todo dialog\n"); |
56 | printf(" -newEvent: New Event dialog\n"); | 57 | printf(" -newEvent: New Event dialog\n"); |
57 | printf(" -showList: List view\n"); | 58 | printf(" -showList: List view\n"); |
58 | printf(" -showDay: Day view\n"); | 59 | printf(" -showDay: Day view\n"); |
59 | printf(" -showWWeek: Work Week view\n"); | 60 | printf(" -showWWeek: Work Week view\n"); |
60 | printf(" -showWeek: Week view\n"); | 61 | printf(" -showWeek: Week view\n"); |
61 | printf(" -showTodo: Todo view\n"); | 62 | printf(" -showTodo: Todo view\n"); |
62 | printf(" -showJournal: Journal view\n"); | 63 | printf(" -showJournal: Journal view\n"); |
63 | printf(" -showKO: Next Days view\n"); | 64 | printf(" -showKO: Next Days view\n"); |
64 | printf(" -showWNext: What's Next view\n"); | 65 | printf(" -showWNext: What's Next view\n"); |
65 | printf(" -showNextXView: Next X View\n"); | 66 | printf(" -showNextXView: Next X View\n"); |
66 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 67 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
67 | printf(" KO/Pi is exiting now. Bye!\n"); | 68 | printf(" KO/Pi is exiting now. Bye!\n"); |
68 | exitHelp = true; | 69 | exitHelp = true; |
69 | } | 70 | } |
70 | } | 71 | } |
71 | if ( ! exitHelp ) { | 72 | if ( ! exitHelp ) { |
72 | KGlobal::setAppName( "korganizer" ); | 73 | KGlobal::setAppName( "korganizer" ); |
73 | QString fileName ; | 74 | QString fileName ; |
74 | #ifndef DESKTOP_VERSION | 75 | #ifndef DESKTOP_VERSION |
75 | fileName = getenv("QPEDIR"); | 76 | fileName = getenv("QPEDIR"); |
76 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 77 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
77 | #else | 78 | #else |
78 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 79 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
79 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 80 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
80 | #endif | 81 | #endif |
81 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 82 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
82 | MainWindow m; | 83 | MainWindow m; |
83 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
84 | 85 | ||
85 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 86 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
86 | a.showMainWidget(&m ); | 87 | a.showMainWidget(&m ); |
87 | #else | 88 | #else |
88 | a.setMainWidget(&m ); | 89 | a.setMainWidget(&m ); |
89 | m.show(); | 90 | m.show(); |
90 | //m.resize( 800, 600 ); | 91 | //m.resize( 800, 600 ); |
91 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 92 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
92 | #endif | 93 | #endif |
93 | if ( argc > 1 ) { | 94 | if ( argc > 1 ) { |
94 | QCString command = argv[1]; | 95 | QCString command = argv[1]; |
95 | if ( argc > 2 ) | 96 | if ( argc > 2 ) |
96 | command += argv[2]; | 97 | command += argv[2]; |
97 | qApp->processEvents(); | 98 | qApp->processEvents(); |
98 | m.recieve(command, QByteArray() ); | 99 | m.recieve(command, QByteArray() ); |
99 | 100 | ||
100 | } | 101 | } |
101 | 102 | ||
102 | a.exec(); | 103 | a.exec(); |
103 | dumpMissing(); | 104 | dumpMissing(); |
105 | |||
106 | KPimGlobalPrefs::instance()->writeConfig(); | ||
104 | } | 107 | } |
105 | qDebug("KO: Bye! "); | 108 | qDebug("KO: Bye! "); |
106 | } | 109 | } |