-rw-r--r-- | korganizer/mainwindow.cpp | 6 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7978b46..9e326a1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -475,916 +475,916 @@ void MainWindow::initActions() | |||
475 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 475 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
476 | action->addTo( viewMenu ); | 476 | action->addTo( viewMenu ); |
477 | connect( action, SIGNAL( activated() ), | 477 | connect( action, SIGNAL( activated() ), |
478 | mView, SLOT( showDatePicker() ) ); | 478 | mView, SLOT( showDatePicker() ) ); |
479 | action->addTo( iconToolBar ); | 479 | action->addTo( iconToolBar ); |
480 | viewMenu->insertSeparator(); | 480 | viewMenu->insertSeparator(); |
481 | icon = loadPixmap( pathString + "list" ); | 481 | icon = loadPixmap( pathString + "list" ); |
482 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 482 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
483 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 483 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
484 | showlist_action->addTo( viewMenu ); | 484 | showlist_action->addTo( viewMenu ); |
485 | connect( showlist_action, SIGNAL( activated() ), | 485 | connect( showlist_action, SIGNAL( activated() ), |
486 | mView->viewManager(), SLOT( showListView() ) ); | 486 | mView->viewManager(), SLOT( showListView() ) ); |
487 | 487 | ||
488 | 488 | ||
489 | icon = loadPixmap( pathString + "day" ); | 489 | icon = loadPixmap( pathString + "day" ); |
490 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 490 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
491 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 491 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
492 | day1_action->addTo( viewMenu ); | 492 | day1_action->addTo( viewMenu ); |
493 | // action->addTo( toolBar ); | 493 | // action->addTo( toolBar ); |
494 | connect( day1_action, SIGNAL( activated() ), | 494 | connect( day1_action, SIGNAL( activated() ), |
495 | mView->viewManager(), SLOT( showDayView() ) ); | 495 | mView->viewManager(), SLOT( showDayView() ) ); |
496 | 496 | ||
497 | icon = loadPixmap( pathString + "workweek" ); | 497 | icon = loadPixmap( pathString + "workweek" ); |
498 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 498 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
499 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 499 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
500 | day5_action->addTo( viewMenu ); | 500 | day5_action->addTo( viewMenu ); |
501 | connect( day5_action, SIGNAL( activated() ), | 501 | connect( day5_action, SIGNAL( activated() ), |
502 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 502 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
503 | 503 | ||
504 | icon = loadPixmap( pathString + "week" ); | 504 | icon = loadPixmap( pathString + "week" ); |
505 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 505 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
506 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 506 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
507 | day7_action->addTo( viewMenu ); | 507 | day7_action->addTo( viewMenu ); |
508 | connect( day7_action, SIGNAL( activated() ), | 508 | connect( day7_action, SIGNAL( activated() ), |
509 | mView->viewManager(), SLOT( showWeekView() ) ); | 509 | mView->viewManager(), SLOT( showWeekView() ) ); |
510 | 510 | ||
511 | icon = loadPixmap( pathString + "month" ); | 511 | icon = loadPixmap( pathString + "month" ); |
512 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 512 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
513 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 513 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
514 | month_action->addTo( viewMenu ); | 514 | month_action->addTo( viewMenu ); |
515 | connect( month_action, SIGNAL( activated() ), | 515 | connect( month_action, SIGNAL( activated() ), |
516 | mView->viewManager(), SLOT( showMonthView() ) ); | 516 | mView->viewManager(), SLOT( showMonthView() ) ); |
517 | 517 | ||
518 | icon = loadPixmap( pathString + "todo" ); | 518 | icon = loadPixmap( pathString + "todo" ); |
519 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 519 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
520 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 520 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
521 | todoview_action->addTo( viewMenu ); | 521 | todoview_action->addTo( viewMenu ); |
522 | connect( todoview_action, SIGNAL( activated() ), | 522 | connect( todoview_action, SIGNAL( activated() ), |
523 | mView->viewManager(), SLOT( showTodoView() ) ); | 523 | mView->viewManager(), SLOT( showTodoView() ) ); |
524 | 524 | ||
525 | icon = loadPixmap( pathString + "journal" ); | 525 | icon = loadPixmap( pathString + "journal" ); |
526 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 526 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
527 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 527 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
528 | viewjournal_action->addTo( viewMenu ); | 528 | viewjournal_action->addTo( viewMenu ); |
529 | connect( viewjournal_action, SIGNAL( activated() ), | 529 | connect( viewjournal_action, SIGNAL( activated() ), |
530 | mView->viewManager(), SLOT( showJournalView() ) ); | 530 | mView->viewManager(), SLOT( showJournalView() ) ); |
531 | 531 | ||
532 | icon = loadPixmap( pathString + "xdays" ); | 532 | icon = loadPixmap( pathString + "xdays" ); |
533 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 533 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
534 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 534 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
535 | xdays_action->addTo( viewMenu ); | 535 | xdays_action->addTo( viewMenu ); |
536 | connect( xdays_action, SIGNAL( activated() ), | 536 | connect( xdays_action, SIGNAL( activated() ), |
537 | mView->viewManager(), SLOT( showNextXView() ) ); | 537 | mView->viewManager(), SLOT( showNextXView() ) ); |
538 | 538 | ||
539 | icon = loadPixmap( pathString + "whatsnext" ); | 539 | icon = loadPixmap( pathString + "whatsnext" ); |
540 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 540 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
541 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 541 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
542 | whatsnext_action->addTo( viewMenu ); | 542 | whatsnext_action->addTo( viewMenu ); |
543 | connect( whatsnext_action, SIGNAL( activated() ), | 543 | connect( whatsnext_action, SIGNAL( activated() ), |
544 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 544 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
545 | 545 | ||
546 | #if 0 | 546 | #if 0 |
547 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 547 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
548 | action->addTo( viewMenu ); | 548 | action->addTo( viewMenu ); |
549 | connect( action, SIGNAL( activated() ), | 549 | connect( action, SIGNAL( activated() ), |
550 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 550 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
551 | #endif | 551 | #endif |
552 | 552 | ||
553 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 553 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
554 | this ); | 554 | this ); |
555 | mNewSubTodoAction->addTo( actionMenu ); | 555 | mNewSubTodoAction->addTo( actionMenu ); |
556 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 556 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
557 | mView, SLOT( newSubTodo() ) ); | 557 | mView, SLOT( newSubTodo() ) ); |
558 | 558 | ||
559 | actionMenu->insertSeparator(); | 559 | actionMenu->insertSeparator(); |
560 | 560 | ||
561 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 561 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
562 | mShowAction->addTo( actionMenu ); | 562 | mShowAction->addTo( actionMenu ); |
563 | connect( mShowAction, SIGNAL( activated() ), | 563 | connect( mShowAction, SIGNAL( activated() ), |
564 | mView, SLOT( showIncidence() ) ); | 564 | mView, SLOT( showIncidence() ) ); |
565 | 565 | ||
566 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 566 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
567 | mEditAction->addTo( actionMenu ); | 567 | mEditAction->addTo( actionMenu ); |
568 | connect( mEditAction, SIGNAL( activated() ), | 568 | connect( mEditAction, SIGNAL( activated() ), |
569 | mView, SLOT( editIncidence() ) ); | 569 | mView, SLOT( editIncidence() ) ); |
570 | 570 | ||
571 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 571 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
572 | mDeleteAction->addTo( actionMenu ); | 572 | mDeleteAction->addTo( actionMenu ); |
573 | connect( mDeleteAction, SIGNAL( activated() ), | 573 | connect( mDeleteAction, SIGNAL( activated() ), |
574 | mView, SLOT( deleteIncidence() ) ); | 574 | mView, SLOT( deleteIncidence() ) ); |
575 | 575 | ||
576 | actionMenu->insertSeparator(); | 576 | actionMenu->insertSeparator(); |
577 | 577 | ||
578 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 578 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
579 | this ); | 579 | this ); |
580 | action->addTo( actionMenu ); | 580 | action->addTo( actionMenu ); |
581 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 581 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
582 | 582 | ||
583 | icon = loadPixmap( pathString + "search" ); | 583 | icon = loadPixmap( pathString + "search" ); |
584 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 584 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
585 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 585 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
586 | search_action->addTo( actionMenu ); | 586 | search_action->addTo( actionMenu ); |
587 | connect( search_action, SIGNAL( activated() ), | 587 | connect( search_action, SIGNAL( activated() ), |
588 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 588 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
589 | 589 | ||
590 | icon = loadPixmap( pathString + "today" ); | 590 | icon = loadPixmap( pathString + "today" ); |
591 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 591 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
592 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 592 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
593 | today_action->addTo( actionMenu ); | 593 | today_action->addTo( actionMenu ); |
594 | connect( today_action, SIGNAL( activated() ), | 594 | connect( today_action, SIGNAL( activated() ), |
595 | mView, SLOT( goToday() ) ); | 595 | mView, SLOT( goToday() ) ); |
596 | 596 | ||
597 | if ( KOPrefs::instance()->mShowFullMenu ) { | 597 | if ( KOPrefs::instance()->mShowFullMenu ) { |
598 | actionMenu->insertSeparator(); | 598 | actionMenu->insertSeparator(); |
599 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 599 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
600 | 600 | ||
601 | } | 601 | } |
602 | // actionMenu->insertSeparator(); | 602 | // actionMenu->insertSeparator(); |
603 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 603 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
604 | this ); | 604 | this ); |
605 | action->addTo( importMenu ); | 605 | action->addTo( importMenu ); |
606 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 606 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
607 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 607 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
608 | this ); | 608 | this ); |
609 | action->addTo( importMenu ); | 609 | action->addTo( importMenu ); |
610 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 610 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
611 | importMenu->insertSeparator(); | 611 | importMenu->insertSeparator(); |
612 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 612 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
613 | this ); | 613 | this ); |
614 | action->addTo( importMenu ); | 614 | action->addTo( importMenu ); |
615 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 615 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
616 | #ifndef DESKTOP_VERSION | 616 | #ifndef DESKTOP_VERSION |
617 | importMenu->insertSeparator(); | 617 | importMenu->insertSeparator(); |
618 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 618 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
619 | this ); | 619 | this ); |
620 | action->addTo( importMenu ); | 620 | action->addTo( importMenu ); |
621 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 621 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
622 | #else | 622 | #else |
623 | #ifdef _WIN32_ | 623 | #ifdef _WIN32_ |
624 | importMenu->insertSeparator(); | 624 | importMenu->insertSeparator(); |
625 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 625 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
626 | this ); | 626 | this ); |
627 | action->addTo( importMenu ); | 627 | action->addTo( importMenu ); |
628 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 628 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
629 | #endif | 629 | #endif |
630 | #endif | 630 | #endif |
631 | 631 | ||
632 | importMenu->insertSeparator(); | 632 | importMenu->insertSeparator(); |
633 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 633 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
634 | this ); | 634 | this ); |
635 | action->addTo( importMenu ); | 635 | action->addTo( importMenu ); |
636 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 636 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
637 | 637 | ||
638 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 638 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
639 | this ); | 639 | this ); |
640 | action->addTo( importMenu ); | 640 | action->addTo( importMenu ); |
641 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 641 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
642 | 642 | ||
643 | importMenu->insertSeparator(); | 643 | importMenu->insertSeparator(); |
644 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 644 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
645 | this ); | 645 | this ); |
646 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 646 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
647 | importMenu->insertSeparator(); | 647 | importMenu->insertSeparator(); |
648 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 648 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
649 | this ); | 649 | this ); |
650 | action->addTo( importMenu ); | 650 | action->addTo( importMenu ); |
651 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 651 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
652 | #ifndef DESKTOP_VERSION | 652 | #ifndef DESKTOP_VERSION |
653 | importMenu->insertSeparator(); | 653 | importMenu->insertSeparator(); |
654 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 654 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
655 | this ); | 655 | this ); |
656 | action->addTo( importMenu ); | 656 | action->addTo( importMenu ); |
657 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 657 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
658 | 658 | ||
659 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 659 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
660 | this ); | 660 | this ); |
661 | action->addTo( importMenu ); | 661 | action->addTo( importMenu ); |
662 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 662 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
663 | #else | 663 | #else |
664 | importMenu->insertSeparator(); | 664 | importMenu->insertSeparator(); |
665 | icon = loadPixmap( pathString + "print" ); | 665 | icon = loadPixmap( pathString + "print" ); |
666 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 666 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
667 | action->addTo( importMenu ); | 667 | action->addTo( importMenu ); |
668 | connect( action, SIGNAL( activated() ), | 668 | connect( action, SIGNAL( activated() ), |
669 | this, SLOT( printCal() ) ); | 669 | this, SLOT( printCal() ) ); |
670 | 670 | ||
671 | icon = loadPixmap( pathString + "print" ); | 671 | icon = loadPixmap( pathString + "print" ); |
672 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 672 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
673 | action->addTo( importMenu ); | 673 | action->addTo( importMenu ); |
674 | connect( action, SIGNAL( activated() ), | 674 | connect( action, SIGNAL( activated() ), |
675 | this, SLOT( printSel() ) ); | 675 | this, SLOT( printSel() ) ); |
676 | #endif | 676 | #endif |
677 | importMenu->insertSeparator(); | 677 | importMenu->insertSeparator(); |
678 | action = new QAction( "beam all", i18n("Save"), 0, | 678 | action = new QAction( "beam all", i18n("Save"), 0, |
679 | this ); | 679 | this ); |
680 | action->addTo( importMenu ); | 680 | action->addTo( importMenu ); |
681 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 681 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
682 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 682 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
683 | this ); | 683 | this ); |
684 | action->addTo( importMenu ); | 684 | action->addTo( importMenu ); |
685 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 685 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
686 | 686 | ||
687 | //menuBar->insertItem( "Configure",configureMenu ); | 687 | //menuBar->insertItem( "Configure",configureMenu ); |
688 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 688 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
689 | icon = loadPixmap( "korganizer/korganizer" ); | 689 | icon = loadPixmap( "korganizer/korganizer" ); |
690 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 690 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
691 | action->addTo( helpMenu ); | 691 | action->addTo( helpMenu ); |
692 | connect( action, SIGNAL( activated() ), | 692 | connect( action, SIGNAL( activated() ), |
693 | SLOT( keyBindings() ) ); | 693 | SLOT( keyBindings() ) ); |
694 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 694 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
695 | action->addTo( helpMenu ); | 695 | action->addTo( helpMenu ); |
696 | connect( action, SIGNAL( activated() ), | 696 | connect( action, SIGNAL( activated() ), |
697 | SLOT( features() ) ); | 697 | SLOT( features() ) ); |
698 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 698 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
699 | action->addTo( helpMenu ); | 699 | action->addTo( helpMenu ); |
700 | connect( action, SIGNAL( activated() ), | 700 | connect( action, SIGNAL( activated() ), |
701 | SLOT( aboutAutoSaving() ) ); | 701 | SLOT( aboutAutoSaving() ) ); |
702 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 702 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
703 | action->addTo( helpMenu ); | 703 | action->addTo( helpMenu ); |
704 | connect( action, SIGNAL( activated() ), | 704 | connect( action, SIGNAL( activated() ), |
705 | SLOT( aboutKnownBugs() ) ); | 705 | SLOT( aboutKnownBugs() ) ); |
706 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 706 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
707 | action->addTo( helpMenu ); | 707 | action->addTo( helpMenu ); |
708 | connect( action, SIGNAL( activated() ), | 708 | connect( action, SIGNAL( activated() ), |
709 | SLOT( usertrans() ) ); | 709 | SLOT( usertrans() ) ); |
710 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 710 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
711 | action->addTo( helpMenu ); | 711 | action->addTo( helpMenu ); |
712 | connect( action, SIGNAL( activated() ), | 712 | connect( action, SIGNAL( activated() ), |
713 | SLOT( synchowto() ) ); | 713 | SLOT( synchowto() ) ); |
714 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 714 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
715 | action->addTo( helpMenu ); | 715 | action->addTo( helpMenu ); |
716 | connect( action, SIGNAL( activated() ), | 716 | connect( action, SIGNAL( activated() ), |
717 | SLOT( whatsNew() ) ); | 717 | SLOT( whatsNew() ) ); |
718 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 718 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
719 | action->addTo( helpMenu ); | 719 | action->addTo( helpMenu ); |
720 | connect( action, SIGNAL( activated() ), | 720 | connect( action, SIGNAL( activated() ), |
721 | SLOT( faq() ) ); | 721 | SLOT( faq() ) ); |
722 | 722 | ||
723 | 723 | ||
724 | action = new QAction( "about", i18n("About..."), 0, this ); | 724 | action = new QAction( "about", i18n("About..."), 0, this ); |
725 | action->addTo( helpMenu ); | 725 | action->addTo( helpMenu ); |
726 | connect( action, SIGNAL( activated() ), | 726 | connect( action, SIGNAL( activated() ), |
727 | SLOT( about() ) ); | 727 | SLOT( about() ) ); |
728 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 728 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
729 | action->addTo( helpMenu ); | 729 | action->addTo( helpMenu ); |
730 | connect( action, SIGNAL( activated() ), | 730 | connect( action, SIGNAL( activated() ), |
731 | SLOT( licence() ) ); | 731 | SLOT( licence() ) ); |
732 | //menuBar->insertSeparator(); | 732 | //menuBar->insertSeparator(); |
733 | 733 | ||
734 | // ****************************************************** | 734 | // ****************************************************** |
735 | // menubar icons | 735 | // menubar icons |
736 | 736 | ||
737 | 737 | ||
738 | iconToolBar->setHorizontalStretchable (true ); | 738 | iconToolBar->setHorizontalStretchable (true ); |
739 | //menuBar->insertItem( iconToolBar ); | 739 | //menuBar->insertItem( iconToolBar ); |
740 | //xdays_action | 740 | //xdays_action |
741 | if (p-> mShowIconNewEvent) | 741 | if (p-> mShowIconNewEvent) |
742 | ne_action->addTo( iconToolBar ); | 742 | ne_action->addTo( iconToolBar ); |
743 | if (p->mShowIconNewTodo ) | 743 | if (p->mShowIconNewTodo ) |
744 | nt_action->addTo( iconToolBar ); | 744 | nt_action->addTo( iconToolBar ); |
745 | if (p-> mShowIconSearch) | 745 | if (p-> mShowIconSearch) |
746 | search_action->addTo( iconToolBar ); | 746 | search_action->addTo( iconToolBar ); |
747 | if (p-> mShowIconNext) | 747 | if (p-> mShowIconNext) |
748 | whatsnext_action->addTo( iconToolBar ); | 748 | whatsnext_action->addTo( iconToolBar ); |
749 | if (p-> mShowIconNextDays) | 749 | if (p-> mShowIconNextDays) |
750 | xdays_action->addTo( iconToolBar ); | 750 | xdays_action->addTo( iconToolBar ); |
751 | if (p-> mShowIconList) | 751 | if (p-> mShowIconList) |
752 | showlist_action->addTo( iconToolBar ); | 752 | showlist_action->addTo( iconToolBar ); |
753 | if (p-> mShowIconDay1) | 753 | if (p-> mShowIconDay1) |
754 | day1_action->addTo( iconToolBar ); | 754 | day1_action->addTo( iconToolBar ); |
755 | if (p-> mShowIconDay5) | 755 | if (p-> mShowIconDay5) |
756 | day5_action->addTo( iconToolBar ); | 756 | day5_action->addTo( iconToolBar ); |
757 | if (p-> mShowIconDay7) | 757 | if (p-> mShowIconDay7) |
758 | day7_action->addTo( iconToolBar ); | 758 | day7_action->addTo( iconToolBar ); |
759 | if (p-> mShowIconMonth) | 759 | if (p-> mShowIconMonth) |
760 | month_action->addTo( iconToolBar ); | 760 | month_action->addTo( iconToolBar ); |
761 | if (p-> mShowIconTodoview) | 761 | if (p-> mShowIconTodoview) |
762 | todoview_action->addTo( iconToolBar ); | 762 | todoview_action->addTo( iconToolBar ); |
763 | if (p-> mShowIconJournal) | 763 | if (p-> mShowIconJournal) |
764 | viewjournal_action->addTo( iconToolBar ); | 764 | viewjournal_action->addTo( iconToolBar ); |
765 | icon = loadPixmap( pathString + "2leftarrowB" ); | 765 | icon = loadPixmap( pathString + "2leftarrowB" ); |
766 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 766 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
767 | if (p-> mShowIconBackFast) { | 767 | if (p-> mShowIconBackFast) { |
768 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 768 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
769 | connect( action, SIGNAL( activated() ), | 769 | connect( action, SIGNAL( activated() ), |
770 | mView, SLOT( goPreviousMonth() ) ); | 770 | mView, SLOT( goPreviousMonth() ) ); |
771 | action->addTo( iconToolBar ); | 771 | action->addTo( iconToolBar ); |
772 | } | 772 | } |
773 | icon = loadPixmap( pathString + "1leftarrowB" ); | 773 | icon = loadPixmap( pathString + "1leftarrowB" ); |
774 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 774 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
775 | if (p-> mShowIconBack) { | 775 | if (p-> mShowIconBack) { |
776 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 776 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
777 | connect( action, SIGNAL( activated() ), | 777 | connect( action, SIGNAL( activated() ), |
778 | mView, SLOT( goPrevious() ) ); | 778 | mView, SLOT( goPrevious() ) ); |
779 | action->addTo( iconToolBar ); | 779 | action->addTo( iconToolBar ); |
780 | } | 780 | } |
781 | if (p-> mShowIconToday) | 781 | if (p-> mShowIconToday) |
782 | today_action->addTo( iconToolBar ); | 782 | today_action->addTo( iconToolBar ); |
783 | icon = loadPixmap( pathString + "1rightarrowB" ); | 783 | icon = loadPixmap( pathString + "1rightarrowB" ); |
784 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 784 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
785 | if (p-> mShowIconForward) { | 785 | if (p-> mShowIconForward) { |
786 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 786 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
787 | connect( action, SIGNAL( activated() ), | 787 | connect( action, SIGNAL( activated() ), |
788 | mView, SLOT( goNext() ) ); | 788 | mView, SLOT( goNext() ) ); |
789 | action->addTo( iconToolBar ); | 789 | action->addTo( iconToolBar ); |
790 | } | 790 | } |
791 | icon = loadPixmap( pathString + "2rightarrowB" ); | 791 | icon = loadPixmap( pathString + "2rightarrowB" ); |
792 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 792 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
793 | if (p-> mShowIconForwardFast) { | 793 | if (p-> mShowIconForwardFast) { |
794 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 794 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
795 | connect( action, SIGNAL( activated() ), | 795 | connect( action, SIGNAL( activated() ), |
796 | mView, SLOT( goNextMonth() ) ); | 796 | mView, SLOT( goNextMonth() ) ); |
797 | action->addTo( iconToolBar ); | 797 | action->addTo( iconToolBar ); |
798 | } | 798 | } |
799 | 799 | ||
800 | 800 | ||
801 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 801 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
802 | 802 | ||
803 | if (p-> mShowIconNewEvent) | 803 | if (p-> mShowIconNewEvent) |
804 | configureToolBarMenu->setItemChecked( 10, true ); | 804 | configureToolBarMenu->setItemChecked( 10, true ); |
805 | if (p->mShowIconNewTodo ) | 805 | if (p->mShowIconNewTodo ) |
806 | configureToolBarMenu->setItemChecked( 20, true ); | 806 | configureToolBarMenu->setItemChecked( 20, true ); |
807 | if (p-> mShowIconSearch) | 807 | if (p-> mShowIconSearch) |
808 | configureToolBarMenu->setItemChecked( 120, true ); | 808 | configureToolBarMenu->setItemChecked( 120, true ); |
809 | if (p-> mShowIconList) | 809 | if (p-> mShowIconList) |
810 | configureToolBarMenu->setItemChecked( 30, true ); | 810 | configureToolBarMenu->setItemChecked( 30, true ); |
811 | if (p-> mShowIconDay1) | 811 | if (p-> mShowIconDay1) |
812 | configureToolBarMenu->setItemChecked( 40, true ); | 812 | configureToolBarMenu->setItemChecked( 40, true ); |
813 | if (p-> mShowIconDay5) | 813 | if (p-> mShowIconDay5) |
814 | configureToolBarMenu->setItemChecked( 50, true ); | 814 | configureToolBarMenu->setItemChecked( 50, true ); |
815 | if (p-> mShowIconDay7) | 815 | if (p-> mShowIconDay7) |
816 | configureToolBarMenu->setItemChecked( 60, true ); | 816 | configureToolBarMenu->setItemChecked( 60, true ); |
817 | if (p-> mShowIconMonth) | 817 | if (p-> mShowIconMonth) |
818 | configureToolBarMenu->setItemChecked( 70, true ); | 818 | configureToolBarMenu->setItemChecked( 70, true ); |
819 | if (p-> mShowIconTodoview) | 819 | if (p-> mShowIconTodoview) |
820 | configureToolBarMenu->setItemChecked( 80, true ); | 820 | configureToolBarMenu->setItemChecked( 80, true ); |
821 | if (p-> mShowIconBackFast) | 821 | if (p-> mShowIconBackFast) |
822 | configureToolBarMenu->setItemChecked( 200, true ); | 822 | configureToolBarMenu->setItemChecked( 200, true ); |
823 | if (p-> mShowIconBack) | 823 | if (p-> mShowIconBack) |
824 | configureToolBarMenu->setItemChecked( 210, true ); | 824 | configureToolBarMenu->setItemChecked( 210, true ); |
825 | if (p-> mShowIconToday) | 825 | if (p-> mShowIconToday) |
826 | configureToolBarMenu->setItemChecked( 130, true ); | 826 | configureToolBarMenu->setItemChecked( 130, true ); |
827 | if (p-> mShowIconForward) | 827 | if (p-> mShowIconForward) |
828 | configureToolBarMenu->setItemChecked( 220, true ); | 828 | configureToolBarMenu->setItemChecked( 220, true ); |
829 | if (p-> mShowIconForwardFast) | 829 | if (p-> mShowIconForwardFast) |
830 | configureToolBarMenu->setItemChecked( 230, true ); | 830 | configureToolBarMenu->setItemChecked( 230, true ); |
831 | if (p-> mShowIconNextDays) | 831 | if (p-> mShowIconNextDays) |
832 | configureToolBarMenu->setItemChecked( 100, true ); | 832 | configureToolBarMenu->setItemChecked( 100, true ); |
833 | if (p-> mShowIconNext) | 833 | if (p-> mShowIconNext) |
834 | configureToolBarMenu->setItemChecked( 110, true ); | 834 | configureToolBarMenu->setItemChecked( 110, true ); |
835 | if (p-> mShowIconJournal) | 835 | if (p-> mShowIconJournal) |
836 | configureToolBarMenu->setItemChecked( 90, true ); | 836 | configureToolBarMenu->setItemChecked( 90, true ); |
837 | if (p-> mShowIconWhatsThis) | 837 | if (p-> mShowIconWhatsThis) |
838 | configureToolBarMenu->setItemChecked( 300, true ); | 838 | configureToolBarMenu->setItemChecked( 300, true ); |
839 | 839 | ||
840 | QLabel* dummy = new QLabel( iconToolBar ); | 840 | QLabel* dummy = new QLabel( iconToolBar ); |
841 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 841 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
842 | if (!p-> mShowIconStretch) | 842 | if (!p-> mShowIconStretch) |
843 | iconToolBar->setStretchableWidget ( dummy ) ; | 843 | iconToolBar->setStretchableWidget ( dummy ) ; |
844 | else | 844 | else |
845 | configureToolBarMenu->setItemChecked( 5, true ); | 845 | configureToolBarMenu->setItemChecked( 5, true ); |
846 | if (p-> mShowIconWhatsThis) | 846 | if (p-> mShowIconWhatsThis) |
847 | QWhatsThis::whatsThisButton ( iconToolBar ); | 847 | QWhatsThis::whatsThisButton ( iconToolBar ); |
848 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 848 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
849 | configureAgenda( p->mHourSize ); | 849 | configureAgenda( p->mHourSize ); |
850 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 850 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
851 | } | 851 | } |
852 | void MainWindow::fillSyncMenu() | 852 | void MainWindow::fillSyncMenu() |
853 | { | 853 | { |
854 | syncMenu->clear(); | 854 | syncMenu->clear(); |
855 | syncMenu->insertItem( i18n("Configure..."), 0 ); | 855 | syncMenu->insertItem( i18n("Configure..."), 0 ); |
856 | syncMenu->insertSeparator(); | 856 | syncMenu->insertSeparator(); |
857 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); | 857 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); |
858 | syncMenu->insertSeparator(); | 858 | syncMenu->insertSeparator(); |
859 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 859 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
860 | config.setGroup("General"); | 860 | config.setGroup("General"); |
861 | QStringList prof = config.readListEntry("SyncProfileNames"); | 861 | QStringList prof = config.readListEntry("SyncProfileNames"); |
862 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 862 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
863 | if ( prof.count() < 3 ) { | 863 | if ( prof.count() < 3 ) { |
864 | prof.clear(); | 864 | prof.clear(); |
865 | prof << i18n("Sharp_DTM"); | 865 | prof << i18n("Sharp_DTM"); |
866 | prof << i18n("Local_file"); | 866 | prof << i18n("Local_file"); |
867 | prof << i18n("Last_file"); | 867 | prof << i18n("Last_file"); |
868 | KSyncProfile* temp = new KSyncProfile (); | 868 | KSyncProfile* temp = new KSyncProfile (); |
869 | temp->setName( prof[0] ); | 869 | temp->setName( prof[0] ); |
870 | temp->writeConfig(&config); | 870 | temp->writeConfig(&config); |
871 | temp->setName( prof[1] ); | 871 | temp->setName( prof[1] ); |
872 | temp->writeConfig(&config); | 872 | temp->writeConfig(&config); |
873 | temp->setName( prof[2] ); | 873 | temp->setName( prof[2] ); |
874 | temp->writeConfig(&config); | 874 | temp->writeConfig(&config); |
875 | config.setGroup("General"); | 875 | config.setGroup("General"); |
876 | config.writeEntry("SyncProfileNames",prof); | 876 | config.writeEntry("SyncProfileNames",prof); |
877 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); | 877 | config.writeEntry("ExternSyncProfiles","Sharp_DTM"); |
878 | config.sync(); | 878 | config.sync(); |
879 | delete temp; | 879 | delete temp; |
880 | } | 880 | } |
881 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 881 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
882 | KOPrefs::instance()->mSyncProfileNames = prof; | 882 | KOPrefs::instance()->mSyncProfileNames = prof; |
883 | int i; | 883 | int i; |
884 | for ( i = 0; i < prof.count(); ++i ) { | 884 | for ( i = 0; i < prof.count(); ++i ) { |
885 | 885 | ||
886 | syncMenu->insertItem( prof[i], 1000+i ); | 886 | syncMenu->insertItem( prof[i], 1000+i ); |
887 | if ( i == 2 ) | 887 | if ( i == 2 ) |
888 | syncMenu->insertSeparator(); | 888 | syncMenu->insertSeparator(); |
889 | } | 889 | } |
890 | QDir app_dir; | 890 | QDir app_dir; |
891 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 891 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
892 | syncMenu->setItemEnabled( false , 1000 ); | 892 | syncMenu->setItemEnabled( false , 1000 ); |
893 | } | 893 | } |
894 | mView->setupExternSyncProfiles(); | 894 | mView->setupExternSyncProfiles(); |
895 | } | 895 | } |
896 | 896 | ||
897 | int MainWindow::ringSync() | 897 | int MainWindow::ringSync() |
898 | { | 898 | { |
899 | int syncedProfiles = 0; | 899 | int syncedProfiles = 0; |
900 | int i; | 900 | int i; |
901 | QTime timer; | 901 | QTime timer; |
902 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 902 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
903 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 903 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
904 | KSyncProfile* temp = new KSyncProfile (); | 904 | KSyncProfile* temp = new KSyncProfile (); |
905 | KOPrefs::instance()->mAskForPreferences = false; | 905 | KOPrefs::instance()->mAskForPreferences = false; |
906 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 906 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
907 | mCurrentSyncProfile = i; | 907 | mCurrentSyncProfile = i; |
908 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 908 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
909 | temp->readConfig(&config); | 909 | temp->readConfig(&config); |
910 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 910 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |
911 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 911 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
912 | ++syncedProfiles; | 912 | ++syncedProfiles; |
913 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 913 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
914 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 914 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
915 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 915 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
916 | KOPrefs::instance()->mShowSyncSummary = false; | 916 | KOPrefs::instance()->mShowSyncSummary = false; |
917 | mView->setSyncDevice(syncProfileNames[i] ); | 917 | mView->setSyncDevice(syncProfileNames[i] ); |
918 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 918 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
919 | if ( i == 0 ) { | 919 | if ( i == 0 ) { |
920 | syncSharp(); | 920 | syncSharp(); |
921 | } else { | 921 | } else { |
922 | if ( temp->getIsLocalFileSync() ) { | 922 | if ( temp->getIsLocalFileSync() ) { |
923 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) | 923 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) |
924 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 924 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
925 | } else { | 925 | } else { |
926 | if ( temp->getIsPhoneSync() ) { | 926 | if ( temp->getIsPhoneSync() ) { |
927 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; | 927 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; |
928 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); | 928 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); |
929 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); | 929 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); |
930 | syncPhone(); | 930 | syncPhone(); |
931 | } else | 931 | } else |
932 | syncRemote( temp, false ); | 932 | syncRemote( temp, false ); |
933 | 933 | ||
934 | } | 934 | } |
935 | } | 935 | } |
936 | timer.start(); | 936 | timer.start(); |
937 | setCaption(i18n("Multiple sync in progress ... please wait!") ); | 937 | setCaption(i18n("Multiple sync in progress ... please wait!") ); |
938 | while ( timer.elapsed () < 2000 ) { | 938 | while ( timer.elapsed () < 2000 ) { |
939 | qApp->processEvents(); | 939 | qApp->processEvents(); |
940 | #ifndef _WIN32_ | 940 | #ifndef _WIN32_ |
941 | sleep (1); | 941 | sleep (1); |
942 | #endif | 942 | #endif |
943 | } | 943 | } |
944 | 944 | ||
945 | } | 945 | } |
946 | 946 | ||
947 | } | 947 | } |
948 | delete temp; | 948 | delete temp; |
949 | return syncedProfiles; | 949 | return syncedProfiles; |
950 | } | 950 | } |
951 | 951 | ||
952 | void MainWindow::multiSync( bool askforPrefs ) | 952 | void MainWindow::multiSync( bool askforPrefs ) |
953 | { | 953 | { |
954 | if (mBlockSaveFlag) | 954 | if (mBlockSaveFlag) |
955 | return; | 955 | return; |
956 | mBlockSaveFlag = true; | 956 | mBlockSaveFlag = true; |
957 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 957 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
958 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 958 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
959 | question, | 959 | question, |
960 | i18n("Yes"), i18n("No"), | 960 | i18n("Yes"), i18n("No"), |
961 | 0, 0 ) != 0 ) { | 961 | 0, 0 ) != 0 ) { |
962 | mBlockSaveFlag = false; | 962 | mBlockSaveFlag = false; |
963 | setCaption(i18n("Aborted! Nothing synced!")); | 963 | setCaption(i18n("Aborted! Nothing synced!")); |
964 | return; | 964 | return; |
965 | } | 965 | } |
966 | mView->setSyncDevice(i18n("Multiple profiles") ); | 966 | mView->setSyncDevice(i18n("Multiple profiles") ); |
967 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; | 967 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; |
968 | if ( askforPrefs ) { | 968 | if ( askforPrefs ) { |
969 | mView->edit_sync_options(); | 969 | mView->edit_sync_options(); |
970 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; | 970 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; |
971 | } | 971 | } |
972 | setCaption(i18n("Multiple sync started.") ); | 972 | setCaption(i18n("Multiple sync started.") ); |
973 | qApp->processEvents(); | 973 | qApp->processEvents(); |
974 | int num = ringSync() ; | 974 | int num = ringSync() ; |
975 | if ( num > 1 ) | 975 | if ( num > 1 ) |
976 | ringSync(); | 976 | ringSync(); |
977 | mBlockSaveFlag = false; | 977 | mBlockSaveFlag = false; |
978 | if ( num ) | 978 | if ( num ) |
979 | save(); | 979 | save(); |
980 | if ( num ) | 980 | if ( num ) |
981 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); | 981 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); |
982 | else | 982 | else |
983 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 983 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
984 | return; | 984 | return; |
985 | } | 985 | } |
986 | void MainWindow::slotSyncMenu( int action ) | 986 | void MainWindow::slotSyncMenu( int action ) |
987 | { | 987 | { |
988 | //qDebug("syncaction %d ", action); | 988 | //qDebug("syncaction %d ", action); |
989 | if ( action == 0 ) { | 989 | if ( action == 0 ) { |
990 | 990 | ||
991 | confSync(); | 991 | confSync(); |
992 | 992 | ||
993 | return; | 993 | return; |
994 | } | 994 | } |
995 | if ( action == 1 ) { | 995 | if ( action == 1 ) { |
996 | multiSync( true ); | 996 | multiSync( true ); |
997 | return; | 997 | return; |
998 | } | 998 | } |
999 | 999 | ||
1000 | if (mBlockSaveFlag) | 1000 | if (mBlockSaveFlag) |
1001 | return; | 1001 | return; |
1002 | mBlockSaveFlag = true; | 1002 | mBlockSaveFlag = true; |
1003 | mCurrentSyncProfile = action - 1000 ; | 1003 | mCurrentSyncProfile = action - 1000 ; |
1004 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); | 1004 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); |
1005 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 1005 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
1006 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 1006 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
1007 | KSyncProfile* temp = new KSyncProfile (); | 1007 | KSyncProfile* temp = new KSyncProfile (); |
1008 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); | 1008 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); |
1009 | temp->readConfig(&config); | 1009 | temp->readConfig(&config); |
1010 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 1010 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
1011 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); | 1011 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); |
1012 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 1012 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
1013 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 1013 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
1014 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); | 1014 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); |
1015 | if ( action == 1000 ) { | 1015 | if ( action == 1000 ) { |
1016 | syncSharp(); | 1016 | syncSharp(); |
1017 | 1017 | ||
1018 | } else if ( action == 1001 ) { | 1018 | } else if ( action == 1001 ) { |
1019 | syncLocalFile(); | 1019 | syncLocalFile(); |
1020 | 1020 | ||
1021 | } else if ( action == 1002 ) { | 1021 | } else if ( action == 1002 ) { |
1022 | quickSyncLocalFile(); | 1022 | quickSyncLocalFile(); |
1023 | 1023 | ||
1024 | } else if ( action >= 1003 ) { | 1024 | } else if ( action >= 1003 ) { |
1025 | if ( temp->getIsLocalFileSync() ) { | 1025 | if ( temp->getIsLocalFileSync() ) { |
1026 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 1026 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
1027 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 1027 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
1028 | } else { | 1028 | } else { |
1029 | if ( temp->getIsPhoneSync() ) { | 1029 | if ( temp->getIsPhoneSync() ) { |
1030 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; | 1030 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; |
1031 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); | 1031 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); |
1032 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); | 1032 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); |
1033 | syncPhone(); | 1033 | syncPhone(); |
1034 | } else | 1034 | } else |
1035 | syncRemote( temp ); | 1035 | syncRemote( temp ); |
1036 | 1036 | ||
1037 | } | 1037 | } |
1038 | } | 1038 | } |
1039 | delete temp; | 1039 | delete temp; |
1040 | mBlockSaveFlag = false; | 1040 | mBlockSaveFlag = false; |
1041 | } | 1041 | } |
1042 | void MainWindow::setDefaultPreferences() | 1042 | void MainWindow::setDefaultPreferences() |
1043 | { | 1043 | { |
1044 | KOPrefs *p = KOPrefs::instance(); | 1044 | KOPrefs *p = KOPrefs::instance(); |
1045 | 1045 | ||
1046 | p->mCompactDialogs = true; | 1046 | p->mCompactDialogs = true; |
1047 | p->mConfirm = true; | 1047 | p->mConfirm = true; |
1048 | // p->mEnableQuickTodo = false; | 1048 | // p->mEnableQuickTodo = false; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | QString MainWindow::resourcePath() | 1051 | QString MainWindow::resourcePath() |
1052 | { | 1052 | { |
1053 | return KGlobal::iconLoader()->iconPath(); | 1053 | return KGlobal::iconLoader()->iconPath(); |
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | void MainWindow::displayText( QString text ,QString cap ) | 1056 | void MainWindow::displayText( QString text ,QString cap ) |
1057 | { | 1057 | { |
1058 | QDialog dia( this, "name", true ); ; | 1058 | QDialog dia( this, "name", true ); ; |
1059 | dia.setCaption( cap ); | 1059 | dia.setCaption( cap ); |
1060 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1060 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1061 | lay->setSpacing( 3 ); | 1061 | lay->setSpacing( 3 ); |
1062 | lay->setMargin( 3 ); | 1062 | lay->setMargin( 3 ); |
1063 | QTextBrowser tb ( &dia ); | 1063 | QTextBrowser tb ( &dia ); |
1064 | lay->addWidget( &tb ); | 1064 | lay->addWidget( &tb ); |
1065 | tb.setText( text ); | 1065 | tb.setText( text ); |
1066 | #ifdef DESKTOP_VERSION | 1066 | #ifdef DESKTOP_VERSION |
1067 | dia.resize( 640, 480); | 1067 | dia.resize( 640, 480); |
1068 | #else | 1068 | #else |
1069 | dia.showMaximized(); | 1069 | dia.showMaximized(); |
1070 | #endif | 1070 | #endif |
1071 | dia.exec(); | 1071 | dia.exec(); |
1072 | } | 1072 | } |
1073 | void MainWindow::displayFile( QString fn, QString cap ) | 1073 | void MainWindow::displayFile( QString fn, QString cap ) |
1074 | { | 1074 | { |
1075 | QString fileName = resourcePath() + fn; | 1075 | QString fileName = resourcePath() + fn; |
1076 | QString text; | 1076 | QString text; |
1077 | QFile file( fileName ); | 1077 | QFile file( fileName ); |
1078 | if (!file.open( IO_ReadOnly ) ) { | 1078 | if (!file.open( IO_ReadOnly ) ) { |
1079 | return ; | 1079 | return ; |
1080 | 1080 | ||
1081 | } | 1081 | } |
1082 | QTextStream ts( &file ); | 1082 | QTextStream ts( &file ); |
1083 | text = ts.read(); | 1083 | text = ts.read(); |
1084 | file.close(); | 1084 | file.close(); |
1085 | displayText( text, cap); | 1085 | displayText( text, cap); |
1086 | } | 1086 | } |
1087 | void MainWindow::features() | 1087 | void MainWindow::features() |
1088 | { | 1088 | { |
1089 | 1089 | ||
1090 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1090 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | void MainWindow::usertrans() | 1093 | void MainWindow::usertrans() |
1094 | { | 1094 | { |
1095 | 1095 | ||
1096 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1096 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); |
1097 | } | 1097 | } |
1098 | #if 0 | 1098 | #if 0 |
1099 | #include <libkcal/vcalformat.h> | 1099 | #include <libkcal/vcalformat.h> |
1100 | #include <libkcal/event.h> | 1100 | #include <libkcal/event.h> |
1101 | #include <libkcal/todo.h> | 1101 | #include <libkcal/todo.h> |
1102 | #include <libkcal/incidence.h> | 1102 | #include <libkcal/incidence.h> |
1103 | #endif | 1103 | #endif |
1104 | void MainWindow::synchowto() | 1104 | void MainWindow::synchowto() |
1105 | { | 1105 | { |
1106 | #if 0 | 1106 | #if 0 |
1107 | QPtrList<Incidence> er = mCalendar->rawIncidences(); | 1107 | QPtrList<Incidence> er = mCalendar->rawIncidences(); |
1108 | Incidence* inR = er.first(); | 1108 | Incidence* inR = er.first(); |
1109 | VCalFormat vf; | 1109 | VCalFormat vf; |
1110 | QString strout; | 1110 | QString strout; |
1111 | while ( inR ) { | 1111 | while ( inR ) { |
1112 | if ( inR->type() == "Todo" ) | 1112 | if ( inR->type() == "Todo" ) |
1113 | strout = vf.todoToString( (Todo *) inR ); | 1113 | strout = vf.todoToString( (Todo *) inR ); |
1114 | if ( inR->type() == "Event" ) | 1114 | if ( inR->type() == "Event" ) |
1115 | strout = vf.eventToString( (Event *) inR ); | 1115 | strout = vf.eventToString( (Event *) inR ); |
1116 | qDebug("incidence: \n%s\n ente\n\n",strout.latin1() ); | 1116 | qDebug("incidence: \n%s\n ente\n\n",strout.latin1() ); |
1117 | inR = er.next(); | 1117 | inR = er.next(); |
1118 | } | 1118 | } |
1119 | #endif | 1119 | #endif |
1120 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); | 1120 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); |
1121 | } | 1121 | } |
1122 | void MainWindow::faq() | 1122 | void MainWindow::faq() |
1123 | { | 1123 | { |
1124 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1124 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); |
1125 | 1125 | ||
1126 | } | 1126 | } |
1127 | void MainWindow::whatsNew() | 1127 | void MainWindow::whatsNew() |
1128 | { | 1128 | { |
1129 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); | 1129 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); |
1130 | 1130 | ||
1131 | } | 1131 | } |
1132 | void MainWindow::licence() | 1132 | void MainWindow::licence() |
1133 | { | 1133 | { |
1134 | KApplication::showLicence(); | 1134 | KApplication::showLicence(); |
1135 | 1135 | ||
1136 | } | 1136 | } |
1137 | void MainWindow::about() | 1137 | void MainWindow::about() |
1138 | { | 1138 | { |
1139 | QString version; | 1139 | QString version; |
1140 | #include <../version> | 1140 | #include <../version> |
1141 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1141 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1142 | i18n("KOrganizer/Platform-independent\n") + | 1142 | i18n("KOrganizer/Platform-independent\n") + |
1143 | "(KO/Pi) " + version + " - " + | 1143 | "(KO/Pi) " + version + " - " + |
1144 | 1144 | ||
1145 | #ifdef DESKTOP_VERSION | 1145 | #ifdef DESKTOP_VERSION |
1146 | i18n("Desktop Edition\n") + | 1146 | i18n("Desktop Edition\n") + |
1147 | #else | 1147 | #else |
1148 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1148 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1149 | #endif | 1149 | #endif |
1150 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1150 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1151 | } | 1151 | } |
1152 | void MainWindow::keyBindings() | 1152 | void MainWindow::keyBindings() |
1153 | { | 1153 | { |
1154 | QString cap = i18n("Key bindings KOrganizer/Pi"); | 1154 | QString cap = i18n("Key bindings KOrganizer/Pi"); |
1155 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1155 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1156 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1156 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1157 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1157 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1158 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1158 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1159 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1159 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1160 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1160 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1161 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1161 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1162 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1162 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1163 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1163 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1164 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1164 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1165 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1165 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1166 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1166 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1167 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1167 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1168 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1168 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1169 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1169 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1170 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1170 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1171 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1171 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1172 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1172 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1173 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1173 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1174 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1174 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1175 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1175 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1176 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1176 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1177 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1177 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1178 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1178 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1179 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1179 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1180 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1180 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1181 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1181 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1182 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1182 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1183 | i18n("<p><h3>In list view:</h3></p>\n") + | 1183 | i18n("<p><h3>In list view:</h3></p>\n") + |
1184 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1184 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1185 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1185 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1186 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1186 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1187 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1187 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1188 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1188 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1189 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1189 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1190 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1190 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1191 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1191 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1192 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1192 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1193 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1193 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1194 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1194 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1195 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1195 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1196 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1196 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1197 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1197 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1198 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1198 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1199 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1199 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1200 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1200 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1201 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1201 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1202 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1202 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1203 | displayText( text, cap); | 1203 | displayText( text, cap); |
1204 | 1204 | ||
1205 | } | 1205 | } |
1206 | void MainWindow::aboutAutoSaving() | 1206 | void MainWindow::aboutAutoSaving() |
1207 | { | 1207 | { |
1208 | QMessageBox* msg; | 1208 | QMessageBox* msg; |
1209 | msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), | 1209 | msg = new QMessageBox( i18n("Auto Saving in KOrganizer/Pi"), |
1210 | i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) 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"), QMessageBox::NoIcon, | 1210 | i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configureable) 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"), QMessageBox::NoIcon, |
1211 | QMessageBox::Ok, | 1211 | QMessageBox::Ok, |
1212 | QMessageBox::NoButton, | 1212 | QMessageBox::NoButton, |
1213 | QMessageBox::NoButton); | 1213 | QMessageBox::NoButton); |
1214 | msg->exec(); | 1214 | msg->exec(); |
1215 | delete msg; | 1215 | delete msg; |
1216 | 1216 | ||
1217 | 1217 | ||
1218 | } | 1218 | } |
1219 | void MainWindow::aboutKnownBugs() | 1219 | void MainWindow::aboutKnownBugs() |
1220 | { | 1220 | { |
1221 | QMessageBox* msg; | 1221 | QMessageBox* msg; |
1222 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1222 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1223 | 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")+ | 1223 | 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")+ |
1224 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1224 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1225 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + | 1225 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + |
1226 | i18n("\nor report them in the bugtracker on\n") + | 1226 | i18n("\nor report them in the bugtracker on\n") + |
1227 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1227 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1228 | QMessageBox::NoIcon, | 1228 | QMessageBox::NoIcon, |
1229 | QMessageBox::Ok, | 1229 | QMessageBox::Ok, |
1230 | QMessageBox::NoButton, | 1230 | QMessageBox::NoButton, |
1231 | QMessageBox::NoButton); | 1231 | QMessageBox::NoButton); |
1232 | msg->exec(); | 1232 | msg->exec(); |
1233 | delete msg; | 1233 | delete msg; |
1234 | 1234 | ||
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | QString MainWindow::defaultFileName() | 1237 | QString MainWindow::defaultFileName() |
1238 | { | 1238 | { |
1239 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1239 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1242 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1243 | { | 1243 | { |
1244 | if ( !incidence ) { | 1244 | if ( !incidence ) { |
1245 | enableIncidenceActions( false ); | 1245 | enableIncidenceActions( false ); |
1246 | 1246 | ||
1247 | mNewSubTodoAction->setEnabled( false ); | 1247 | mNewSubTodoAction->setEnabled( false ); |
1248 | setCaptionToDates(); | 1248 | setCaptionToDates(); |
1249 | return; | 1249 | return; |
1250 | 1250 | ||
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | //KGlobal::locale()->formatDateTime(nextA, true); | 1253 | //KGlobal::locale()->formatDateTime(nextA, true); |
1254 | QString startString = ""; | 1254 | QString startString = ""; |
1255 | if ( incidence->type() != "Todo" ) { | 1255 | if ( incidence->type() != "Todo" ) { |
1256 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1256 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1257 | if ( incidence->doesFloat() ) { | 1257 | if ( incidence->doesFloat() ) { |
1258 | startString += ": "+incidence->dtStartDateStr( true ); | 1258 | startString += ": "+incidence->dtStartDateStr( true ); |
1259 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1259 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1260 | 1260 | ||
1261 | } else { | 1261 | } else { |
1262 | startString = ": "+incidence->dtStartStr(true); | 1262 | startString = ": "+incidence->dtStartStr(true); |
1263 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1263 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1264 | 1264 | ||
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | } else { | 1267 | } else { |
1268 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1268 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1269 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1269 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1270 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1270 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1271 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1271 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | } | 1274 | } |
1275 | else | 1275 | else |
1276 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1276 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1277 | if ( !incidence->location().isEmpty() ) | 1277 | if ( !incidence->location().isEmpty() ) |
1278 | startString += " (" +incidence->location()+")"; | 1278 | startString += " (" +incidence->location()+")"; |
1279 | setCaption( incidence->summary()+startString); | 1279 | setCaption( incidence->summary()+startString); |
1280 | 1280 | ||
1281 | enableIncidenceActions( true ); | 1281 | enableIncidenceActions( true ); |
1282 | 1282 | ||
1283 | if ( incidence->type() == "Event" ) { | 1283 | if ( incidence->type() == "Event" ) { |
1284 | mShowAction->setText( i18n("Show Event...") ); | 1284 | mShowAction->setText( i18n("Show Event...") ); |
1285 | mEditAction->setText( i18n("Edit Event...") ); | 1285 | mEditAction->setText( i18n("Edit Event...") ); |
1286 | mDeleteAction->setText( i18n("Delete Event...") ); | 1286 | mDeleteAction->setText( i18n("Delete Event...") ); |
1287 | 1287 | ||
1288 | mNewSubTodoAction->setEnabled( false ); | 1288 | mNewSubTodoAction->setEnabled( false ); |
1289 | } else if ( incidence->type() == "Todo" ) { | 1289 | } else if ( incidence->type() == "Todo" ) { |
1290 | mShowAction->setText( i18n("Show Todo...") ); | 1290 | mShowAction->setText( i18n("Show Todo...") ); |
1291 | mEditAction->setText( i18n("Edit Todo...") ); | 1291 | mEditAction->setText( i18n("Edit Todo...") ); |
1292 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1292 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1293 | 1293 | ||
1294 | mNewSubTodoAction->setEnabled( true ); | 1294 | mNewSubTodoAction->setEnabled( true ); |
1295 | } else { | 1295 | } else { |
1296 | mShowAction->setText( i18n("Show...") ); | 1296 | mShowAction->setText( i18n("Show...") ); |
1297 | mShowAction->setText( i18n("Edit...") ); | 1297 | mShowAction->setText( i18n("Edit...") ); |
1298 | mShowAction->setText( i18n("Delete...") ); | 1298 | mShowAction->setText( i18n("Delete...") ); |
1299 | 1299 | ||
1300 | mNewSubTodoAction->setEnabled( false ); | 1300 | mNewSubTodoAction->setEnabled( false ); |
1301 | } | 1301 | } |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | void MainWindow::enableIncidenceActions( bool enabled ) | 1304 | void MainWindow::enableIncidenceActions( bool enabled ) |
1305 | { | 1305 | { |
1306 | mShowAction->setEnabled( enabled ); | 1306 | mShowAction->setEnabled( enabled ); |
1307 | mEditAction->setEnabled( enabled ); | 1307 | mEditAction->setEnabled( enabled ); |
1308 | mDeleteAction->setEnabled( enabled ); | 1308 | mDeleteAction->setEnabled( enabled ); |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | void MainWindow::importOL() | 1311 | void MainWindow::importOL() |
1312 | { | 1312 | { |
1313 | #ifdef _WIN32_ | 1313 | #ifdef _WIN32_ |
1314 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1314 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1315 | id->exec(); | 1315 | id->exec(); |
1316 | delete id; | 1316 | delete id; |
1317 | mView->updateView(); | 1317 | mView->updateView(); |
1318 | #endif | 1318 | #endif |
1319 | } | 1319 | } |
1320 | void MainWindow::importBday() | 1320 | void MainWindow::importBday() |
1321 | { | 1321 | { |
1322 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1322 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1323 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1323 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1324 | i18n("Import!"), i18n("Cancel"), 0, | 1324 | i18n("Import!"), i18n("Cancel"), 0, |
1325 | 0, 1 ); | 1325 | 0, 1 ); |
1326 | if ( result == 0 ) { | 1326 | if ( result == 0 ) { |
1327 | mView->importBday(); | 1327 | mView->importBday(); |
1328 | 1328 | ||
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | 1331 | ||
1332 | } | 1332 | } |
1333 | void MainWindow::importQtopia() | 1333 | void MainWindow::importQtopia() |
1334 | { | 1334 | { |
1335 | #ifndef DESKTOP_VERSION | 1335 | #ifndef DESKTOP_VERSION |
1336 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1336 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1337 | 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"), | 1337 | 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"), |
1338 | i18n("Import!"), i18n("Cancel"), 0, | 1338 | i18n("Import!"), i18n("Cancel"), 0, |
1339 | 0, 1 ); | 1339 | 0, 1 ); |
1340 | if ( result == 0 ) { | 1340 | if ( result == 0 ) { |
1341 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1341 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1342 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1342 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1343 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1343 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1344 | mView->importQtopia( categories, datebook, todolist ); | 1344 | mView->importQtopia( categories, datebook, todolist ); |
1345 | } | 1345 | } |
1346 | #else | 1346 | #else |
1347 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1347 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1348 | i18n("Not supported \non desktop!\n"), | 1348 | i18n("Not supported \non desktop!\n"), |
1349 | i18n("Ok"), i18n("Cancel"), 0, | 1349 | i18n("Ok"), i18n("Cancel"), 0, |
1350 | 0, 1 ); | 1350 | 0, 1 ); |
1351 | 1351 | ||
1352 | #endif | 1352 | #endif |
1353 | } | 1353 | } |
1354 | 1354 | ||
1355 | void MainWindow::saveOnClose() | 1355 | void MainWindow::saveOnClose() |
1356 | { | 1356 | { |
1357 | KOPrefs *p = KOPrefs::instance(); | 1357 | KOPrefs *p = KOPrefs::instance(); |
1358 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1358 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1359 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1359 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1360 | iconToolBar->y() > height()/2; | 1360 | iconToolBar->y() > height()/2; |
1361 | mView->writeSettings(); | 1361 | mView->writeSettings(); |
1362 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1362 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1363 | save(); | 1363 | save(); |
1364 | } | 1364 | } |
1365 | void MainWindow::slotModifiedChanged( bool changed ) | 1365 | void MainWindow::slotModifiedChanged( bool changed ) |
1366 | { | 1366 | { |
1367 | if ( mBlockAtStartup ) | 1367 | if ( mBlockAtStartup ) |
1368 | return; | 1368 | return; |
1369 | int msec; | 1369 | int msec; |
1370 | // we store the changes after 1 minute, | 1370 | // we store the changes after 1 minute, |
1371 | // and for safety reasons after 10 minutes again | 1371 | // and for safety reasons after 10 minutes again |
1372 | if ( !mBlockSaveFlag ) | 1372 | if ( !mBlockSaveFlag ) |
1373 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1373 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1374 | else | 1374 | else |
1375 | msec = 1000 * 600; | 1375 | msec = 1000 * 600; |
1376 | mSaveTimer.start( msec, true ); // 1 minute | 1376 | mSaveTimer.start( msec, true ); // 1 minute |
1377 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1377 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1378 | mCalendarModifiedFlag = true; | 1378 | mCalendarModifiedFlag = true; |
1379 | } | 1379 | } |
1380 | #include <qfileinfo.h> | 1380 | #include <qfileinfo.h> |
1381 | void MainWindow::save() | 1381 | void MainWindow::save() |
1382 | { | 1382 | { |
1383 | if ( mBlockSaveFlag ) | 1383 | if ( mBlockSaveFlag ) |
1384 | return; | 1384 | return; |
1385 | bool store = mBlockSaveFlag; | 1385 | bool store = mBlockSaveFlag; |
1386 | mBlockSaveFlag = true; | 1386 | mBlockSaveFlag = true; |
1387 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1387 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1388 | 1388 | ||
1389 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1389 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1390 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1390 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 67a3f52..857ceac 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -161,460 +161,460 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
161 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); | 161 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); |
162 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); | 162 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); |
163 | 163 | ||
164 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); | 164 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); |
165 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); | 165 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); |
166 | ++iii; | 166 | ++iii; |
167 | 167 | ||
168 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); | 168 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); |
169 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); | 169 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); |
170 | ++iii; | 170 | ++iii; |
171 | 171 | ||
172 | mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); | 172 | mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); |
173 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 173 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
174 | ++iii; | 174 | ++iii; |
175 | 175 | ||
176 | mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); | 176 | mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); |
177 | topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); | 177 | topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); |
178 | ++iii; | 178 | ++iii; |
179 | topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); | 179 | topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); |
180 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); | 180 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); |
181 | topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); | 181 | topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); |
182 | ++iii; | 182 | ++iii; |
183 | 183 | ||
184 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 184 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
185 | gr = proGr; | 185 | gr = proGr; |
186 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 186 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
187 | ++iii; | 187 | ++iii; |
188 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 188 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
189 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 189 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
190 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 190 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
191 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); | 191 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); |
192 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 192 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
193 | 193 | ||
194 | 194 | ||
195 | phoneWidget = new QVBox( topFrame); | 195 | phoneWidget = new QVBox( topFrame); |
196 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); | 196 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); |
197 | ++iii; | 197 | ++iii; |
198 | QHBox* temphb = new QHBox( phoneWidget ); | 198 | QHBox* temphb = new QHBox( phoneWidget ); |
199 | new QLabel( i18n("I/O device: "), temphb ); | 199 | new QLabel( i18n("I/O device: "), temphb ); |
200 | mPhoneDevice = new QLineEdit( temphb); | 200 | mPhoneDevice = new QLineEdit( temphb); |
201 | button = new QPushButton( i18n("Help..."), temphb ); | 201 | button = new QPushButton( i18n("Help..."), temphb ); |
202 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); | 202 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); |
203 | 203 | ||
204 | 204 | ||
205 | temphb = new QHBox( phoneWidget ); | 205 | temphb = new QHBox( phoneWidget ); |
206 | new QLabel( i18n("Connection: "), temphb ); | 206 | new QLabel( i18n("Connection: "), temphb ); |
207 | mPhoneConnection = new QLineEdit( temphb); | 207 | mPhoneConnection = new QLineEdit( temphb); |
208 | button = new QPushButton( i18n("Help..."), temphb ); | 208 | button = new QPushButton( i18n("Help..."), temphb ); |
209 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); | 209 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); |
210 | 210 | ||
211 | 211 | ||
212 | temphb = new QHBox( phoneWidget ); | 212 | temphb = new QHBox( phoneWidget ); |
213 | new QLabel( i18n("Model(opt.): "), temphb ); | 213 | new QLabel( i18n("Model(opt.): "), temphb ); |
214 | mPhoneModel = new QLineEdit( temphb); | 214 | mPhoneModel = new QLineEdit( temphb); |
215 | button = new QPushButton( i18n("Help..."), temphb ); | 215 | button = new QPushButton( i18n("Help..."), temphb ); |
216 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); | 216 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); |
217 | 217 | ||
218 | // *** local | 218 | // *** local |
219 | localFileWidget = new QVBox( topFrame); | 219 | localFileWidget = new QVBox( topFrame); |
220 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 220 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
221 | ++iii; | 221 | ++iii; |
222 | temphb = new QHBox( localFileWidget ); | 222 | temphb = new QHBox( localFileWidget ); |
223 | 223 | ||
224 | lab = new QLabel( i18n("Local file Cal:"), temphb ); | 224 | lab = new QLabel( i18n("Local file Cal:"), temphb ); |
225 | lab = new QLabel( i18n("Local file ABook:"), temphb ); | 225 | lab = new QLabel( i18n("Local file ABook:"), temphb ); |
226 | temphb = new QHBox( localFileWidget ); | 226 | temphb = new QHBox( localFileWidget ); |
227 | button = new QPushButton( i18n("Choose..."), temphb ); | 227 | button = new QPushButton( i18n("Choose..."), temphb ); |
228 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 228 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
229 | button = new QPushButton( i18n("Choose..."), temphb ); | 229 | button = new QPushButton( i18n("Choose..."), temphb ); |
230 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); | 230 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); |
231 | temphb = new QHBox( localFileWidget ); | 231 | temphb = new QHBox( localFileWidget ); |
232 | 232 | ||
233 | mRemoteFile = new QLineEdit( temphb); | 233 | mRemoteFile = new QLineEdit( temphb); |
234 | mRemoteFileAB = new QLineEdit( temphb); | 234 | mRemoteFileAB = new QLineEdit( temphb); |
235 | 235 | ||
236 | // *** remote | 236 | // *** remote |
237 | remoteFileWidget = new QVBox( topFrame); | 237 | remoteFileWidget = new QVBox( topFrame); |
238 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 238 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
239 | ++iii; | 239 | ++iii; |
240 | temphb = new QHBox( remoteFileWidget ); | 240 | temphb = new QHBox( remoteFileWidget ); |
241 | new QLabel( i18n("Calendar:"), temphb); | 241 | new QLabel( i18n("Calendar:"), temphb); |
242 | new QLabel( i18n("AddressBook:"), temphb); | 242 | new QLabel( i18n("AddressBook:"), temphb); |
243 | 243 | ||
244 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 244 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
245 | temphb = new QHBox( remoteFileWidget ); | 245 | temphb = new QHBox( remoteFileWidget ); |
246 | mRemotePrecommand = new QLineEdit(temphb); | 246 | mRemotePrecommand = new QLineEdit(temphb); |
247 | mRemotePrecommandAB = new QLineEdit(temphb); | 247 | mRemotePrecommandAB = new QLineEdit(temphb); |
248 | 248 | ||
249 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 249 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
250 | temphb = new QHBox( remoteFileWidget ); | 250 | temphb = new QHBox( remoteFileWidget ); |
251 | mLocalTempFile = new QLineEdit(temphb); | 251 | mLocalTempFile = new QLineEdit(temphb); |
252 | mLocalTempFileAB = new QLineEdit(temphb); | 252 | mLocalTempFileAB = new QLineEdit(temphb); |
253 | 253 | ||
254 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 254 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
255 | temphb = new QHBox( remoteFileWidget ); | 255 | temphb = new QHBox( remoteFileWidget ); |
256 | mRemotePostcommand = new QLineEdit(temphb ); | 256 | mRemotePostcommand = new QLineEdit(temphb ); |
257 | mRemotePostcommandAB = new QLineEdit(temphb ); | 257 | mRemotePostcommandAB = new QLineEdit(temphb ); |
258 | 258 | ||
259 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 259 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
260 | temphb = new QHBox( remoteFileWidget ); | 260 | temphb = new QHBox( remoteFileWidget ); |
261 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 261 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
262 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 262 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
263 | button = new QPushButton( i18n("ftp"), temphb ); | 263 | button = new QPushButton( i18n("ftp"), temphb ); |
264 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 264 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
265 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 265 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
266 | 266 | ||
267 | 267 | ||
268 | } | 268 | } |
269 | void KSyncPrefsDialog::slotOK() | 269 | void KSyncPrefsDialog::slotOK() |
270 | { | 270 | { |
271 | if ( mMyMachineName->text() == "undefined" ) { | 271 | if ( mMyMachineName->text() == "undefined" ) { |
272 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 272 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
273 | return; | 273 | return; |
274 | } | 274 | } |
275 | int i; | 275 | int i; |
276 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { | 276 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { |
277 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { | 277 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { |
278 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); | 278 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); |
279 | return; | 279 | return; |
280 | } | 280 | } |
281 | } | 281 | } |
282 | usrWriteConfig(); | 282 | usrWriteConfig(); |
283 | QDialog::accept(); | 283 | QDialog::accept(); |
284 | } | 284 | } |
285 | void KSyncPrefsDialog::accept() | 285 | void KSyncPrefsDialog::accept() |
286 | { | 286 | { |
287 | slotOK(); | 287 | slotOK(); |
288 | } | 288 | } |
289 | void KSyncPrefsDialog::chooseFile() | 289 | void KSyncPrefsDialog::chooseFile() |
290 | { | 290 | { |
291 | QString fn = QDir::homeDirPath(); | 291 | QString fn = QDir::homeDirPath(); |
292 | 292 | ||
293 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 293 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
294 | if ( fn == "" ) | 294 | if ( fn == "" ) |
295 | return; | 295 | return; |
296 | mRemoteFile->setText( fn ); | 296 | mRemoteFile->setText( fn ); |
297 | } | 297 | } |
298 | 298 | ||
299 | void KSyncPrefsDialog::chooseFileAB() | 299 | void KSyncPrefsDialog::chooseFileAB() |
300 | { | 300 | { |
301 | QString fn = QDir::homeDirPath(); | 301 | QString fn = QDir::homeDirPath(); |
302 | 302 | ||
303 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 303 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
304 | if ( fn == "" ) | 304 | if ( fn == "" ) |
305 | return; | 305 | return; |
306 | mRemoteFileAB->setText( fn ); | 306 | mRemoteFileAB->setText( fn ); |
307 | } | 307 | } |
308 | 308 | ||
309 | void KSyncPrefsDialog::textChanged( const QString & s ) | 309 | void KSyncPrefsDialog::textChanged( const QString & s ) |
310 | { | 310 | { |
311 | if ( mProfileBox->count() == 0 ) | 311 | if ( mProfileBox->count() == 0 ) |
312 | return; | 312 | return; |
313 | if ( currentSelection < 3 ) { | 313 | if ( currentSelection < 3 ) { |
314 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 314 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
315 | mProfileBox->blockSignals( true ); | 315 | mProfileBox->blockSignals( true ); |
316 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 316 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
317 | mProfileBox->blockSignals( false ); | 317 | mProfileBox->blockSignals( false ); |
318 | return; | 318 | return; |
319 | } | 319 | } |
320 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 320 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
321 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 321 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
322 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 322 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
323 | prof->setName( s ); | 323 | prof->setName( s ); |
324 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 324 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
325 | } | 325 | } |
326 | void KSyncPrefsDialog::profileChanged( int item ) | 326 | void KSyncPrefsDialog::profileChanged( int item ) |
327 | { | 327 | { |
328 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); | 328 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); |
329 | KSyncProfile* prof; | 329 | KSyncProfile* prof; |
330 | saveProfile(); | 330 | saveProfile(); |
331 | currentSelection = item; | 331 | currentSelection = item; |
332 | prof = mSyncProfiles.at(item) ; | 332 | prof = mSyncProfiles.at(item) ; |
333 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 333 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
334 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 334 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
335 | mLocalTempFile->setText(prof->getLocalTempFile()); | 335 | mLocalTempFile->setText(prof->getLocalTempFile()); |
336 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 336 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
337 | 337 | ||
338 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); | 338 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); |
339 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); | 339 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); |
340 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); | 340 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); |
341 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; | 341 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; |
342 | 342 | ||
343 | mPhoneDevice->setText(prof->getPhoneDevice()); | 343 | mPhoneDevice->setText(prof->getPhoneDevice()); |
344 | mPhoneConnection->setText(prof->getPhoneConnection()); | 344 | mPhoneConnection->setText(prof->getPhoneConnection()); |
345 | mPhoneModel->setText(prof->getPhoneModel()); | 345 | mPhoneModel->setText(prof->getPhoneModel()); |
346 | 346 | ||
347 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); | 347 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); |
348 | mAskForPreferences->setChecked( prof->getAskForPreferences()); | 348 | mAskForPreferences->setChecked( prof->getAskForPreferences()); |
349 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 349 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
350 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 350 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
351 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 351 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
352 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | 352 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); |
353 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); | 353 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); |
354 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); | 354 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); |
355 | 355 | ||
356 | switch ( prof->getSyncPrefs() ) { | 356 | switch ( prof->getSyncPrefs() ) { |
357 | case 0: | 357 | case 0: |
358 | loc->setChecked( true); | 358 | loc->setChecked( true); |
359 | break; | 359 | break; |
360 | case 1: | 360 | case 1: |
361 | rem->setChecked( true ); | 361 | rem->setChecked( true ); |
362 | break; | 362 | break; |
363 | case 2: | 363 | case 2: |
364 | newest->setChecked( true); | 364 | newest->setChecked( true); |
365 | break; | 365 | break; |
366 | case 3: | 366 | case 3: |
367 | ask->setChecked( true); | 367 | ask->setChecked( true); |
368 | break; | 368 | break; |
369 | case 4: | 369 | case 4: |
370 | f_loc->setChecked( true); | 370 | f_loc->setChecked( true); |
371 | break; | 371 | break; |
372 | case 5: | 372 | case 5: |
373 | f_rem->setChecked( true); | 373 | f_rem->setChecked( true); |
374 | break; | 374 | break; |
375 | case 6: | 375 | case 6: |
376 | //both->setChecked( true); | 376 | //both->setChecked( true); |
377 | break; | 377 | break; |
378 | default: | 378 | default: |
379 | break; | 379 | break; |
380 | } | 380 | } |
381 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; | 381 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; |
382 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; | 382 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; |
383 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); | 383 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); |
384 | proGr->setEnabled( item > 2 ); | 384 | proGr->setEnabled( item > 2 ); |
385 | if ( item < 3 ) { | 385 | if ( item < 3 ) { |
386 | localFileWidget->hide(); | 386 | localFileWidget->hide(); |
387 | remoteFileWidget->hide(); | 387 | remoteFileWidget->hide(); |
388 | phoneWidget->hide(); | 388 | phoneWidget->hide(); |
389 | 389 | ||
390 | } else | 390 | } else |
391 | kindChanged( prof->getIsLocalFileSync() ); | 391 | kindChanged( prof->getIsLocalFileSync() ); |
392 | } | 392 | } |
393 | 393 | ||
394 | void KSyncPrefsDialog::fillSSH() | 394 | void KSyncPrefsDialog::fillSSH() |
395 | { | 395 | { |
396 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 396 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
397 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 397 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
398 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 398 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
399 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 399 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
400 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 400 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
401 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); | 401 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); |
402 | } | 402 | } |
403 | void KSyncPrefsDialog::fillFTP() | 403 | void KSyncPrefsDialog::fillFTP() |
404 | { | 404 | { |
405 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 405 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
406 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 406 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
407 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 407 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
408 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); | 408 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); |
409 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 409 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
410 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 410 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
411 | 411 | ||
412 | } | 412 | } |
413 | void KSyncPrefsDialog::kindChanged( bool b ) | 413 | void KSyncPrefsDialog::kindChanged( bool b ) |
414 | { | 414 | { |
415 | 415 | ||
416 | if ( mIsLocal->isChecked () ) | 416 | if ( mIsLocal->isChecked () ) |
417 | localFileWidget->show(); | 417 | localFileWidget->show(); |
418 | else | 418 | else |
419 | localFileWidget->hide(); | 419 | localFileWidget->hide(); |
420 | 420 | ||
421 | if ( mIsNotLocal->isChecked () ) | 421 | if ( mIsNotLocal->isChecked () ) |
422 | remoteFileWidget->show(); | 422 | remoteFileWidget->show(); |
423 | else | 423 | else |
424 | remoteFileWidget->hide(); | 424 | remoteFileWidget->hide(); |
425 | 425 | ||
426 | if ( mIsPhone->isChecked () ) { | 426 | if ( mIsPhone->isChecked () ) { |
427 | phoneWidget->show(); | 427 | phoneWidget->show(); |
428 | } | 428 | } |
429 | else { | 429 | else { |
430 | phoneWidget->hide(); | 430 | phoneWidget->hide(); |
431 | } | 431 | } |
432 | 432 | ||
433 | } | 433 | } |
434 | void KSyncPrefsDialog::deleteProfile() | 434 | void KSyncPrefsDialog::deleteProfile() |
435 | { | 435 | { |
436 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 436 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
437 | if ( currentSelection >= 0 ) { | 437 | if ( currentSelection >= 0 ) { |
438 | if ( currentSelection < 3 ) { | 438 | if ( currentSelection < 3 ) { |
439 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); | 439 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); |
440 | return; | 440 | return; |
441 | } | 441 | } |
442 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); | 442 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); |
443 | mSyncProfiles.remove( temp ); | 443 | mSyncProfiles.remove( temp ); |
444 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); | 444 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); |
445 | insertProfiles(); | 445 | insertProfiles(); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | 448 | ||
449 | void KSyncPrefsDialog::saveProfile() | 449 | void KSyncPrefsDialog::saveProfile() |
450 | { | 450 | { |
451 | KSyncProfile* prof; | 451 | KSyncProfile* prof; |
452 | if ( currentSelection >= 0 ) { | 452 | if ( currentSelection >= 0 ) { |
453 | prof = mSyncProfiles.at(currentSelection) ; | 453 | prof = mSyncProfiles.at(currentSelection) ; |
454 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 454 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
455 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 455 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
456 | prof->setLocalTempFile( mLocalTempFile->text()); | 456 | prof->setLocalTempFile( mLocalTempFile->text()); |
457 | prof->setRemoteFileName( mRemoteFile->text() ); | 457 | prof->setRemoteFileName( mRemoteFile->text() ); |
458 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); | 458 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); |
459 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); | 459 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); |
460 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); | 460 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); |
461 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); | 461 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); |
462 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 462 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
463 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 463 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
464 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 464 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
465 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 465 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
466 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 466 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
467 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | 467 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); |
468 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 468 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
469 | prof->setSyncPrefs( syncprefs); | 469 | prof->setSyncPrefs( syncprefs); |
470 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 470 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
471 | prof->setIsPhoneSync( mIsPhone->isChecked() ); | 471 | prof->setIsPhoneSync( mIsPhone->isChecked() ); |
472 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); | 472 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); |
473 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); | 473 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); |
474 | prof->setPhoneDevice( mPhoneDevice->text() ); | 474 | prof->setPhoneDevice( mPhoneDevice->text() ); |
475 | prof->setPhoneConnection( mPhoneConnection->text() ); | 475 | prof->setPhoneConnection( mPhoneConnection->text() ); |
476 | prof->setPhoneModel( mPhoneModel->text() ); | 476 | prof->setPhoneModel( mPhoneModel->text() ); |
477 | 477 | ||
478 | } | 478 | } |
479 | 479 | ||
480 | } | 480 | } |
481 | 481 | ||
482 | void KSyncPrefsDialog::insertProfiles() | 482 | void KSyncPrefsDialog::insertProfiles() |
483 | { | 483 | { |
484 | int curItem = mProfileBox->currentItem(); | 484 | int curItem = mProfileBox->currentItem(); |
485 | mProfileBox->blockSignals( true ); | 485 | mProfileBox->blockSignals( true ); |
486 | mProfileBox->clear(); | 486 | mProfileBox->clear(); |
487 | mProfileBox->insertStringList (mSyncProfileNames ); | 487 | mProfileBox->insertStringList (mSyncProfileNames ); |
488 | int item = mSyncProfileNames.count() -1; | 488 | int item = mSyncProfileNames.count() -1; |
489 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) | 489 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) |
490 | mProfileBox->setCurrentItem( curItem ); | 490 | mProfileBox->setCurrentItem( curItem ); |
491 | else if ( item >= 0 ) { | 491 | else if ( item >= 0 ) { |
492 | mProfileBox->setCurrentItem( item ); | 492 | mProfileBox->setCurrentItem( item ); |
493 | } | 493 | } |
494 | currentSelection = -1; | 494 | currentSelection = -1; |
495 | if ( mSyncProfileNames.count() > 0 ) { | 495 | if ( mSyncProfileNames.count() > 0 ) { |
496 | //qDebug(" profileChanged( mProfileBox->currentItem() "); | 496 | //qDebug(" profileChanged( mProfileBox->currentItem() "); |
497 | profileChanged( mProfileBox->currentItem() ); | 497 | profileChanged( mProfileBox->currentItem() ); |
498 | currentSelection = mProfileBox->currentItem(); | 498 | currentSelection = mProfileBox->currentItem(); |
499 | } | 499 | } |
500 | mProfileBox->blockSignals( false ); | 500 | mProfileBox->blockSignals( false ); |
501 | } | 501 | } |
502 | 502 | ||
503 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) | 503 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) |
504 | { | 504 | { |
505 | saveProfile(); | 505 | saveProfile(); |
506 | mSyncProfiles.append( temp ); | 506 | mSyncProfiles.append( temp ); |
507 | mSyncProfileNames << temp->getName(); | 507 | mSyncProfileNames << temp->getName(); |
508 | insertProfiles(); | 508 | insertProfiles(); |
509 | int last = mProfileBox->count() -1; | 509 | int last = mProfileBox->count() -1; |
510 | mProfileBox->blockSignals( true ); | 510 | mProfileBox->blockSignals( true ); |
511 | mProfileBox->setCurrentItem( last ); | 511 | mProfileBox->setCurrentItem( last ); |
512 | mProfileBox->blockSignals( false ); | 512 | mProfileBox->blockSignals( false ); |
513 | profileChanged(last); | 513 | profileChanged(last); |
514 | } | 514 | } |
515 | void KSyncPrefsDialog::newProfile() | 515 | void KSyncPrefsDialog::newProfile() |
516 | { | 516 | { |
517 | addProfile ( new KSyncProfile () ); | 517 | addProfile ( new KSyncProfile () ); |
518 | } | 518 | } |
519 | 519 | ||
520 | void KSyncPrefsDialog::cloneProfile() | 520 | void KSyncPrefsDialog::cloneProfile() |
521 | { | 521 | { |
522 | if ( currentSelection >= 0 ) | 522 | if ( currentSelection >= 0 ) |
523 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; | 523 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; |
524 | else | 524 | else |
525 | newProfile(); | 525 | newProfile(); |
526 | } | 526 | } |
527 | 527 | ||
528 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) | 528 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) |
529 | { | 529 | { |
530 | mMyMachineName->setText( name ); | 530 | mMyMachineName->setText( name ); |
531 | 531 | ||
532 | } | 532 | } |
533 | QString KSyncPrefsDialog::getLocalMachineName ( ) | 533 | QString KSyncPrefsDialog::getLocalMachineName ( ) |
534 | { | 534 | { |
535 | return mMyMachineName->text(); | 535 | return mMyMachineName->text(); |
536 | } | 536 | } |
537 | 537 | ||
538 | QStringList KSyncPrefsDialog::getSyncProfileNames() | 538 | QStringList KSyncPrefsDialog::getSyncProfileNames() |
539 | { | 539 | { |
540 | return mSyncProfileNames; | 540 | return mSyncProfileNames; |
541 | } | 541 | } |
542 | void KSyncPrefsDialog::usrReadConfig() | 542 | void KSyncPrefsDialog::usrReadConfig() |
543 | { | 543 | { |
544 | //KConfig *config = KOGlobals::config(); | 544 | //KConfig *config = KOGlobals::config(); |
545 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 545 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
546 | config.setGroup("General"); | 546 | config.setGroup("General"); |
547 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | 547 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); |
548 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); | 548 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); |
549 | int i; | 549 | int i; |
550 | KSyncProfile* temp ; | 550 | KSyncProfile* temp ; |
551 | mSyncProfiles.clear(); | 551 | mSyncProfiles.clear(); |
552 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 552 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
553 | temp = new KSyncProfile (); | 553 | temp = new KSyncProfile (); |
554 | temp->setName( mSyncProfileNames[i] ); | 554 | temp->setName( mSyncProfileNames[i] ); |
555 | temp->readConfig( &config ); | 555 | temp->readConfig( &config ); |
556 | mSyncProfiles.append( temp ); | 556 | mSyncProfiles.append( temp ); |
557 | } | 557 | } |
558 | insertProfiles(); | 558 | insertProfiles(); |
559 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 559 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
560 | } | 560 | } |
561 | 561 | ||
562 | 562 | ||
563 | void KSyncPrefsDialog::usrWriteConfig() | 563 | void KSyncPrefsDialog::usrWriteConfig() |
564 | { | 564 | { |
565 | saveProfile(); | 565 | saveProfile(); |
566 | if ( currentSelection >= 0 ) | 566 | if ( currentSelection >= 0 ) |
567 | profileChanged(currentSelection); | 567 | profileChanged(currentSelection); |
568 | //KConfig *config = KOGlobals::config(); | 568 | //KConfig *config = KOGlobals::config(); |
569 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 569 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
570 | KSyncProfile* prof = mSyncProfiles.first(); | 570 | KSyncProfile* prof = mSyncProfiles.first(); |
571 | QStringList externalSyncProfileNames; | 571 | QStringList externalSyncProfileNames; |
572 | externalSyncProfileNames.append("Sharp_DTM");; | 572 | externalSyncProfileNames.append("Sharp_DTM");; |
573 | while ( prof ) { | 573 | while ( prof ) { |
574 | prof->writeConfig(&config); | 574 | prof->writeConfig(&config); |
575 | if ( prof->getIsPhoneSync( ) ) | 575 | if ( prof->getIsPhoneSync( ) ) |
576 | externalSyncProfileNames.append(prof->getName( ) ); | 576 | externalSyncProfileNames.append(prof->getName( ) ); |
577 | prof = mSyncProfiles.next(); | 577 | prof = mSyncProfiles.next(); |
578 | } | 578 | } |
579 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 579 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
580 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 580 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
581 | config.setGroup("General"); | 581 | config.setGroup("General"); |
582 | config.writeEntry("SyncProfileNames",mSyncProfileNames); | 582 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
583 | config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); | 583 | config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); |
584 | config.writeEntry("LocalMachineName",mMyMachineName->text()); | 584 | config.writeEntry("LocalMachineName",mMyMachineName->text()); |
585 | config.sync(); | 585 | config.sync(); |
586 | } | 586 | } |
587 | 587 | ||
588 | void KSyncPrefsDialog::helpDevice() | 588 | void KSyncPrefsDialog::helpDevice() |
589 | { | 589 | { |
590 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); | 590 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); |
591 | #ifdef _WIN32_ | 591 | #ifdef _WIN32_ |
592 | hint += "Leave empty for Irda.\n" | 592 | hint += "Leave empty for Irda.\n" |
593 | "com1:\n(first serial port)\n" | 593 | "com1:\n(first serial port)\n" |
594 | "usb not supported\n" | 594 | "usb not supported\n" |
595 | "???\n(bluetooth device address)\n"; | 595 | "???\n(bluetooth device address)\n"; |
596 | 596 | ||
597 | #else | 597 | #else |
598 | hint += "/dev/ircomm\n(Irda)\n" | 598 | hint += "/dev/ircomm\n(Irda)\n" |
599 | "/dev/ttyS0\n(first serial port)\n" | 599 | "/dev/ttyS0\n(first serial port)\n" |
600 | "/dev/ttyUSB0\n(first device usb port)\n" | 600 | "/dev/ttyUSB0\n(first device usb port)\n" |
601 | "???\n(bluetooth device address)\n"; | 601 | "???\n(bluetooth device address)\n"; |
602 | #endif | 602 | #endif |
603 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 603 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
604 | } | 604 | } |
605 | void KSyncPrefsDialog::helpModel() | 605 | void KSyncPrefsDialog::helpModel() |
606 | { | 606 | { |
607 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); | 607 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); |
608 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; | 608 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; |
609 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 609 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
610 | 610 | ||
611 | } | 611 | } |
612 | void KSyncPrefsDialog::helpConnection() | 612 | void KSyncPrefsDialog::helpConnection() |
613 | { | 613 | { |
614 | QString hint = i18n("Insert kind of connection,e.g.:\n"); | 614 | QString hint = i18n("Insert kind of connection,e.g.:\n"); |
615 | hint += "irda | Nokia FBUS over infrared\n" | 615 | hint += "irda | Nokia FBUS over infrared\n" |
616 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" | 616 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" |
617 | "irdaobex | set also model as obex\n" | 617 | "irdaobex | set also model as obex\n" |
618 | "fbus | Nokia FBUS2 serial\n"; | 618 | "fbus | Nokia FBUS2 serial\n"; |
619 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 619 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
620 | } | 620 | } |