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