-rw-r--r-- | korganizer/mainwindow.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 2d17986..3c16458 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -109,49 +109,48 @@ class KOex2phonePrefs : public QDialog | |||
109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
110 | lay->addWidget( ok ); | 110 | lay->addWidget( ok ); |
111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
112 | lay->addWidget( cancel ); | 112 | lay->addWidget( cancel ); |
113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
115 | resize( 220, 240 ); | 115 | resize( 220, 240 ); |
116 | 116 | ||
117 | } | 117 | } |
118 | 118 | ||
119 | public: | 119 | public: |
120 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 120 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
121 | QCheckBox* mWriteBackFuture; | 121 | QCheckBox* mWriteBackFuture; |
122 | QSpinBox* mWriteBackFutureWeeks; | 122 | QSpinBox* mWriteBackFutureWeeks; |
123 | }; | 123 | }; |
124 | 124 | ||
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; |
142 | setCaption("KOrganizer/Pi"); | 141 | setCaption("KOrganizer/Pi"); |
143 | KOPrefs *p = KOPrefs::instance(); | 142 | KOPrefs *p = KOPrefs::instance(); |
144 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 143 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
145 | if ( p->mHourSize > 18 ) | 144 | if ( p->mHourSize > 18 ) |
146 | p->mHourSize = 18; | 145 | p->mHourSize = 18; |
147 | QMainWindow::ToolBarDock tbd; | 146 | QMainWindow::ToolBarDock tbd; |
148 | if ( p->mToolBarHor ) { | 147 | if ( p->mToolBarHor ) { |
149 | if ( p->mToolBarUp ) | 148 | if ( p->mToolBarUp ) |
150 | tbd = Bottom; | 149 | tbd = Bottom; |
151 | else | 150 | else |
152 | tbd = Top; | 151 | tbd = Top; |
153 | } | 152 | } |
154 | else { | 153 | else { |
155 | if ( p->mToolBarUp ) | 154 | if ( p->mToolBarUp ) |
156 | tbd = Right; | 155 | tbd = Right; |
157 | else | 156 | else |
@@ -258,52 +257,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
258 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 257 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
259 | mSyncManager->setDefaultFileName( defaultFileName()); | 258 | mSyncManager->setDefaultFileName( defaultFileName()); |
260 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 259 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
261 | mSyncManager->fillSyncMenu(); | 260 | mSyncManager->fillSyncMenu(); |
262 | 261 | ||
263 | 262 | ||
264 | 263 | ||
265 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 264 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
266 | if ( showWarning ) { | 265 | if ( showWarning ) { |
267 | KMessageBox::information( this, | 266 | KMessageBox::information( this, |
268 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 267 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
269 | qApp->processEvents(); | 268 | qApp->processEvents(); |
270 | mView->dialogManager()->showSyncOptions(); | 269 | mView->dialogManager()->showSyncOptions(); |
271 | } | 270 | } |
272 | 271 | ||
273 | //US listen for result adressed from Ka/Pi | 272 | //US listen for result adressed from Ka/Pi |
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 ) |
294 | mView->goToday(); | 291 | mView->goToday(); |
295 | #endif | 292 | #endif |
296 | QWidget::showMaximized () ; | 293 | QWidget::showMaximized () ; |
297 | mClosed = false; | 294 | mClosed = false; |
298 | } | 295 | } |
299 | void MainWindow::closeEvent( QCloseEvent* ce ) | 296 | void MainWindow::closeEvent( QCloseEvent* ce ) |
300 | { | 297 | { |
301 | 298 | ||
302 | 299 | ||
303 | 300 | ||
304 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 301 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
305 | saveOnClose(); | 302 | saveOnClose(); |
306 | mClosed = true; | 303 | mClosed = true; |
307 | ce->accept(); | 304 | ce->accept(); |
308 | return; | 305 | return; |
309 | 306 | ||
@@ -461,49 +458,48 @@ void MainWindow::initActions() | |||
461 | menuBar1->insertItem( i18n("File"), importMenu ); | 458 | menuBar1->insertItem( i18n("File"), importMenu ); |
462 | menuBar1->insertItem( i18n("View"), viewMenu ); | 459 | menuBar1->insertItem( i18n("View"), viewMenu ); |
463 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 460 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
464 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 461 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
465 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 462 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
466 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 463 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
467 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 464 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
468 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 465 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
469 | } else { | 466 | } else { |
470 | QPEMenuBar *menuBar1; | 467 | QPEMenuBar *menuBar1; |
471 | menuBar1 = new QPEMenuBar( iconToolBar ); | 468 | menuBar1 = new QPEMenuBar( iconToolBar ); |
472 | QPopupMenu *menuBar = new QPopupMenu( this ); | 469 | QPopupMenu *menuBar = new QPopupMenu( this ); |
473 | menuBar1->insertItem( i18n("ME"), menuBar); | 470 | menuBar1->insertItem( i18n("ME"), menuBar); |
474 | menuBar->insertItem( i18n("File"), importMenu ); | 471 | menuBar->insertItem( i18n("File"), importMenu ); |
475 | menuBar->insertItem( i18n("View"), viewMenu ); | 472 | menuBar->insertItem( i18n("View"), viewMenu ); |
476 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 473 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
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 ); |
494 | 490 | ||
495 | QString pathString = ""; | 491 | QString pathString = ""; |
496 | if ( !p->mToolBarMiniIcons ) { | 492 | if ( !p->mToolBarMiniIcons ) { |
497 | if ( QApplication::desktop()->width() < 480 ) | 493 | if ( QApplication::desktop()->width() < 480 ) |
498 | pathString += "icons16/"; | 494 | pathString += "icons16/"; |
499 | } else | 495 | } else |
500 | pathString += "iconsmini/"; | 496 | pathString += "iconsmini/"; |
501 | configureAgendaMenu->setCheckable( true ); | 497 | configureAgendaMenu->setCheckable( true ); |
502 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); | 498 | configureAgendaMenu->insertItem(i18n("Toggle Allday"), 1 ); |
503 | configureAgendaMenu->insertSeparator(); | 499 | configureAgendaMenu->insertSeparator(); |
504 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 500 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
505 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 501 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
506 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 502 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
507 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 503 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
508 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 504 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
509 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 505 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |