-rw-r--r-- | kaddressbook/mainembedded.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index ffa37a5..3f6f69d 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -23,101 +23,97 @@ int main( int argc, char **argv ) | |||
23 | #else | 23 | #else |
24 | QApplication a( argc, argv ); | 24 | QApplication a( argc, argv ); |
25 | QApplication::setStyle( new QPlatinumStyle ()); | 25 | QApplication::setStyle( new QPlatinumStyle ()); |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | bool exitHelp = false; | 28 | bool exitHelp = false; |
29 | if ( argc > 1 ) { | 29 | if ( argc > 1 ) { |
30 | QString command = argv[1]; | 30 | QString command = argv[1]; |
31 | if ( command == "-help" ){ | 31 | if ( command == "-help" ){ |
32 | printf("KA/E command line commands:\n"); | 32 | printf("KA/E command line commands:\n"); |
33 | printf(" no command: Start KA/E in usual way\n"); | 33 | printf(" no command: Start KA/E in usual way\n"); |
34 | printf(" -help: This output\n"); | 34 | printf(" -help: This output\n"); |
35 | printf(" KA/E is exiting now. Bye!\n"); | 35 | printf(" KA/E is exiting now. Bye!\n"); |
36 | exitHelp = true; | 36 | exitHelp = true; |
37 | } | 37 | } |
38 | } | 38 | } |
39 | if ( ! exitHelp ) { | 39 | if ( ! exitHelp ) { |
40 | 40 | ||
41 | KGlobal::setAppName( "kaddressbook" ); | 41 | KGlobal::setAppName( "kaddressbook" ); |
42 | #ifndef DESKTOP_VERSION | 42 | #ifndef DESKTOP_VERSION |
43 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); | 43 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); |
44 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 44 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
45 | #else | 45 | #else |
46 | QString fileName ; | 46 | QString fileName ; |
47 | #ifndef _WIN32_ | 47 | #ifndef _WIN32_ |
48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; | 48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; |
49 | #else | 49 | #else |
50 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; | 50 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; |
51 | #endif | 51 | #endif |
52 | KGlobal::iconLoader()->setIconPath(fileName); | 52 | KGlobal::iconLoader()->setIconPath(fileName); |
53 | QString appdir = QDir::homeDirPath(); | 53 | QString appdir = QDir::homeDirPath(); |
54 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 54 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
55 | appdir += "kaddressbook"; | 55 | appdir += "kaddressbook"; |
56 | else | 56 | else |
57 | appdir += "/kaddressbook"; | 57 | appdir += "/kaddressbook"; |
58 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 58 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
59 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | 59 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); |
60 | #endif // desktop | 60 | #endif // desktop |
61 | QDir app_dir; | 61 | QDir app_dir; |
62 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | 62 | if ( !app_dir.exists(KStandardDirs::appDir()) ) |
63 | app_dir.mkdir (KStandardDirs::appDir()); | 63 | app_dir.mkdir (KStandardDirs::appDir()); |
64 | 64 | ||
65 | KAddressBookMain* m = new KAddressBookMain(); | 65 | KAddressBookMain* m = new KAddressBookMain(); |
66 | //US MainWindow m; | 66 | //US MainWindow m; |
67 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 67 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
68 | 68 | ||
69 | #ifndef DESKTOP_VERSION | 69 | #ifndef DESKTOP_VERSION |
70 | a.showMainWidget(m ); | 70 | a.showMainWidget(m ); |
71 | m->showFullScreen(); | 71 | m->showMaximized(); |
72 | int min = 20; | ||
73 | if ( QApplication::desktop()->width() > 320 ) | ||
74 | min += 20; | ||
75 | m->setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min ); | ||
76 | 72 | ||
77 | #else | 73 | #else |
78 | a.setMainWidget(m ); | 74 | a.setMainWidget(m ); |
79 | m->show(); | 75 | m->show(); |
80 | //m->resize( 640, 480 ); | 76 | //m->resize( 640, 480 ); |
81 | #endif | 77 | #endif |
82 | a.exec(); | 78 | a.exec(); |
83 | 79 | ||
84 | } | 80 | } |
85 | qDebug("KA: Bye! "); | 81 | qDebug("KA: Bye! "); |
86 | } | 82 | } |
87 | 83 | ||
88 | /* | 84 | /* |
89 | #include <stdlib.h> | 85 | #include <stdlib.h> |
90 | 86 | ||
91 | #include <qstring.h> | 87 | #include <qstring.h> |
92 | 88 | ||
93 | #include <kabc/stdaddressbook.h> | 89 | #include <kabc/stdaddressbook.h> |
94 | #include <kaboutdata.h> | 90 | #include <kaboutdata.h> |
95 | #include <kcmdlineargs.h> | 91 | #include <kcmdlineargs.h> |
96 | #include <kcrash.h> | 92 | #include <kcrash.h> |
97 | #include <kdebug.h> | 93 | #include <kdebug.h> |
98 | #include <klocale.h> | 94 | #include <klocale.h> |
99 | #include <kstartupinfo.h> | 95 | #include <kstartupinfo.h> |
100 | #include <kuniqueapplication.h> | 96 | #include <kuniqueapplication.h> |
101 | #include <kwin.h> | 97 | #include <kwin.h> |
102 | 98 | ||
103 | #include "kaddressbookmain.h" | 99 | #include "kaddressbookmain.h" |
104 | #include "kabcore.h" | 100 | #include "kabcore.h" |
105 | 101 | ||
106 | extern "C" { | 102 | extern "C" { |
107 | 103 | ||
108 | void crashHandler( int ) | 104 | void crashHandler( int ) |
109 | { | 105 | { |
110 | KABC::StdAddressBook::handleCrash(); | 106 | KABC::StdAddressBook::handleCrash(); |
111 | ::exit( 0 ); | 107 | ::exit( 0 ); |
112 | } | 108 | } |
113 | 109 | ||
114 | } | 110 | } |
115 | 111 | ||
116 | class KAddressBookApp : public KUniqueApplication { | 112 | class KAddressBookApp : public KUniqueApplication { |
117 | public: | 113 | public: |
118 | KAddressBookApp() : mMainWin( 0 ) {} | 114 | KAddressBookApp() : mMainWin( 0 ) {} |
119 | ~KAddressBookApp() {} | 115 | ~KAddressBookApp() {} |
120 | 116 | ||
121 | int newInstance(); | 117 | int newInstance(); |
122 | 118 | ||
123 | private: | 119 | private: |