summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-09-19 02:18:36 (UTC)
committer zautrix <zautrix>2005-09-19 02:18:36 (UTC)
commitf4b88b634935aac5a1212e86d8eb5d90c1eff301 (patch) (unidiff)
tree67394dc47bfd03e91444ec6cf41835b28ae8192c
parentd73247ed44cab687a0d94a96ea7b3cf604b80ba0 (diff)
downloadkdepimpi-f4b88b634935aac5a1212e86d8eb5d90c1eff301.zip
kdepimpi-f4b88b634935aac5a1212e86d8eb5d90c1eff301.tar.gz
kdepimpi-f4b88b634935aac5a1212e86d8eb5d90c1eff301.tar.bz2
wn
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp5
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
@@ -495,287 +495,284 @@ void MainWindow::toggleBeamReceive()
495{ 495{
496 if ( mBRdisabled ) 496 if ( mBRdisabled )
497 return; 497 return;
498#ifndef DESKTOP_VERSION 498#ifndef DESKTOP_VERSION
499 if ( infrared ) { 499 if ( infrared ) {
500 qDebug("KO: Disable BeamReceive "); 500 qDebug("KO: Disable BeamReceive ");
501 delete infrared; 501 delete infrared;
502 infrared = 0; 502 infrared = 0;
503 brAction->setOn(false); 503 brAction->setOn(false);
504 return; 504 return;
505 } 505 }
506 qDebug("KO: Enable BeamReceive "); 506 qDebug("KO: Enable BeamReceive ");
507 brAction->setOn(true); 507 brAction->setOn(true);
508 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 508 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
509 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 509 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
510#endif 510#endif
511} 511}
512void MainWindow::showMaximized () 512void MainWindow::showMaximized ()
513{ 513{
514#ifndef DESKTOP_VERSION 514#ifndef DESKTOP_VERSION
515 if ( ! globalFlagBlockStartup ) 515 if ( ! globalFlagBlockStartup )
516 if ( mClosed ) 516 if ( mClosed )
517 mView->goToday(); 517 mView->goToday();
518#endif 518#endif
519 QWidget::showMaximized () ; 519 QWidget::showMaximized () ;
520 mClosed = false; 520 mClosed = false;
521} 521}
522 522
523bool MainWindow::askForQuitOnSaveError() 523bool MainWindow::askForQuitOnSaveError()
524{ 524{
525 bool retval = false; 525 bool retval = false;
526 switch( QMessageBox::information( this, "KO/Pi", 526 switch( QMessageBox::information( this, "KO/Pi",
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
541void MainWindow::closeEvent( QCloseEvent* ce ) 541void 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}
582void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) 582void 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}
588void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 588void 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}
696void MainWindow::startMultiSync() 693void 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}
711QPixmap MainWindow::loadPixmap( QString name ) 708QPixmap MainWindow::loadPixmap( QString name )
712{ 709{
713 return SmallIcon( name ); 710 return SmallIcon( name );
714 711
715} 712}
716void MainWindow::setUsesBigPixmaps ( bool b ) 713void 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}
722void MainWindow::initActions() 719void 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;
750 } 747 }
751 } else { 748 } else {
752 pathString += "iconsmini/"; 749 pathString += "iconsmini/";
753 pixWid = 18; pixHei = 16; 750 pixWid = 18; pixHei = 16;
754 } 751 }
755 752
756 if ( KOPrefs::instance()->mShowFullMenu ) { 753 if ( KOPrefs::instance()->mShowFullMenu ) {
757 menuBar1 = new KMenuBar( this );//menuBar(); 754 menuBar1 = new KMenuBar( this );//menuBar();
758 //setMenuBar( menuBar1 ); 755 //setMenuBar( menuBar1 );
759 menuBar1->show(); 756 menuBar1->show();
760 menuBar1->insertItem( i18n("File"), importMenu ); 757 menuBar1->insertItem( i18n("File"), importMenu );
761 menuBar1->insertItem( i18n("View"), viewMenu ); 758 menuBar1->insertItem( i18n("View"), viewMenu );
762 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 759 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
763 menuBar1->insertItem( i18n("Action"), actionMenu ); 760 menuBar1->insertItem( i18n("Action"), actionMenu );
764#ifdef DESKTOP_VERSION 761#ifdef DESKTOP_VERSION
765 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 762 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
766 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 763 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
767#else 764#else
768 menuBar1->insertItem( i18n("Sync"), syncMenu ); 765 menuBar1->insertItem( i18n("Sync"), syncMenu );
769 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 766 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
770#endif 767#endif
771 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 768 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
772 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 769 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
773 menuBar1->insertItem( i18n("Help"), helpMenu ); 770 menuBar1->insertItem( i18n("Help"), helpMenu );
774 } else { 771 } else {
775 menuBar1 = new KMenuBar( iconToolBar ); 772 menuBar1 = new KMenuBar( iconToolBar );
776 QPopupMenu *menuBar = new QPopupMenu( this ); 773 QPopupMenu *menuBar = new QPopupMenu( this );
777 icon = loadPixmap( pathString + "z_menu" ); 774 icon = loadPixmap( pathString + "z_menu" );
778 menuBar1->insertItem( icon.pixmap(), menuBar); 775 menuBar1->insertItem( icon.pixmap(), menuBar);
779 //menuBar1->insertItem( i18n("ME"), menuBar); 776 //menuBar1->insertItem( i18n("ME"), menuBar);
780 menuBar->insertItem( i18n("File"), importMenu ); 777 menuBar->insertItem( i18n("File"), importMenu );
781 menuBar->insertItem( i18n("View"), viewMenu ); 778 menuBar->insertItem( i18n("View"), viewMenu );