-rw-r--r-- | korganizer/mainwindow.cpp | 23 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
2 files changed, 19 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 68233e8..d8373a6 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -544,103 +544,116 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
544 | // mView->viewManager()->showWhatsNextView(); | 544 | // mView->viewManager()->showWhatsNextView(); |
545 | mCalendar->checkAlarmForIncidence( 0, true); | 545 | mCalendar->checkAlarmForIncidence( 0, true); |
546 | //showMaximized(); | 546 | //showMaximized(); |
547 | //raise(); | 547 | //raise(); |
548 | hide(); | 548 | hide(); |
549 | return; | 549 | return; |
550 | } | 550 | } |
551 | if ( cmsg == "-newCountdown" ) { | 551 | if ( cmsg == "-newCountdown" ) { |
552 | qDebug("newCountdown "); | 552 | qDebug("newCountdown "); |
553 | 553 | ||
554 | } | 554 | } |
555 | QString msg ; | 555 | QString msg ; |
556 | QString allmsg = cmsg; | 556 | QString allmsg = cmsg; |
557 | while ( allmsg.length() > 0 ) { | 557 | while ( allmsg.length() > 0 ) { |
558 | int nextC = allmsg.find( "-", 1 ); | 558 | int nextC = allmsg.find( "-", 1 ); |
559 | if ( nextC == -1 ) { | 559 | if ( nextC == -1 ) { |
560 | msg = allmsg; | 560 | msg = allmsg; |
561 | allmsg = ""; | 561 | allmsg = ""; |
562 | } else{ | 562 | } else{ |
563 | msg = allmsg.left( nextC ); | 563 | msg = allmsg.left( nextC ); |
564 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 564 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
565 | } | 565 | } |
566 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 566 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
567 | if ( msg == "-newEvent" ) { | 567 | if ( msg == "-newEvent" ) { |
568 | mView->newEvent(); | 568 | QTimer::singleShot( 0, mView, SLOT ( newEvent())); |
569 | } | 569 | } |
570 | if ( msg == "-newTodo" ) { | 570 | if ( msg == "-newTodo" ) { |
571 | mView->newTodo(); | 571 | QTimer::singleShot( 0, mView, SLOT ( newTodo())); |
572 | |||
573 | } | 572 | } |
574 | if ( msg == "-showWN" ) { | 573 | if ( msg == "-showWN" ) { |
575 | mView->viewManager()->showWhatsNextView(); | 574 | mView->viewManager()->showWhatsNextView(); |
576 | } | 575 | } |
577 | if ( msg == "-showTodo" ) { | 576 | if ( msg == "-showTodo" ) { |
578 | mView->viewManager()->showTodoView(); | 577 | mView->viewManager()->showTodoView(); |
579 | } | 578 | } |
580 | if ( msg == "-showList" ) { | 579 | if ( msg == "-showList" ) { |
581 | mView->viewManager()->showListView(); | 580 | mView->viewManager()->showListView(); |
582 | } | 581 | } |
583 | else if ( msg == "-showDay" ) { | 582 | else if ( msg == "-showDay" ) { |
584 | mView->viewManager()->showDayView(); | 583 | mView->viewManager()->showDayView(); |
585 | } | 584 | } |
586 | else if ( msg == "-showWWeek" ) { | 585 | else if ( msg == "-showWWeek" ) { |
587 | mView->viewManager()->showWorkWeekView(); | 586 | mView->viewManager()->showWorkWeekView(); |
588 | } | 587 | } |
589 | else if ( msg == "-ringSync" ) { | 588 | else if ( msg == "-ringSync" ) { |
590 | mSyncManager->multiSync( false ); | 589 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
591 | } | 590 | } |
592 | else if ( msg == "-showWeek" ) { | 591 | else if ( msg == "-showWeek" ) { |
593 | mView->viewManager()->showWeekView(); | 592 | mView->viewManager()->showWeekView(); |
594 | } | 593 | } |
595 | else if ( msg == "-showTodo" ) { | 594 | else if ( msg == "-showTodo" ) { |
596 | mView->viewManager()->showTodoView(); | 595 | mView->viewManager()->showTodoView(); |
597 | } | 596 | } |
598 | else if ( msg == "-showJournal" ) { | 597 | else if ( msg == "-showJournal" ) { |
599 | mView->dateNavigator()->selectDates( 1 ); | 598 | mView->dateNavigator()->selectDates( 1 ); |
600 | mView->dateNavigator()->selectToday(); | 599 | mView->dateNavigator()->selectToday(); |
601 | mView->viewManager()->showJournalView(); | 600 | mView->viewManager()->showJournalView(); |
602 | } | 601 | } |
603 | else if ( msg == "-showKO" ) { | 602 | else if ( msg == "-showKO" ) { |
604 | mView->viewManager()->showNextXView(); | 603 | mView->viewManager()->showNextXView(); |
605 | } | 604 | } |
606 | else if ( msg == "-showWNext" ) { | 605 | else if ( msg == "-showWNext" ) { |
607 | mView->viewManager()->showWhatsNextView(); | 606 | mView->viewManager()->showWhatsNextView(); |
608 | } | 607 | } |
609 | else if ( msg == "nextView()" ) { | 608 | else if ( msg == "nextView()" ) { |
610 | mView->viewManager()->showNextView(); | 609 | mView->viewManager()->showNextView(); |
611 | } | 610 | } |
612 | else if ( msg == "-showNextXView" ) { | 611 | else if ( msg == "-showNextXView" ) { |
613 | mView->viewManager()->showNextXView(); | 612 | mView->viewManager()->showNextXView(); |
614 | } | 613 | } |
615 | 614 | ||
616 | 615 | ||
617 | } | 616 | } |
618 | 617 | ||
619 | showMaximized(); | 618 | showMaximized(); |
620 | raise(); | 619 | raise(); |
621 | } | 620 | } |
622 | 621 | void MainWindow::startMultiSync() | |
622 | { | ||
623 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | ||
624 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | ||
625 | question, | ||
626 | i18n("Yes"), i18n("No"), | ||
627 | 0, 0 ) != 0 ) { | ||
628 | setCaption(i18n("Aborted! Nothing synced!")); | ||
629 | return; | ||
630 | } | ||
631 | mSyncManager->multiSync( false ); | ||
632 | #ifndef DESKTOP_VERSION | ||
633 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | ||
634 | #endif | ||
635 | } | ||
623 | QPixmap MainWindow::loadPixmap( QString name ) | 636 | QPixmap MainWindow::loadPixmap( QString name ) |
624 | { | 637 | { |
625 | return SmallIcon( name ); | 638 | return SmallIcon( name ); |
626 | 639 | ||
627 | } | 640 | } |
628 | void MainWindow::setUsesBigPixmaps ( bool b ) | 641 | void MainWindow::setUsesBigPixmaps ( bool b ) |
629 | { | 642 | { |
630 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 643 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
631 | if ( b ) | 644 | if ( b ) |
632 | qDebug("KO: BigPixmaps are not supported "); | 645 | qDebug("KO: BigPixmaps are not supported "); |
633 | } | 646 | } |
634 | void MainWindow::initActions() | 647 | void MainWindow::initActions() |
635 | { | 648 | { |
636 | //KOPrefs::instance()->mShowFullMenu | 649 | //KOPrefs::instance()->mShowFullMenu |
637 | iconToolBar->clear(); | 650 | iconToolBar->clear(); |
638 | KOPrefs *p = KOPrefs::instance(); | 651 | KOPrefs *p = KOPrefs::instance(); |
639 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 652 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
640 | 653 | ||
641 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 654 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
642 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 655 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
643 | QPopupMenu *importMenu = new QPopupMenu( this ); | 656 | QPopupMenu *importMenu = new QPopupMenu( this ); |
644 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 657 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
645 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 658 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
646 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 659 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index c9817c3..a4d0523 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -31,48 +31,49 @@ class CalendarLocal; | |||
31 | } | 31 | } |
32 | 32 | ||
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | class MainWindow : public QMainWindow | 35 | class MainWindow : public QMainWindow |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 39 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
40 | ~MainWindow(); | 40 | ~MainWindow(); |
41 | bool beamReceiveEnabled(); | 41 | bool beamReceiveEnabled(); |
42 | static QString defaultFileName(); | 42 | static QString defaultFileName(); |
43 | static QString syncFileName(); | 43 | static QString syncFileName(); |
44 | static QString resourcePath(); | 44 | static QString resourcePath(); |
45 | public slots: | 45 | public slots: |
46 | void setUsesBigPixmaps ( bool ); | 46 | void setUsesBigPixmaps ( bool ); |
47 | void setCaption ( const QString & ); | 47 | void setCaption ( const QString & ); |
48 | void updateWeekNum(const KCal::DateList &); | 48 | void updateWeekNum(const KCal::DateList &); |
49 | void updateWeek(QDate); | 49 | void updateWeek(QDate); |
50 | void updateFilterToolbar(); | 50 | void updateFilterToolbar(); |
51 | virtual void showMaximized (); | 51 | virtual void showMaximized (); |
52 | void configureAgenda( int ); | 52 | void configureAgenda( int ); |
53 | void recieve( const QCString& msg, const QByteArray& data ); | 53 | void recieve( const QCString& msg, const QByteArray& data ); |
54 | protected slots: | 54 | protected slots: |
55 | void startMultiSync(); | ||
55 | void setCaptionToDates(); | 56 | void setCaptionToDates(); |
56 | void weekAction(); | 57 | void weekAction(); |
57 | void about(); | 58 | void about(); |
58 | void licence(); | 59 | void licence(); |
59 | void faq(); | 60 | void faq(); |
60 | void usertrans(); | 61 | void usertrans(); |
61 | void features(); | 62 | void features(); |
62 | void synchowto(); | 63 | void synchowto(); |
63 | void storagehowto(); | 64 | void storagehowto(); |
64 | void timetrackinghowto(); | 65 | void timetrackinghowto(); |
65 | void kdesynchowto(); | 66 | void kdesynchowto(); |
66 | void multisynchowto(); | 67 | void multisynchowto(); |
67 | void whatsNew(); | 68 | void whatsNew(); |
68 | void keyBindings(); | 69 | void keyBindings(); |
69 | void aboutAutoSaving();; | 70 | void aboutAutoSaving();; |
70 | void aboutKnownBugs(); | 71 | void aboutKnownBugs(); |
71 | 72 | ||
72 | void processIncidenceSelection( Incidence * ); | 73 | void processIncidenceSelection( Incidence * ); |
73 | 74 | ||
74 | void importQtopia(); | 75 | void importQtopia(); |
75 | void importBday(); | 76 | void importBday(); |
76 | void importOL(); | 77 | void importOL(); |
77 | void importIcal(); | 78 | void importIcal(); |
78 | void importFile( QString, bool ); | 79 | void importFile( QString, bool ); |