author | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
commit | 07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861 (patch) (unidiff) | |
tree | 03d0e5d20e607e035e17fcdabd6bce789069f41e /korganizer | |
parent | 44169895703beb3e8b1551a313d2d341bf742905 (diff) | |
download | kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.zip kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.gz kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.bz2 |
some bugfixes
-rw-r--r-- | korganizer/main.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 6 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 7f9b5c6..16186c0 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,12 +1,13 @@ | |||
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 <qpe/global.h> | 6 | #include <qpe/global.h> |
6 | #include <stdlib.h> | 7 | #include <stdlib.h> |
7 | #else | 8 | #else |
8 | #include <qapplication.h> | 9 | #include <qapplication.h> |
9 | #include <qstring.h> | 10 | #include <qstring.h> |
10 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
11 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
12 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
@@ -74,16 +75,18 @@ int main( int argc, char **argv ) | |||
74 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 75 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
75 | #else | 76 | #else |
76 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 77 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
77 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 78 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
78 | #endif | 79 | #endif |
79 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 80 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
80 | MainWindow m; | 81 | MainWindow m; |
81 | #ifndef DESKTOP_VERSION | 82 | #ifndef DESKTOP_VERSION |
83 | QCopChannel* c1 = new QCopChannel("QPE/Application/datebook",&m, "channel" ) ; | ||
84 | QObject::connect( c1, SIGNAL (received ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | ||
82 | 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& ))); |
83 | a.showMainWidget(&m ); | 86 | a.showMainWidget(&m ); |
84 | #else | 87 | #else |
85 | a.setMainWidget(&m ); | 88 | a.setMainWidget(&m ); |
86 | m.show(); | 89 | m.show(); |
87 | //m.resize( 800, 600 ); | 90 | //m.resize( 800, 600 ); |
88 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 91 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
89 | #endif | 92 | #endif |
@@ -91,12 +94,15 @@ int main( int argc, char **argv ) | |||
91 | QCString command = argv[1]; | 94 | QCString command = argv[1]; |
92 | if ( argc > 2 ) | 95 | if ( argc > 2 ) |
93 | command += argv[2]; | 96 | command += argv[2]; |
94 | qApp->processEvents(); | 97 | qApp->processEvents(); |
95 | m.recieve(command, QByteArray() ); | 98 | m.recieve(command, QByteArray() ); |
96 | 99 | ||
97 | } | 100 | } |
98 | a.exec(); | 101 | a.exec(); |
102 | #ifndef DESKTOP_VERSION | ||
103 | delete c1; | ||
104 | #endif | ||
99 | 105 | ||
100 | } | 106 | } |
101 | qDebug("KO: Bye! "); | 107 | qDebug("KO: Bye! "); |
102 | } | 108 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 2d17986..3c16458 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -125,17 +125,16 @@ public: | |||
125 | int globalFlagBlockStartup; | 125 | int globalFlagBlockStartup; |
126 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 126 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
127 | QMainWindow( parent, name ) | 127 | QMainWindow( parent, name ) |
128 | { | 128 | { |
129 | 129 | ||
130 | #ifdef DESKTOP_VERSION | 130 | #ifdef DESKTOP_VERSION |
131 | setFont( QFont("Arial"), 14 ); | 131 | setFont( QFont("Arial"), 14 ); |
132 | #endif | 132 | #endif |
133 | mServerSocket = 0; | ||
134 | mClosed = false; | 133 | mClosed = false; |
135 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 134 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
136 | QString confFile = locateLocal("config","korganizerrc"); | 135 | QString confFile = locateLocal("config","korganizerrc"); |
137 | QFileInfo finf ( confFile ); | 136 | QFileInfo finf ( confFile ); |
138 | bool showWarning = !finf.exists(); | 137 | bool showWarning = !finf.exists(); |
139 | setIcon(SmallIcon( "ko24" ) ); | 138 | setIcon(SmallIcon( "ko24" ) ); |
140 | mBlockAtStartup = true; | 139 | mBlockAtStartup = true; |
141 | mFlagKeyPressed = false; | 140 | mFlagKeyPressed = false; |
@@ -274,20 +273,18 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
274 | #ifndef DESKTOP_VERSION | 273 | #ifndef DESKTOP_VERSION |
275 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 274 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
276 | #endif | 275 | #endif |
277 | } | 276 | } |
278 | MainWindow::~MainWindow() | 277 | MainWindow::~MainWindow() |
279 | { | 278 | { |
280 | //qDebug("MainWindow::~MainWindow() "); | 279 | //qDebug("MainWindow::~MainWindow() "); |
281 | //save toolbar location | 280 | //save toolbar location |
282 | delete mServerSocket; | ||
283 | delete mCalendar; | 281 | delete mCalendar; |
284 | delete KOPrefs::instance(); | 282 | delete mSyncManager; |
285 | delete KIncidenceFormatter::instance(); | ||
286 | 283 | ||
287 | 284 | ||
288 | } | 285 | } |
289 | void MainWindow::showMaximized () | 286 | void MainWindow::showMaximized () |
290 | { | 287 | { |
291 | #ifndef DESKTOP_VERSION | 288 | #ifndef DESKTOP_VERSION |
292 | if ( ! globalFlagBlockStartup ) | 289 | if ( ! globalFlagBlockStartup ) |
293 | if ( mClosed ) | 290 | if ( mClosed ) |
@@ -477,17 +474,16 @@ void MainWindow::initActions() | |||
477 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 474 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
478 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 475 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
479 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 476 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
480 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 477 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
481 | menuBar->insertItem( i18n("Help"), helpMenu ); | 478 | menuBar->insertItem( i18n("Help"), helpMenu ); |
482 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 479 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
483 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 480 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
484 | } | 481 | } |
485 | connect ( syncMenu, SIGNAL( activated ( int ) ), this, SLOT (slotSyncMenu( int ) ) ); | ||
486 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 482 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
487 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); | 483 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); |
488 | 484 | ||
489 | // ****************** | 485 | // ****************** |
490 | QAction *action; | 486 | QAction *action; |
491 | QIconSet icon; | 487 | QIconSet icon; |
492 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 488 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
493 | configureToolBarMenu->setCheckable( true ); | 489 | configureToolBarMenu->setCheckable( true ); |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index ee7bd87..e3383ed 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -87,18 +87,16 @@ class MainWindow : public QMainWindow | |||
87 | private slots: | 87 | private slots: |
88 | QSocket* piSocket; | 88 | QSocket* piSocket; |
89 | QString piFileString; | 89 | QString piFileString; |
90 | QTime piTime; | 90 | QTime piTime; |
91 | void getFile( bool ); | 91 | void getFile( bool ); |
92 | void syncFileRequest(); | 92 | void syncFileRequest(); |
93 | private: | 93 | private: |
94 | KSyncManager* mSyncManager; | 94 | KSyncManager* mSyncManager; |
95 | //QTimer* mTimerCommandSocket; | ||
96 | KServerSocket * mServerSocket; | ||
97 | bool mClosed; | 95 | bool mClosed; |
98 | void saveOnClose(); | 96 | void saveOnClose(); |
99 | bool mFlagKeyPressed; | 97 | bool mFlagKeyPressed; |
100 | bool mBlockAtStartup; | 98 | bool mBlockAtStartup; |
101 | QPEToolBar *iconToolBar; | 99 | QPEToolBar *iconToolBar; |
102 | void initActions(); | 100 | void initActions(); |
103 | void setDefaultPreferences(); | 101 | void setDefaultPreferences(); |
104 | void keyPressEvent ( QKeyEvent * ) ; | 102 | void keyPressEvent ( QKeyEvent * ) ; |