-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 1776dcc..883a9d1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -527,223 +527,220 @@ bool MainWindow::askForQuitOnSaveError() | |||
527 | i18n("Error saving data") + "!\n" + | 527 | i18n("Error saving data") + "!\n" + |
528 | i18n("You can save all data\nto another file via\nFile->Export->Export All Data") + "!\n" + | 528 | i18n("You can save all data\nto another file via\nFile->Export->Export All Data") + "!\n" + |
529 | i18n("Do you really want\nto close KO/Pi?"), | 529 | i18n("Do you really want\nto close KO/Pi?"), |
530 | i18n(" Yes, close "), i18n("No"), | 530 | i18n(" Yes, close "), i18n("No"), |
531 | 0, 1 ) ) { | 531 | 0, 1 ) ) { |
532 | case 0: | 532 | case 0: |
533 | retval = true; | 533 | retval = true; |
534 | break; | 534 | break; |
535 | default: | 535 | default: |
536 | break; | 536 | break; |
537 | } | 537 | } |
538 | return retval; | 538 | return retval; |
539 | } | 539 | } |
540 | 540 | ||
541 | void MainWindow::closeEvent( QCloseEvent* ce ) | 541 | void MainWindow::closeEvent( QCloseEvent* ce ) |
542 | { | 542 | { |
543 | 543 | ||
544 | 544 | ||
545 | 545 | ||
546 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 546 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
547 | saveOnClose(); | 547 | saveOnClose(); |
548 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { | 548 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { |
549 | ce->ignore(); | 549 | ce->ignore(); |
550 | return; | 550 | return; |
551 | } | 551 | } |
552 | mClosed = true; | 552 | mClosed = true; |
553 | ce->accept(); | 553 | ce->accept(); |
554 | return; | 554 | return; |
555 | 555 | ||
556 | } | 556 | } |
557 | 557 | ||
558 | switch( QMessageBox::information( this, "KO/Pi", | 558 | switch( QMessageBox::information( this, "KO/Pi", |
559 | i18n("Do you really want\nto close KO/Pi?"), | 559 | i18n("Do you really want\nto close KO/Pi?"), |
560 | i18n("Close"), i18n("No"), | 560 | i18n("Close"), i18n("No"), |
561 | 0, 0 ) ) { | 561 | 0, 0 ) ) { |
562 | case 0: | 562 | case 0: |
563 | saveOnClose(); | 563 | saveOnClose(); |
564 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { | 564 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { |
565 | ce->ignore(); | 565 | ce->ignore(); |
566 | return; | 566 | return; |
567 | } | 567 | } |
568 | mClosed = true; | 568 | mClosed = true; |
569 | ce->accept(); | 569 | ce->accept(); |
570 | break; | 570 | break; |
571 | case 1: | 571 | case 1: |
572 | ce->ignore(); | 572 | ce->ignore(); |
573 | break; | 573 | break; |
574 | case 2: | 574 | case 2: |
575 | 575 | ||
576 | default: | 576 | default: |
577 | break; | 577 | break; |
578 | } | 578 | } |
579 | 579 | ||
580 | 580 | ||
581 | } | 581 | } |
582 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) | 582 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) |
583 | { | 583 | { |
584 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | 584 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); |
585 | mCStringMess = cmsg; | 585 | mCStringMess = cmsg; |
586 | mByteData = data; | 586 | mByteData = data; |
587 | } | 587 | } |
588 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 588 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
589 | { | 589 | { |
590 | QDataStream stream( data, IO_ReadOnly ); | 590 | QDataStream stream( data, IO_ReadOnly ); |
591 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 591 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
592 | //QString datamess; | 592 | //QString datamess; |
593 | //qDebug("message "); | 593 | //qDebug("message "); |
594 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 594 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
595 | 595 | ||
596 | if ( cmsg == "setDocument(QString)" ) { | 596 | if ( cmsg == "setDocument(QString)" ) { |
597 | QDataStream stream( data, IO_ReadOnly ); | 597 | QDataStream stream( data, IO_ReadOnly ); |
598 | QString fileName; | 598 | QString fileName; |
599 | stream >> fileName; | 599 | stream >> fileName; |
600 | //qDebug("filename %s ", fileName.latin1()); | 600 | //qDebug("filename %s ", fileName.latin1()); |
601 | showMaximized(); | 601 | showMaximized(); |
602 | raise(); | 602 | raise(); |
603 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 603 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
604 | mSyncManager->slotSyncMenu( 1002 ); | 604 | mSyncManager->slotSyncMenu( 1002 ); |
605 | return; | 605 | return; |
606 | } | 606 | } |
607 | 607 | ||
608 | if ( cmsg == "-writeFile" ) { | 608 | if ( cmsg == "-writeFile" ) { |
609 | // I made from the "-writeFile" an "-writeAlarm" | 609 | // I made from the "-writeFile" an "-writeAlarm" |
610 | mView->viewManager()->showWhatsNextView(); | 610 | mView->viewManager()->showWhatsNextView(); |
611 | mCalendar->checkAlarmForIncidence( 0, true); | 611 | mCalendar->checkAlarmForIncidence( 0, true); |
612 | showMaximized(); | 612 | showMaximized(); |
613 | raise(); | 613 | raise(); |
614 | return; | 614 | return; |
615 | 615 | ||
616 | } | 616 | } |
617 | if ( cmsg == "-writeFileSilent" ) { | 617 | if ( cmsg == "-writeFileSilent" ) { |
618 | // I made from the "-writeFile" an "-writeAlarm" | 618 | // I made from the "-writeFile" an "-writeAlarm" |
619 | // mView->viewManager()->showWhatsNextView(); | 619 | // mView->viewManager()->showWhatsNextView(); |
620 | mCalendar->checkAlarmForIncidence( 0, true); | 620 | mCalendar->checkAlarmForIncidence( 0, true); |
621 | //showMaximized(); | 621 | //showMaximized(); |
622 | //raise(); | 622 | //raise(); |
623 | hide(); | 623 | //hide(); |
624 | return; | 624 | return; |
625 | } | 625 | } |
626 | if ( cmsg == "-newCountdown" ) { | 626 | if ( cmsg == "-newCountdown" ) { |
627 | qDebug("newCountdown "); | 627 | qDebug("newCountdown "); |
628 | 628 | ||
629 | } | 629 | } |
630 | QString msg ; | 630 | QString msg ; |
631 | QString allmsg = cmsg; | 631 | QString allmsg = cmsg; |
632 | while ( allmsg.length() > 0 ) { | 632 | while ( allmsg.length() > 0 ) { |
633 | int nextC = allmsg.find( "-", 1 ); | 633 | int nextC = allmsg.find( "-", 1 ); |
634 | if ( nextC == -1 ) { | 634 | if ( nextC == -1 ) { |
635 | msg = allmsg; | 635 | msg = allmsg; |
636 | allmsg = ""; | 636 | allmsg = ""; |
637 | } else{ | 637 | } else{ |
638 | msg = allmsg.left( nextC ); | 638 | msg = allmsg.left( nextC ); |
639 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 639 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
640 | } | 640 | } |
641 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 641 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
642 | if ( msg == "-newEvent" ) { | 642 | if ( msg == "-newEvent" ) { |
643 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); | 643 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
644 | } | 644 | } |
645 | if ( msg == "-newTodo" ) { | 645 | if ( msg == "-newTodo" ) { |
646 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); | 646 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
647 | } | 647 | } |
648 | if ( msg == "-showWN" ) { | 648 | if ( msg == "-showWN" ) { |
649 | mView->viewManager()->showWhatsNextView(); | 649 | mView->viewManager()->showWhatsNextView(); |
650 | } | 650 | } |
651 | if ( msg == "-showTodo" ) { | ||
652 | mView->viewManager()->showTodoView(); | ||
653 | } | ||
654 | if ( msg == "-showList" ) { | 651 | if ( msg == "-showList" ) { |
655 | mView->viewManager()->showListView(); | 652 | mView->viewManager()->showListView(); |
656 | } | 653 | } |
657 | else if ( msg == "-showDay" ) { | 654 | else if ( msg == "-showDay" ) { |
658 | mView->viewManager()->showDayView(); | 655 | mView->viewManager()->showDayView(); |
659 | } | 656 | } |
660 | else if ( msg == "-showWWeek" ) { | 657 | else if ( msg == "-showWWeek" ) { |
661 | mView->viewManager()->showWorkWeekView(); | 658 | mView->viewManager()->showWorkWeekView(); |
662 | } | 659 | } |
663 | else if ( msg == "-ringSync" ) { | 660 | else if ( msg == "-ringSync" ) { |
664 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 661 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
665 | } | 662 | } |
666 | else if ( msg == "-showWeek" ) { | 663 | else if ( msg == "-showWeek" ) { |
667 | mView->viewManager()->showWeekView(); | 664 | mView->viewManager()->showWeekView(); |
668 | } | 665 | } |
669 | else if ( msg == "-showTodo" ) { | 666 | else if ( msg == "-showTodo" ) { |
670 | mView->viewManager()->showTodoView(); | 667 | mView->viewManager()->showTodoView(); |
671 | } | 668 | } |
672 | else if ( msg == "-showJournal" ) { | 669 | else if ( msg == "-showJournal" ) { |
673 | mView->dateNavigator()->selectDates( 1 ); | 670 | mView->dateNavigator()->selectDates( 1 ); |
674 | mView->dateNavigator()->selectToday(); | 671 | mView->dateNavigator()->selectToday(); |
675 | mView->viewManager()->showJournalView(); | 672 | mView->viewManager()->showJournalView(); |
676 | } | 673 | } |
677 | else if ( msg == "-showKO" ) { | 674 | else if ( msg == "-showKO" ) { |
678 | mView->viewManager()->showNextXView(); | 675 | mView->viewManager()->showNextXView(); |
679 | } | 676 | } |
680 | else if ( msg == "-showWNext" ) { | 677 | else if ( msg == "-showWNext" ) { |
681 | mView->viewManager()->showWhatsNextView(); | 678 | mView->viewManager()->showWhatsNextView(); |
682 | } | 679 | } |
683 | else if ( msg == "nextView()" ) { | 680 | else if ( msg == "nextView()" ) { |
684 | mView->viewManager()->showNextView(); | 681 | mView->viewManager()->showNextView(); |
685 | } | 682 | } |
686 | else if ( msg == "-showNextXView" ) { | 683 | else if ( msg == "-showNextXView" ) { |
687 | mView->viewManager()->showNextXView(); | 684 | mView->viewManager()->showNextXView(); |
688 | } | 685 | } |
689 | 686 | ||
690 | 687 | ||
691 | } | 688 | } |
692 | 689 | ||
693 | showMaximized(); | 690 | showMaximized(); |
694 | raise(); | 691 | raise(); |
695 | } | 692 | } |
696 | void MainWindow::startMultiSync() | 693 | void MainWindow::startMultiSync() |
697 | { | 694 | { |
698 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 695 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
699 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 696 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
700 | question, | 697 | question, |
701 | i18n("Yes"), i18n("No"), | 698 | i18n("Yes"), i18n("No"), |
702 | 0, 0 ) != 0 ) { | 699 | 0, 0 ) != 0 ) { |
703 | setCaption(i18n("Aborted! Nothing synced!")); | 700 | setCaption(i18n("Aborted! Nothing synced!")); |
704 | return; | 701 | return; |
705 | } | 702 | } |
706 | mSyncManager->multiSync( false ); | 703 | mSyncManager->multiSync( false ); |
707 | #ifndef DESKTOP_VERSION | 704 | #ifndef DESKTOP_VERSION |
708 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 705 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
709 | #endif | 706 | #endif |
710 | } | 707 | } |
711 | QPixmap MainWindow::loadPixmap( QString name ) | 708 | QPixmap MainWindow::loadPixmap( QString name ) |
712 | { | 709 | { |
713 | return SmallIcon( name ); | 710 | return SmallIcon( name ); |
714 | 711 | ||
715 | } | 712 | } |
716 | void MainWindow::setUsesBigPixmaps ( bool b ) | 713 | void MainWindow::setUsesBigPixmaps ( bool b ) |
717 | { | 714 | { |
718 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 715 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
719 | if ( b ) | 716 | if ( b ) |
720 | qDebug("KO: BigPixmaps are not supported "); | 717 | qDebug("KO: BigPixmaps are not supported "); |
721 | } | 718 | } |
722 | void MainWindow::initActions() | 719 | void MainWindow::initActions() |
723 | { | 720 | { |
724 | //KOPrefs::instance()->mShowFullMenu | 721 | //KOPrefs::instance()->mShowFullMenu |
725 | iconToolBar->clear(); | 722 | iconToolBar->clear(); |
726 | KOPrefs *p = KOPrefs::instance(); | 723 | KOPrefs *p = KOPrefs::instance(); |
727 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 724 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
728 | 725 | ||
729 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 726 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
730 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 727 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
731 | mCurrentItemMenu = new QPopupMenu ( this ); | 728 | mCurrentItemMenu = new QPopupMenu ( this ); |
732 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | 729 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); |
733 | QPopupMenu *importMenu = new QPopupMenu( this ); | 730 | QPopupMenu *importMenu = new QPopupMenu( this ); |
734 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 731 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
735 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 732 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
736 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 733 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
737 | selectFilterMenu = new QPopupMenu( this ); | 734 | selectFilterMenu = new QPopupMenu( this ); |
738 | selectFilterMenu->setCheckable( true ); | 735 | selectFilterMenu->setCheckable( true ); |
739 | syncMenu = new QPopupMenu( this ); | 736 | syncMenu = new QPopupMenu( this ); |
740 | configureAgendaMenu = new QPopupMenu( this ); | 737 | configureAgendaMenu = new QPopupMenu( this ); |
741 | configureToolBarMenu = new QPopupMenu( this ); | 738 | configureToolBarMenu = new QPopupMenu( this ); |
742 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 739 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
743 | QIconSet icon; | 740 | QIconSet icon; |
744 | int pixWid = 22, pixHei = 22; | 741 | int pixWid = 22, pixHei = 22; |
745 | QString pathString = ""; | 742 | QString pathString = ""; |
746 | if ( !p->mToolBarMiniIcons ) { | 743 | if ( !p->mToolBarMiniIcons ) { |
747 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 744 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
748 | pathString += "icons16/"; | 745 | pathString += "icons16/"; |
749 | pixWid = 18; pixHei = 16; | 746 | pixWid = 18; pixHei = 16; |