summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp10
-rw-r--r--korganizer/mainwindow.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ffc4d9a..8e5d108 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -321,1851 +321,1859 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
321 SLOT( slotModifiedChanged( bool ) ) ); 321 SLOT( slotModifiedChanged( bool ) ) );
322 322
323 323
324 connect( mView, SIGNAL( tempDisableBR(bool) ), 324 connect( mView, SIGNAL( tempDisableBR(bool) ),
325 SLOT( disableBR(bool) ) ); 325 SLOT( disableBR(bool) ) );
326 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 326 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
327 mView->setModified( false ); 327 mView->setModified( false );
328 mBlockAtStartup = false; 328 mBlockAtStartup = false;
329 mView->setModified( false ); 329 mView->setModified( false );
330 setCentralWidget( mView ); 330 setCentralWidget( mView );
331 globalFlagBlockStartup = 0; 331 globalFlagBlockStartup = 0;
332 mView->show(); 332 mView->show();
333 delete splash; 333 delete splash;
334 if ( newFile ) 334 if ( newFile )
335 mView->updateConfig(); 335 mView->updateConfig();
336 // qApp->processEvents(); 336 // qApp->processEvents();
337 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 337 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
338 //fillSyncMenu(); 338 //fillSyncMenu();
339 339
340 340
341 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 341 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
342 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 342 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
343 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 343 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
344 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 344 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
345 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 345 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
346 mSyncManager->setDefaultFileName( sentSyncFile()); 346 mSyncManager->setDefaultFileName( sentSyncFile());
347 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 347 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
348 mSyncManager->fillSyncMenu(); 348 mSyncManager->fillSyncMenu();
349 349
350 350
351 351
352 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 352 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
353 if ( showWarning ) { 353 if ( showWarning ) {
354 KMessageBox::information( this, 354 KMessageBox::information( this,
355 "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"); 355 "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");
356 qApp->processEvents(); 356 qApp->processEvents();
357 mView->dialogManager()->showSyncOptions(); 357 mView->dialogManager()->showSyncOptions();
358 } 358 }
359 359
360 //US listen for result adressed from Ka/Pi 360 //US listen for result adressed from Ka/Pi
361#ifndef DESKTOP_VERSION 361#ifndef DESKTOP_VERSION
362 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 362 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
363#endif 363#endif
364#ifndef DESKTOP_VERSION 364#ifndef DESKTOP_VERSION
365 infrared = 0; 365 infrared = 0;
366#endif 366#endif
367 updateFilterToolbar(); 367 updateFilterToolbar();
368 updateWeek( mView->startDate() ); 368 updateWeek( mView->startDate() );
369 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 369 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
370 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 370 SLOT( updateWeekNum( const KCal::DateList & ) ) );
371 mBRdisabled = false; 371 mBRdisabled = false;
372 //toggleBeamReceive(); 372 //toggleBeamReceive();
373} 373}
374MainWindow::~MainWindow() 374MainWindow::~MainWindow()
375{ 375{
376 //qDebug("MainWindow::~MainWindow() "); 376 //qDebug("MainWindow::~MainWindow() ");
377 //save toolbar location 377 //save toolbar location
378 delete mCalendar; 378 delete mCalendar;
379 delete mSyncManager; 379 delete mSyncManager;
380#ifndef DESKTOP_VERSION 380#ifndef DESKTOP_VERSION
381 if ( infrared ) 381 if ( infrared )
382 delete infrared; 382 delete infrared;
383#endif 383#endif
384 384
385 385
386} 386}
387 387
388void MainWindow::disableBR(bool b) 388void MainWindow::disableBR(bool b)
389{ 389{
390#ifndef DESKTOP_VERSION 390#ifndef DESKTOP_VERSION
391 if ( b ) { 391 if ( b ) {
392 if ( infrared ) { 392 if ( infrared ) {
393 toggleBeamReceive(); 393 toggleBeamReceive();
394 mBRdisabled = true; 394 mBRdisabled = true;
395 } 395 }
396 mBRdisabled = true; 396 mBRdisabled = true;
397 } else { 397 } else {
398 if ( mBRdisabled ) { 398 if ( mBRdisabled ) {
399 mBRdisabled = false; 399 mBRdisabled = false;
400 //makes no sense,because other cal ap is probably running 400 //makes no sense,because other cal ap is probably running
401 // toggleBeamReceive(); 401 // toggleBeamReceive();
402 } 402 }
403 } 403 }
404#endif 404#endif
405 405
406} 406}
407bool MainWindow::beamReceiveEnabled() 407bool MainWindow::beamReceiveEnabled()
408{ 408{
409#ifndef DESKTOP_VERSION 409#ifndef DESKTOP_VERSION
410 return ( infrared != 0 ); 410 return ( infrared != 0 );
411#endif 411#endif
412 return false; 412 return false;
413} 413}
414 414
415void MainWindow::toggleBeamReceive() 415void MainWindow::toggleBeamReceive()
416{ 416{
417 if ( mBRdisabled ) 417 if ( mBRdisabled )
418 return; 418 return;
419#ifndef DESKTOP_VERSION 419#ifndef DESKTOP_VERSION
420 if ( infrared ) { 420 if ( infrared ) {
421 qDebug("disable BeamReceive "); 421 qDebug("disable BeamReceive ");
422 delete infrared; 422 delete infrared;
423 infrared = 0; 423 infrared = 0;
424 brAction->setOn(false); 424 brAction->setOn(false);
425 return; 425 return;
426 } 426 }
427 qDebug("enable BeamReceive "); 427 qDebug("enable BeamReceive ");
428 brAction->setOn(true); 428 brAction->setOn(true);
429 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 429 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
430 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 430 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
431#endif 431#endif
432} 432}
433void MainWindow::showMaximized () 433void MainWindow::showMaximized ()
434{ 434{
435#ifndef DESKTOP_VERSION 435#ifndef DESKTOP_VERSION
436 if ( ! globalFlagBlockStartup ) 436 if ( ! globalFlagBlockStartup )
437 if ( mClosed ) 437 if ( mClosed )
438 mView->goToday(); 438 mView->goToday();
439#endif 439#endif
440 QWidget::showMaximized () ; 440 QWidget::showMaximized () ;
441 mClosed = false; 441 mClosed = false;
442} 442}
443void MainWindow::closeEvent( QCloseEvent* ce ) 443void MainWindow::closeEvent( QCloseEvent* ce )
444{ 444{
445 445
446 446
447 447
448 if ( ! KOPrefs::instance()->mAskForQuit ) { 448 if ( ! KOPrefs::instance()->mAskForQuit ) {
449 saveOnClose(); 449 saveOnClose();
450 mClosed = true; 450 mClosed = true;
451 ce->accept(); 451 ce->accept();
452 return; 452 return;
453 453
454 } 454 }
455 455
456 switch( QMessageBox::information( this, "KO/Pi", 456 switch( QMessageBox::information( this, "KO/Pi",
457 i18n("Do you really want\nto close KO/Pi?"), 457 i18n("Do you really want\nto close KO/Pi?"),
458 i18n("Close"), i18n("No"), 458 i18n("Close"), i18n("No"),
459 0, 0 ) ) { 459 0, 0 ) ) {
460 case 0: 460 case 0:
461 saveOnClose(); 461 saveOnClose();
462 mClosed = true; 462 mClosed = true;
463 ce->accept(); 463 ce->accept();
464 break; 464 break;
465 case 1: 465 case 1:
466 ce->ignore(); 466 ce->ignore();
467 break; 467 break;
468 case 2: 468 case 2:
469 469
470 default: 470 default:
471 break; 471 break;
472 } 472 }
473 473
474 474
475} 475}
476 476
477void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 477void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
478{ 478{
479 QDataStream stream( data, IO_ReadOnly ); 479 QDataStream stream( data, IO_ReadOnly );
480 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 480 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
481 //QString datamess; 481 //QString datamess;
482 //qDebug("message "); 482 //qDebug("message ");
483 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 483 qDebug("KO: QCOP message received: %s ", cmsg.data() );
484 484
485 if ( cmsg == "setDocument(QString)" ) { 485 if ( cmsg == "setDocument(QString)" ) {
486 QDataStream stream( data, IO_ReadOnly ); 486 QDataStream stream( data, IO_ReadOnly );
487 QString fileName; 487 QString fileName;
488 stream >> fileName; 488 stream >> fileName;
489 //qDebug("filename %s ", fileName.latin1()); 489 //qDebug("filename %s ", fileName.latin1());
490 showMaximized(); 490 showMaximized();
491 raise(); 491 raise();
492 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 492 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
493 mSyncManager->slotSyncMenu( 1002 ); 493 mSyncManager->slotSyncMenu( 1002 );
494 return; 494 return;
495 } 495 }
496 496
497 if ( cmsg == "-writeFile" ) { 497 if ( cmsg == "-writeFile" ) {
498 // I made from the "-writeFile" an "-writeAlarm" 498 // I made from the "-writeFile" an "-writeAlarm"
499 mView->viewManager()->showWhatsNextView(); 499 mView->viewManager()->showWhatsNextView();
500 mCalendar->checkAlarmForIncidence( 0, true); 500 mCalendar->checkAlarmForIncidence( 0, true);
501 showMaximized(); 501 showMaximized();
502 raise(); 502 raise();
503 return; 503 return;
504 504
505 } 505 }
506 if ( cmsg == "-writeFileSilent" ) { 506 if ( cmsg == "-writeFileSilent" ) {
507 // I made from the "-writeFile" an "-writeAlarm" 507 // I made from the "-writeFile" an "-writeAlarm"
508 // mView->viewManager()->showWhatsNextView(); 508 // mView->viewManager()->showWhatsNextView();
509 mCalendar->checkAlarmForIncidence( 0, true); 509 mCalendar->checkAlarmForIncidence( 0, true);
510 //showMaximized(); 510 //showMaximized();
511 //raise(); 511 //raise();
512 hide(); 512 hide();
513 return; 513 return;
514 } 514 }
515 if ( cmsg == "-newCountdown" ) { 515 if ( cmsg == "-newCountdown" ) {
516 qDebug("newCountdown "); 516 qDebug("newCountdown ");
517 517
518 } 518 }
519 QString msg ; 519 QString msg ;
520 QString allmsg = cmsg; 520 QString allmsg = cmsg;
521 while ( allmsg.length() > 0 ) { 521 while ( allmsg.length() > 0 ) {
522 int nextC = allmsg.find( "-", 1 ); 522 int nextC = allmsg.find( "-", 1 );
523 if ( nextC == -1 ) { 523 if ( nextC == -1 ) {
524 msg = allmsg; 524 msg = allmsg;
525 allmsg = ""; 525 allmsg = "";
526 } else{ 526 } else{
527 msg = allmsg.left( nextC ); 527 msg = allmsg.left( nextC );
528 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 528 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
529 } 529 }
530 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 530 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
531 if ( msg == "-newEvent" ) { 531 if ( msg == "-newEvent" ) {
532 mView->newEvent(); 532 mView->newEvent();
533 } 533 }
534 if ( msg == "-newTodo" ) { 534 if ( msg == "-newTodo" ) {
535 mView->newTodo(); 535 mView->newTodo();
536 536
537 } 537 }
538 if ( msg == "-showWN" ) { 538 if ( msg == "-showWN" ) {
539 mView->viewManager()->showWhatsNextView(); 539 mView->viewManager()->showWhatsNextView();
540 } 540 }
541 if ( msg == "-showTodo" ) { 541 if ( msg == "-showTodo" ) {
542 mView->viewManager()->showTodoView(); 542 mView->viewManager()->showTodoView();
543 } 543 }
544 if ( msg == "-showList" ) { 544 if ( msg == "-showList" ) {
545 mView->viewManager()->showListView(); 545 mView->viewManager()->showListView();
546 } 546 }
547 else if ( msg == "-showDay" ) { 547 else if ( msg == "-showDay" ) {
548 mView->viewManager()->showDayView(); 548 mView->viewManager()->showDayView();
549 } 549 }
550 else if ( msg == "-showWWeek" ) { 550 else if ( msg == "-showWWeek" ) {
551 mView->viewManager()->showWorkWeekView(); 551 mView->viewManager()->showWorkWeekView();
552 } 552 }
553 else if ( msg == "-ringSync" ) { 553 else if ( msg == "-ringSync" ) {
554 mSyncManager->multiSync( false ); 554 mSyncManager->multiSync( false );
555 } 555 }
556 else if ( msg == "-showWeek" ) { 556 else if ( msg == "-showWeek" ) {
557 mView->viewManager()->showWeekView(); 557 mView->viewManager()->showWeekView();
558 } 558 }
559 else if ( msg == "-showTodo" ) { 559 else if ( msg == "-showTodo" ) {
560 mView->viewManager()->showTodoView(); 560 mView->viewManager()->showTodoView();
561 } 561 }
562 else if ( msg == "-showJournal" ) { 562 else if ( msg == "-showJournal" ) {
563 mView->dateNavigator()->selectDates( 1 ); 563 mView->dateNavigator()->selectDates( 1 );
564 mView->dateNavigator()->selectToday(); 564 mView->dateNavigator()->selectToday();
565 mView->viewManager()->showJournalView(); 565 mView->viewManager()->showJournalView();
566 } 566 }
567 else if ( msg == "-showKO" ) { 567 else if ( msg == "-showKO" ) {
568 mView->viewManager()->showNextXView(); 568 mView->viewManager()->showNextXView();
569 } 569 }
570 else if ( msg == "-showWNext" ) { 570 else if ( msg == "-showWNext" ) {
571 mView->viewManager()->showWhatsNextView(); 571 mView->viewManager()->showWhatsNextView();
572 } 572 }
573 else if ( msg == "nextView()" ) { 573 else if ( msg == "nextView()" ) {
574 mView->viewManager()->showNextView(); 574 mView->viewManager()->showNextView();
575 } 575 }
576 else if ( msg == "-showNextXView" ) { 576 else if ( msg == "-showNextXView" ) {
577 mView->viewManager()->showNextXView(); 577 mView->viewManager()->showNextXView();
578 } 578 }
579 579
580 580
581 } 581 }
582 582
583 showMaximized(); 583 showMaximized();
584 raise(); 584 raise();
585} 585}
586 586
587QPixmap MainWindow::loadPixmap( QString name ) 587QPixmap MainWindow::loadPixmap( QString name )
588{ 588{
589 return SmallIcon( name ); 589 return SmallIcon( name );
590 590
591} 591}
592void MainWindow::initActions() 592void MainWindow::initActions()
593{ 593{
594 //KOPrefs::instance()->mShowFullMenu 594 //KOPrefs::instance()->mShowFullMenu
595 iconToolBar->clear(); 595 iconToolBar->clear();
596 KOPrefs *p = KOPrefs::instance(); 596 KOPrefs *p = KOPrefs::instance();
597 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 597 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
598 598
599 QPopupMenu *viewMenu = new QPopupMenu( this ); 599 QPopupMenu *viewMenu = new QPopupMenu( this );
600 QPopupMenu *actionMenu = new QPopupMenu( this ); 600 QPopupMenu *actionMenu = new QPopupMenu( this );
601 QPopupMenu *importMenu = new QPopupMenu( this ); 601 QPopupMenu *importMenu = new QPopupMenu( this );
602 QPopupMenu *importMenu_X = new QPopupMenu( this ); 602 QPopupMenu *importMenu_X = new QPopupMenu( this );
603 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 603 QPopupMenu *exportMenu_X = new QPopupMenu( this );
604 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 604 QPopupMenu *beamMenu_X = new QPopupMenu( this );
605 selectFilterMenu = new QPopupMenu( this ); 605 selectFilterMenu = new QPopupMenu( this );
606 selectFilterMenu->setCheckable( true ); 606 selectFilterMenu->setCheckable( true );
607 syncMenu = new QPopupMenu( this ); 607 syncMenu = new QPopupMenu( this );
608 configureAgendaMenu = new QPopupMenu( this ); 608 configureAgendaMenu = new QPopupMenu( this );
609 configureToolBarMenu = new QPopupMenu( this ); 609 configureToolBarMenu = new QPopupMenu( this );
610 QPopupMenu *helpMenu = new QPopupMenu( this ); 610 QPopupMenu *helpMenu = new QPopupMenu( this );
611 QIconSet icon; 611 QIconSet icon;
612 int pixWid = 22, pixHei = 22; 612 int pixWid = 22, pixHei = 22;
613 QString pathString = ""; 613 QString pathString = "";
614 if ( !p->mToolBarMiniIcons ) { 614 if ( !p->mToolBarMiniIcons ) {
615 if ( QApplication::desktop()->width() < 480 ) { 615 if ( QApplication::desktop()->width() < 480 ) {
616 pathString += "icons16/"; 616 pathString += "icons16/";
617 pixWid = 18; pixHei = 16; 617 pixWid = 18; pixHei = 16;
618 } 618 }
619 } else { 619 } else {
620 pathString += "iconsmini/"; 620 pathString += "iconsmini/";
621 pixWid = 18; pixHei = 16; 621 pixWid = 18; pixHei = 16;
622 } 622 }
623 if ( KOPrefs::instance()->mShowFullMenu ) { 623 if ( KOPrefs::instance()->mShowFullMenu ) {
624 QMenuBar *menuBar1; 624 QMenuBar *menuBar1;
625 menuBar1 = menuBar(); 625 menuBar1 = menuBar();
626 menuBar1->insertItem( i18n("File"), importMenu ); 626 menuBar1->insertItem( i18n("File"), importMenu );
627 menuBar1->insertItem( i18n("View"), viewMenu ); 627 menuBar1->insertItem( i18n("View"), viewMenu );
628 menuBar1->insertItem( i18n("Actions"), actionMenu ); 628 menuBar1->insertItem( i18n("Actions"), actionMenu );
629#ifdef DESKTOP_VERSION 629#ifdef DESKTOP_VERSION
630 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 630 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
631 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 631 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
632#else 632#else
633 menuBar1->insertItem( i18n("Sync"), syncMenu ); 633 menuBar1->insertItem( i18n("Sync"), syncMenu );
634 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 634 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
635#endif 635#endif
636 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 636 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
637 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 637 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
638 menuBar1->insertItem( i18n("Help"), helpMenu ); 638 menuBar1->insertItem( i18n("Help"), helpMenu );
639 } else { 639 } else {
640 QPEMenuBar *menuBar1; 640 QPEMenuBar *menuBar1;
641 menuBar1 = new QPEMenuBar( iconToolBar ); 641 menuBar1 = new QPEMenuBar( iconToolBar );
642 QPopupMenu *menuBar = new QPopupMenu( this ); 642 QPopupMenu *menuBar = new QPopupMenu( this );
643 icon = loadPixmap( pathString + "z_menu" ); 643 icon = loadPixmap( pathString + "z_menu" );
644 menuBar1->insertItem( icon.pixmap(), menuBar); 644 menuBar1->insertItem( icon.pixmap(), menuBar);
645 //menuBar1->insertItem( i18n("ME"), menuBar); 645 //menuBar1->insertItem( i18n("ME"), menuBar);
646 menuBar->insertItem( i18n("File"), importMenu ); 646 menuBar->insertItem( i18n("File"), importMenu );
647 menuBar->insertItem( i18n("View"), viewMenu ); 647 menuBar->insertItem( i18n("View"), viewMenu );
648 menuBar->insertItem( i18n("Actions"), actionMenu ); 648 menuBar->insertItem( i18n("Actions"), actionMenu );
649 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 649 menuBar->insertItem( i18n("Synchronize"), syncMenu );
650 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 650 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
651 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 651 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
652 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 652 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
653 menuBar->insertItem( i18n("Help"), helpMenu ); 653 menuBar->insertItem( i18n("Help"), helpMenu );
654 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 654 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
655 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 655 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
656 } 656 }
657 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 657 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
658 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 658 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
659 659
660 660
661 mWeekBgColor = iconToolBar->backgroundColor(); 661 mWeekBgColor = iconToolBar->backgroundColor();
662 mWeekPixmap.resize( pixWid , pixHei ); 662 mWeekPixmap.resize( pixWid , pixHei );
663 mWeekPixmap.fill( mWeekBgColor ); 663 mWeekPixmap.fill( mWeekBgColor );
664 icon = mWeekPixmap; 664 icon = mWeekPixmap;
665 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 665 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
666 if ( p-> mShowIconWeekNum ) 666 if ( p-> mShowIconWeekNum )
667 mWeekAction->addTo( iconToolBar ); 667 mWeekAction->addTo( iconToolBar );
668 mWeekFont = font(); 668 mWeekFont = font();
669 669
670 int fontPoint = mWeekFont.pointSize(); 670 int fontPoint = mWeekFont.pointSize();
671 QFontMetrics f( mWeekFont ); 671 QFontMetrics f( mWeekFont );
672 int fontWid = f.width( "30" ); 672 int fontWid = f.width( "30" );
673 while ( fontWid > pixWid ) { 673 while ( fontWid > pixWid ) {
674 --fontPoint; 674 --fontPoint;
675 mWeekFont.setPointSize( fontPoint ); 675 mWeekFont.setPointSize( fontPoint );
676 QFontMetrics f( mWeekFont ); 676 QFontMetrics f( mWeekFont );
677 fontWid = f.width( "30" ); 677 fontWid = f.width( "30" );
678 //qDebug("dec-- "); 678 //qDebug("dec-- ");
679 } 679 }
680 680
681 connect( mWeekAction, SIGNAL( activated() ), 681 connect( mWeekAction, SIGNAL( activated() ),
682 this, SLOT( weekAction() ) ); 682 this, SLOT( weekAction() ) );
683 683
684 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 684 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
685 if ( p->mShowIconFilterview ) { 685 if ( p->mShowIconFilterview ) {
686 icon = loadPixmap( pathString + "filter" ); 686 icon = loadPixmap( pathString + "filter" );
687 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 687 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
688 connect( actionFilterMenuTB, SIGNAL( activated() ), 688 connect( actionFilterMenuTB, SIGNAL( activated() ),
689 this, SLOT( fillFilterMenuTB() ) ); 689 this, SLOT( fillFilterMenuTB() ) );
690 actionFilterMenuTB->addTo( iconToolBar ); 690 actionFilterMenuTB->addTo( iconToolBar );
691 selectFilterMenuTB = new QPopupMenu( this ); 691 selectFilterMenuTB = new QPopupMenu( this );
692 selectFilterMenuTB->setCheckable( true ); 692 selectFilterMenuTB->setCheckable( true );
693 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 693 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
694 } 694 }
695 695
696 //#endif 696 //#endif
697 // ****************** 697 // ******************
698 QAction *action; 698 QAction *action;
699 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 699 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
700 configureToolBarMenu->setCheckable( true ); 700 configureToolBarMenu->setCheckable( true );
701 701
702 702
703 configureAgendaMenu->setCheckable( true ); 703 configureAgendaMenu->setCheckable( true );
704 int iii ; 704 int iii ;
705 for ( iii = 1;iii<= 10 ;++iii ){ 705 for ( iii = 1;iii<= 10 ;++iii ){
706 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 706 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
707 } 707 }
708 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 708 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
709 709
710 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 710 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
711 this, SLOT( showConfigureAgenda( ) ) ); 711 this, SLOT( showConfigureAgenda( ) ) );
712 712
713 icon = loadPixmap( pathString + "configure" ); 713 icon = loadPixmap( pathString + "configure" );
714 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 714 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
715 action->addTo( actionMenu ); 715 action->addTo( actionMenu );
716 connect( action, SIGNAL( activated() ), 716 connect( action, SIGNAL( activated() ),
717 mView, SLOT( edit_options() ) ); 717 mView, SLOT( edit_options() ) );
718 actionMenu->insertSeparator(); 718 actionMenu->insertSeparator();
719 719
720 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 720 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
721 action->addTo( actionMenu ); 721 action->addTo( actionMenu );
722 connect( action, SIGNAL( activated() ), 722 connect( action, SIGNAL( activated() ),
723 mView, SLOT( undo_delete() ) ); 723 mView, SLOT( undo_delete() ) );
724 actionMenu->insertSeparator(); 724 actionMenu->insertSeparator();
725 725
726 icon = loadPixmap( pathString + "newevent" ); 726 icon = loadPixmap( pathString + "newevent" );
727 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 727 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
728 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 728 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
729 configureToolBarMenu->insertSeparator(); 729 configureToolBarMenu->insertSeparator();
730 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 730 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
731 configureToolBarMenu->insertSeparator(); 731 configureToolBarMenu->insertSeparator();
732 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 732 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
733 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 733 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
734 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 734 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
735 ne_action->addTo( actionMenu ); 735 ne_action->addTo( actionMenu );
736 connect( ne_action, SIGNAL( activated() ), 736 connect( ne_action, SIGNAL( activated() ),
737 mView, SLOT( newEvent() ) ); 737 mView, SLOT( newEvent() ) );
738 icon = loadPixmap( pathString + "newtodo" ); 738 icon = loadPixmap( pathString + "newtodo" );
739 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 739 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
740 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 740 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
741 nt_action->addTo( actionMenu ); 741 nt_action->addTo( actionMenu );
742 connect( nt_action, SIGNAL( activated() ), 742 connect( nt_action, SIGNAL( activated() ),
743 mView, SLOT( newTodo() ) ); 743 mView, SLOT( newTodo() ) );
744 744
745 icon = loadPixmap( pathString + "today" ); 745 icon = loadPixmap( pathString + "today" );
746 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 746 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
747 today_action->addTo( viewMenu ); 747 today_action->addTo( viewMenu );
748 connect( today_action, SIGNAL( activated() ), 748 connect( today_action, SIGNAL( activated() ),
749 mView, SLOT( goToday() ) ); 749 mView, SLOT( goToday() ) );
750 viewMenu->insertSeparator(); 750 viewMenu->insertSeparator();
751 751
752 // *********************** 752 // ***********************
753 if ( KOPrefs::instance()->mVerticalScreen ) { 753 if ( KOPrefs::instance()->mVerticalScreen ) {
754 icon = SmallIcon( "1updownarrow" ); 754 icon = SmallIcon( "1updownarrow" );
755 } else { 755 } else {
756 icon = SmallIcon("1leftrightarrow" ); 756 icon = SmallIcon("1leftrightarrow" );
757 } 757 }
758 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 758 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
759 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 759 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
760 FSaction->addTo( viewMenu ); 760 FSaction->addTo( viewMenu );
761 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 761 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
762 762
763 icon = loadPixmap( pathString + "navi" ); 763 icon = loadPixmap( pathString + "navi" );
764 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 764 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
765 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 765 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
766 action->addTo( viewMenu ); 766 action->addTo( viewMenu );
767 connect( action, SIGNAL( activated() ), 767 connect( action, SIGNAL( activated() ),
768 mView, SLOT( toggleDateNavigatorWidget() ) ); 768 mView, SLOT( toggleDateNavigatorWidget() ) );
769 mToggleNav = action ; 769 mToggleNav = action ;
770 icon = loadPixmap( pathString + "filter" ); 770 icon = loadPixmap( pathString + "filter" );
771 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 771 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
772 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 772 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
773 action->addTo( viewMenu ); 773 action->addTo( viewMenu );
774 connect( action, SIGNAL( activated() ), 774 connect( action, SIGNAL( activated() ),
775 mView, SLOT( toggleFilter() ) ); 775 mView, SLOT( toggleFilter() ) );
776 mToggleFilter = action; 776 mToggleFilter = action;
777 icon = loadPixmap( pathString + "allday" ); 777 icon = loadPixmap( pathString + "allday" );
778 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 778 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
779 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 779 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
780 action->addTo( viewMenu ); 780 action->addTo( viewMenu );
781 connect( action, SIGNAL( activated() ), 781 connect( action, SIGNAL( activated() ),
782 mView, SLOT( toggleAllDaySize() ) ); 782 mView, SLOT( toggleAllDaySize() ) );
783 mToggleAllday = action; 783 mToggleAllday = action;
784 784
785 785
786 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 786 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
787 mToggleNav, SLOT( setEnabled ( bool ) ) ); 787 mToggleNav, SLOT( setEnabled ( bool ) ) );
788 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 788 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
789 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 789 mToggleFilter, SLOT( setEnabled ( bool ) ) );
790 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 790 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
791 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 791 mToggleAllday, SLOT( setEnabled ( bool ) ) );
792 792
793 viewMenu->insertSeparator(); 793 viewMenu->insertSeparator();
794 icon = loadPixmap( pathString + "picker" ); 794 icon = loadPixmap( pathString + "picker" );
795 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 795 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
796 action->addTo( viewMenu ); 796 action->addTo( viewMenu );
797 connect( action, SIGNAL( activated() ), 797 connect( action, SIGNAL( activated() ),
798 mView, SLOT( showDatePicker() ) ); 798 mView, SLOT( showDatePicker() ) );
799 action->addTo( iconToolBar ); 799 action->addTo( iconToolBar );
800 viewMenu->insertSeparator(); 800 viewMenu->insertSeparator();
801 801
802 if ( p-> mShowIconToggleFull ) 802 if ( p-> mShowIconToggleFull )
803 FSaction->addTo( iconToolBar ); 803 FSaction->addTo( iconToolBar );
804 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 804 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
805 805
806 //******************** 806 //********************
807 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 807 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
808 808
809 809
810 icon = loadPixmap( pathString + "whatsnext" ); 810 icon = loadPixmap( pathString + "whatsnext" );
811 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 811 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
812 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 812 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
813 whatsnext_action->addTo( viewMenu ); 813 whatsnext_action->addTo( viewMenu );
814 connect( whatsnext_action, SIGNAL( activated() ), 814 connect( whatsnext_action, SIGNAL( activated() ),
815 mView->viewManager(), SLOT( showWhatsNextView() ) ); 815 mView->viewManager(), SLOT( showWhatsNextView() ) );
816 816
817 icon = loadPixmap( pathString + "xdays" ); 817 icon = loadPixmap( pathString + "xdays" );
818 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 818 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
819 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 819 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
820 xdays_action->addTo( viewMenu ); 820 xdays_action->addTo( viewMenu );
821 connect( xdays_action, SIGNAL( activated() ), 821 connect( xdays_action, SIGNAL( activated() ),
822 mView->viewManager(), SLOT( showNextXView() ) ); 822 mView->viewManager(), SLOT( showNextXView() ) );
823 823
824 824
825 icon = loadPixmap( pathString + "journal" ); 825 icon = loadPixmap( pathString + "journal" );
826 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 826 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
827 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 827 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
828 viewjournal_action->addTo( viewMenu ); 828 viewjournal_action->addTo( viewMenu );
829 connect( viewjournal_action, SIGNAL( activated() ), 829 connect( viewjournal_action, SIGNAL( activated() ),
830 mView->viewManager(), SLOT( showJournalView() ) ); 830 mView->viewManager(), SLOT( showJournalView() ) );
831 831
832 832
833 icon = loadPixmap( pathString + "day" ); 833 icon = loadPixmap( pathString + "day" );
834 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 834 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
835 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 835 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
836 day1_action->addTo( viewMenu ); 836 day1_action->addTo( viewMenu );
837 // action->addTo( toolBar ); 837 // action->addTo( toolBar );
838 connect( day1_action, SIGNAL( activated() ), 838 connect( day1_action, SIGNAL( activated() ),
839 mView->viewManager(), SLOT( showDayView() ) ); 839 mView->viewManager(), SLOT( showDayView() ) );
840 840
841 icon = loadPixmap( pathString + "workweek" ); 841 icon = loadPixmap( pathString + "workweek" );
842 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 842 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
843 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 843 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
844 day5_action->addTo( viewMenu ); 844 day5_action->addTo( viewMenu );
845 connect( day5_action, SIGNAL( activated() ), 845 connect( day5_action, SIGNAL( activated() ),
846 mView->viewManager(), SLOT( showWorkWeekView() ) ); 846 mView->viewManager(), SLOT( showWorkWeekView() ) );
847 847
848 icon = loadPixmap( pathString + "week" ); 848 icon = loadPixmap( pathString + "week" );
849 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 849 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
850 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 850 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
851 day7_action->addTo( viewMenu ); 851 day7_action->addTo( viewMenu );
852 connect( day7_action, SIGNAL( activated() ), 852 connect( day7_action, SIGNAL( activated() ),
853 mView->viewManager(), SLOT( showWeekView() ) ); 853 mView->viewManager(), SLOT( showWeekView() ) );
854 854
855 icon = loadPixmap( pathString + "workweek2" ); 855 icon = loadPixmap( pathString + "workweek2" );
856 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 856 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
857 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 857 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
858 day6_action->addTo( viewMenu ); 858 day6_action->addTo( viewMenu );
859 connect( day6_action, SIGNAL( activated() ), 859 connect( day6_action, SIGNAL( activated() ),
860 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 860 mView->viewManager(), SLOT( showMonthViewWeek() ) );
861 861
862 icon = loadPixmap( pathString + "month" ); 862 icon = loadPixmap( pathString + "month" );
863 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 863 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
864 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 864 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
865 month_action->addTo( viewMenu ); 865 month_action->addTo( viewMenu );
866 connect( month_action, SIGNAL( activated() ), 866 connect( month_action, SIGNAL( activated() ),
867 mView->viewManager(), SLOT( showMonthView() ) ); 867 mView->viewManager(), SLOT( showMonthView() ) );
868 868
869 icon = loadPixmap( pathString + "list" ); 869 icon = loadPixmap( pathString + "list" );
870 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 870 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
871 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 871 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
872 showlist_action->addTo( viewMenu ); 872 showlist_action->addTo( viewMenu );
873 connect( showlist_action, SIGNAL( activated() ), 873 connect( showlist_action, SIGNAL( activated() ),
874 mView->viewManager(), SLOT( showListView() ) ); 874 mView->viewManager(), SLOT( showListView() ) );
875 875
876 icon = loadPixmap( pathString + "todo" ); 876 icon = loadPixmap( pathString + "todo" );
877 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 877 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
878 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 878 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
879 todoview_action->addTo( viewMenu ); 879 todoview_action->addTo( viewMenu );
880 connect( todoview_action, SIGNAL( activated() ), 880 connect( todoview_action, SIGNAL( activated() ),
881 mView->viewManager(), SLOT( showTodoView() ) ); 881 mView->viewManager(), SLOT( showTodoView() ) );
882 882
883 883
884 884
885#if 0 885#if 0
886 action = new QAction( "view_timespan", "Time Span", 0, this ); 886 action = new QAction( "view_timespan", "Time Span", 0, this );
887 action->addTo( viewMenu ); 887 action->addTo( viewMenu );
888 connect( action, SIGNAL( activated() ), 888 connect( action, SIGNAL( activated() ),
889 mView->viewManager(), SLOT( showTimeSpanView() ) ); 889 mView->viewManager(), SLOT( showTimeSpanView() ) );
890#endif 890#endif
891 891
892 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 892 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
893 this ); 893 this );
894 mNewSubTodoAction->addTo( actionMenu ); 894 mNewSubTodoAction->addTo( actionMenu );
895 connect( mNewSubTodoAction, SIGNAL( activated() ), 895 connect( mNewSubTodoAction, SIGNAL( activated() ),
896 mView, SLOT( newSubTodo() ) ); 896 mView, SLOT( newSubTodo() ) );
897 897
898 actionMenu->insertSeparator(); 898 actionMenu->insertSeparator();
899 899
900 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 900 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
901 mShowAction->addTo( actionMenu ); 901 mShowAction->addTo( actionMenu );
902 connect( mShowAction, SIGNAL( activated() ), 902 connect( mShowAction, SIGNAL( activated() ),
903 mView, SLOT( showIncidence() ) ); 903 mView, SLOT( showIncidence() ) );
904 904
905 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 905 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
906 mEditAction->addTo( actionMenu ); 906 mEditAction->addTo( actionMenu );
907 connect( mEditAction, SIGNAL( activated() ), 907 connect( mEditAction, SIGNAL( activated() ),
908 mView, SLOT( editIncidence() ) ); 908 mView, SLOT( editIncidence() ) );
909 909
910 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 910 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
911 mDeleteAction->addTo( actionMenu ); 911 mDeleteAction->addTo( actionMenu );
912 connect( mDeleteAction, SIGNAL( activated() ), 912 connect( mDeleteAction, SIGNAL( activated() ),
913 mView, SLOT( deleteIncidence() ) ); 913 mView, SLOT( deleteIncidence() ) );
914 914
915 915
916 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 916 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
917 mCloneAction->addTo( actionMenu ); 917 mCloneAction->addTo( actionMenu );
918 connect( mCloneAction, SIGNAL( activated() ), 918 connect( mCloneAction, SIGNAL( activated() ),
919 mView, SLOT( cloneIncidence() ) ); 919 mView, SLOT( cloneIncidence() ) );
920 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 920 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
921 mMoveAction->addTo( actionMenu ); 921 mMoveAction->addTo( actionMenu );
922 connect( mMoveAction, SIGNAL( activated() ), 922 connect( mMoveAction, SIGNAL( activated() ),
923 mView, SLOT( moveIncidence() ) ); 923 mView, SLOT( moveIncidence() ) );
924 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 924 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
925 mBeamAction->addTo( actionMenu ); 925 mBeamAction->addTo( actionMenu );
926 connect( mBeamAction, SIGNAL( activated() ), 926 connect( mBeamAction, SIGNAL( activated() ),
927 mView, SLOT( beamIncidence() ) ); 927 mView, SLOT( beamIncidence() ) );
928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
929 mCancelAction->addTo( actionMenu ); 929 mCancelAction->addTo( actionMenu );
930 connect( mCancelAction, SIGNAL( activated() ), 930 connect( mCancelAction, SIGNAL( activated() ),
931 mView, SLOT( toggleCancelIncidence() ) ); 931 mView, SLOT( toggleCancelIncidence() ) );
932 932
933 actionMenu->insertSeparator(); 933 actionMenu->insertSeparator();
934 934
935 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 935 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
936 this ); 936 this );
937 action->addTo( actionMenu ); 937 action->addTo( actionMenu );
938 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 938 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
939 939
940 icon = loadPixmap( pathString + "search" ); 940 icon = loadPixmap( pathString + "search" );
941 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 941 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
942 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 942 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
943 search_action->addTo( actionMenu ); 943 search_action->addTo( actionMenu );
944 connect( search_action, SIGNAL( activated() ), 944 connect( search_action, SIGNAL( activated() ),
945 mView->dialogManager(), SLOT( showSearchDialog() ) ); 945 mView->dialogManager(), SLOT( showSearchDialog() ) );
946 946
947 947
948 948
949 if ( KOPrefs::instance()->mShowFullMenu ) { 949 if ( KOPrefs::instance()->mShowFullMenu ) {
950 actionMenu->insertSeparator(); 950 actionMenu->insertSeparator();
951 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 951 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
952 952
953 } 953 }
954 // actionMenu->insertSeparator(); 954 // actionMenu->insertSeparator();
955 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 955 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
956 this ); 956 this );
957 action->addTo( importMenu_X ); 957 action->addTo( importMenu_X );
958 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 958 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
959 action = new QAction( "import_quick", i18n("Import last file"), 0, 959 action = new QAction( "import_quick", i18n("Import last file"), 0,
960 this ); 960 this );
961 action->addTo( importMenu_X ); 961 action->addTo( importMenu_X );
962 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 962 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
963 importMenu_X->insertSeparator(); 963 importMenu_X->insertSeparator();
964 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 964 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
965 this ); 965 this );
966 action->addTo( importMenu_X ); 966 action->addTo( importMenu_X );
967 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 967 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
968 //#ifndef DESKTOP_VERSION 968 //#ifndef DESKTOP_VERSION
969 importMenu_X->insertSeparator(); 969 importMenu_X->insertSeparator();
970 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 970 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
971 this ); 971 this );
972 action->addTo( importMenu_X ); 972 action->addTo( importMenu_X );
973 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 973 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
974 //#else 974 //#else
975#ifdef _OL_IMPORT_ 975#ifdef _OL_IMPORT_
976 importMenu_X->insertSeparator(); 976 importMenu_X->insertSeparator();
977 action = new QAction( "import_ol", i18n("Import from OL"), 0, 977 action = new QAction( "import_ol", i18n("Import from OL"), 0,
978 this ); 978 this );
979 action->addTo( importMenu_X ); 979 action->addTo( importMenu_X );
980 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 980 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
981#endif 981#endif
982 //#endif 982 //#endif
983 983
984 //importMenu->insertSeparator(); 984 //importMenu->insertSeparator();
985 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 985 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
986 this ); 986 this );
987 action->addTo( importMenu ); 987 action->addTo( importMenu );
988 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 988 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
989 989
990 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 990 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
991 this ); 991 this );
992 action->addTo( importMenu ); 992 action->addTo( importMenu );
993 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 993 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
994 importMenu->insertSeparator(); 994 importMenu->insertSeparator();
995 importMenu->insertItem( i18n("Import"), importMenu_X ); 995 importMenu->insertItem( i18n("Import"), importMenu_X );
996 //importMenu->insertSeparator(); 996 //importMenu->insertSeparator();
997 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 997 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
998 this ); 998 this );
999 action->addTo( exportMenu_X ); 999 action->addTo( exportMenu_X );
1000 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1000 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1001 1001
1002 1002
1003 //LR 1003 //LR
1004 QPopupMenu *ex2phone = new QPopupMenu( this ); 1004 QPopupMenu *ex2phone = new QPopupMenu( this );
1005 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1005 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1006 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1006 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1007 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1007 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1008 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1008 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1009 1009
1010 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1010 importMenu->insertItem( i18n("Export"), exportMenu_X );
1011#ifndef DESKTOP_VERSION 1011#ifndef DESKTOP_VERSION
1012 //importMenu->insertSeparator(); 1012 //importMenu->insertSeparator();
1013 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1013 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1014 this ); 1014 this );
1015 brAction->addTo( beamMenu_X ); 1015 brAction->addTo( beamMenu_X );
1016 brAction->setToggleAction (true ) ; 1016 brAction->setToggleAction (true ) ;
1017 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1017 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1018 1018
1019 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1019 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1020 this ); 1020 this );
1021 action->addTo( beamMenu_X ); 1021 action->addTo( beamMenu_X );
1022 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1022 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1023 1023
1024 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1024 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1025 this ); 1025 this );
1026 action->addTo( beamMenu_X ); 1026 action->addTo( beamMenu_X );
1027 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1027 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1028 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1028 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1029#else 1029#else
1030 //importMenu->insertSeparator(); 1030 //importMenu->insertSeparator();
1031 icon = loadPixmap( pathString + "print" ); 1031 icon = loadPixmap( pathString + "print" );
1032 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1032 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1033 action->addTo( beamMenu_X ); 1033 action->addTo( beamMenu_X );
1034 connect( action, SIGNAL( activated() ), 1034 connect( action, SIGNAL( activated() ),
1035 this, SLOT( printCal() ) ); 1035 this, SLOT( printCal() ) );
1036 1036
1037 icon = loadPixmap( pathString + "print" ); 1037 icon = loadPixmap( pathString + "print" );
1038 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1038 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1039 action->addTo( beamMenu_X ); 1039 action->addTo( beamMenu_X );
1040 connect( action, SIGNAL( activated() ), 1040 connect( action, SIGNAL( activated() ),
1041 this, SLOT( printSel() ) ); 1041 this, SLOT( printSel() ) );
1042 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1042 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1043 action->addTo( beamMenu_X ); 1043 action->addTo( beamMenu_X );
1044 connect( action, SIGNAL( activated() ), 1044 connect( action, SIGNAL( activated() ),
1045 mView->viewManager(), SLOT( slotprintWNV() ) ); 1045 mView->viewManager(), SLOT( slotprintWNV() ) );
1046 1046
1047 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1047 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1048 action->addTo( beamMenu_X ); 1048 action->addTo( beamMenu_X );
1049 connect( action, SIGNAL( activated() ), 1049 connect( action, SIGNAL( activated() ),
1050 mView, SLOT( slotprintSelInc() ) ); 1050 mView, SLOT( slotprintSelInc() ) );
1051 1051
1052 1052
1053 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1053 importMenu->insertItem( i18n("Print"), beamMenu_X );
1054#endif 1054#endif
1055 importMenu->insertSeparator(); 1055 importMenu->insertSeparator();
1056 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1056 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1057 this ); 1057 this );
1058 action->addTo( importMenu ); 1058 action->addTo( importMenu );
1059 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1059 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1060 importMenu->insertSeparator(); 1060 importMenu->insertSeparator();
1061 action = new QAction( "beam all", i18n("Save"), 0, 1061 action = new QAction( "beam all", i18n("Save"), 0,
1062 this ); 1062 this );
1063 action->addTo( importMenu ); 1063 action->addTo( importMenu );
1064 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1064 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1065 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1065 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1066 this ); 1066 this );
1067 action->addTo( importMenu ); 1067 action->addTo( importMenu );
1068 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1068 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1069 1069
1070 //menuBar->insertItem( "Configure",configureMenu ); 1070 //menuBar->insertItem( "Configure",configureMenu );
1071 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1071 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1072 icon = loadPixmap( "korganizer/korganizer" ); 1072 icon = loadPixmap( "korganizer/korganizer" );
1073 1073
1074 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1074 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1075 action->addTo( helpMenu ); 1075 action->addTo( helpMenu );
1076 connect( action, SIGNAL( activated() ), 1076 connect( action, SIGNAL( activated() ),
1077 SLOT( whatsNew() ) ); 1077 SLOT( whatsNew() ) );
1078 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1078 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1079 action->addTo( helpMenu ); 1079 action->addTo( helpMenu );
1080 connect( action, SIGNAL( activated() ), 1080 connect( action, SIGNAL( activated() ),
1081 SLOT( features() ) ); 1081 SLOT( features() ) );
1082 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1082 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1083 action->addTo( helpMenu ); 1083 action->addTo( helpMenu );
1084 connect( action, SIGNAL( activated() ), 1084 connect( action, SIGNAL( activated() ),
1085 SLOT( keyBindings() ) ); 1085 SLOT( keyBindings() ) );
1086 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1086 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1087 action->addTo( helpMenu ); 1087 action->addTo( helpMenu );
1088 connect( action, SIGNAL( activated() ), 1088 connect( action, SIGNAL( activated() ),
1089 SLOT( storagehowto() ) ); 1089 SLOT( storagehowto() ) );
1090 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1091 action->addTo( helpMenu );
1092 connect( action, SIGNAL( activated() ),
1093 SLOT( timetrackinghowto() ) );
1090 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1094 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1091 action->addTo( helpMenu ); 1095 action->addTo( helpMenu );
1092 connect( action, SIGNAL( activated() ), 1096 connect( action, SIGNAL( activated() ),
1093 SLOT( synchowto() ) ); 1097 SLOT( synchowto() ) );
1094 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1098 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1095 action->addTo( helpMenu ); 1099 action->addTo( helpMenu );
1096 connect( action, SIGNAL( activated() ), 1100 connect( action, SIGNAL( activated() ),
1097 SLOT( kdesynchowto() ) ); 1101 SLOT( kdesynchowto() ) );
1098 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1102 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1099 action->addTo( helpMenu ); 1103 action->addTo( helpMenu );
1100 connect( action, SIGNAL( activated() ), 1104 connect( action, SIGNAL( activated() ),
1101 SLOT( multisynchowto() ) ); 1105 SLOT( multisynchowto() ) );
1102 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1106 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1103 action->addTo( helpMenu ); 1107 action->addTo( helpMenu );
1104 connect( action, SIGNAL( activated() ), 1108 connect( action, SIGNAL( activated() ),
1105 SLOT( aboutAutoSaving() ) ); 1109 SLOT( aboutAutoSaving() ) );
1106 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1110 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1107 action->addTo( helpMenu ); 1111 action->addTo( helpMenu );
1108 connect( action, SIGNAL( activated() ), 1112 connect( action, SIGNAL( activated() ),
1109 SLOT( aboutKnownBugs() ) ); 1113 SLOT( aboutKnownBugs() ) );
1110 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1114 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1111 action->addTo( helpMenu ); 1115 action->addTo( helpMenu );
1112 connect( action, SIGNAL( activated() ), 1116 connect( action, SIGNAL( activated() ),
1113 SLOT( usertrans() ) ); 1117 SLOT( usertrans() ) );
1114 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1118 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1115 action->addTo( helpMenu ); 1119 action->addTo( helpMenu );
1116 connect( action, SIGNAL( activated() ), 1120 connect( action, SIGNAL( activated() ),
1117 SLOT( faq() ) ); 1121 SLOT( faq() ) );
1118 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1122 action = new QAction( "licence", i18n("Licence..."), 0, this );
1119 action->addTo( helpMenu ); 1123 action->addTo( helpMenu );
1120 connect( action, SIGNAL( activated() ), 1124 connect( action, SIGNAL( activated() ),
1121 SLOT( licence() ) ); 1125 SLOT( licence() ) );
1122 action = new QAction( "about", i18n("About..."), 0, this ); 1126 action = new QAction( "about", i18n("About..."), 0, this );
1123 action->addTo( helpMenu ); 1127 action->addTo( helpMenu );
1124 connect( action, SIGNAL( activated() ), 1128 connect( action, SIGNAL( activated() ),
1125 SLOT( about() ) ); 1129 SLOT( about() ) );
1126 //menuBar->insertSeparator(); 1130 //menuBar->insertSeparator();
1127 1131
1128 // ****************************************************** 1132 // ******************************************************
1129 // menubar icons 1133 // menubar icons
1130 1134
1131 1135
1132 1136
1133 //menuBar->insertItem( iconToolBar ); 1137 //menuBar->insertItem( iconToolBar );
1134 //xdays_action 1138 //xdays_action
1135 if (p-> mShowIconNewEvent) 1139 if (p-> mShowIconNewEvent)
1136 ne_action->addTo( iconToolBar ); 1140 ne_action->addTo( iconToolBar );
1137 if (p->mShowIconNewTodo ) 1141 if (p->mShowIconNewTodo )
1138 nt_action->addTo( iconToolBar ); 1142 nt_action->addTo( iconToolBar );
1139 if (p-> mShowIconSearch) 1143 if (p-> mShowIconSearch)
1140 search_action->addTo( iconToolBar ); 1144 search_action->addTo( iconToolBar );
1141 if (p-> mShowIconWhatsThis) 1145 if (p-> mShowIconWhatsThis)
1142 QWhatsThis::whatsThisButton ( iconToolBar ); 1146 QWhatsThis::whatsThisButton ( iconToolBar );
1143 if (p-> mShowIconNext) 1147 if (p-> mShowIconNext)
1144 whatsnext_action->addTo( viewToolBar ); 1148 whatsnext_action->addTo( viewToolBar );
1145 if (p-> mShowIconNextDays) 1149 if (p-> mShowIconNextDays)
1146 xdays_action->addTo( viewToolBar ); 1150 xdays_action->addTo( viewToolBar );
1147 if (p-> mShowIconJournal) 1151 if (p-> mShowIconJournal)
1148 viewjournal_action->addTo( viewToolBar ); 1152 viewjournal_action->addTo( viewToolBar );
1149 if (p-> mShowIconDay1) 1153 if (p-> mShowIconDay1)
1150 day1_action->addTo( viewToolBar ); 1154 day1_action->addTo( viewToolBar );
1151 if (p-> mShowIconDay5) 1155 if (p-> mShowIconDay5)
1152 day5_action->addTo( viewToolBar ); 1156 day5_action->addTo( viewToolBar );
1153 if (p-> mShowIconDay7) 1157 if (p-> mShowIconDay7)
1154 day7_action->addTo( viewToolBar ); 1158 day7_action->addTo( viewToolBar );
1155 if (p-> mShowIconDay6) 1159 if (p-> mShowIconDay6)
1156 day6_action->addTo( viewToolBar ); 1160 day6_action->addTo( viewToolBar );
1157 if (p-> mShowIconMonth) 1161 if (p-> mShowIconMonth)
1158 month_action->addTo( viewToolBar ); 1162 month_action->addTo( viewToolBar );
1159 if (p-> mShowIconList) 1163 if (p-> mShowIconList)
1160 showlist_action->addTo( viewToolBar ); 1164 showlist_action->addTo( viewToolBar );
1161 if (p-> mShowIconTodoview) 1165 if (p-> mShowIconTodoview)
1162 todoview_action->addTo( viewToolBar ); 1166 todoview_action->addTo( viewToolBar );
1163 1167
1164 icon = loadPixmap( pathString + "2leftarrowB" ); 1168 icon = loadPixmap( pathString + "2leftarrowB" );
1165 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1169 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
1166 if (p-> mShowIconBackFast) { 1170 if (p-> mShowIconBackFast) {
1167 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1171 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1168 connect( action, SIGNAL( activated() ), 1172 connect( action, SIGNAL( activated() ),
1169 mView, SLOT( goPreviousMonth() ) ); 1173 mView, SLOT( goPreviousMonth() ) );
1170 action->addTo( navigatorToolBar ); 1174 action->addTo( navigatorToolBar );
1171 } 1175 }
1172 icon = loadPixmap( pathString + "1leftarrowB" ); 1176 icon = loadPixmap( pathString + "1leftarrowB" );
1173 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1177 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
1174 if (p-> mShowIconBack) { 1178 if (p-> mShowIconBack) {
1175 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1179 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1176 connect( action, SIGNAL( activated() ), 1180 connect( action, SIGNAL( activated() ),
1177 mView, SLOT( goPrevious() ) ); 1181 mView, SLOT( goPrevious() ) );
1178 action->addTo( navigatorToolBar ); 1182 action->addTo( navigatorToolBar );
1179 } 1183 }
1180 icon = loadPixmap( pathString + "today" ); 1184 icon = loadPixmap( pathString + "today" );
1181 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1185 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1182 if (p-> mShowIconToday) 1186 if (p-> mShowIconToday)
1183 today_action->addTo( navigatorToolBar ); 1187 today_action->addTo( navigatorToolBar );
1184 icon = loadPixmap( pathString + "1rightarrowB" ); 1188 icon = loadPixmap( pathString + "1rightarrowB" );
1185 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1189 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1186 if (p-> mShowIconForward) { 1190 if (p-> mShowIconForward) {
1187 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1191 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1188 connect( action, SIGNAL( activated() ), 1192 connect( action, SIGNAL( activated() ),
1189 mView, SLOT( goNext() ) ); 1193 mView, SLOT( goNext() ) );
1190 action->addTo( navigatorToolBar ); 1194 action->addTo( navigatorToolBar );
1191 } 1195 }
1192 icon = loadPixmap( pathString + "2rightarrowB" ); 1196 icon = loadPixmap( pathString + "2rightarrowB" );
1193 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1197 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1194 if (p-> mShowIconForwardFast) { 1198 if (p-> mShowIconForwardFast) {
1195 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1199 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1196 connect( action, SIGNAL( activated() ), 1200 connect( action, SIGNAL( activated() ),
1197 mView, SLOT( goNextMonth() ) ); 1201 mView, SLOT( goNextMonth() ) );
1198 action->addTo( navigatorToolBar ); 1202 action->addTo( navigatorToolBar );
1199 } 1203 }
1200 1204
1201 1205
1202 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); 1206 configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6);
1203 1207
1204 1208
1205 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); 1209 if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true);
1206 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); 1210 if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true);
1207 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); 1211 if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true);
1208 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); 1212 if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true);
1209 1213
1210 if (p-> mShowIconNewEvent) 1214 if (p-> mShowIconNewEvent)
1211 configureToolBarMenu->setItemChecked( 10, true ); 1215 configureToolBarMenu->setItemChecked( 10, true );
1212 if (p->mShowIconNewTodo ) 1216 if (p->mShowIconNewTodo )
1213 configureToolBarMenu->setItemChecked( 20, true ); 1217 configureToolBarMenu->setItemChecked( 20, true );
1214 if (p-> mShowIconSearch) 1218 if (p-> mShowIconSearch)
1215 configureToolBarMenu->setItemChecked( 120, true ); 1219 configureToolBarMenu->setItemChecked( 120, true );
1216 if (p-> mShowIconList) 1220 if (p-> mShowIconList)
1217 configureToolBarMenu->setItemChecked( 30, true ); 1221 configureToolBarMenu->setItemChecked( 30, true );
1218 if (p-> mShowIconDay1) 1222 if (p-> mShowIconDay1)
1219 configureToolBarMenu->setItemChecked( 40, true ); 1223 configureToolBarMenu->setItemChecked( 40, true );
1220 if (p-> mShowIconDay5) 1224 if (p-> mShowIconDay5)
1221 configureToolBarMenu->setItemChecked( 50, true ); 1225 configureToolBarMenu->setItemChecked( 50, true );
1222 if (p-> mShowIconDay6) 1226 if (p-> mShowIconDay6)
1223 configureToolBarMenu->setItemChecked( 75, true ); 1227 configureToolBarMenu->setItemChecked( 75, true );
1224 if (p-> mShowIconDay7) 1228 if (p-> mShowIconDay7)
1225 configureToolBarMenu->setItemChecked( 60, true ); 1229 configureToolBarMenu->setItemChecked( 60, true );
1226 if (p-> mShowIconMonth) 1230 if (p-> mShowIconMonth)
1227 configureToolBarMenu->setItemChecked( 70, true ); 1231 configureToolBarMenu->setItemChecked( 70, true );
1228 if (p-> mShowIconTodoview) 1232 if (p-> mShowIconTodoview)
1229 configureToolBarMenu->setItemChecked( 80, true ); 1233 configureToolBarMenu->setItemChecked( 80, true );
1230 if (p-> mShowIconBackFast) 1234 if (p-> mShowIconBackFast)
1231 configureToolBarMenu->setItemChecked( 200, true ); 1235 configureToolBarMenu->setItemChecked( 200, true );
1232 if (p-> mShowIconBack) 1236 if (p-> mShowIconBack)
1233 configureToolBarMenu->setItemChecked( 210, true ); 1237 configureToolBarMenu->setItemChecked( 210, true );
1234 if (p-> mShowIconToday) 1238 if (p-> mShowIconToday)
1235 configureToolBarMenu->setItemChecked( 130, true ); 1239 configureToolBarMenu->setItemChecked( 130, true );
1236 if (p-> mShowIconForward) 1240 if (p-> mShowIconForward)
1237 configureToolBarMenu->setItemChecked( 220, true ); 1241 configureToolBarMenu->setItemChecked( 220, true );
1238 if (p-> mShowIconForwardFast) 1242 if (p-> mShowIconForwardFast)
1239 configureToolBarMenu->setItemChecked( 230, true ); 1243 configureToolBarMenu->setItemChecked( 230, true );
1240 if (p-> mShowIconNextDays) 1244 if (p-> mShowIconNextDays)
1241 configureToolBarMenu->setItemChecked( 100, true ); 1245 configureToolBarMenu->setItemChecked( 100, true );
1242 if (p-> mShowIconNext) 1246 if (p-> mShowIconNext)
1243 configureToolBarMenu->setItemChecked( 110, true ); 1247 configureToolBarMenu->setItemChecked( 110, true );
1244 if (p-> mShowIconJournal) 1248 if (p-> mShowIconJournal)
1245 configureToolBarMenu->setItemChecked( 90, true ); 1249 configureToolBarMenu->setItemChecked( 90, true );
1246 if (p-> mShowIconWhatsThis) 1250 if (p-> mShowIconWhatsThis)
1247 configureToolBarMenu->setItemChecked( 300, true ); 1251 configureToolBarMenu->setItemChecked( 300, true );
1248 if (p-> mShowIconWeekNum) 1252 if (p-> mShowIconWeekNum)
1249 configureToolBarMenu->setItemChecked( 400, true ); 1253 configureToolBarMenu->setItemChecked( 400, true );
1250 if (!p-> mShowIconStretch) { 1254 if (!p-> mShowIconStretch) {
1251 QLabel* dummy = new QLabel( iconToolBar ); 1255 QLabel* dummy = new QLabel( iconToolBar );
1252 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1256 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1253 dummy->setMinimumWidth( 0 ); 1257 dummy->setMinimumWidth( 0 );
1254 iconToolBar->setStretchableWidget ( dummy ) ; 1258 iconToolBar->setStretchableWidget ( dummy ) ;
1255 } 1259 }
1256 else { 1260 else {
1257 iconToolBar->setHorizontalStretchable (true ); 1261 iconToolBar->setHorizontalStretchable (true );
1258 viewToolBar->setHorizontalStretchable (true ); 1262 viewToolBar->setHorizontalStretchable (true );
1259 navigatorToolBar->setHorizontalStretchable (true ); 1263 navigatorToolBar->setHorizontalStretchable (true );
1260 iconToolBar->setVerticalStretchable (true ); 1264 iconToolBar->setVerticalStretchable (true );
1261 viewToolBar->setVerticalStretchable (true ); 1265 viewToolBar->setVerticalStretchable (true );
1262 navigatorToolBar->setVerticalStretchable (true ); 1266 navigatorToolBar->setVerticalStretchable (true );
1263 configureToolBarMenu->setItemChecked( 5, true ); 1267 configureToolBarMenu->setItemChecked( 5, true );
1264 } 1268 }
1265 if (p-> mShowIconFilter) 1269 if (p-> mShowIconFilter)
1266 configureToolBarMenu->setItemChecked( 7, true ); 1270 configureToolBarMenu->setItemChecked( 7, true );
1267 if (p-> mShowIconOnetoolbar) 1271 if (p-> mShowIconOnetoolbar)
1268 configureToolBarMenu->setItemChecked( 6, true ); 1272 configureToolBarMenu->setItemChecked( 6, true );
1269 1273
1270 1274
1271 if ( filterMenubar ) 1275 if ( filterMenubar )
1272 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1276 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1273 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1277 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1274 configureAgenda( p->mHourSize ); 1278 configureAgenda( p->mHourSize );
1275 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1279 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1276} 1280}
1277 1281
1278void MainWindow::exportToPhone( int mode ) 1282void MainWindow::exportToPhone( int mode )
1279{ 1283{
1280 1284
1281 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1285 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1282 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1286 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1283 KOex2phonePrefs ex2phone; 1287 KOex2phonePrefs ex2phone;
1284 1288
1285 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1289 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1286 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1290 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1287 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1291 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1288 if ( mode == 1 ) 1292 if ( mode == 1 )
1289 ex2phone.setCaption(i18n("Export complete calendar")); 1293 ex2phone.setCaption(i18n("Export complete calendar"));
1290 if ( mode == 2 ) 1294 if ( mode == 2 )
1291 ex2phone.setCaption(i18n("Export filtered calendar")); 1295 ex2phone.setCaption(i18n("Export filtered calendar"));
1292 1296
1293 if ( !ex2phone.exec() ) { 1297 if ( !ex2phone.exec() ) {
1294 return; 1298 return;
1295 } 1299 }
1296 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1300 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1297 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1301 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1298 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1302 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1299 1303
1300 int inFuture = 0; 1304 int inFuture = 0;
1301 if ( ex2phone.mWriteBackFuture->isChecked() ) 1305 if ( ex2phone.mWriteBackFuture->isChecked() )
1302 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1306 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1303 QPtrList<Incidence> delSel; 1307 QPtrList<Incidence> delSel;
1304 if ( mode == 1 ) 1308 if ( mode == 1 )
1305 delSel = mCalendar->rawIncidences(); 1309 delSel = mCalendar->rawIncidences();
1306 if ( mode == 2 ) 1310 if ( mode == 2 )
1307 delSel = mCalendar->incidences(); 1311 delSel = mCalendar->incidences();
1308 CalendarLocal* cal = new CalendarLocal(); 1312 CalendarLocal* cal = new CalendarLocal();
1309 cal->setLocalTime(); 1313 cal->setLocalTime();
1310 Incidence *incidence = delSel.first(); 1314 Incidence *incidence = delSel.first();
1311 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1315 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1312 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1316 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1313 while ( incidence ) { 1317 while ( incidence ) {
1314 if ( incidence->type() != "Journal" ) { 1318 if ( incidence->type() != "Journal" ) {
1315 bool add = true; 1319 bool add = true;
1316 if ( inFuture ) { 1320 if ( inFuture ) {
1317 QDateTime dt; 1321 QDateTime dt;
1318 if ( incidence->type() == "Todo" ) { 1322 if ( incidence->type() == "Todo" ) {
1319 Todo * t = (Todo*)incidence; 1323 Todo * t = (Todo*)incidence;
1320 if ( t->hasDueDate() ) 1324 if ( t->hasDueDate() )
1321 dt = t->dtDue(); 1325 dt = t->dtDue();
1322 else 1326 else
1323 dt = cur.addSecs( 62 ); 1327 dt = cur.addSecs( 62 );
1324 } 1328 }
1325 else { 1329 else {
1326 bool ok; 1330 bool ok;
1327 dt = incidence->getNextOccurence( cur, &ok ); 1331 dt = incidence->getNextOccurence( cur, &ok );
1328 if ( !ok ) 1332 if ( !ok )
1329 dt = cur.addSecs( -62 ); 1333 dt = cur.addSecs( -62 );
1330 } 1334 }
1331 if ( dt < cur || dt > end ) { 1335 if ( dt < cur || dt > end ) {
1332 add = false; 1336 add = false;
1333 } 1337 }
1334 } 1338 }
1335 if ( add ) { 1339 if ( add ) {
1336 Incidence *in = incidence->clone(); 1340 Incidence *in = incidence->clone();
1337 cal->addIncidence( in ); 1341 cal->addIncidence( in );
1338 } 1342 }
1339 } 1343 }
1340 incidence = delSel.next(); 1344 incidence = delSel.next();
1341 } 1345 }
1342 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1346 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1343 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1347 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1344 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1348 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1345 1349
1346 setCaption( i18n("Writing to phone...")); 1350 setCaption( i18n("Writing to phone..."));
1347 if ( PhoneFormat::writeToPhone( cal ) ) 1351 if ( PhoneFormat::writeToPhone( cal ) )
1348 setCaption( i18n("Export to phone successful!")); 1352 setCaption( i18n("Export to phone successful!"));
1349 else 1353 else
1350 setCaption( i18n("Error exporting to phone!")); 1354 setCaption( i18n("Error exporting to phone!"));
1351 delete cal; 1355 delete cal;
1352} 1356}
1353 1357
1354 1358
1355void MainWindow::setDefaultPreferences() 1359void MainWindow::setDefaultPreferences()
1356{ 1360{
1357 KOPrefs *p = KOPrefs::instance(); 1361 KOPrefs *p = KOPrefs::instance();
1358 1362
1359 p->mCompactDialogs = true; 1363 p->mCompactDialogs = true;
1360 p->mConfirm = true; 1364 p->mConfirm = true;
1361 // p->mEnableQuickTodo = false; 1365 // p->mEnableQuickTodo = false;
1362 1366
1363} 1367}
1364 1368
1365QString MainWindow::resourcePath() 1369QString MainWindow::resourcePath()
1366{ 1370{
1367 return KGlobal::iconLoader()->iconPath(); 1371 return KGlobal::iconLoader()->iconPath();
1368} 1372}
1369 1373
1370void MainWindow::displayText( QString text ,QString cap ) 1374void MainWindow::displayText( QString text ,QString cap )
1371{ 1375{
1372 QDialog dia( this, "name", true ); ; 1376 QDialog dia( this, "name", true ); ;
1373 dia.setCaption( cap ); 1377 dia.setCaption( cap );
1374 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1378 QVBoxLayout* lay = new QVBoxLayout( &dia );
1375 lay->setSpacing( 3 ); 1379 lay->setSpacing( 3 );
1376 lay->setMargin( 3 ); 1380 lay->setMargin( 3 );
1377 QTextBrowser tb ( &dia ); 1381 QTextBrowser tb ( &dia );
1378 lay->addWidget( &tb ); 1382 lay->addWidget( &tb );
1379 tb.setText( text ); 1383 tb.setText( text );
1380#ifdef DESKTOP_VERSION 1384#ifdef DESKTOP_VERSION
1381 dia.resize( 640, 480); 1385 dia.resize( 640, 480);
1382#else 1386#else
1383 dia.showMaximized(); 1387 dia.showMaximized();
1384#endif 1388#endif
1385 dia.exec(); 1389 dia.exec();
1386} 1390}
1387 1391
1388void MainWindow::features() 1392void MainWindow::features()
1389{ 1393{
1390 1394
1391 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1395 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1392} 1396}
1393 1397
1394void MainWindow::usertrans() 1398void MainWindow::usertrans()
1395{ 1399{
1396 1400
1397 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1401 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1398} 1402}
1399 1403
1400void MainWindow::storagehowto() 1404void MainWindow::storagehowto()
1401{ 1405{
1402 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 1406 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
1403} 1407}
1408void MainWindow::timetrackinghowto()
1409{
1410 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" );
1411}
1404void MainWindow::kdesynchowto() 1412void MainWindow::kdesynchowto()
1405{ 1413{
1406 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1414 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1407} 1415}
1408void MainWindow::multisynchowto() 1416void MainWindow::multisynchowto()
1409{ 1417{
1410 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1418 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1411} 1419}
1412void MainWindow::synchowto() 1420void MainWindow::synchowto()
1413{ 1421{
1414 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1422 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1415} 1423}
1416void MainWindow::faq() 1424void MainWindow::faq()
1417{ 1425{
1418 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1426 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1419 1427
1420} 1428}
1421void MainWindow::whatsNew() 1429void MainWindow::whatsNew()
1422{ 1430{
1423 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1431 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1424 1432
1425} 1433}
1426void MainWindow::licence() 1434void MainWindow::licence()
1427{ 1435{
1428 KApplication::showLicence(); 1436 KApplication::showLicence();
1429 1437
1430} 1438}
1431void MainWindow::about() 1439void MainWindow::about()
1432{ 1440{
1433 QString version; 1441 QString version;
1434#include <../version> 1442#include <../version>
1435 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1443 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1436 i18n("KOrganizer/Platform-independent\n") + 1444 i18n("KOrganizer/Platform-independent\n") +
1437 "(KO/Pi) " + version + " - " + 1445 "(KO/Pi) " + version + " - " +
1438 1446
1439#ifdef DESKTOP_VERSION 1447#ifdef DESKTOP_VERSION
1440 i18n("Desktop Edition\n") + 1448 i18n("Desktop Edition\n") +
1441#else 1449#else
1442 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1450 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1443#endif 1451#endif
1444 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1452 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1445} 1453}
1446void MainWindow::keyBindings() 1454void MainWindow::keyBindings()
1447{ 1455{
1448 QString cap = i18n("KO/Pi Keys + Colors"); 1456 QString cap = i18n("KO/Pi Keys + Colors");
1449 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1457 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1450 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1458 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1451 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1459 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1452 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1460 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1453 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1461 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1454 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1462 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1455 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1463 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1456 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1464 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1457 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1465 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1458 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1466 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1459 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1467 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1460 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1468 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1461 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1469 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1462 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1470 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1463 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1471 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1464 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1472 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1465 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1473 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1466 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1474 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1467 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1475 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1468 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1476 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1469 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1477 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1470 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1478 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1471 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1479 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1472 i18n("<p><h3>In agenda view:</h3></p>\n") + 1480 i18n("<p><h3>In agenda view:</h3></p>\n") +
1473 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1481 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1474 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1482 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1475 i18n("<p><h3>In todo view:</h3></p>\n") + 1483 i18n("<p><h3>In todo view:</h3></p>\n") +
1476 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1484 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1477 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1485 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1478 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1486 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1479 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1487 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1480 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1488 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1481 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1489 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1482 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1490 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1483 i18n("<p><h3>In list view:</h3></p>\n") + 1491 i18n("<p><h3>In list view:</h3></p>\n") +
1484 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1492 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1485 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1493 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1486 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1494 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1487 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1495 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1488 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1496 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1489 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1497 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1490 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1498 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1491 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1499 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1492 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1500 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1493 i18n("<p><b>E</b>: Edit item</p>\n") + 1501 i18n("<p><b>E</b>: Edit item</p>\n") +
1494 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1502 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1495 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1503 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1496 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1504 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1497 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1505 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1498 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1506 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1499 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1507 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1500 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1508 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1501 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1509 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1502 i18n("<p><b>White</b>: Item readonly</p>\n"); 1510 i18n("<p><b>White</b>: Item readonly</p>\n");
1503 displayText( text, cap); 1511 displayText( text, cap);
1504} 1512}
1505void MainWindow::aboutAutoSaving() 1513void MainWindow::aboutAutoSaving()
1506{ 1514{
1507 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1515 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1508 1516
1509 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1517 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1510 1518
1511} 1519}
1512void MainWindow::aboutKnownBugs() 1520void MainWindow::aboutKnownBugs()
1513{ 1521{
1514 QMessageBox* msg; 1522 QMessageBox* msg;
1515 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1523 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1516 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1524 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1517 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1525 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1518 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1526 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1519 i18n("\nor report them in the bugtracker on\n") + 1527 i18n("\nor report them in the bugtracker on\n") +
1520 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1528 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1521 QMessageBox::NoIcon, 1529 QMessageBox::NoIcon,
1522 QMessageBox::Ok, 1530 QMessageBox::Ok,
1523 QMessageBox::NoButton, 1531 QMessageBox::NoButton,
1524 QMessageBox::NoButton); 1532 QMessageBox::NoButton);
1525 msg->exec(); 1533 msg->exec();
1526 delete msg; 1534 delete msg;
1527 1535
1528} 1536}
1529 1537
1530QString MainWindow::defaultFileName() 1538QString MainWindow::defaultFileName()
1531{ 1539{
1532 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1540 return locateLocal( "data", "korganizer/mycalendar.ics" );
1533} 1541}
1534QString MainWindow::syncFileName() 1542QString MainWindow::syncFileName()
1535{ 1543{
1536#ifdef DESKTOP_VERSION 1544#ifdef DESKTOP_VERSION
1537 return locateLocal( "tmp", "synccalendar.ics" ); 1545 return locateLocal( "tmp", "synccalendar.ics" );
1538#else 1546#else
1539 return QString( "/tmp/synccalendar.ics" ); 1547 return QString( "/tmp/synccalendar.ics" );
1540#endif 1548#endif
1541} 1549}
1542#include "koglobals.h" 1550#include "koglobals.h"
1543#include <kcalendarsystem.h> 1551#include <kcalendarsystem.h>
1544void MainWindow::updateWeek(QDate seda) 1552void MainWindow::updateWeek(QDate seda)
1545{ 1553{
1546 int weekNum = KGlobal::locale()->weekNum ( seda ); 1554 int weekNum = KGlobal::locale()->weekNum ( seda );
1547 mWeekPixmap.fill( mWeekBgColor ); 1555 mWeekPixmap.fill( mWeekBgColor );
1548 QPainter p ( &mWeekPixmap ); 1556 QPainter p ( &mWeekPixmap );
1549 p.setFont( mWeekFont ); 1557 p.setFont( mWeekFont );
1550 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1558 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1551 p.end(); 1559 p.end();
1552 QIconSet icon3 ( mWeekPixmap ); 1560 QIconSet icon3 ( mWeekPixmap );
1553 mWeekAction->setIconSet ( icon3 ); 1561 mWeekAction->setIconSet ( icon3 );
1554 1562
1555} 1563}
1556void MainWindow::updateWeekNum(const DateList &selectedDates) 1564void MainWindow::updateWeekNum(const DateList &selectedDates)
1557{ 1565{
1558 updateWeek( selectedDates.first() ); 1566 updateWeek( selectedDates.first() );
1559} 1567}
1560void MainWindow::processIncidenceSelection( Incidence *incidence ) 1568void MainWindow::processIncidenceSelection( Incidence *incidence )
1561{ 1569{
1562 1570
1563 if ( !incidence ) { 1571 if ( !incidence ) {
1564 enableIncidenceActions( false ); 1572 enableIncidenceActions( false );
1565 1573
1566 mNewSubTodoAction->setEnabled( false ); 1574 mNewSubTodoAction->setEnabled( false );
1567 setCaptionToDates(); 1575 setCaptionToDates();
1568 return; 1576 return;
1569 1577
1570 } 1578 }
1571 1579
1572 //KGlobal::locale()->formatDateTime(nextA, true); 1580 //KGlobal::locale()->formatDateTime(nextA, true);
1573 QString startString = ""; 1581 QString startString = "";
1574 if ( incidence->type() != "Todo" ) { 1582 if ( incidence->type() != "Todo" ) {
1575 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1583 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1576 if ( incidence->doesFloat() ) { 1584 if ( incidence->doesFloat() ) {
1577 startString += ": "+incidence->dtStartDateStr( true ); 1585 startString += ": "+incidence->dtStartDateStr( true );
1578 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1586 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1579 1587
1580 } else { 1588 } else {
1581 startString = ": "+incidence->dtStartStr(true); 1589 startString = ": "+incidence->dtStartStr(true);
1582 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1590 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1583 1591
1584 } 1592 }
1585 1593
1586 } else { 1594 } else {
1587 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1595 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1588 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1596 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1589 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1597 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1590 1598
1591 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1599 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1592 bool ok; 1600 bool ok;
1593 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1601 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1594 if ( ok ) { 1602 if ( ok ) {
1595 int years = noc.date().year() - incidence->dtStart().date().year(); 1603 int years = noc.date().year() - incidence->dtStart().date().year();
1596 startString += i18n(" (%1 y.)"). arg( years ); 1604 startString += i18n(" (%1 y.)"). arg( years );
1597 } 1605 }
1598 } 1606 }
1599 else 1607 else
1600 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1608 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1601 } 1609 }
1602 1610
1603 } 1611 }
1604 else 1612 else
1605 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1613 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1606 if ( !incidence->location().isEmpty() ) 1614 if ( !incidence->location().isEmpty() )
1607 startString += " (" +incidence->location()+")"; 1615 startString += " (" +incidence->location()+")";
1608 setCaption( incidence->summary()+startString); 1616 setCaption( incidence->summary()+startString);
1609 1617
1610 enableIncidenceActions( true ); 1618 enableIncidenceActions( true );
1611 1619
1612 if ( incidence->type() == "Event" ) { 1620 if ( incidence->type() == "Event" ) {
1613 mShowAction->setText( i18n("Show Event...") ); 1621 mShowAction->setText( i18n("Show Event...") );
1614 mEditAction->setText( i18n("Edit Event...") ); 1622 mEditAction->setText( i18n("Edit Event...") );
1615 mDeleteAction->setText( i18n("Delete Event...") ); 1623 mDeleteAction->setText( i18n("Delete Event...") );
1616 1624
1617 mNewSubTodoAction->setEnabled( false ); 1625 mNewSubTodoAction->setEnabled( false );
1618 } else if ( incidence->type() == "Todo" ) { 1626 } else if ( incidence->type() == "Todo" ) {
1619 mShowAction->setText( i18n("Show Todo...") ); 1627 mShowAction->setText( i18n("Show Todo...") );
1620 mEditAction->setText( i18n("Edit Todo...") ); 1628 mEditAction->setText( i18n("Edit Todo...") );
1621 mDeleteAction->setText( i18n("Delete Todo...") ); 1629 mDeleteAction->setText( i18n("Delete Todo...") );
1622 1630
1623 mNewSubTodoAction->setEnabled( true ); 1631 mNewSubTodoAction->setEnabled( true );
1624 } else { 1632 } else {
1625 mShowAction->setText( i18n("Show...") ); 1633 mShowAction->setText( i18n("Show...") );
1626 mShowAction->setText( i18n("Edit...") ); 1634 mShowAction->setText( i18n("Edit...") );
1627 mShowAction->setText( i18n("Delete...") ); 1635 mShowAction->setText( i18n("Delete...") );
1628 1636
1629 mNewSubTodoAction->setEnabled( false ); 1637 mNewSubTodoAction->setEnabled( false );
1630 } 1638 }
1631} 1639}
1632 1640
1633void MainWindow::enableIncidenceActions( bool enabled ) 1641void MainWindow::enableIncidenceActions( bool enabled )
1634{ 1642{
1635 mShowAction->setEnabled( enabled ); 1643 mShowAction->setEnabled( enabled );
1636 mEditAction->setEnabled( enabled ); 1644 mEditAction->setEnabled( enabled );
1637 mDeleteAction->setEnabled( enabled ); 1645 mDeleteAction->setEnabled( enabled );
1638 1646
1639 mCloneAction->setEnabled( enabled ); 1647 mCloneAction->setEnabled( enabled );
1640 mMoveAction->setEnabled( enabled ); 1648 mMoveAction->setEnabled( enabled );
1641 mBeamAction->setEnabled( enabled ); 1649 mBeamAction->setEnabled( enabled );
1642 mCancelAction->setEnabled( enabled ); 1650 mCancelAction->setEnabled( enabled );
1643} 1651}
1644 1652
1645void MainWindow::importOL() 1653void MainWindow::importOL()
1646{ 1654{
1647#ifdef _OL_IMPORT_ 1655#ifdef _OL_IMPORT_
1648 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1656 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1649 id->exec(); 1657 id->exec();
1650 delete id; 1658 delete id;
1651 mView->updateView(); 1659 mView->updateView();
1652#endif 1660#endif
1653} 1661}
1654void MainWindow::importBday() 1662void MainWindow::importBday()
1655{ 1663{
1656 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1664 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1657 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1665 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1658 i18n("Import!"), i18n("Cancel"), 0, 1666 i18n("Import!"), i18n("Cancel"), 0,
1659 0, 1 ); 1667 0, 1 );
1660 if ( result == 0 ) { 1668 if ( result == 0 ) {
1661 mView->importBday(); 1669 mView->importBday();
1662 1670
1663 } 1671 }
1664 1672
1665 1673
1666} 1674}
1667void MainWindow::importQtopia() 1675void MainWindow::importQtopia()
1668{ 1676{
1669 //#ifndef DESKTOP_VERSION 1677 //#ifndef DESKTOP_VERSION
1670 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1678 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1671#ifdef DESKTOP_VERSION 1679#ifdef DESKTOP_VERSION
1672 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1680 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1673#endif 1681#endif
1674 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1682 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1675 i18n("Import!"), i18n("Cancel"), 0, 1683 i18n("Import!"), i18n("Cancel"), 0,
1676 0, 1 ); 1684 0, 1 );
1677 if ( result == 0 ) { 1685 if ( result == 0 ) {
1678#ifndef DESKTOP_VERSION 1686#ifndef DESKTOP_VERSION
1679 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1687 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1680 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1688 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1681 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1689 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1682#else 1690#else
1683 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1691 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1684 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1692 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1685 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1693 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1686#endif 1694#endif
1687 mView->importQtopia( categories, datebook, todolist ); 1695 mView->importQtopia( categories, datebook, todolist );
1688 } 1696 }
1689#if 0 1697#if 0
1690 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1698 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1691 i18n("Not supported \non desktop!\n"), 1699 i18n("Not supported \non desktop!\n"),
1692 i18n("Ok"), i18n("Cancel"), 0, 1700 i18n("Ok"), i18n("Cancel"), 0,
1693 0, 1 ); 1701 0, 1 );
1694 1702
1695#endif 1703#endif
1696} 1704}
1697 1705
1698void MainWindow::saveOnClose() 1706void MainWindow::saveOnClose()
1699{ 1707{
1700 KOPrefs *p = KOPrefs::instance(); 1708 KOPrefs *p = KOPrefs::instance();
1701 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1709 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1702 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1710 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1703 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1711 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1704 if ( filterToolBar ) { 1712 if ( filterToolBar ) {
1705 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1713 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1706 } 1714 }
1707#ifdef DESKTOP_VERSION 1715#ifdef DESKTOP_VERSION
1708 1716
1709 QPoint myP; 1717 QPoint myP;
1710 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1718 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1711 if ( p->mToolBarHor ) 1719 if ( p->mToolBarHor )
1712 p->mToolBarUp = myP.y() > height()/2; 1720 p->mToolBarUp = myP.y() > height()/2;
1713 else 1721 else
1714 p->mToolBarUp = myP.x() > width()/2; 1722 p->mToolBarUp = myP.x() > width()/2;
1715 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1723 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1716 if ( p->mToolBarHorV ) 1724 if ( p->mToolBarHorV )
1717 p->mToolBarUpV = myP.y() > height()/2; 1725 p->mToolBarUpV = myP.y() > height()/2;
1718 else 1726 else
1719 p->mToolBarUpV = myP.x() > width()/2 ; 1727 p->mToolBarUpV = myP.x() > width()/2 ;
1720 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1728 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1721 if ( p->mToolBarHorN ) 1729 if ( p->mToolBarHorN )
1722 p->mToolBarUpN = myP.y() > height()/2; 1730 p->mToolBarUpN = myP.y() > height()/2;
1723 else 1731 else
1724 p->mToolBarUpN = myP.x() > width()/2 ; 1732 p->mToolBarUpN = myP.x() > width()/2 ;
1725 if ( filterToolBar ) { 1733 if ( filterToolBar ) {
1726 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1734 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1727 if ( p->mToolBarHorF ) 1735 if ( p->mToolBarHorF )
1728 p->mToolBarUpF = myP.y() > height()/2; 1736 p->mToolBarUpF = myP.y() > height()/2;
1729 else 1737 else
1730 p->mToolBarUpF = myP.x() > width()/2 ; 1738 p->mToolBarUpF = myP.x() > width()/2 ;
1731 } 1739 }
1732#else 1740#else
1733 if ( p->mToolBarHor ) 1741 if ( p->mToolBarHor )
1734 p->mToolBarUp = iconToolBar->y() > height()/2; 1742 p->mToolBarUp = iconToolBar->y() > height()/2;
1735 else 1743 else
1736 p->mToolBarUp = iconToolBar->x() > width()/2; 1744 p->mToolBarUp = iconToolBar->x() > width()/2;
1737 if ( p->mToolBarHorV ) 1745 if ( p->mToolBarHorV )
1738 p->mToolBarUpV = viewToolBar->y() > height()/2; 1746 p->mToolBarUpV = viewToolBar->y() > height()/2;
1739 else 1747 else
1740 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1748 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1741 1749
1742 if ( p->mToolBarHorN ) 1750 if ( p->mToolBarHorN )
1743 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1751 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1744 else 1752 else
1745 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1753 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1746 if ( filterToolBar ) { 1754 if ( filterToolBar ) {
1747 if ( p->mToolBarHorF ) 1755 if ( p->mToolBarHorF )
1748 p->mToolBarUpF = filterToolBar->y() > height()/2; 1756 p->mToolBarUpF = filterToolBar->y() > height()/2;
1749 else 1757 else
1750 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1758 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1751 } 1759 }
1752#endif 1760#endif
1753 1761
1754 1762
1755 mView->writeSettings(); 1763 mView->writeSettings();
1756 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1764 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1757 save(); 1765 save();
1758} 1766}
1759void MainWindow::slotModifiedChanged( bool changed ) 1767void MainWindow::slotModifiedChanged( bool changed )
1760{ 1768{
1761 if ( mBlockAtStartup ) 1769 if ( mBlockAtStartup )
1762 return; 1770 return;
1763 1771
1764 int msec; 1772 int msec;
1765 // we store the changes after 1 minute, 1773 // we store the changes after 1 minute,
1766 // and for safety reasons after 10 minutes again 1774 // and for safety reasons after 10 minutes again
1767 if ( !mSyncManager->blockSave() ) 1775 if ( !mSyncManager->blockSave() )
1768 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1776 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1769 else 1777 else
1770 msec = 1000 * 600; 1778 msec = 1000 * 600;
1771 mSaveTimer.start( msec, true ); // 1 minute 1779 mSaveTimer.start( msec, true ); // 1 minute
1772 qDebug("KO: Saving File in %d secs!", msec/1000); 1780 qDebug("KO: Saving File in %d secs!", msec/1000);
1773 mCalendarModifiedFlag = true; 1781 mCalendarModifiedFlag = true;
1774} 1782}
1775void MainWindow::saveStopTimer() 1783void MainWindow::saveStopTimer()
1776{ 1784{
1777 mSaveTimer.stop(); 1785 mSaveTimer.stop();
1778} 1786}
1779void MainWindow::save() 1787void MainWindow::save()
1780{ 1788{
1781 if ( !mCalendarModifiedFlag ) { 1789 if ( !mCalendarModifiedFlag ) {
1782 qDebug("KO: Calendar not modified. Nothing saved."); 1790 qDebug("KO: Calendar not modified. Nothing saved.");
1783 return; 1791 return;
1784 } 1792 }
1785 if ( mSyncManager->blockSave() ) 1793 if ( mSyncManager->blockSave() )
1786 return; 1794 return;
1787 mSyncManager->setBlockSave(true); 1795 mSyncManager->setBlockSave(true);
1788 if ( mView->checkFileVersion( defaultFileName()) ) { 1796 if ( mView->checkFileVersion( defaultFileName()) ) {
1789 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1797 QTime neededSaveTime = QDateTime::currentDateTime().time();
1790 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1798 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1791 qDebug("KO: Start saving data to file!"); 1799 qDebug("KO: Start saving data to file!");
1792 mView->saveCalendar( defaultFileName() ); 1800 mView->saveCalendar( defaultFileName() );
1793 mCalendarModifiedFlag = false; 1801 mCalendarModifiedFlag = false;
1794 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1802 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1795 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1803 qDebug("KO: Needed %d ms for saving.",msNeeded );
1796 QString savemes; 1804 QString savemes;
1797 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1805 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1798 setCaption(savemes); 1806 setCaption(savemes);
1799 } else 1807 } else
1800 setCaption(i18n("Saving cancelled!")); 1808 setCaption(i18n("Saving cancelled!"));
1801 mSyncManager->setBlockSave( false ); 1809 mSyncManager->setBlockSave( false );
1802} 1810}
1803 1811
1804void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1812void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1805{ 1813{
1806 if ( !e->isAutoRepeat() ) { 1814 if ( !e->isAutoRepeat() ) {
1807 mFlagKeyPressed = false; 1815 mFlagKeyPressed = false;
1808 } 1816 }
1809} 1817}
1810void MainWindow::keyPressEvent ( QKeyEvent * e ) 1818void MainWindow::keyPressEvent ( QKeyEvent * e )
1811{ 1819{
1812 qApp->processEvents(); 1820 qApp->processEvents();
1813 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1821 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1814 e->ignore(); 1822 e->ignore();
1815 // qDebug(" ignore %d",e->isAutoRepeat() ); 1823 // qDebug(" ignore %d",e->isAutoRepeat() );
1816 return; 1824 return;
1817 } 1825 }
1818 if (! e->isAutoRepeat() ) 1826 if (! e->isAutoRepeat() )
1819 mFlagKeyPressed = true; 1827 mFlagKeyPressed = true;
1820 KOPrefs *p = KOPrefs::instance(); 1828 KOPrefs *p = KOPrefs::instance();
1821 bool showSelectedDates = false; 1829 bool showSelectedDates = false;
1822 int size; 1830 int size;
1823 int pro = 0; 1831 int pro = 0;
1824 //qDebug("MainWindow::keyPressEvent "); 1832 //qDebug("MainWindow::keyPressEvent ");
1825 switch ( e->key() ) { 1833 switch ( e->key() ) {
1826 case Qt::Key_Right: 1834 case Qt::Key_Right:
1827 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1835 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1828 mView->goNextMonth(); 1836 mView->goNextMonth();
1829 else 1837 else
1830 mView->goNext(); 1838 mView->goNext();
1831 showSelectedDates = true; 1839 showSelectedDates = true;
1832 break; 1840 break;
1833 case Qt::Key_Left: 1841 case Qt::Key_Left:
1834 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1842 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1835 mView->goPreviousMonth(); 1843 mView->goPreviousMonth();
1836 else 1844 else
1837 mView->goPrevious(); 1845 mView->goPrevious();
1838 showSelectedDates = true; 1846 showSelectedDates = true;
1839 break; 1847 break;
1840 case Qt::Key_Down: 1848 case Qt::Key_Down:
1841 mView->viewManager()->agendaView()->scrollOneHourDown(); 1849 mView->viewManager()->agendaView()->scrollOneHourDown();
1842 break; 1850 break;
1843 case Qt::Key_Up: 1851 case Qt::Key_Up:
1844 mView->viewManager()->agendaView()->scrollOneHourUp(); 1852 mView->viewManager()->agendaView()->scrollOneHourUp();
1845 break; 1853 break;
1846 case Qt::Key_K: 1854 case Qt::Key_K:
1847 mView->viewManager()->showMonthViewWeek(); 1855 mView->viewManager()->showMonthViewWeek();
1848 break; 1856 break;
1849 case Qt::Key_I: 1857 case Qt::Key_I:
1850 mView->showIncidence(); 1858 mView->showIncidence();
1851 break; 1859 break;
1852 case Qt::Key_Delete: 1860 case Qt::Key_Delete:
1853 case Qt::Key_Backspace: 1861 case Qt::Key_Backspace:
1854 mView->deleteIncidence(); 1862 mView->deleteIncidence();
1855 break; 1863 break;
1856 case Qt::Key_D: 1864 case Qt::Key_D:
1857 mView->viewManager()->showDayView(); 1865 mView->viewManager()->showDayView();
1858 showSelectedDates = true; 1866 showSelectedDates = true;
1859 break; 1867 break;
1860 case Qt::Key_O: 1868 case Qt::Key_O:
1861 mView->toggleFilerEnabled( ); 1869 mView->toggleFilerEnabled( );
1862 break; 1870 break;
1863 case Qt::Key_0: 1871 case Qt::Key_0:
1864 case Qt::Key_1: 1872 case Qt::Key_1:
1865 case Qt::Key_2: 1873 case Qt::Key_2:
1866 case Qt::Key_3: 1874 case Qt::Key_3:
1867 case Qt::Key_4: 1875 case Qt::Key_4:
1868 case Qt::Key_5: 1876 case Qt::Key_5:
1869 case Qt::Key_6: 1877 case Qt::Key_6:
1870 case Qt::Key_7: 1878 case Qt::Key_7:
1871 case Qt::Key_8: 1879 case Qt::Key_8:
1872 case Qt::Key_9: 1880 case Qt::Key_9:
1873 pro = e->key()-48; 1881 pro = e->key()-48;
1874 if ( pro == 0 ) 1882 if ( pro == 0 )
1875 pro = 10; 1883 pro = 10;
1876 if ( e->state() == Qt::ControlButton) 1884 if ( e->state() == Qt::ControlButton)
1877 pro += 10; 1885 pro += 10;
1878 break; 1886 break;
1879 case Qt::Key_M: 1887 case Qt::Key_M:
1880 mView->viewManager()->showMonthView(); 1888 mView->viewManager()->showMonthView();
1881 showSelectedDates = true; 1889 showSelectedDates = true;
1882 break; 1890 break;
1883 case Qt::Key_Insert: 1891 case Qt::Key_Insert:
1884 mView->newEvent(); 1892 mView->newEvent();
1885 break; 1893 break;
1886 case Qt::Key_S : 1894 case Qt::Key_S :
1887 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1895 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1888 mView->newSubTodo(); 1896 mView->newSubTodo();
1889 else 1897 else
1890 mView->dialogManager()->showSearchDialog(); 1898 mView->dialogManager()->showSearchDialog();
1891 break; 1899 break;
1892 case Qt::Key_Y : 1900 case Qt::Key_Y :
1893 case Qt::Key_Z : 1901 case Qt::Key_Z :
1894 mView->viewManager()->showWorkWeekView(); 1902 mView->viewManager()->showWorkWeekView();
1895 showSelectedDates = true; 1903 showSelectedDates = true;
1896 break; 1904 break;
1897 case Qt::Key_U : 1905 case Qt::Key_U :
1898 mView->viewManager()->showWeekView(); 1906 mView->viewManager()->showWeekView();
1899 showSelectedDates = true; 1907 showSelectedDates = true;
1900 break; 1908 break;
1901 case Qt::Key_H : 1909 case Qt::Key_H :
1902 keyBindings(); 1910 keyBindings();
1903 break; 1911 break;
1904 case Qt::Key_W: 1912 case Qt::Key_W:
1905 mView->viewManager()->showWhatsNextView(); 1913 mView->viewManager()->showWhatsNextView();
1906 break; 1914 break;
1907 case Qt::Key_L: 1915 case Qt::Key_L:
1908 mView->viewManager()->showListView(); 1916 mView->viewManager()->showListView();
1909 break; 1917 break;
1910 case Qt::Key_N: 1918 case Qt::Key_N:
1911 mView->viewManager()->showNextView(); 1919 mView->viewManager()->showNextView();
1912 break; 1920 break;
1913 case Qt::Key_V: 1921 case Qt::Key_V:
1914 mView->viewManager()->showTodoView(); 1922 mView->viewManager()->showTodoView();
1915 break; 1923 break;
1916 case Qt::Key_C: 1924 case Qt::Key_C:
1917 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1925 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1918 break; 1926 break;
1919 case Qt::Key_P: 1927 case Qt::Key_P:
1920 mView->showDatePicker( ); 1928 mView->showDatePicker( );
1921 break; 1929 break;
1922 case Qt::Key_F: 1930 case Qt::Key_F:
1923 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1931 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1924 mView->editFilters(); 1932 mView->editFilters();
1925 else 1933 else
1926 mView->toggleFilter(); 1934 mView->toggleFilter();
1927 break; 1935 break;
1928 case Qt::Key_X: 1936 case Qt::Key_X:
1929 if ( e->state() == Qt::ControlButton ) 1937 if ( e->state() == Qt::ControlButton )
1930 mView->toggleDateNavigatorWidget(); 1938 mView->toggleDateNavigatorWidget();
1931 else { 1939 else {
1932 mView->viewManager()->showNextXView(); 1940 mView->viewManager()->showNextXView();
1933 showSelectedDates = true; 1941 showSelectedDates = true;
1934 } 1942 }
1935 break; 1943 break;
1936 case Qt::Key_Space: 1944 case Qt::Key_Space:
1937 mView->toggleExpand(); 1945 mView->toggleExpand();
1938 break; 1946 break;
1939 case Qt::Key_A: 1947 case Qt::Key_A:
1940 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 1948 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
1941 mView->showNextAlarms(); 1949 mView->showNextAlarms();
1942 else 1950 else
1943 mView->toggleAllDaySize(); 1951 mView->toggleAllDaySize();
1944 break; 1952 break;
1945 case Qt::Key_T: 1953 case Qt::Key_T:
1946 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1954 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1947 mView->newTodo(); 1955 mView->newTodo();
1948 else { 1956 else {
1949 mView->goToday(); 1957 mView->goToday();
1950 showSelectedDates = true; 1958 showSelectedDates = true;
1951 } 1959 }
1952 break; 1960 break;
1953 case Qt::Key_J: 1961 case Qt::Key_J:
1954 mView->viewManager()->showJournalView(); 1962 mView->viewManager()->showJournalView();
1955 break; 1963 break;
1956 case Qt::Key_B: 1964 case Qt::Key_B:
1957 mView->editIncidenceDescription();; 1965 mView->editIncidenceDescription();;
1958 break; 1966 break;
1959 // case Qt::Key_Return: 1967 // case Qt::Key_Return:
1960 case Qt::Key_E: 1968 case Qt::Key_E:
1961 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1969 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1962 mView->newEvent(); 1970 mView->newEvent();
1963 else 1971 else
1964 mView->editIncidence(); 1972 mView->editIncidence();
1965 break; 1973 break;
1966 case Qt::Key_Plus: 1974 case Qt::Key_Plus:
1967 size = p->mHourSize +2; 1975 size = p->mHourSize +2;
1968 if ( size <= 22 ) 1976 if ( size <= 22 )
1969 configureAgenda( size ); 1977 configureAgenda( size );
1970 break; 1978 break;
1971 case Qt::Key_Minus: 1979 case Qt::Key_Minus:
1972 size = p->mHourSize - 2; 1980 size = p->mHourSize - 2;
1973 if ( size >= 4 ) 1981 if ( size >= 4 )
1974 configureAgenda( size ); 1982 configureAgenda( size );
1975 break; 1983 break;
1976 1984
1977 1985
1978 default: 1986 default:
1979 e->ignore(); 1987 e->ignore();
1980 } 1988 }
1981 if ( pro > 0 ) { 1989 if ( pro > 0 ) {
1982 mView->selectFilter( pro-1 ); 1990 mView->selectFilter( pro-1 );
1983 } 1991 }
1984 if ( showSelectedDates ) { 1992 if ( showSelectedDates ) {
1985 ;// setCaptionToDates(); 1993 ;// setCaptionToDates();
1986 } 1994 }
1987 1995
1988} 1996}
1989void MainWindow::fillFilterMenuTB() 1997void MainWindow::fillFilterMenuTB()
1990{ 1998{
1991 selectFilterMenuTB->clear(); 1999 selectFilterMenuTB->clear();
1992 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2000 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
1993 selectFilterMenuTB->insertSeparator(); 2001 selectFilterMenuTB->insertSeparator();
1994 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2002 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
1995 2003
1996 selectFilterMenuTB->insertSeparator(); 2004 selectFilterMenuTB->insertSeparator();
1997 QPtrList<CalFilter> fili = mView->filters(); 2005 QPtrList<CalFilter> fili = mView->filters();
1998 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2006 CalFilter *curfilter = mView->filterView()->selectedFilter();
1999 CalFilter *filter = fili.first(); 2007 CalFilter *filter = fili.first();
2000 int iii = 2; 2008 int iii = 2;
2001 bool checkitem = mView->filterView()->filtersEnabled(); 2009 bool checkitem = mView->filterView()->filtersEnabled();
2002 while(filter) { 2010 while(filter) {
2003 selectFilterMenuTB->insertItem( filter->name(), iii ); 2011 selectFilterMenuTB->insertItem( filter->name(), iii );
2004 if ( filter == curfilter) 2012 if ( filter == curfilter)
2005 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2013 selectFilterMenuTB->setItemChecked( iii, checkitem );
2006 filter = fili.next(); 2014 filter = fili.next();
2007 ++iii; 2015 ++iii;
2008 } 2016 }
2009 if ( !checkitem ) 2017 if ( !checkitem )
2010 selectFilterMenuTB->setItemChecked( 1, true ); 2018 selectFilterMenuTB->setItemChecked( 1, true );
2011 2019
2012 int x = 0; 2020 int x = 0;
2013 int y = iconToolBar->height(); 2021 int y = iconToolBar->height();
2014 int dX = 0; 2022 int dX = 0;
2015 int dY = 0; 2023 int dY = 0;
2016 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2024 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2017 if ( iconToolBar->y() > height()/2 ) { 2025 if ( iconToolBar->y() > height()/2 ) {
2018 dY = selectFilterMenuTB->sizeHint().height()+8; 2026 dY = selectFilterMenuTB->sizeHint().height()+8;
2019 y = 0; 2027 y = 0;
2020 } 2028 }
2021 } else { 2029 } else {
2022 if ( iconToolBar->x() > width()/2 ) { // right side 2030 if ( iconToolBar->x() > width()/2 ) { // right side
2023 x=0; 2031 x=0;
2024 dX= selectFilterMenuTB->sizeHint().width()+8; 2032 dX= selectFilterMenuTB->sizeHint().width()+8;
2025 y = 0; 2033 y = 0;
2026 } else { 2034 } else {
2027 x= iconToolBar->width(); 2035 x= iconToolBar->width();
2028 y = 0; 2036 y = 0;
2029 } 2037 }
2030 } 2038 }
2031 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2039 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2032 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2040 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2033} 2041}
2034void MainWindow::fillFilterMenu() 2042void MainWindow::fillFilterMenu()
2035{ 2043{
2036 selectFilterMenu->clear(); 2044 selectFilterMenu->clear();
2037 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2045 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2038 selectFilterMenu->insertSeparator(); 2046 selectFilterMenu->insertSeparator();
2039 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2047 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2040 2048
2041 selectFilterMenu->insertSeparator(); 2049 selectFilterMenu->insertSeparator();
2042 QPtrList<CalFilter> fili = mView->filters(); 2050 QPtrList<CalFilter> fili = mView->filters();
2043 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2051 CalFilter *curfilter = mView->filterView()->selectedFilter();
2044 CalFilter *filter = fili.first(); 2052 CalFilter *filter = fili.first();
2045 int iii = 2; 2053 int iii = 2;
2046 bool checkitem = mView->filterView()->filtersEnabled(); 2054 bool checkitem = mView->filterView()->filtersEnabled();
2047 while(filter) { 2055 while(filter) {
2048 selectFilterMenu->insertItem( filter->name(), iii ); 2056 selectFilterMenu->insertItem( filter->name(), iii );
2049 if ( filter == curfilter) 2057 if ( filter == curfilter)
2050 selectFilterMenu->setItemChecked( iii, checkitem ); 2058 selectFilterMenu->setItemChecked( iii, checkitem );
2051 filter = fili.next(); 2059 filter = fili.next();
2052 ++iii; 2060 ++iii;
2053 } 2061 }
2054 if ( !checkitem ) 2062 if ( !checkitem )
2055 selectFilterMenu->setItemChecked( 1, true ); 2063 selectFilterMenu->setItemChecked( 1, true );
2056} 2064}
2057void MainWindow::fillFilterMenuPopup() 2065void MainWindow::fillFilterMenuPopup()
2058{ 2066{
2059 filterPopupMenu->clear(); 2067 filterPopupMenu->clear();
2060 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2068 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2061 2069
2062 filterPopupMenu->insertSeparator(); 2070 filterPopupMenu->insertSeparator();
2063 QPtrList<CalFilter> fili = mView->filters(); 2071 QPtrList<CalFilter> fili = mView->filters();
2064 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2072 CalFilter *curfilter = mView->filterView()->selectedFilter();
2065 CalFilter *filter = fili.first(); 2073 CalFilter *filter = fili.first();
2066 int iii = 1; 2074 int iii = 1;
2067 bool checkitem = mView->filterView()->filtersEnabled(); 2075 bool checkitem = mView->filterView()->filtersEnabled();
2068 while(filter) { 2076 while(filter) {
2069 filterPopupMenu->insertItem( filter->name(), iii ); 2077 filterPopupMenu->insertItem( filter->name(), iii );
2070 if ( filter == curfilter) 2078 if ( filter == curfilter)
2071 filterPopupMenu->setItemChecked( iii, checkitem ); 2079 filterPopupMenu->setItemChecked( iii, checkitem );
2072 filter = fili.next(); 2080 filter = fili.next();
2073 ++iii; 2081 ++iii;
2074 } 2082 }
2075 if ( !checkitem ) 2083 if ( !checkitem )
2076 filterPopupMenu->setItemChecked( 0, true ); 2084 filterPopupMenu->setItemChecked( 0, true );
2077} 2085}
2078void MainWindow::selectFilter( int fil ) 2086void MainWindow::selectFilter( int fil )
2079{ 2087{
2080 2088
2081 if ( fil == 0 ) { 2089 if ( fil == 0 ) {
2082 mView->editFilters( ); 2090 mView->editFilters( );
2083 } else if ( fil == 1 ){ 2091 } else if ( fil == 1 ){
2084 if ( mView->filterView()->filtersEnabled() ) 2092 if ( mView->filterView()->filtersEnabled() )
2085 mView->toggleFilerEnabled( ); 2093 mView->toggleFilerEnabled( );
2086 } else { 2094 } else {
2087 if ( !mView->filterView()->filtersEnabled() ) { 2095 if ( !mView->filterView()->filtersEnabled() ) {
2088 mView->filterView()->blockSignals( true ); 2096 mView->filterView()->blockSignals( true );
2089 mView->toggleFilerEnabled( ); 2097 mView->toggleFilerEnabled( );
2090 mView->filterView()->blockSignals( false ); 2098 mView->filterView()->blockSignals( false );
2091 } 2099 }
2092 mView->selectFilter( fil-2 ); 2100 mView->selectFilter( fil-2 );
2093 } 2101 }
2094} 2102}
2095void MainWindow::updateFilterToolbar() 2103void MainWindow::updateFilterToolbar()
2096{ 2104{
2097 if ( filterMenubar ) { 2105 if ( filterMenubar ) {
2098 if ( !mView->filterView()->filtersEnabled() ) { 2106 if ( !mView->filterView()->filtersEnabled() ) {
2099 filterMenubar->changeItem( 0, i18n("No Filter") ); 2107 filterMenubar->changeItem( 0, i18n("No Filter") );
2100 } else { 2108 } else {
2101 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2109 CalFilter *curfilter = mView->filterView()->selectedFilter();
2102 if ( curfilter ) { 2110 if ( curfilter ) {
2103 filterMenubar->changeItem( 0, curfilter->name() ); 2111 filterMenubar->changeItem( 0, curfilter->name() );
2104 } 2112 }
2105 } 2113 }
2106 } 2114 }
2107} 2115}
2108void MainWindow::selectFilterPopup( int fil ) 2116void MainWindow::selectFilterPopup( int fil )
2109{ 2117{
2110 selectFilter( fil + 1 ); 2118 selectFilter( fil + 1 );
2111 2119
2112} 2120}
2113void MainWindow::configureToolBar( int item ) 2121void MainWindow::configureToolBar( int item )
2114{ 2122{
2115 2123
2116 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2124 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2117 KOPrefs *p = KOPrefs::instance(); 2125 KOPrefs *p = KOPrefs::instance();
2118 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2126 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2119 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2127 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2120 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2128 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2121 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2129 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2122 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2130 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2123 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2131 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2124 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2132 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2125 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2133 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2126 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2134 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2127 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2135 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2128 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2136 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2129 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2137 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2130 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2138 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2131 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2139 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2132 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2140 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2133 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2141 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2134 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2142 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2135 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2143 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2136 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2144 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2137 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2145 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2138 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2146 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2139 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2147 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2140 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2148 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2141 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2149 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2142 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2150 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2143 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2151 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2144 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2152 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2145 // initActions(); 2153 // initActions();
2146} 2154}
2147void MainWindow::setCaption ( const QString & c ) 2155void MainWindow::setCaption ( const QString & c )
2148{ 2156{
2149 QString cap = c; 2157 QString cap = c;
2150 cap.replace( QRegExp("\n"), " " ); 2158 cap.replace( QRegExp("\n"), " " );
2151 cap = cap.stripWhiteSpace(); 2159 cap = cap.stripWhiteSpace();
2152 if ( cap.isEmpty() ) 2160 if ( cap.isEmpty() )
2153 cap = "KO/Pi"; 2161 cap = "KO/Pi";
2154 QWidget::setCaption( cap ); 2162 QWidget::setCaption( cap );
2155} 2163}
2156void MainWindow::setCaptionToDates() 2164void MainWindow::setCaptionToDates()
2157{ 2165{
2158 QString selDates; 2166 QString selDates;
2159 QDate date = mView->startDate(); 2167 QDate date = mView->startDate();
2160 if ( ! date.isValid() ) { 2168 if ( ! date.isValid() ) {
2161 setCaption(""); 2169 setCaption("");
2162 return; 2170 return;
2163 } 2171 }
2164 selDates = KGlobal::locale()->formatDate( date, true); 2172 selDates = KGlobal::locale()->formatDate( date, true);
2165 if (mView->startDate() < mView->endDate() ) 2173 if (mView->startDate() < mView->endDate() )
2166 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2174 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2167 else { 2175 else {
2168 QString addString; 2176 QString addString;
2169 if ( date == QDateTime::currentDateTime().date() ) 2177 if ( date == QDateTime::currentDateTime().date() )
2170 addString = i18n("Today"); 2178 addString = i18n("Today");
2171 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2179 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 3151f50..f2a6c60 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,174 +1,175 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include "simplealarmclient.h" 13#include "simplealarmclient.h"
14#include <ksyncmanager.h> 14#include <ksyncmanager.h>
15#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
16#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
17#endif 17#endif
18class QAction; 18class QAction;
19class CalendarView; 19class CalendarView;
20class KSyncProfile; 20class KSyncProfile;
21#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
22 22
23#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
24#define QPEMenuBar QMenuBar 24#define QPEMenuBar QMenuBar
25#endif 25#endif
26class QPEToolBar; 26class QPEToolBar;
27class QPEMenuBar; 27class QPEMenuBar;
28 28
29 29
30namespace KCal { 30namespace KCal {
31class CalendarLocal; 31class CalendarLocal;
32} 32}
33 33
34class KOMenuBar : public QMenuBar 34class KOMenuBar : public QMenuBar
35{ 35{
36 public: 36 public:
37 KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} 37 KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;}
38 QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} 38 QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );}
39}; 39};
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43class MainWindow : public QMainWindow 43class MainWindow : public QMainWindow
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 public: 46 public:
47 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); 47 MainWindow( QWidget *parent = 0, const char *name = 0, QString command = "");
48 ~MainWindow(); 48 ~MainWindow();
49 bool beamReceiveEnabled(); 49 bool beamReceiveEnabled();
50 static QString defaultFileName(); 50 static QString defaultFileName();
51 static QString syncFileName(); 51 static QString syncFileName();
52 static QString resourcePath(); 52 static QString resourcePath();
53 public slots: 53 public slots:
54 void setCaption ( const QString & ); 54 void setCaption ( const QString & );
55 void updateWeekNum(const KCal::DateList &); 55 void updateWeekNum(const KCal::DateList &);
56 void updateWeek(QDate); 56 void updateWeek(QDate);
57 void updateFilterToolbar(); 57 void updateFilterToolbar();
58 virtual void showMaximized (); 58 virtual void showMaximized ();
59 void configureAgenda( int ); 59 void configureAgenda( int );
60 void recieve( const QCString& msg, const QByteArray& data ); 60 void recieve( const QCString& msg, const QByteArray& data );
61 protected slots: 61 protected slots:
62 void setCaptionToDates(); 62 void setCaptionToDates();
63 void weekAction(); 63 void weekAction();
64 void about(); 64 void about();
65 void licence(); 65 void licence();
66 void faq(); 66 void faq();
67 void usertrans(); 67 void usertrans();
68 void features(); 68 void features();
69 void synchowto(); 69 void synchowto();
70 void storagehowto(); 70 void storagehowto();
71 void timetrackinghowto();
71 void kdesynchowto(); 72 void kdesynchowto();
72 void multisynchowto(); 73 void multisynchowto();
73 void whatsNew(); 74 void whatsNew();
74 void keyBindings(); 75 void keyBindings();
75 void aboutAutoSaving();; 76 void aboutAutoSaving();;
76 void aboutKnownBugs(); 77 void aboutKnownBugs();
77 78
78 void processIncidenceSelection( Incidence * ); 79 void processIncidenceSelection( Incidence * );
79 80
80 void importQtopia(); 81 void importQtopia();
81 void importBday(); 82 void importBday();
82 void importOL(); 83 void importOL();
83 void importIcal(); 84 void importIcal();
84 void importFile( QString, bool ); 85 void importFile( QString, bool );
85 void quickImportIcal(); 86 void quickImportIcal();
86 87
87 void slotModifiedChanged( bool ); 88 void slotModifiedChanged( bool );
88 89
89 void save(); 90 void save();
90 void saveStopTimer(); 91 void saveStopTimer();
91 void configureToolBar( int ); 92 void configureToolBar( int );
92 void printSel(); 93 void printSel();
93 void printCal(); 94 void printCal();
94 void saveCalendar(); 95 void saveCalendar();
95 void loadCalendar(); 96 void loadCalendar();
96 void exportVCalendar(); 97 void exportVCalendar();
97 void fillFilterMenu(); 98 void fillFilterMenu();
98 void fillFilterMenuTB(); 99 void fillFilterMenuTB();
99 void selectFilter( int ); 100 void selectFilter( int );
100 void fillFilterMenuPopup(); 101 void fillFilterMenuPopup();
101 void selectFilterPopup( int ); 102 void selectFilterPopup( int );
102 void exportToPhone( int ); 103 void exportToPhone( int );
103 void toggleBeamReceive(); 104 void toggleBeamReceive();
104 void disableBR(bool); 105 void disableBR(bool);
105 signals: 106 signals:
106 void selectWeek ( int ); 107 void selectWeek ( int );
107 private slots: 108 private slots:
108 void showConfigureAgenda(); 109 void showConfigureAgenda();
109 void getFile( bool ); 110 void getFile( bool );
110 void syncFileRequest(); 111 void syncFileRequest();
111 112
112 protected: 113 protected:
113 void hideEvent ( QHideEvent * ); 114 void hideEvent ( QHideEvent * );
114 QString sentSyncFile(); 115 QString sentSyncFile();
115 void displayText( QString, QString); 116 void displayText( QString, QString);
116 void enableIncidenceActions( bool ); 117 void enableIncidenceActions( bool );
117 118
118 private: 119 private:
119 bool mBRdisabled; 120 bool mBRdisabled;
120#ifndef DESKTOP_VERSION 121#ifndef DESKTOP_VERSION
121 QCopChannel* infrared; 122 QCopChannel* infrared;
122#endif 123#endif
123 QAction* brAction; 124 QAction* brAction;
124 KSyncManager* mSyncManager; 125 KSyncManager* mSyncManager;
125 bool mClosed; 126 bool mClosed;
126 void saveOnClose(); 127 void saveOnClose();
127 bool mFlagKeyPressed; 128 bool mFlagKeyPressed;
128 bool mBlockAtStartup; 129 bool mBlockAtStartup;
129 QPEToolBar *iconToolBar; 130 QPEToolBar *iconToolBar;
130 QPEToolBar *viewToolBar; 131 QPEToolBar *viewToolBar;
131 QPEToolBar *navigatorToolBar; 132 QPEToolBar *navigatorToolBar;
132 QPEToolBar *filterToolBar; 133 QPEToolBar *filterToolBar;
133 QPEMenuBar *filterMenubar; 134 QPEMenuBar *filterMenubar;
134 QPopupMenu * filterPopupMenu; 135 QPopupMenu * filterPopupMenu;
135 void initActions(); 136 void initActions();
136 void setDefaultPreferences(); 137 void setDefaultPreferences();
137 void resizeEvent( QResizeEvent* e); 138 void resizeEvent( QResizeEvent* e);
138 void keyPressEvent ( QKeyEvent * ) ; 139 void keyPressEvent ( QKeyEvent * ) ;
139 void keyReleaseEvent ( QKeyEvent * ) ; 140 void keyReleaseEvent ( QKeyEvent * ) ;
140 QPopupMenu *configureToolBarMenu; 141 QPopupMenu *configureToolBarMenu;
141 QPopupMenu *selectFilterMenu; 142 QPopupMenu *selectFilterMenu;
142 QPopupMenu *selectFilterMenuTB; 143 QPopupMenu *selectFilterMenuTB;
143 QPopupMenu *configureAgendaMenu, *syncMenu; 144 QPopupMenu *configureAgendaMenu, *syncMenu;
144 CalendarLocal *mCalendar; 145 CalendarLocal *mCalendar;
145 CalendarView *mView; 146 CalendarView *mView;
146 QAction *mNewSubTodoAction; 147 QAction *mNewSubTodoAction;
147 QAction *mWeekAction; 148 QAction *mWeekAction;
148 QFont mWeekFont; 149 QFont mWeekFont;
149 QPixmap mWeekPixmap; 150 QPixmap mWeekPixmap;
150 QColor mWeekBgColor; 151 QColor mWeekBgColor;
151 152
152 QAction *mShowAction; 153 QAction *mShowAction;
153 QAction *mEditAction; 154 QAction *mEditAction;
154 QAction *mDeleteAction; 155 QAction *mDeleteAction;
155 QAction *mCloneAction; 156 QAction *mCloneAction;
156 QAction *mMoveAction; 157 QAction *mMoveAction;
157 QAction *mBeamAction; 158 QAction *mBeamAction;
158 QAction *mCancelAction; 159 QAction *mCancelAction;
159 160
160 QAction *mToggleNav; 161 QAction *mToggleNav;
161 QAction *mToggleFilter; 162 QAction *mToggleFilter;
162 QAction *mToggleAllday; 163 QAction *mToggleAllday;
163 QAction *actionFilterMenuTB; 164 QAction *actionFilterMenuTB;
164 165
165 void closeEvent( QCloseEvent* ce ); 166 void closeEvent( QCloseEvent* ce );
166 SimpleAlarmClient mAlarmClient; 167 SimpleAlarmClient mAlarmClient;
167 QTimer mSaveTimer; 168 QTimer mSaveTimer;
168 //bool mBlockSaveFlag; 169 //bool mBlockSaveFlag;
169 bool mCalendarModifiedFlag; 170 bool mCalendarModifiedFlag;
170 QPixmap loadPixmap( QString ); 171 QPixmap loadPixmap( QString );
171}; 172};
172 173
173 174
174#endif 175#endif