-rw-r--r-- | korganizer/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index ee9589c..2bf46b9 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,112 +1,114 @@ | |||
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 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #endif | 15 | #endif |
16 | #include <qtextcodec.h> | 16 | #include <qtextcodec.h> |
17 | 17 | ||
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <kstandarddirs.h> | 19 | #include <kstandarddirs.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <libkdepim/kpimglobalprefs.h> | 23 | #include <libkdepim/kpimglobalprefs.h> |
24 | void dumpMissing(); | 24 | void dumpMissing(); |
25 | |||
26 | |||
25 | int main( int argc, char **argv ) | 27 | int main( int argc, char **argv ) |
26 | { | 28 | { |
27 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
28 | QPEApplication a( argc, argv ); | 30 | QPEApplication a( argc, argv ); |
29 | a.setKeepRunning (); | 31 | a.setKeepRunning (); |
30 | #else | 32 | #else |
31 | QApplication a( argc, argv ); | 33 | QApplication a( argc, argv ); |
32 | QApplication::setStyle( new QPlatinumStyle ()); | 34 | QApplication::setStyle( new QPlatinumStyle ()); |
33 | #ifdef _WIN32_ | 35 | #ifdef _WIN32_ |
34 | QString hdir ( getenv( "HOME") ); | 36 | QString hdir ( getenv( "HOME") ); |
35 | if ( hdir.isEmpty() ) { | 37 | if ( hdir.isEmpty() ) { |
36 | QString hd ("C:/" ); | 38 | QString hd ("C:/" ); |
37 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); | 39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); |
38 | if ( QDir::homeDirPath().lower() == hd.lower() ) { | 40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { |
39 | _putenv( "HOME=C:"); | 41 | _putenv( "HOME=C:"); |
40 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); | 42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); |
41 | } | 43 | } |
42 | } else { | 44 | } else { |
43 | QDir app_dir; | 45 | QDir app_dir; |
44 | if ( !app_dir.exists(hdir) ) | 46 | if ( !app_dir.exists(hdir) ) |
45 | app_dir.mkdir (hdir); | 47 | app_dir.mkdir (hdir); |
46 | } | 48 | } |
47 | #endif | 49 | #endif |
48 | #endif | 50 | #endif |
49 | bool exitHelp = false; | 51 | bool exitHelp = false; |
50 | if ( argc > 1 ) { | 52 | if ( argc > 1 ) { |
51 | QString command = argv[1]; | 53 | QString command = argv[1]; |
52 | if ( command == "-help" ){ | 54 | if ( command == "-help" ){ |
53 | printf("KO/Pi command line commands:\n"); | 55 | printf("KO/Pi command line commands:\n"); |
54 | printf(" no command: Start KO/Pi in usual way\n"); | 56 | printf(" no command: Start KO/Pi in usual way\n"); |
55 | printf(" -help: This output\n"); | 57 | printf(" -help: This output\n"); |
56 | printf("Next Option: Open or Show after start:\n"); | 58 | printf("Next Option: Open or Show after start:\n"); |
57 | printf(" -newTodo: New Todo dialog\n"); | 59 | printf(" -newTodo: New Todo dialog\n"); |
58 | printf(" -newEvent: New Event dialog\n"); | 60 | printf(" -newEvent: New Event dialog\n"); |
59 | printf(" -showList: List view\n"); | 61 | printf(" -showList: List view\n"); |
60 | printf(" -showDay: Day view\n"); | 62 | printf(" -showDay: Day view\n"); |
61 | printf(" -showWWeek: Work Week view\n"); | 63 | printf(" -showWWeek: Work Week view\n"); |
62 | printf(" -showWeek: Week view\n"); | 64 | printf(" -showWeek: Week view\n"); |
63 | printf(" -showTodo: Todo view\n"); | 65 | printf(" -showTodo: Todo view\n"); |
64 | printf(" -showJournal: Journal view\n"); | 66 | printf(" -showJournal: Journal view\n"); |
65 | printf(" -showKO: Next Days view\n"); | 67 | printf(" -showKO: Next Days view\n"); |
66 | printf(" -showWNext: What's Next view\n"); | 68 | printf(" -showWNext: What's Next view\n"); |
67 | printf(" -showNextXView: Next X View\n"); | 69 | printf(" -showNextXView: Next X View\n"); |
68 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 70 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
69 | printf(" KO/Pi is exiting now. Bye!\n"); | 71 | printf(" KO/Pi is exiting now. Bye!\n"); |
70 | exitHelp = true; | 72 | exitHelp = true; |
71 | } | 73 | } |
72 | } | 74 | } |
73 | if ( ! exitHelp ) { | 75 | if ( ! exitHelp ) { |
74 | KGlobal::setAppName( "korganizer" ); | 76 | KGlobal::setAppName( "korganizer" ); |
75 | QString fileName ; | 77 | QString fileName ; |
76 | #ifndef DESKTOP_VERSION | 78 | #ifndef DESKTOP_VERSION |
77 | fileName = getenv("QPEDIR"); | 79 | fileName = getenv("QPEDIR"); |
78 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 80 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
79 | #else | 81 | #else |
80 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 82 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
81 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 83 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
82 | #endif | 84 | #endif |
83 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
84 | 86 | ||
85 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
86 | MainWindow m; | 88 | MainWindow m; |
87 | #ifndef DESKTOP_VERSION | 89 | #ifndef DESKTOP_VERSION |
88 | 90 | ||
89 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 91 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
90 | a.showMainWidget(&m ); | 92 | a.showMainWidget(&m ); |
91 | #else | 93 | #else |
92 | a.setMainWidget(&m ); | 94 | a.setMainWidget(&m ); |
93 | m.show(); | 95 | m.show(); |
94 | //m.resize( 800, 600 ); | 96 | //m.resize( 800, 600 ); |
95 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 97 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
96 | #endif | 98 | #endif |
97 | if ( argc > 1 ) { | 99 | if ( argc > 1 ) { |
98 | QCString command = argv[1]; | 100 | QCString command = argv[1]; |
99 | if ( argc > 2 ) | 101 | if ( argc > 2 ) |
100 | command += argv[2]; | 102 | command += argv[2]; |
101 | qApp->processEvents(); | 103 | qApp->processEvents(); |
102 | m.recieve(command, QByteArray() ); | 104 | m.recieve(command, QByteArray() ); |
103 | 105 | ||
104 | } | 106 | } |
105 | 107 | ||
106 | a.exec(); | 108 | a.exec(); |
107 | dumpMissing(); | 109 | dumpMissing(); |
108 | 110 | ||
109 | KPimGlobalPrefs::instance()->writeConfig(); | 111 | KPimGlobalPrefs::instance()->writeConfig(); |
110 | } | 112 | } |
111 | qDebug("KO: Bye! "); | 113 | qDebug("KO: Bye! "); |
112 | } | 114 | } |