author | zautrix <zautrix> | 2005-03-29 17:05:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 17:05:50 (UTC) |
commit | a7c827aa0e555206b60dec3bc07f7afab4352883 (patch) (unidiff) | |
tree | 56dbda15314f27ffabd143d09ea036b092444198 /korganizer | |
parent | 3116f249fc6ccd0e067213e826d3d924f6986972 (diff) | |
download | kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.zip kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.tar.gz kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.tar.bz2 |
fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 8a4c7eb..6ddced0 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -235,1059 +235,1068 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
235 | 235 | ||
236 | 236 | ||
237 | mCalendarModifiedFlag = false; | 237 | mCalendarModifiedFlag = false; |
238 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 238 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
239 | splash->setAlignment ( AlignCenter ); | 239 | splash->setAlignment ( AlignCenter ); |
240 | setCentralWidget( splash ); | 240 | setCentralWidget( splash ); |
241 | #ifndef DESKTOP_VERSION | 241 | #ifndef DESKTOP_VERSION |
242 | showMaximized(); | 242 | showMaximized(); |
243 | #endif | 243 | #endif |
244 | 244 | ||
245 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 245 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
246 | setDefaultPreferences(); | 246 | setDefaultPreferences(); |
247 | mCalendar = new CalendarLocal(); | 247 | mCalendar = new CalendarLocal(); |
248 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 248 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
249 | mView->hide(); | 249 | mView->hide(); |
250 | //mView->resize(splash->size() ); | 250 | //mView->resize(splash->size() ); |
251 | initActions(); | 251 | initActions(); |
252 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 252 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
253 | mSyncManager->setBlockSave(false); | 253 | mSyncManager->setBlockSave(false); |
254 | mView->setSyncManager(mSyncManager); | 254 | mView->setSyncManager(mSyncManager); |
255 | #ifndef DESKTOP_VERSION | 255 | #ifndef DESKTOP_VERSION |
256 | iconToolBar->show(); | 256 | iconToolBar->show(); |
257 | qApp->processEvents(); | 257 | qApp->processEvents(); |
258 | #endif | 258 | #endif |
259 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 259 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
260 | int vh = height() ; | 260 | int vh = height() ; |
261 | int vw = width(); | 261 | int vw = width(); |
262 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 262 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
263 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 263 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
264 | vh -= iconToolBar->height(); | 264 | vh -= iconToolBar->height(); |
265 | } else { | 265 | } else { |
266 | vw -= iconToolBar->height(); | 266 | vw -= iconToolBar->height(); |
267 | } | 267 | } |
268 | //mView->setMaximumSize( splash->size() ); | 268 | //mView->setMaximumSize( splash->size() ); |
269 | //mView->resize( splash->size() ); | 269 | //mView->resize( splash->size() ); |
270 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 270 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
271 | mView->readSettings(); | 271 | mView->readSettings(); |
272 | bool newFile = false; | 272 | bool newFile = false; |
273 | if( !QFile::exists( defaultFileName() ) ) { | 273 | if( !QFile::exists( defaultFileName() ) ) { |
274 | QFileInfo finfo ( defaultFileName() ); | 274 | QFileInfo finfo ( defaultFileName() ); |
275 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 275 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
276 | qDebug("oldfile %s ", oldFile.latin1()); | 276 | qDebug("oldfile %s ", oldFile.latin1()); |
277 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 277 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
278 | finfo.setFile( oldFile ); | 278 | finfo.setFile( oldFile ); |
279 | if (finfo.exists() ) { | 279 | if (finfo.exists() ) { |
280 | KMessageBox::information( this, message); | 280 | KMessageBox::information( this, message); |
281 | mView->openCalendar( oldFile ); | 281 | mView->openCalendar( oldFile ); |
282 | qApp->processEvents(); | 282 | qApp->processEvents(); |
283 | } else { | 283 | } else { |
284 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 284 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
285 | finfo.setFile( oldFile ); | 285 | finfo.setFile( oldFile ); |
286 | if (finfo.exists() ) { | 286 | if (finfo.exists() ) { |
287 | KMessageBox::information( this, message); | 287 | KMessageBox::information( this, message); |
288 | mView->openCalendar( oldFile ); | 288 | mView->openCalendar( oldFile ); |
289 | qApp->processEvents(); | 289 | qApp->processEvents(); |
290 | } | 290 | } |
291 | } | 291 | } |
292 | mView->saveCalendar( defaultFileName() ); | 292 | mView->saveCalendar( defaultFileName() ); |
293 | newFile = true; | 293 | newFile = true; |
294 | } | 294 | } |
295 | 295 | ||
296 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 296 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
297 | mView->openCalendar( defaultFileName() ); | 297 | mView->openCalendar( defaultFileName() ); |
298 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 298 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
299 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 299 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
300 | 300 | ||
301 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 301 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
302 | KOPrefs::instance()->setAllDefaults(); | 302 | KOPrefs::instance()->setAllDefaults(); |
303 | int count = mView->addCategories(); | 303 | int count = mView->addCategories(); |
304 | } | 304 | } |
305 | processIncidenceSelection( 0 ); | 305 | processIncidenceSelection( 0 ); |
306 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 306 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
307 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 307 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
308 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 308 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
309 | SLOT( slotModifiedChanged( bool ) ) ); | 309 | SLOT( slotModifiedChanged( bool ) ) ); |
310 | 310 | ||
311 | 311 | ||
312 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 312 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
313 | SLOT( disableBR(bool) ) ); | 313 | SLOT( disableBR(bool) ) ); |
314 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 314 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
315 | mView->setModified( false ); | 315 | mView->setModified( false ); |
316 | mBlockAtStartup = false; | 316 | mBlockAtStartup = false; |
317 | mView->setModified( false ); | 317 | mView->setModified( false ); |
318 | setCentralWidget( mView ); | 318 | setCentralWidget( mView ); |
319 | globalFlagBlockStartup = 0; | 319 | globalFlagBlockStartup = 0; |
320 | mView->show(); | 320 | mView->show(); |
321 | delete splash; | 321 | delete splash; |
322 | if ( newFile ) | 322 | if ( newFile ) |
323 | mView->updateConfig(); | 323 | mView->updateConfig(); |
324 | // qApp->processEvents(); | 324 | // qApp->processEvents(); |
325 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 325 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
326 | //fillSyncMenu(); | 326 | //fillSyncMenu(); |
327 | 327 | ||
328 | 328 | ||
329 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 329 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
330 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 330 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
331 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 331 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
332 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 332 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
333 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 333 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
334 | mSyncManager->setDefaultFileName( sentSyncFile()); | 334 | mSyncManager->setDefaultFileName( sentSyncFile()); |
335 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 335 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
336 | mSyncManager->fillSyncMenu(); | 336 | mSyncManager->fillSyncMenu(); |
337 | 337 | ||
338 | 338 | ||
339 | 339 | ||
340 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 340 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
341 | if ( showWarning ) { | 341 | if ( showWarning ) { |
342 | KMessageBox::information( this, | 342 | KMessageBox::information( this, |
343 | "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"); | 343 | "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"); |
344 | qApp->processEvents(); | 344 | qApp->processEvents(); |
345 | mView->dialogManager()->showSyncOptions(); | 345 | mView->dialogManager()->showSyncOptions(); |
346 | } | 346 | } |
347 | 347 | ||
348 | //US listen for result adressed from Ka/Pi | 348 | //US listen for result adressed from Ka/Pi |
349 | #ifndef DESKTOP_VERSION | 349 | #ifndef DESKTOP_VERSION |
350 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 350 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
351 | #endif | 351 | #endif |
352 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
353 | infrared = 0; | 353 | infrared = 0; |
354 | #endif | 354 | #endif |
355 | updateFilterToolbar(); | 355 | updateFilterToolbar(); |
356 | updateWeek( mView->startDate() ); | 356 | updateWeek( mView->startDate() ); |
357 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 357 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
358 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 358 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
359 | mBRdisabled = false; | 359 | mBRdisabled = false; |
360 | //toggleBeamReceive(); | 360 | //toggleBeamReceive(); |
361 | } | 361 | } |
362 | MainWindow::~MainWindow() | 362 | MainWindow::~MainWindow() |
363 | { | 363 | { |
364 | //qDebug("MainWindow::~MainWindow() "); | 364 | //qDebug("MainWindow::~MainWindow() "); |
365 | //save toolbar location | 365 | //save toolbar location |
366 | delete mCalendar; | 366 | delete mCalendar; |
367 | delete mSyncManager; | 367 | delete mSyncManager; |
368 | #ifndef DESKTOP_VERSION | 368 | #ifndef DESKTOP_VERSION |
369 | if ( infrared ) | 369 | if ( infrared ) |
370 | delete infrared; | 370 | delete infrared; |
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | 373 | ||
374 | } | 374 | } |
375 | 375 | ||
376 | void MainWindow::disableBR(bool b) | 376 | void MainWindow::disableBR(bool b) |
377 | { | 377 | { |
378 | #ifndef DESKTOP_VERSION | 378 | #ifndef DESKTOP_VERSION |
379 | if ( b ) { | 379 | if ( b ) { |
380 | if ( infrared ) { | 380 | if ( infrared ) { |
381 | toggleBeamReceive(); | 381 | toggleBeamReceive(); |
382 | mBRdisabled = true; | 382 | mBRdisabled = true; |
383 | } | 383 | } |
384 | mBRdisabled = true; | 384 | mBRdisabled = true; |
385 | } else { | 385 | } else { |
386 | if ( mBRdisabled ) { | 386 | if ( mBRdisabled ) { |
387 | mBRdisabled = false; | 387 | mBRdisabled = false; |
388 | //makes no sense,because other cal ap is probably running | 388 | //makes no sense,because other cal ap is probably running |
389 | // toggleBeamReceive(); | 389 | // toggleBeamReceive(); |
390 | } | 390 | } |
391 | } | 391 | } |
392 | #endif | 392 | #endif |
393 | 393 | ||
394 | } | 394 | } |
395 | bool MainWindow::beamReceiveEnabled() | 395 | bool MainWindow::beamReceiveEnabled() |
396 | { | 396 | { |
397 | #ifndef DESKTOP_VERSION | 397 | #ifndef DESKTOP_VERSION |
398 | return ( infrared != 0 ); | 398 | return ( infrared != 0 ); |
399 | #endif | 399 | #endif |
400 | return false; | 400 | return false; |
401 | } | 401 | } |
402 | 402 | ||
403 | void MainWindow::toggleBeamReceive() | 403 | void MainWindow::toggleBeamReceive() |
404 | { | 404 | { |
405 | if ( mBRdisabled ) | 405 | if ( mBRdisabled ) |
406 | return; | 406 | return; |
407 | #ifndef DESKTOP_VERSION | 407 | #ifndef DESKTOP_VERSION |
408 | if ( infrared ) { | 408 | if ( infrared ) { |
409 | qDebug("disable BeamReceive "); | 409 | qDebug("disable BeamReceive "); |
410 | delete infrared; | 410 | delete infrared; |
411 | infrared = 0; | 411 | infrared = 0; |
412 | brAction->setOn(false); | 412 | brAction->setOn(false); |
413 | return; | 413 | return; |
414 | } | 414 | } |
415 | qDebug("enable BeamReceive "); | 415 | qDebug("enable BeamReceive "); |
416 | brAction->setOn(true); | 416 | brAction->setOn(true); |
417 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 417 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
418 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 418 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
419 | #endif | 419 | #endif |
420 | } | 420 | } |
421 | void MainWindow::showMaximized () | 421 | void MainWindow::showMaximized () |
422 | { | 422 | { |
423 | #ifndef DESKTOP_VERSION | 423 | #ifndef DESKTOP_VERSION |
424 | if ( ! globalFlagBlockStartup ) | 424 | if ( ! globalFlagBlockStartup ) |
425 | if ( mClosed ) | 425 | if ( mClosed ) |
426 | mView->goToday(); | 426 | mView->goToday(); |
427 | #endif | 427 | #endif |
428 | QWidget::showMaximized () ; | 428 | QWidget::showMaximized () ; |
429 | mClosed = false; | 429 | mClosed = false; |
430 | } | 430 | } |
431 | void MainWindow::closeEvent( QCloseEvent* ce ) | 431 | void MainWindow::closeEvent( QCloseEvent* ce ) |
432 | { | 432 | { |
433 | 433 | ||
434 | 434 | ||
435 | 435 | ||
436 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 436 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
437 | saveOnClose(); | 437 | saveOnClose(); |
438 | mClosed = true; | 438 | mClosed = true; |
439 | ce->accept(); | 439 | ce->accept(); |
440 | return; | 440 | return; |
441 | 441 | ||
442 | } | 442 | } |
443 | 443 | ||
444 | switch( QMessageBox::information( this, "KO/Pi", | 444 | switch( QMessageBox::information( this, "KO/Pi", |
445 | i18n("Do you really want\nto close KO/Pi?"), | 445 | i18n("Do you really want\nto close KO/Pi?"), |
446 | i18n("Close"), i18n("No"), | 446 | i18n("Close"), i18n("No"), |
447 | 0, 0 ) ) { | 447 | 0, 0 ) ) { |
448 | case 0: | 448 | case 0: |
449 | saveOnClose(); | 449 | saveOnClose(); |
450 | mClosed = true; | 450 | mClosed = true; |
451 | ce->accept(); | 451 | ce->accept(); |
452 | break; | 452 | break; |
453 | case 1: | 453 | case 1: |
454 | ce->ignore(); | 454 | ce->ignore(); |
455 | break; | 455 | break; |
456 | case 2: | 456 | case 2: |
457 | 457 | ||
458 | default: | 458 | default: |
459 | break; | 459 | break; |
460 | } | 460 | } |
461 | 461 | ||
462 | 462 | ||
463 | } | 463 | } |
464 | 464 | ||
465 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 465 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
466 | { | 466 | { |
467 | QDataStream stream( data, IO_ReadOnly ); | 467 | QDataStream stream( data, IO_ReadOnly ); |
468 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 468 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
469 | //QString datamess; | 469 | //QString datamess; |
470 | //qDebug("message "); | 470 | //qDebug("message "); |
471 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 471 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
472 | 472 | ||
473 | if ( cmsg == "setDocument(QString)" ) { | 473 | if ( cmsg == "setDocument(QString)" ) { |
474 | QDataStream stream( data, IO_ReadOnly ); | 474 | QDataStream stream( data, IO_ReadOnly ); |
475 | QString fileName; | 475 | QString fileName; |
476 | stream >> fileName; | 476 | stream >> fileName; |
477 | //qDebug("filename %s ", fileName.latin1()); | 477 | //qDebug("filename %s ", fileName.latin1()); |
478 | showMaximized(); | 478 | showMaximized(); |
479 | raise(); | 479 | raise(); |
480 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 480 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
481 | mSyncManager->slotSyncMenu( 1002 ); | 481 | mSyncManager->slotSyncMenu( 1002 ); |
482 | return; | 482 | return; |
483 | } | 483 | } |
484 | 484 | ||
485 | if ( cmsg == "-writeFile" ) { | 485 | if ( cmsg == "-writeFile" ) { |
486 | // I made from the "-writeFile" an "-writeAlarm" | 486 | // I made from the "-writeFile" an "-writeAlarm" |
487 | mView->viewManager()->showWhatsNextView(); | 487 | mView->viewManager()->showWhatsNextView(); |
488 | mCalendar->checkAlarmForIncidence( 0, true); | 488 | mCalendar->checkAlarmForIncidence( 0, true); |
489 | showMaximized(); | 489 | showMaximized(); |
490 | raise(); | 490 | raise(); |
491 | return; | 491 | return; |
492 | 492 | ||
493 | } | 493 | } |
494 | if ( cmsg == "-writeFileSilent" ) { | 494 | if ( cmsg == "-writeFileSilent" ) { |
495 | // I made from the "-writeFile" an "-writeAlarm" | 495 | // I made from the "-writeFile" an "-writeAlarm" |
496 | // mView->viewManager()->showWhatsNextView(); | 496 | // mView->viewManager()->showWhatsNextView(); |
497 | mCalendar->checkAlarmForIncidence( 0, true); | 497 | mCalendar->checkAlarmForIncidence( 0, true); |
498 | //showMaximized(); | 498 | //showMaximized(); |
499 | //raise(); | 499 | //raise(); |
500 | hide(); | 500 | hide(); |
501 | return; | 501 | return; |
502 | } | 502 | } |
503 | if ( cmsg == "-newCountdown" ) { | 503 | if ( cmsg == "-newCountdown" ) { |
504 | qDebug("newCountdown "); | 504 | qDebug("newCountdown "); |
505 | 505 | ||
506 | } | 506 | } |
507 | QString msg ; | 507 | QString msg ; |
508 | QString allmsg = cmsg; | 508 | QString allmsg = cmsg; |
509 | while ( allmsg.length() > 0 ) { | 509 | while ( allmsg.length() > 0 ) { |
510 | int nextC = allmsg.find( "-", 1 ); | 510 | int nextC = allmsg.find( "-", 1 ); |
511 | if ( nextC == -1 ) { | 511 | if ( nextC == -1 ) { |
512 | msg = allmsg; | 512 | msg = allmsg; |
513 | allmsg = ""; | 513 | allmsg = ""; |
514 | } else{ | 514 | } else{ |
515 | msg = allmsg.left( nextC ); | 515 | msg = allmsg.left( nextC ); |
516 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 516 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
517 | } | 517 | } |
518 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 518 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
519 | if ( msg == "-newEvent" ) { | 519 | if ( msg == "-newEvent" ) { |
520 | mView->newEvent(); | 520 | mView->newEvent(); |
521 | } | 521 | } |
522 | if ( msg == "-newTodo" ) { | 522 | if ( msg == "-newTodo" ) { |
523 | mView->newTodo(); | 523 | mView->newTodo(); |
524 | 524 | ||
525 | } | 525 | } |
526 | if ( msg == "-showWN" ) { | 526 | if ( msg == "-showWN" ) { |
527 | mView->viewManager()->showWhatsNextView(); | 527 | mView->viewManager()->showWhatsNextView(); |
528 | } | 528 | } |
529 | if ( msg == "-showTodo" ) { | 529 | if ( msg == "-showTodo" ) { |
530 | mView->viewManager()->showTodoView(); | 530 | mView->viewManager()->showTodoView(); |
531 | } | 531 | } |
532 | if ( msg == "-showList" ) { | 532 | if ( msg == "-showList" ) { |
533 | mView->viewManager()->showListView(); | 533 | mView->viewManager()->showListView(); |
534 | } | 534 | } |
535 | else if ( msg == "-showDay" ) { | 535 | else if ( msg == "-showDay" ) { |
536 | mView->viewManager()->showDayView(); | 536 | mView->viewManager()->showDayView(); |
537 | } | 537 | } |
538 | else if ( msg == "-showWWeek" ) { | 538 | else if ( msg == "-showWWeek" ) { |
539 | mView->viewManager()->showWorkWeekView(); | 539 | mView->viewManager()->showWorkWeekView(); |
540 | } | 540 | } |
541 | else if ( msg == "-ringSync" ) { | 541 | else if ( msg == "-ringSync" ) { |
542 | mSyncManager->multiSync( false ); | 542 | mSyncManager->multiSync( false ); |
543 | } | 543 | } |
544 | else if ( msg == "-showWeek" ) { | 544 | else if ( msg == "-showWeek" ) { |
545 | mView->viewManager()->showWeekView(); | 545 | mView->viewManager()->showWeekView(); |
546 | } | 546 | } |
547 | else if ( msg == "-showTodo" ) { | 547 | else if ( msg == "-showTodo" ) { |
548 | mView->viewManager()->showTodoView(); | 548 | mView->viewManager()->showTodoView(); |
549 | } | 549 | } |
550 | else if ( msg == "-showJournal" ) { | 550 | else if ( msg == "-showJournal" ) { |
551 | mView->dateNavigator()->selectDates( 1 ); | 551 | mView->dateNavigator()->selectDates( 1 ); |
552 | mView->dateNavigator()->selectToday(); | 552 | mView->dateNavigator()->selectToday(); |
553 | mView->viewManager()->showJournalView(); | 553 | mView->viewManager()->showJournalView(); |
554 | } | 554 | } |
555 | else if ( msg == "-showKO" ) { | 555 | else if ( msg == "-showKO" ) { |
556 | mView->viewManager()->showNextXView(); | 556 | mView->viewManager()->showNextXView(); |
557 | } | 557 | } |
558 | else if ( msg == "-showWNext" ) { | 558 | else if ( msg == "-showWNext" ) { |
559 | mView->viewManager()->showWhatsNextView(); | 559 | mView->viewManager()->showWhatsNextView(); |
560 | } | 560 | } |
561 | else if ( msg == "nextView()" ) { | 561 | else if ( msg == "nextView()" ) { |
562 | mView->viewManager()->showNextView(); | 562 | mView->viewManager()->showNextView(); |
563 | } | 563 | } |
564 | else if ( msg == "-showNextXView" ) { | 564 | else if ( msg == "-showNextXView" ) { |
565 | mView->viewManager()->showNextXView(); | 565 | mView->viewManager()->showNextXView(); |
566 | } | 566 | } |
567 | 567 | ||
568 | 568 | ||
569 | } | 569 | } |
570 | 570 | ||
571 | showMaximized(); | 571 | showMaximized(); |
572 | raise(); | 572 | raise(); |
573 | } | 573 | } |
574 | 574 | ||
575 | QPixmap MainWindow::loadPixmap( QString name ) | 575 | QPixmap MainWindow::loadPixmap( QString name ) |
576 | { | 576 | { |
577 | return SmallIcon( name ); | 577 | return SmallIcon( name ); |
578 | 578 | ||
579 | } | 579 | } |
580 | void MainWindow::initActions() | 580 | void MainWindow::initActions() |
581 | { | 581 | { |
582 | //KOPrefs::instance()->mShowFullMenu | 582 | //KOPrefs::instance()->mShowFullMenu |
583 | iconToolBar->clear(); | 583 | iconToolBar->clear(); |
584 | KOPrefs *p = KOPrefs::instance(); | 584 | KOPrefs *p = KOPrefs::instance(); |
585 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 585 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
586 | 586 | ||
587 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 587 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
588 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 588 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
589 | QPopupMenu *importMenu = new QPopupMenu( this ); | 589 | QPopupMenu *importMenu = new QPopupMenu( this ); |
590 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 590 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
591 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 591 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
592 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 592 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
593 | selectFilterMenu = new QPopupMenu( this ); | 593 | selectFilterMenu = new QPopupMenu( this ); |
594 | selectFilterMenu->setCheckable( true ); | 594 | selectFilterMenu->setCheckable( true ); |
595 | syncMenu = new QPopupMenu( this ); | 595 | syncMenu = new QPopupMenu( this ); |
596 | configureAgendaMenu = new QPopupMenu( this ); | 596 | configureAgendaMenu = new QPopupMenu( this ); |
597 | configureToolBarMenu = new QPopupMenu( this ); | 597 | configureToolBarMenu = new QPopupMenu( this ); |
598 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 598 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
599 | QIconSet icon; | 599 | QIconSet icon; |
600 | int pixWid = 22, pixHei = 22; | 600 | int pixWid = 22, pixHei = 22; |
601 | QString pathString = ""; | 601 | QString pathString = ""; |
602 | if ( !p->mToolBarMiniIcons ) { | 602 | if ( !p->mToolBarMiniIcons ) { |
603 | if ( QApplication::desktop()->width() < 480 ) { | 603 | if ( QApplication::desktop()->width() < 480 ) { |
604 | pathString += "icons16/"; | 604 | pathString += "icons16/"; |
605 | pixWid = 18; pixHei = 16; | 605 | pixWid = 18; pixHei = 16; |
606 | } | 606 | } |
607 | } else { | 607 | } else { |
608 | pathString += "iconsmini/"; | 608 | pathString += "iconsmini/"; |
609 | pixWid = 18; pixHei = 16; | 609 | pixWid = 18; pixHei = 16; |
610 | } | 610 | } |
611 | if ( KOPrefs::instance()->mShowFullMenu ) { | 611 | if ( KOPrefs::instance()->mShowFullMenu ) { |
612 | QMenuBar *menuBar1; | 612 | QMenuBar *menuBar1; |
613 | menuBar1 = menuBar(); | 613 | menuBar1 = menuBar(); |
614 | menuBar1->insertItem( i18n("File"), importMenu ); | 614 | menuBar1->insertItem( i18n("File"), importMenu ); |
615 | menuBar1->insertItem( i18n("View"), viewMenu ); | 615 | menuBar1->insertItem( i18n("View"), viewMenu ); |
616 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 616 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
617 | #ifdef DESKTOP_VERSION | 617 | #ifdef DESKTOP_VERSION |
618 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 618 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
619 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 619 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
620 | #else | 620 | #else |
621 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 621 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
622 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 622 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
623 | #endif | 623 | #endif |
624 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 624 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
625 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 625 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
626 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 626 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
627 | } else { | 627 | } else { |
628 | QPEMenuBar *menuBar1; | 628 | QPEMenuBar *menuBar1; |
629 | menuBar1 = new QPEMenuBar( iconToolBar ); | 629 | menuBar1 = new QPEMenuBar( iconToolBar ); |
630 | QPopupMenu *menuBar = new QPopupMenu( this ); | 630 | QPopupMenu *menuBar = new QPopupMenu( this ); |
631 | icon = loadPixmap( pathString + "z_menu" ); | 631 | icon = loadPixmap( pathString + "z_menu" ); |
632 | menuBar1->insertItem( icon.pixmap(), menuBar); | 632 | menuBar1->insertItem( icon.pixmap(), menuBar); |
633 | //menuBar1->insertItem( i18n("ME"), menuBar); | 633 | //menuBar1->insertItem( i18n("ME"), menuBar); |
634 | menuBar->insertItem( i18n("File"), importMenu ); | 634 | menuBar->insertItem( i18n("File"), importMenu ); |
635 | menuBar->insertItem( i18n("View"), viewMenu ); | 635 | menuBar->insertItem( i18n("View"), viewMenu ); |
636 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 636 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
637 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 637 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
638 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 638 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
639 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 639 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
640 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 640 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
641 | menuBar->insertItem( i18n("Help"), helpMenu ); | 641 | menuBar->insertItem( i18n("Help"), helpMenu ); |
642 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 642 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
643 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 643 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
644 | } | 644 | } |
645 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 645 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
646 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 646 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
647 | mWeekBgColor = iconToolBar->backgroundColor(); | 647 | mWeekBgColor = iconToolBar->backgroundColor(); |
648 | mWeekPixmap.resize( pixWid , pixHei ); | 648 | mWeekPixmap.resize( pixWid , pixHei ); |
649 | mWeekPixmap.fill( mWeekBgColor ); | 649 | mWeekPixmap.fill( mWeekBgColor ); |
650 | icon = mWeekPixmap; | 650 | icon = mWeekPixmap; |
651 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 651 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
652 | if ( p-> mShowIconWeekNum ) | 652 | if ( p-> mShowIconWeekNum ) |
653 | mWeekAction->addTo( iconToolBar ); | 653 | mWeekAction->addTo( iconToolBar ); |
654 | mWeekFont = font(); | 654 | mWeekFont = font(); |
655 | 655 | ||
656 | int fontPoint = mWeekFont.pointSize(); | 656 | int fontPoint = mWeekFont.pointSize(); |
657 | QFontMetrics f( mWeekFont ); | 657 | QFontMetrics f( mWeekFont ); |
658 | int fontWid = f.width( "30" ); | 658 | int fontWid = f.width( "30" ); |
659 | while ( fontWid > pixWid ) { | 659 | while ( fontWid > pixWid ) { |
660 | --fontPoint; | 660 | --fontPoint; |
661 | mWeekFont.setPointSize( fontPoint ); | 661 | mWeekFont.setPointSize( fontPoint ); |
662 | QFontMetrics f( mWeekFont ); | 662 | QFontMetrics f( mWeekFont ); |
663 | fontWid = f.width( "30" ); | 663 | fontWid = f.width( "30" ); |
664 | //qDebug("dec-- "); | 664 | //qDebug("dec-- "); |
665 | } | 665 | } |
666 | 666 | ||
667 | connect( mWeekAction, SIGNAL( activated() ), | 667 | connect( mWeekAction, SIGNAL( activated() ), |
668 | this, SLOT( weekAction() ) ); | 668 | this, SLOT( weekAction() ) ); |
669 | 669 | ||
670 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 670 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
671 | 671 | ||
672 | //#endif | 672 | //#endif |
673 | // ****************** | 673 | // ****************** |
674 | QAction *action; | 674 | QAction *action; |
675 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 675 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
676 | configureToolBarMenu->setCheckable( true ); | 676 | configureToolBarMenu->setCheckable( true ); |
677 | 677 | ||
678 | 678 | ||
679 | configureAgendaMenu->setCheckable( true ); | 679 | configureAgendaMenu->setCheckable( true ); |
680 | int iii ; | 680 | int iii ; |
681 | for ( iii = 1;iii<= 10 ;++iii ){ | 681 | for ( iii = 1;iii<= 10 ;++iii ){ |
682 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 682 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
683 | } | 683 | } |
684 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 684 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
685 | 685 | ||
686 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 686 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
687 | this, SLOT( showConfigureAgenda( ) ) ); | 687 | this, SLOT( showConfigureAgenda( ) ) ); |
688 | 688 | ||
689 | icon = loadPixmap( pathString + "configure" ); | 689 | icon = loadPixmap( pathString + "configure" ); |
690 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 690 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
691 | action->addTo( actionMenu ); | 691 | action->addTo( actionMenu ); |
692 | connect( action, SIGNAL( activated() ), | 692 | connect( action, SIGNAL( activated() ), |
693 | mView, SLOT( edit_options() ) ); | 693 | mView, SLOT( edit_options() ) ); |
694 | actionMenu->insertSeparator(); | 694 | actionMenu->insertSeparator(); |
695 | 695 | ||
696 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 696 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
697 | action->addTo( actionMenu ); | 697 | action->addTo( actionMenu ); |
698 | connect( action, SIGNAL( activated() ), | 698 | connect( action, SIGNAL( activated() ), |
699 | mView, SLOT( undo_delete() ) ); | 699 | mView, SLOT( undo_delete() ) ); |
700 | actionMenu->insertSeparator(); | 700 | actionMenu->insertSeparator(); |
701 | 701 | ||
702 | icon = loadPixmap( pathString + "newevent" ); | 702 | icon = loadPixmap( pathString + "newevent" ); |
703 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 703 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
704 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 704 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
705 | configureToolBarMenu->insertSeparator(); | 705 | configureToolBarMenu->insertSeparator(); |
706 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 706 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
707 | configureToolBarMenu->insertSeparator(); | 707 | configureToolBarMenu->insertSeparator(); |
708 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 708 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
709 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 709 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
710 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 710 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
711 | ne_action->addTo( actionMenu ); | 711 | ne_action->addTo( actionMenu ); |
712 | connect( ne_action, SIGNAL( activated() ), | 712 | connect( ne_action, SIGNAL( activated() ), |
713 | mView, SLOT( newEvent() ) ); | 713 | mView, SLOT( newEvent() ) ); |
714 | icon = loadPixmap( pathString + "newtodo" ); | 714 | icon = loadPixmap( pathString + "newtodo" ); |
715 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 715 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
716 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 716 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
717 | nt_action->addTo( actionMenu ); | 717 | nt_action->addTo( actionMenu ); |
718 | connect( nt_action, SIGNAL( activated() ), | 718 | connect( nt_action, SIGNAL( activated() ), |
719 | mView, SLOT( newTodo() ) ); | 719 | mView, SLOT( newTodo() ) ); |
720 | 720 | ||
721 | icon = loadPixmap( pathString + "today" ); | 721 | icon = loadPixmap( pathString + "today" ); |
722 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 722 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
723 | today_action->addTo( viewMenu ); | 723 | today_action->addTo( viewMenu ); |
724 | connect( today_action, SIGNAL( activated() ), | 724 | connect( today_action, SIGNAL( activated() ), |
725 | mView, SLOT( goToday() ) ); | 725 | mView, SLOT( goToday() ) ); |
726 | viewMenu->insertSeparator(); | 726 | viewMenu->insertSeparator(); |
727 | 727 | ||
728 | // *********************** | 728 | // *********************** |
729 | if ( KOPrefs::instance()->mVerticalScreen ) { | 729 | if ( KOPrefs::instance()->mVerticalScreen ) { |
730 | icon = SmallIcon( "1updownarrow" ); | 730 | icon = SmallIcon( "1updownarrow" ); |
731 | } else { | 731 | } else { |
732 | icon = SmallIcon("1leftrightarrow" ); | 732 | icon = SmallIcon("1leftrightarrow" ); |
733 | } | 733 | } |
734 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 734 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
735 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 735 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
736 | FSaction->addTo( viewMenu ); | 736 | FSaction->addTo( viewMenu ); |
737 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 737 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
738 | 738 | ||
739 | icon = loadPixmap( pathString + "navi" ); | 739 | icon = loadPixmap( pathString + "navi" ); |
740 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 740 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
741 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 741 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
742 | action->addTo( viewMenu ); | 742 | action->addTo( viewMenu ); |
743 | connect( action, SIGNAL( activated() ), | 743 | connect( action, SIGNAL( activated() ), |
744 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 744 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
745 | mToggleNav = action ; | 745 | mToggleNav = action ; |
746 | icon = loadPixmap( pathString + "filter" ); | 746 | icon = loadPixmap( pathString + "filter" ); |
747 | configureToolBarMenu->insertItem(icon, i18n("Toggle FilterView"), 26 ); | 747 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
748 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 748 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
749 | action->addTo( viewMenu ); | 749 | action->addTo( viewMenu ); |
750 | connect( action, SIGNAL( activated() ), | 750 | connect( action, SIGNAL( activated() ), |
751 | mView, SLOT( toggleFilter() ) ); | 751 | mView, SLOT( toggleFilter() ) ); |
752 | mToggleFilter = action; | 752 | mToggleFilter = action; |
753 | icon = loadPixmap( pathString + "allday" ); | 753 | icon = loadPixmap( pathString + "allday" ); |
754 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 754 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
755 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 755 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
756 | action->addTo( viewMenu ); | 756 | action->addTo( viewMenu ); |
757 | connect( action, SIGNAL( activated() ), | 757 | connect( action, SIGNAL( activated() ), |
758 | mView, SLOT( toggleAllDaySize() ) ); | 758 | mView, SLOT( toggleAllDaySize() ) ); |
759 | mToggleAllday = action; | 759 | mToggleAllday = action; |
760 | 760 | ||
761 | 761 | ||
762 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 762 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
763 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 763 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
764 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 764 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
765 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 765 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
766 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 766 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
767 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 767 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
768 | 768 | ||
769 | viewMenu->insertSeparator(); | 769 | viewMenu->insertSeparator(); |
770 | icon = loadPixmap( pathString + "picker" ); | 770 | icon = loadPixmap( pathString + "picker" ); |
771 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 771 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
772 | action->addTo( viewMenu ); | 772 | action->addTo( viewMenu ); |
773 | connect( action, SIGNAL( activated() ), | 773 | connect( action, SIGNAL( activated() ), |
774 | mView, SLOT( showDatePicker() ) ); | 774 | mView, SLOT( showDatePicker() ) ); |
775 | action->addTo( iconToolBar ); | 775 | action->addTo( iconToolBar ); |
776 | viewMenu->insertSeparator(); | 776 | viewMenu->insertSeparator(); |
777 | 777 | ||
778 | if ( p-> mShowIconToggleFull ) | 778 | if ( p-> mShowIconToggleFull ) |
779 | FSaction->addTo( iconToolBar ); | 779 | FSaction->addTo( iconToolBar ); |
780 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 780 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
781 | if ( p->mShowIconFilterview ) mToggleFilter->addTo( iconToolBar ); | 781 | if ( p->mShowIconFilterview ) { |
782 | icon = loadPixmap( pathString + "filter" ); | ||
783 | QPEMenuBar *menuBar111 = new QPEMenuBar( iconToolBar ); | ||
784 | menuBar111->insertItem( icon.pixmap(), selectFilterMenu); | ||
785 | int isi = 24; | ||
786 | if ( QApplication::desktop()->width() < 480 ) | ||
787 | isi = 18; | ||
788 | menuBar111->setFixedSize( QSize( isi, isi )) ; | ||
789 | } | ||
790 | //******************** | ||
782 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 791 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
783 | 792 | ||
784 | 793 | ||
785 | icon = loadPixmap( pathString + "whatsnext" ); | 794 | icon = loadPixmap( pathString + "whatsnext" ); |
786 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 795 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
787 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 796 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
788 | whatsnext_action->addTo( viewMenu ); | 797 | whatsnext_action->addTo( viewMenu ); |
789 | connect( whatsnext_action, SIGNAL( activated() ), | 798 | connect( whatsnext_action, SIGNAL( activated() ), |
790 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 799 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
791 | 800 | ||
792 | icon = loadPixmap( pathString + "xdays" ); | 801 | icon = loadPixmap( pathString + "xdays" ); |
793 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 802 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
794 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 803 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
795 | xdays_action->addTo( viewMenu ); | 804 | xdays_action->addTo( viewMenu ); |
796 | connect( xdays_action, SIGNAL( activated() ), | 805 | connect( xdays_action, SIGNAL( activated() ), |
797 | mView->viewManager(), SLOT( showNextXView() ) ); | 806 | mView->viewManager(), SLOT( showNextXView() ) ); |
798 | 807 | ||
799 | 808 | ||
800 | icon = loadPixmap( pathString + "journal" ); | 809 | icon = loadPixmap( pathString + "journal" ); |
801 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 810 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
802 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 811 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
803 | viewjournal_action->addTo( viewMenu ); | 812 | viewjournal_action->addTo( viewMenu ); |
804 | connect( viewjournal_action, SIGNAL( activated() ), | 813 | connect( viewjournal_action, SIGNAL( activated() ), |
805 | mView->viewManager(), SLOT( showJournalView() ) ); | 814 | mView->viewManager(), SLOT( showJournalView() ) ); |
806 | 815 | ||
807 | 816 | ||
808 | icon = loadPixmap( pathString + "day" ); | 817 | icon = loadPixmap( pathString + "day" ); |
809 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 818 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
810 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 819 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
811 | day1_action->addTo( viewMenu ); | 820 | day1_action->addTo( viewMenu ); |
812 | // action->addTo( toolBar ); | 821 | // action->addTo( toolBar ); |
813 | connect( day1_action, SIGNAL( activated() ), | 822 | connect( day1_action, SIGNAL( activated() ), |
814 | mView->viewManager(), SLOT( showDayView() ) ); | 823 | mView->viewManager(), SLOT( showDayView() ) ); |
815 | 824 | ||
816 | icon = loadPixmap( pathString + "workweek" ); | 825 | icon = loadPixmap( pathString + "workweek" ); |
817 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 826 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
818 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 827 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
819 | day5_action->addTo( viewMenu ); | 828 | day5_action->addTo( viewMenu ); |
820 | connect( day5_action, SIGNAL( activated() ), | 829 | connect( day5_action, SIGNAL( activated() ), |
821 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 830 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
822 | 831 | ||
823 | icon = loadPixmap( pathString + "week" ); | 832 | icon = loadPixmap( pathString + "week" ); |
824 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 833 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
825 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 834 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
826 | day7_action->addTo( viewMenu ); | 835 | day7_action->addTo( viewMenu ); |
827 | connect( day7_action, SIGNAL( activated() ), | 836 | connect( day7_action, SIGNAL( activated() ), |
828 | mView->viewManager(), SLOT( showWeekView() ) ); | 837 | mView->viewManager(), SLOT( showWeekView() ) ); |
829 | 838 | ||
830 | icon = loadPixmap( pathString + "workweek2" ); | 839 | icon = loadPixmap( pathString + "workweek2" ); |
831 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 840 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
832 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 841 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
833 | day6_action->addTo( viewMenu ); | 842 | day6_action->addTo( viewMenu ); |
834 | connect( day6_action, SIGNAL( activated() ), | 843 | connect( day6_action, SIGNAL( activated() ), |
835 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 844 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
836 | 845 | ||
837 | icon = loadPixmap( pathString + "month" ); | 846 | icon = loadPixmap( pathString + "month" ); |
838 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 847 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
839 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 848 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
840 | month_action->addTo( viewMenu ); | 849 | month_action->addTo( viewMenu ); |
841 | connect( month_action, SIGNAL( activated() ), | 850 | connect( month_action, SIGNAL( activated() ), |
842 | mView->viewManager(), SLOT( showMonthView() ) ); | 851 | mView->viewManager(), SLOT( showMonthView() ) ); |
843 | 852 | ||
844 | icon = loadPixmap( pathString + "list" ); | 853 | icon = loadPixmap( pathString + "list" ); |
845 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 854 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
846 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 855 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
847 | showlist_action->addTo( viewMenu ); | 856 | showlist_action->addTo( viewMenu ); |
848 | connect( showlist_action, SIGNAL( activated() ), | 857 | connect( showlist_action, SIGNAL( activated() ), |
849 | mView->viewManager(), SLOT( showListView() ) ); | 858 | mView->viewManager(), SLOT( showListView() ) ); |
850 | 859 | ||
851 | icon = loadPixmap( pathString + "todo" ); | 860 | icon = loadPixmap( pathString + "todo" ); |
852 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 861 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
853 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 862 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
854 | todoview_action->addTo( viewMenu ); | 863 | todoview_action->addTo( viewMenu ); |
855 | connect( todoview_action, SIGNAL( activated() ), | 864 | connect( todoview_action, SIGNAL( activated() ), |
856 | mView->viewManager(), SLOT( showTodoView() ) ); | 865 | mView->viewManager(), SLOT( showTodoView() ) ); |
857 | 866 | ||
858 | 867 | ||
859 | 868 | ||
860 | #if 0 | 869 | #if 0 |
861 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 870 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
862 | action->addTo( viewMenu ); | 871 | action->addTo( viewMenu ); |
863 | connect( action, SIGNAL( activated() ), | 872 | connect( action, SIGNAL( activated() ), |
864 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 873 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
865 | #endif | 874 | #endif |
866 | 875 | ||
867 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 876 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
868 | this ); | 877 | this ); |
869 | mNewSubTodoAction->addTo( actionMenu ); | 878 | mNewSubTodoAction->addTo( actionMenu ); |
870 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 879 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
871 | mView, SLOT( newSubTodo() ) ); | 880 | mView, SLOT( newSubTodo() ) ); |
872 | 881 | ||
873 | actionMenu->insertSeparator(); | 882 | actionMenu->insertSeparator(); |
874 | 883 | ||
875 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 884 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
876 | mShowAction->addTo( actionMenu ); | 885 | mShowAction->addTo( actionMenu ); |
877 | connect( mShowAction, SIGNAL( activated() ), | 886 | connect( mShowAction, SIGNAL( activated() ), |
878 | mView, SLOT( showIncidence() ) ); | 887 | mView, SLOT( showIncidence() ) ); |
879 | 888 | ||
880 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 889 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
881 | mEditAction->addTo( actionMenu ); | 890 | mEditAction->addTo( actionMenu ); |
882 | connect( mEditAction, SIGNAL( activated() ), | 891 | connect( mEditAction, SIGNAL( activated() ), |
883 | mView, SLOT( editIncidence() ) ); | 892 | mView, SLOT( editIncidence() ) ); |
884 | 893 | ||
885 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 894 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
886 | mDeleteAction->addTo( actionMenu ); | 895 | mDeleteAction->addTo( actionMenu ); |
887 | connect( mDeleteAction, SIGNAL( activated() ), | 896 | connect( mDeleteAction, SIGNAL( activated() ), |
888 | mView, SLOT( deleteIncidence() ) ); | 897 | mView, SLOT( deleteIncidence() ) ); |
889 | 898 | ||
890 | 899 | ||
891 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 900 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
892 | mCloneAction->addTo( actionMenu ); | 901 | mCloneAction->addTo( actionMenu ); |
893 | connect( mCloneAction, SIGNAL( activated() ), | 902 | connect( mCloneAction, SIGNAL( activated() ), |
894 | mView, SLOT( cloneIncidence() ) ); | 903 | mView, SLOT( cloneIncidence() ) ); |
895 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 904 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
896 | mMoveAction->addTo( actionMenu ); | 905 | mMoveAction->addTo( actionMenu ); |
897 | connect( mMoveAction, SIGNAL( activated() ), | 906 | connect( mMoveAction, SIGNAL( activated() ), |
898 | mView, SLOT( moveIncidence() ) ); | 907 | mView, SLOT( moveIncidence() ) ); |
899 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 908 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
900 | mBeamAction->addTo( actionMenu ); | 909 | mBeamAction->addTo( actionMenu ); |
901 | connect( mBeamAction, SIGNAL( activated() ), | 910 | connect( mBeamAction, SIGNAL( activated() ), |
902 | mView, SLOT( beamIncidence() ) ); | 911 | mView, SLOT( beamIncidence() ) ); |
903 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 912 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
904 | mCancelAction->addTo( actionMenu ); | 913 | mCancelAction->addTo( actionMenu ); |
905 | connect( mCancelAction, SIGNAL( activated() ), | 914 | connect( mCancelAction, SIGNAL( activated() ), |
906 | mView, SLOT( toggleCancelIncidence() ) ); | 915 | mView, SLOT( toggleCancelIncidence() ) ); |
907 | 916 | ||
908 | actionMenu->insertSeparator(); | 917 | actionMenu->insertSeparator(); |
909 | 918 | ||
910 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 919 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
911 | this ); | 920 | this ); |
912 | action->addTo( actionMenu ); | 921 | action->addTo( actionMenu ); |
913 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 922 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
914 | 923 | ||
915 | icon = loadPixmap( pathString + "search" ); | 924 | icon = loadPixmap( pathString + "search" ); |
916 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 925 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
917 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 926 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
918 | search_action->addTo( actionMenu ); | 927 | search_action->addTo( actionMenu ); |
919 | connect( search_action, SIGNAL( activated() ), | 928 | connect( search_action, SIGNAL( activated() ), |
920 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 929 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
921 | 930 | ||
922 | 931 | ||
923 | 932 | ||
924 | if ( KOPrefs::instance()->mShowFullMenu ) { | 933 | if ( KOPrefs::instance()->mShowFullMenu ) { |
925 | actionMenu->insertSeparator(); | 934 | actionMenu->insertSeparator(); |
926 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 935 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
927 | 936 | ||
928 | } | 937 | } |
929 | // actionMenu->insertSeparator(); | 938 | // actionMenu->insertSeparator(); |
930 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 939 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
931 | this ); | 940 | this ); |
932 | action->addTo( importMenu_X ); | 941 | action->addTo( importMenu_X ); |
933 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 942 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
934 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 943 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
935 | this ); | 944 | this ); |
936 | action->addTo( importMenu_X ); | 945 | action->addTo( importMenu_X ); |
937 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 946 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
938 | importMenu_X->insertSeparator(); | 947 | importMenu_X->insertSeparator(); |
939 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 948 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
940 | this ); | 949 | this ); |
941 | action->addTo( importMenu_X ); | 950 | action->addTo( importMenu_X ); |
942 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 951 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
943 | //#ifndef DESKTOP_VERSION | 952 | //#ifndef DESKTOP_VERSION |
944 | importMenu_X->insertSeparator(); | 953 | importMenu_X->insertSeparator(); |
945 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 954 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
946 | this ); | 955 | this ); |
947 | action->addTo( importMenu_X ); | 956 | action->addTo( importMenu_X ); |
948 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 957 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
949 | //#else | 958 | //#else |
950 | #ifdef _OL_IMPORT_ | 959 | #ifdef _OL_IMPORT_ |
951 | importMenu_X->insertSeparator(); | 960 | importMenu_X->insertSeparator(); |
952 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 961 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
953 | this ); | 962 | this ); |
954 | action->addTo( importMenu_X ); | 963 | action->addTo( importMenu_X ); |
955 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 964 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
956 | #endif | 965 | #endif |
957 | //#endif | 966 | //#endif |
958 | 967 | ||
959 | //importMenu->insertSeparator(); | 968 | //importMenu->insertSeparator(); |
960 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 969 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
961 | this ); | 970 | this ); |
962 | action->addTo( importMenu ); | 971 | action->addTo( importMenu ); |
963 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 972 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
964 | 973 | ||
965 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 974 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
966 | this ); | 975 | this ); |
967 | action->addTo( importMenu ); | 976 | action->addTo( importMenu ); |
968 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 977 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
969 | importMenu->insertSeparator(); | 978 | importMenu->insertSeparator(); |
970 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 979 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
971 | //importMenu->insertSeparator(); | 980 | //importMenu->insertSeparator(); |
972 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 981 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
973 | this ); | 982 | this ); |
974 | action->addTo( exportMenu_X ); | 983 | action->addTo( exportMenu_X ); |
975 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 984 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
976 | 985 | ||
977 | 986 | ||
978 | //LR | 987 | //LR |
979 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 988 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
980 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 989 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
981 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 990 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
982 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 991 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
983 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 992 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
984 | 993 | ||
985 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 994 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
986 | #ifndef DESKTOP_VERSION | 995 | #ifndef DESKTOP_VERSION |
987 | //importMenu->insertSeparator(); | 996 | //importMenu->insertSeparator(); |
988 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 997 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
989 | this ); | 998 | this ); |
990 | brAction->addTo( beamMenu_X ); | 999 | brAction->addTo( beamMenu_X ); |
991 | brAction->setToggleAction (true ) ; | 1000 | brAction->setToggleAction (true ) ; |
992 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1001 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
993 | 1002 | ||
994 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1003 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
995 | this ); | 1004 | this ); |
996 | action->addTo( beamMenu_X ); | 1005 | action->addTo( beamMenu_X ); |
997 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1006 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
998 | 1007 | ||
999 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1008 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
1000 | this ); | 1009 | this ); |
1001 | action->addTo( beamMenu_X ); | 1010 | action->addTo( beamMenu_X ); |
1002 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1011 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1003 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1012 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1004 | #else | 1013 | #else |
1005 | //importMenu->insertSeparator(); | 1014 | //importMenu->insertSeparator(); |
1006 | icon = loadPixmap( pathString + "print" ); | 1015 | icon = loadPixmap( pathString + "print" ); |
1007 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1016 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1008 | action->addTo( beamMenu_X ); | 1017 | action->addTo( beamMenu_X ); |
1009 | connect( action, SIGNAL( activated() ), | 1018 | connect( action, SIGNAL( activated() ), |
1010 | this, SLOT( printCal() ) ); | 1019 | this, SLOT( printCal() ) ); |
1011 | 1020 | ||
1012 | icon = loadPixmap( pathString + "print" ); | 1021 | icon = loadPixmap( pathString + "print" ); |
1013 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1022 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1014 | action->addTo( beamMenu_X ); | 1023 | action->addTo( beamMenu_X ); |
1015 | connect( action, SIGNAL( activated() ), | 1024 | connect( action, SIGNAL( activated() ), |
1016 | this, SLOT( printSel() ) ); | 1025 | this, SLOT( printSel() ) ); |
1017 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1026 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1018 | action->addTo( beamMenu_X ); | 1027 | action->addTo( beamMenu_X ); |
1019 | connect( action, SIGNAL( activated() ), | 1028 | connect( action, SIGNAL( activated() ), |
1020 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1029 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1021 | 1030 | ||
1022 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1031 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1023 | action->addTo( beamMenu_X ); | 1032 | action->addTo( beamMenu_X ); |
1024 | connect( action, SIGNAL( activated() ), | 1033 | connect( action, SIGNAL( activated() ), |
1025 | mView, SLOT( slotprintSelInc() ) ); | 1034 | mView, SLOT( slotprintSelInc() ) ); |
1026 | 1035 | ||
1027 | 1036 | ||
1028 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1037 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1029 | #endif | 1038 | #endif |
1030 | importMenu->insertSeparator(); | 1039 | importMenu->insertSeparator(); |
1031 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1040 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1032 | this ); | 1041 | this ); |
1033 | action->addTo( importMenu ); | 1042 | action->addTo( importMenu ); |
1034 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1043 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1035 | importMenu->insertSeparator(); | 1044 | importMenu->insertSeparator(); |
1036 | action = new QAction( "beam all", i18n("Save"), 0, | 1045 | action = new QAction( "beam all", i18n("Save"), 0, |
1037 | this ); | 1046 | this ); |
1038 | action->addTo( importMenu ); | 1047 | action->addTo( importMenu ); |
1039 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1048 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1040 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1049 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1041 | this ); | 1050 | this ); |
1042 | action->addTo( importMenu ); | 1051 | action->addTo( importMenu ); |
1043 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1052 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1044 | 1053 | ||
1045 | //menuBar->insertItem( "Configure",configureMenu ); | 1054 | //menuBar->insertItem( "Configure",configureMenu ); |
1046 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1055 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1047 | icon = loadPixmap( "korganizer/korganizer" ); | 1056 | icon = loadPixmap( "korganizer/korganizer" ); |
1048 | 1057 | ||
1049 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1058 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1050 | action->addTo( helpMenu ); | 1059 | action->addTo( helpMenu ); |
1051 | connect( action, SIGNAL( activated() ), | 1060 | connect( action, SIGNAL( activated() ), |
1052 | SLOT( whatsNew() ) ); | 1061 | SLOT( whatsNew() ) ); |
1053 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1062 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1054 | action->addTo( helpMenu ); | 1063 | action->addTo( helpMenu ); |
1055 | connect( action, SIGNAL( activated() ), | 1064 | connect( action, SIGNAL( activated() ), |
1056 | SLOT( features() ) ); | 1065 | SLOT( features() ) ); |
1057 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1066 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1058 | action->addTo( helpMenu ); | 1067 | action->addTo( helpMenu ); |
1059 | connect( action, SIGNAL( activated() ), | 1068 | connect( action, SIGNAL( activated() ), |
1060 | SLOT( keyBindings() ) ); | 1069 | SLOT( keyBindings() ) ); |
1061 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1070 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1062 | action->addTo( helpMenu ); | 1071 | action->addTo( helpMenu ); |
1063 | connect( action, SIGNAL( activated() ), | 1072 | connect( action, SIGNAL( activated() ), |
1064 | SLOT( synchowto() ) ); | 1073 | SLOT( synchowto() ) ); |
1065 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1074 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1066 | action->addTo( helpMenu ); | 1075 | action->addTo( helpMenu ); |
1067 | connect( action, SIGNAL( activated() ), | 1076 | connect( action, SIGNAL( activated() ), |
1068 | SLOT( kdesynchowto() ) ); | 1077 | SLOT( kdesynchowto() ) ); |
1069 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1078 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1070 | action->addTo( helpMenu ); | 1079 | action->addTo( helpMenu ); |
1071 | connect( action, SIGNAL( activated() ), | 1080 | connect( action, SIGNAL( activated() ), |
1072 | SLOT( multisynchowto() ) ); | 1081 | SLOT( multisynchowto() ) ); |
1073 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1082 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1074 | action->addTo( helpMenu ); | 1083 | action->addTo( helpMenu ); |
1075 | connect( action, SIGNAL( activated() ), | 1084 | connect( action, SIGNAL( activated() ), |
1076 | SLOT( aboutAutoSaving() ) ); | 1085 | SLOT( aboutAutoSaving() ) ); |
1077 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1086 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
1078 | action->addTo( helpMenu ); | 1087 | action->addTo( helpMenu ); |
1079 | connect( action, SIGNAL( activated() ), | 1088 | connect( action, SIGNAL( activated() ), |
1080 | SLOT( aboutKnownBugs() ) ); | 1089 | SLOT( aboutKnownBugs() ) ); |
1081 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1090 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
1082 | action->addTo( helpMenu ); | 1091 | action->addTo( helpMenu ); |
1083 | connect( action, SIGNAL( activated() ), | 1092 | connect( action, SIGNAL( activated() ), |
1084 | SLOT( usertrans() ) ); | 1093 | SLOT( usertrans() ) ); |
1085 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1094 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1086 | action->addTo( helpMenu ); | 1095 | action->addTo( helpMenu ); |
1087 | connect( action, SIGNAL( activated() ), | 1096 | connect( action, SIGNAL( activated() ), |
1088 | SLOT( faq() ) ); | 1097 | SLOT( faq() ) ); |
1089 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1098 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1090 | action->addTo( helpMenu ); | 1099 | action->addTo( helpMenu ); |
1091 | connect( action, SIGNAL( activated() ), | 1100 | connect( action, SIGNAL( activated() ), |
1092 | SLOT( licence() ) ); | 1101 | SLOT( licence() ) ); |
1093 | action = new QAction( "about", i18n("About..."), 0, this ); | 1102 | action = new QAction( "about", i18n("About..."), 0, this ); |
1094 | action->addTo( helpMenu ); | 1103 | action->addTo( helpMenu ); |
1095 | connect( action, SIGNAL( activated() ), | 1104 | connect( action, SIGNAL( activated() ), |
1096 | SLOT( about() ) ); | 1105 | SLOT( about() ) ); |
1097 | //menuBar->insertSeparator(); | 1106 | //menuBar->insertSeparator(); |
1098 | 1107 | ||
1099 | // ****************************************************** | 1108 | // ****************************************************** |
1100 | // menubar icons | 1109 | // menubar icons |
1101 | 1110 | ||
1102 | 1111 | ||
1103 | 1112 | ||
1104 | //menuBar->insertItem( iconToolBar ); | 1113 | //menuBar->insertItem( iconToolBar ); |
1105 | //xdays_action | 1114 | //xdays_action |
1106 | if (p-> mShowIconNewEvent) | 1115 | if (p-> mShowIconNewEvent) |
1107 | ne_action->addTo( iconToolBar ); | 1116 | ne_action->addTo( iconToolBar ); |
1108 | if (p->mShowIconNewTodo ) | 1117 | if (p->mShowIconNewTodo ) |
1109 | nt_action->addTo( iconToolBar ); | 1118 | nt_action->addTo( iconToolBar ); |
1110 | if (p-> mShowIconSearch) | 1119 | if (p-> mShowIconSearch) |
1111 | search_action->addTo( iconToolBar ); | 1120 | search_action->addTo( iconToolBar ); |
1112 | if (p-> mShowIconWhatsThis) | 1121 | if (p-> mShowIconWhatsThis) |
1113 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1122 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1114 | if (p-> mShowIconNext) | 1123 | if (p-> mShowIconNext) |
1115 | whatsnext_action->addTo( viewToolBar ); | 1124 | whatsnext_action->addTo( viewToolBar ); |
1116 | if (p-> mShowIconNextDays) | 1125 | if (p-> mShowIconNextDays) |
1117 | xdays_action->addTo( viewToolBar ); | 1126 | xdays_action->addTo( viewToolBar ); |
1118 | if (p-> mShowIconJournal) | 1127 | if (p-> mShowIconJournal) |
1119 | viewjournal_action->addTo( viewToolBar ); | 1128 | viewjournal_action->addTo( viewToolBar ); |
1120 | if (p-> mShowIconDay1) | 1129 | if (p-> mShowIconDay1) |
1121 | day1_action->addTo( viewToolBar ); | 1130 | day1_action->addTo( viewToolBar ); |
1122 | if (p-> mShowIconDay5) | 1131 | if (p-> mShowIconDay5) |
1123 | day5_action->addTo( viewToolBar ); | 1132 | day5_action->addTo( viewToolBar ); |
1124 | if (p-> mShowIconDay7) | 1133 | if (p-> mShowIconDay7) |
1125 | day7_action->addTo( viewToolBar ); | 1134 | day7_action->addTo( viewToolBar ); |
1126 | if (p-> mShowIconDay6) | 1135 | if (p-> mShowIconDay6) |
1127 | day6_action->addTo( viewToolBar ); | 1136 | day6_action->addTo( viewToolBar ); |
1128 | if (p-> mShowIconMonth) | 1137 | if (p-> mShowIconMonth) |
1129 | month_action->addTo( viewToolBar ); | 1138 | month_action->addTo( viewToolBar ); |
1130 | if (p-> mShowIconList) | 1139 | if (p-> mShowIconList) |
1131 | showlist_action->addTo( viewToolBar ); | 1140 | showlist_action->addTo( viewToolBar ); |
1132 | if (p-> mShowIconTodoview) | 1141 | if (p-> mShowIconTodoview) |
1133 | todoview_action->addTo( viewToolBar ); | 1142 | todoview_action->addTo( viewToolBar ); |
1134 | 1143 | ||
1135 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1144 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1136 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1145 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1137 | if (p-> mShowIconBackFast) { | 1146 | if (p-> mShowIconBackFast) { |
1138 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1147 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1139 | connect( action, SIGNAL( activated() ), | 1148 | connect( action, SIGNAL( activated() ), |
1140 | mView, SLOT( goPreviousMonth() ) ); | 1149 | mView, SLOT( goPreviousMonth() ) ); |
1141 | action->addTo( navigatorToolBar ); | 1150 | action->addTo( navigatorToolBar ); |
1142 | } | 1151 | } |
1143 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1152 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1144 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1153 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1145 | if (p-> mShowIconBack) { | 1154 | if (p-> mShowIconBack) { |
1146 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1155 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1147 | connect( action, SIGNAL( activated() ), | 1156 | connect( action, SIGNAL( activated() ), |
1148 | mView, SLOT( goPrevious() ) ); | 1157 | mView, SLOT( goPrevious() ) ); |
1149 | action->addTo( navigatorToolBar ); | 1158 | action->addTo( navigatorToolBar ); |
1150 | } | 1159 | } |
1151 | icon = loadPixmap( pathString + "today" ); | 1160 | icon = loadPixmap( pathString + "today" ); |
1152 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1161 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1153 | if (p-> mShowIconToday) | 1162 | if (p-> mShowIconToday) |
1154 | today_action->addTo( navigatorToolBar ); | 1163 | today_action->addTo( navigatorToolBar ); |
1155 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1164 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1156 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1165 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1157 | if (p-> mShowIconForward) { | 1166 | if (p-> mShowIconForward) { |
1158 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1167 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1159 | connect( action, SIGNAL( activated() ), | 1168 | connect( action, SIGNAL( activated() ), |
1160 | mView, SLOT( goNext() ) ); | 1169 | mView, SLOT( goNext() ) ); |
1161 | action->addTo( navigatorToolBar ); | 1170 | action->addTo( navigatorToolBar ); |
1162 | } | 1171 | } |
1163 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1172 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1164 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1173 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1165 | if (p-> mShowIconForwardFast) { | 1174 | if (p-> mShowIconForwardFast) { |
1166 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1175 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1167 | connect( action, SIGNAL( activated() ), | 1176 | connect( action, SIGNAL( activated() ), |
1168 | mView, SLOT( goNextMonth() ) ); | 1177 | mView, SLOT( goNextMonth() ) ); |
1169 | action->addTo( navigatorToolBar ); | 1178 | action->addTo( navigatorToolBar ); |
1170 | } | 1179 | } |
1171 | 1180 | ||
1172 | 1181 | ||
1173 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1182 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1174 | 1183 | ||
1175 | 1184 | ||
1176 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); | 1185 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); |
1177 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); | 1186 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); |
1178 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); | 1187 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); |
1179 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); | 1188 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); |
1180 | 1189 | ||
1181 | if (p-> mShowIconNewEvent) | 1190 | if (p-> mShowIconNewEvent) |
1182 | configureToolBarMenu->setItemChecked( 10, true ); | 1191 | configureToolBarMenu->setItemChecked( 10, true ); |
1183 | if (p->mShowIconNewTodo ) | 1192 | if (p->mShowIconNewTodo ) |
1184 | configureToolBarMenu->setItemChecked( 20, true ); | 1193 | configureToolBarMenu->setItemChecked( 20, true ); |
1185 | if (p-> mShowIconSearch) | 1194 | if (p-> mShowIconSearch) |
1186 | configureToolBarMenu->setItemChecked( 120, true ); | 1195 | configureToolBarMenu->setItemChecked( 120, true ); |
1187 | if (p-> mShowIconList) | 1196 | if (p-> mShowIconList) |
1188 | configureToolBarMenu->setItemChecked( 30, true ); | 1197 | configureToolBarMenu->setItemChecked( 30, true ); |
1189 | if (p-> mShowIconDay1) | 1198 | if (p-> mShowIconDay1) |
1190 | configureToolBarMenu->setItemChecked( 40, true ); | 1199 | configureToolBarMenu->setItemChecked( 40, true ); |
1191 | if (p-> mShowIconDay5) | 1200 | if (p-> mShowIconDay5) |
1192 | configureToolBarMenu->setItemChecked( 50, true ); | 1201 | configureToolBarMenu->setItemChecked( 50, true ); |
1193 | if (p-> mShowIconDay6) | 1202 | if (p-> mShowIconDay6) |
1194 | configureToolBarMenu->setItemChecked( 75, true ); | 1203 | configureToolBarMenu->setItemChecked( 75, true ); |
1195 | if (p-> mShowIconDay7) | 1204 | if (p-> mShowIconDay7) |
1196 | configureToolBarMenu->setItemChecked( 60, true ); | 1205 | configureToolBarMenu->setItemChecked( 60, true ); |
1197 | if (p-> mShowIconMonth) | 1206 | if (p-> mShowIconMonth) |
1198 | configureToolBarMenu->setItemChecked( 70, true ); | 1207 | configureToolBarMenu->setItemChecked( 70, true ); |
1199 | if (p-> mShowIconTodoview) | 1208 | if (p-> mShowIconTodoview) |
1200 | configureToolBarMenu->setItemChecked( 80, true ); | 1209 | configureToolBarMenu->setItemChecked( 80, true ); |
1201 | if (p-> mShowIconBackFast) | 1210 | if (p-> mShowIconBackFast) |
1202 | configureToolBarMenu->setItemChecked( 200, true ); | 1211 | configureToolBarMenu->setItemChecked( 200, true ); |
1203 | if (p-> mShowIconBack) | 1212 | if (p-> mShowIconBack) |
1204 | configureToolBarMenu->setItemChecked( 210, true ); | 1213 | configureToolBarMenu->setItemChecked( 210, true ); |
1205 | if (p-> mShowIconToday) | 1214 | if (p-> mShowIconToday) |
1206 | configureToolBarMenu->setItemChecked( 130, true ); | 1215 | configureToolBarMenu->setItemChecked( 130, true ); |
1207 | if (p-> mShowIconForward) | 1216 | if (p-> mShowIconForward) |
1208 | configureToolBarMenu->setItemChecked( 220, true ); | 1217 | configureToolBarMenu->setItemChecked( 220, true ); |
1209 | if (p-> mShowIconForwardFast) | 1218 | if (p-> mShowIconForwardFast) |
1210 | configureToolBarMenu->setItemChecked( 230, true ); | 1219 | configureToolBarMenu->setItemChecked( 230, true ); |
1211 | if (p-> mShowIconNextDays) | 1220 | if (p-> mShowIconNextDays) |
1212 | configureToolBarMenu->setItemChecked( 100, true ); | 1221 | configureToolBarMenu->setItemChecked( 100, true ); |
1213 | if (p-> mShowIconNext) | 1222 | if (p-> mShowIconNext) |
1214 | configureToolBarMenu->setItemChecked( 110, true ); | 1223 | configureToolBarMenu->setItemChecked( 110, true ); |
1215 | if (p-> mShowIconJournal) | 1224 | if (p-> mShowIconJournal) |
1216 | configureToolBarMenu->setItemChecked( 90, true ); | 1225 | configureToolBarMenu->setItemChecked( 90, true ); |
1217 | if (p-> mShowIconWhatsThis) | 1226 | if (p-> mShowIconWhatsThis) |
1218 | configureToolBarMenu->setItemChecked( 300, true ); | 1227 | configureToolBarMenu->setItemChecked( 300, true ); |
1219 | if (p-> mShowIconWeekNum) | 1228 | if (p-> mShowIconWeekNum) |
1220 | configureToolBarMenu->setItemChecked( 400, true ); | 1229 | configureToolBarMenu->setItemChecked( 400, true ); |
1221 | if (!p-> mShowIconStretch) { | 1230 | if (!p-> mShowIconStretch) { |
1222 | QLabel* dummy = new QLabel( iconToolBar ); | 1231 | QLabel* dummy = new QLabel( iconToolBar ); |
1223 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1232 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1224 | dummy->setMinimumWidth( 0 ); | 1233 | dummy->setMinimumWidth( 0 ); |
1225 | iconToolBar->setStretchableWidget ( dummy ) ; | 1234 | iconToolBar->setStretchableWidget ( dummy ) ; |
1226 | } | 1235 | } |
1227 | else { | 1236 | else { |
1228 | iconToolBar->setHorizontalStretchable (true ); | 1237 | iconToolBar->setHorizontalStretchable (true ); |
1229 | viewToolBar->setHorizontalStretchable (true ); | 1238 | viewToolBar->setHorizontalStretchable (true ); |
1230 | navigatorToolBar->setHorizontalStretchable (true ); | 1239 | navigatorToolBar->setHorizontalStretchable (true ); |
1231 | iconToolBar->setVerticalStretchable (true ); | 1240 | iconToolBar->setVerticalStretchable (true ); |
1232 | viewToolBar->setVerticalStretchable (true ); | 1241 | viewToolBar->setVerticalStretchable (true ); |
1233 | navigatorToolBar->setVerticalStretchable (true ); | 1242 | navigatorToolBar->setVerticalStretchable (true ); |
1234 | configureToolBarMenu->setItemChecked( 5, true ); | 1243 | configureToolBarMenu->setItemChecked( 5, true ); |
1235 | } | 1244 | } |
1236 | if (p-> mShowIconFilter) | 1245 | if (p-> mShowIconFilter) |
1237 | configureToolBarMenu->setItemChecked( 7, true ); | 1246 | configureToolBarMenu->setItemChecked( 7, true ); |
1238 | if (p-> mShowIconOnetoolbar) | 1247 | if (p-> mShowIconOnetoolbar) |
1239 | configureToolBarMenu->setItemChecked( 6, true ); | 1248 | configureToolBarMenu->setItemChecked( 6, true ); |
1240 | 1249 | ||
1241 | 1250 | ||
1242 | if ( filterMenubar ) | 1251 | if ( filterMenubar ) |
1243 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); | 1252 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); |
1244 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1253 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1245 | configureAgenda( p->mHourSize ); | 1254 | configureAgenda( p->mHourSize ); |
1246 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1255 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1247 | } | 1256 | } |
1248 | 1257 | ||
1249 | void MainWindow::exportToPhone( int mode ) | 1258 | void MainWindow::exportToPhone( int mode ) |
1250 | { | 1259 | { |
1251 | 1260 | ||
1252 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1261 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1253 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1262 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1254 | KOex2phonePrefs ex2phone; | 1263 | KOex2phonePrefs ex2phone; |
1255 | 1264 | ||
1256 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1265 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1257 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1266 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1258 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1267 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1259 | if ( mode == 1 ) | 1268 | if ( mode == 1 ) |
1260 | ex2phone.setCaption(i18n("Export complete calendar")); | 1269 | ex2phone.setCaption(i18n("Export complete calendar")); |
1261 | if ( mode == 2 ) | 1270 | if ( mode == 2 ) |
1262 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1271 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1263 | 1272 | ||
1264 | if ( !ex2phone.exec() ) { | 1273 | if ( !ex2phone.exec() ) { |
1265 | return; | 1274 | return; |
1266 | } | 1275 | } |
1267 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1276 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1268 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1277 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1269 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1278 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1270 | 1279 | ||
1271 | int inFuture = 0; | 1280 | int inFuture = 0; |
1272 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1281 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1273 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1282 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1274 | QPtrList<Incidence> delSel; | 1283 | QPtrList<Incidence> delSel; |
1275 | if ( mode == 1 ) | 1284 | if ( mode == 1 ) |
1276 | delSel = mCalendar->rawIncidences(); | 1285 | delSel = mCalendar->rawIncidences(); |
1277 | if ( mode == 2 ) | 1286 | if ( mode == 2 ) |
1278 | delSel = mCalendar->incidences(); | 1287 | delSel = mCalendar->incidences(); |
1279 | CalendarLocal* cal = new CalendarLocal(); | 1288 | CalendarLocal* cal = new CalendarLocal(); |
1280 | cal->setLocalTime(); | 1289 | cal->setLocalTime(); |
1281 | Incidence *incidence = delSel.first(); | 1290 | Incidence *incidence = delSel.first(); |
1282 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1291 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1283 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1292 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1284 | while ( incidence ) { | 1293 | while ( incidence ) { |
1285 | if ( incidence->type() != "Journal" ) { | 1294 | if ( incidence->type() != "Journal" ) { |
1286 | bool add = true; | 1295 | bool add = true; |
1287 | if ( inFuture ) { | 1296 | if ( inFuture ) { |
1288 | QDateTime dt; | 1297 | QDateTime dt; |
1289 | if ( incidence->type() == "Todo" ) { | 1298 | if ( incidence->type() == "Todo" ) { |
1290 | Todo * t = (Todo*)incidence; | 1299 | Todo * t = (Todo*)incidence; |
1291 | if ( t->hasDueDate() ) | 1300 | if ( t->hasDueDate() ) |
1292 | dt = t->dtDue(); | 1301 | dt = t->dtDue(); |
1293 | else | 1302 | else |