author | zautrix <zautrix> | 2004-08-01 19:29:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 19:29:37 (UTC) |
commit | 062113379f93ed645d2f246183c89eb8b6814834 (patch) (unidiff) | |
tree | 34e3a96d06b40d24c19c4e6814a65f290734563d | |
parent | 3bdbe8154381abc3fca2aaf5c055b59c2f8637a2 (diff) | |
download | kdepimpi-062113379f93ed645d2f246183c89eb8b6814834.zip kdepimpi-062113379f93ed645d2f246183c89eb8b6814834.tar.gz kdepimpi-062113379f93ed645d2f246183c89eb8b6814834.tar.bz2 |
sync dialog fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 10 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 9 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 8 |
3 files changed, 13 insertions, 14 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 298fa82..44b1264 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -566,528 +566,528 @@ void MainWindow::initActions() | |||
566 | 566 | ||
567 | } | 567 | } |
568 | // actionMenu->insertSeparator(); | 568 | // actionMenu->insertSeparator(); |
569 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 569 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
570 | this ); | 570 | this ); |
571 | action->addTo( importMenu ); | 571 | action->addTo( importMenu ); |
572 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 572 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
573 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 573 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
574 | this ); | 574 | this ); |
575 | action->addTo( importMenu ); | 575 | action->addTo( importMenu ); |
576 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 576 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
577 | importMenu->insertSeparator(); | 577 | importMenu->insertSeparator(); |
578 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 578 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
579 | this ); | 579 | this ); |
580 | action->addTo( importMenu ); | 580 | action->addTo( importMenu ); |
581 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 581 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
582 | #ifndef DESKTOP_VERSION | 582 | #ifndef DESKTOP_VERSION |
583 | importMenu->insertSeparator(); | 583 | importMenu->insertSeparator(); |
584 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 584 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
585 | this ); | 585 | this ); |
586 | action->addTo( importMenu ); | 586 | action->addTo( importMenu ); |
587 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 587 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
588 | #else | 588 | #else |
589 | #ifdef _WIN32_ | 589 | #ifdef _WIN32_ |
590 | importMenu->insertSeparator(); | 590 | importMenu->insertSeparator(); |
591 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 591 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
592 | this ); | 592 | this ); |
593 | action->addTo( importMenu ); | 593 | action->addTo( importMenu ); |
594 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 594 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
595 | #endif | 595 | #endif |
596 | #endif | 596 | #endif |
597 | 597 | ||
598 | importMenu->insertSeparator(); | 598 | importMenu->insertSeparator(); |
599 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 599 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
600 | this ); | 600 | this ); |
601 | action->addTo( importMenu ); | 601 | action->addTo( importMenu ); |
602 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 602 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
603 | 603 | ||
604 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 604 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
605 | this ); | 605 | this ); |
606 | action->addTo( importMenu ); | 606 | action->addTo( importMenu ); |
607 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 607 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
608 | 608 | ||
609 | importMenu->insertSeparator(); | 609 | importMenu->insertSeparator(); |
610 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 610 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
611 | this ); | 611 | this ); |
612 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 612 | action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
613 | importMenu->insertSeparator(); | 613 | importMenu->insertSeparator(); |
614 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 614 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
615 | this ); | 615 | this ); |
616 | action->addTo( importMenu ); | 616 | action->addTo( importMenu ); |
617 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 617 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
618 | #ifndef DESKTOP_VERSION | 618 | #ifndef DESKTOP_VERSION |
619 | importMenu->insertSeparator(); | 619 | importMenu->insertSeparator(); |
620 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 620 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
621 | this ); | 621 | this ); |
622 | action->addTo( importMenu ); | 622 | action->addTo( importMenu ); |
623 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 623 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
624 | 624 | ||
625 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 625 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
626 | this ); | 626 | this ); |
627 | action->addTo( importMenu ); | 627 | action->addTo( importMenu ); |
628 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 628 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
629 | #else | 629 | #else |
630 | importMenu->insertSeparator(); | 630 | importMenu->insertSeparator(); |
631 | icon = loadPixmap( pathString + "print" ); | 631 | icon = loadPixmap( pathString + "print" ); |
632 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 632 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
633 | action->addTo( importMenu ); | 633 | action->addTo( importMenu ); |
634 | connect( action, SIGNAL( activated() ), | 634 | connect( action, SIGNAL( activated() ), |
635 | this, SLOT( printCal() ) ); | 635 | this, SLOT( printCal() ) ); |
636 | 636 | ||
637 | icon = loadPixmap( pathString + "print" ); | 637 | icon = loadPixmap( pathString + "print" ); |
638 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 638 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
639 | action->addTo( importMenu ); | 639 | action->addTo( importMenu ); |
640 | connect( action, SIGNAL( activated() ), | 640 | connect( action, SIGNAL( activated() ), |
641 | this, SLOT( printSel() ) ); | 641 | this, SLOT( printSel() ) ); |
642 | #endif | 642 | #endif |
643 | importMenu->insertSeparator(); | 643 | importMenu->insertSeparator(); |
644 | action = new QAction( "beam all", i18n("Save"), 0, | 644 | action = new QAction( "beam all", i18n("Save"), 0, |
645 | this ); | 645 | this ); |
646 | action->addTo( importMenu ); | 646 | action->addTo( importMenu ); |
647 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 647 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
648 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 648 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
649 | this ); | 649 | this ); |
650 | action->addTo( importMenu ); | 650 | action->addTo( importMenu ); |
651 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 651 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
652 | 652 | ||
653 | //menuBar->insertItem( "Configure",configureMenu ); | 653 | //menuBar->insertItem( "Configure",configureMenu ); |
654 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 654 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
655 | icon = loadPixmap( "korganizer/korganizer" ); | 655 | icon = loadPixmap( "korganizer/korganizer" ); |
656 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 656 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
657 | action->addTo( helpMenu ); | 657 | action->addTo( helpMenu ); |
658 | connect( action, SIGNAL( activated() ), | 658 | connect( action, SIGNAL( activated() ), |
659 | SLOT( keyBindings() ) ); | 659 | SLOT( keyBindings() ) ); |
660 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 660 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
661 | action->addTo( helpMenu ); | 661 | action->addTo( helpMenu ); |
662 | connect( action, SIGNAL( activated() ), | 662 | connect( action, SIGNAL( activated() ), |
663 | SLOT( features() ) ); | 663 | SLOT( features() ) ); |
664 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 664 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
665 | action->addTo( helpMenu ); | 665 | action->addTo( helpMenu ); |
666 | connect( action, SIGNAL( activated() ), | 666 | connect( action, SIGNAL( activated() ), |
667 | SLOT( aboutAutoSaving() ) ); | 667 | SLOT( aboutAutoSaving() ) ); |
668 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 668 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
669 | action->addTo( helpMenu ); | 669 | action->addTo( helpMenu ); |
670 | connect( action, SIGNAL( activated() ), | 670 | connect( action, SIGNAL( activated() ), |
671 | SLOT( aboutKnownBugs() ) ); | 671 | SLOT( aboutKnownBugs() ) ); |
672 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 672 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
673 | action->addTo( helpMenu ); | 673 | action->addTo( helpMenu ); |
674 | connect( action, SIGNAL( activated() ), | 674 | connect( action, SIGNAL( activated() ), |
675 | SLOT( usertrans() ) ); | 675 | SLOT( usertrans() ) ); |
676 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 676 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
677 | action->addTo( helpMenu ); | 677 | action->addTo( helpMenu ); |
678 | connect( action, SIGNAL( activated() ), | 678 | connect( action, SIGNAL( activated() ), |
679 | SLOT( synchowto() ) ); | 679 | SLOT( synchowto() ) ); |
680 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 680 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
681 | action->addTo( helpMenu ); | 681 | action->addTo( helpMenu ); |
682 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
683 | SLOT( whatsNew() ) ); | 683 | SLOT( whatsNew() ) ); |
684 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 684 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
685 | action->addTo( helpMenu ); | 685 | action->addTo( helpMenu ); |
686 | connect( action, SIGNAL( activated() ), | 686 | connect( action, SIGNAL( activated() ), |
687 | SLOT( faq() ) ); | 687 | SLOT( faq() ) ); |
688 | 688 | ||
689 | 689 | ||
690 | action = new QAction( "about", i18n("About..."), 0, this ); | 690 | action = new QAction( "about", i18n("About..."), 0, this ); |
691 | action->addTo( helpMenu ); | 691 | action->addTo( helpMenu ); |
692 | connect( action, SIGNAL( activated() ), | 692 | connect( action, SIGNAL( activated() ), |
693 | SLOT( about() ) ); | 693 | SLOT( about() ) ); |
694 | //menuBar->insertSeparator(); | 694 | //menuBar->insertSeparator(); |
695 | 695 | ||
696 | // ****************************************************** | 696 | // ****************************************************** |
697 | // menubar icons | 697 | // menubar icons |
698 | 698 | ||
699 | 699 | ||
700 | iconToolBar->setHorizontalStretchable (true ); | 700 | iconToolBar->setHorizontalStretchable (true ); |
701 | //menuBar->insertItem( iconToolBar ); | 701 | //menuBar->insertItem( iconToolBar ); |
702 | //xdays_action | 702 | //xdays_action |
703 | if (p-> mShowIconNewEvent) | 703 | if (p-> mShowIconNewEvent) |
704 | ne_action->addTo( iconToolBar ); | 704 | ne_action->addTo( iconToolBar ); |
705 | if (p->mShowIconNewTodo ) | 705 | if (p->mShowIconNewTodo ) |
706 | nt_action->addTo( iconToolBar ); | 706 | nt_action->addTo( iconToolBar ); |
707 | if (p-> mShowIconSearch) | 707 | if (p-> mShowIconSearch) |
708 | search_action->addTo( iconToolBar ); | 708 | search_action->addTo( iconToolBar ); |
709 | if (p-> mShowIconNext) | 709 | if (p-> mShowIconNext) |
710 | whatsnext_action->addTo( iconToolBar ); | 710 | whatsnext_action->addTo( iconToolBar ); |
711 | if (p-> mShowIconNextDays) | 711 | if (p-> mShowIconNextDays) |
712 | xdays_action->addTo( iconToolBar ); | 712 | xdays_action->addTo( iconToolBar ); |
713 | if (p-> mShowIconList) | 713 | if (p-> mShowIconList) |
714 | showlist_action->addTo( iconToolBar ); | 714 | showlist_action->addTo( iconToolBar ); |
715 | if (p-> mShowIconDay1) | 715 | if (p-> mShowIconDay1) |
716 | day1_action->addTo( iconToolBar ); | 716 | day1_action->addTo( iconToolBar ); |
717 | if (p-> mShowIconDay5) | 717 | if (p-> mShowIconDay5) |
718 | day5_action->addTo( iconToolBar ); | 718 | day5_action->addTo( iconToolBar ); |
719 | if (p-> mShowIconDay7) | 719 | if (p-> mShowIconDay7) |
720 | day7_action->addTo( iconToolBar ); | 720 | day7_action->addTo( iconToolBar ); |
721 | if (p-> mShowIconMonth) | 721 | if (p-> mShowIconMonth) |
722 | month_action->addTo( iconToolBar ); | 722 | month_action->addTo( iconToolBar ); |
723 | if (p-> mShowIconTodoview) | 723 | if (p-> mShowIconTodoview) |
724 | todoview_action->addTo( iconToolBar ); | 724 | todoview_action->addTo( iconToolBar ); |
725 | if (p-> mShowIconJournal) | 725 | if (p-> mShowIconJournal) |
726 | viewjournal_action->addTo( iconToolBar ); | 726 | viewjournal_action->addTo( iconToolBar ); |
727 | icon = loadPixmap( pathString + "2leftarrowB" ); | 727 | icon = loadPixmap( pathString + "2leftarrowB" ); |
728 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 728 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
729 | if (p-> mShowIconBackFast) { | 729 | if (p-> mShowIconBackFast) { |
730 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 730 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
731 | connect( action, SIGNAL( activated() ), | 731 | connect( action, SIGNAL( activated() ), |
732 | mView, SLOT( goPreviousMonth() ) ); | 732 | mView, SLOT( goPreviousMonth() ) ); |
733 | action->addTo( iconToolBar ); | 733 | action->addTo( iconToolBar ); |
734 | } | 734 | } |
735 | icon = loadPixmap( pathString + "1leftarrowB" ); | 735 | icon = loadPixmap( pathString + "1leftarrowB" ); |
736 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 736 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
737 | if (p-> mShowIconBack) { | 737 | if (p-> mShowIconBack) { |
738 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 738 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
739 | connect( action, SIGNAL( activated() ), | 739 | connect( action, SIGNAL( activated() ), |
740 | mView, SLOT( goPrevious() ) ); | 740 | mView, SLOT( goPrevious() ) ); |
741 | action->addTo( iconToolBar ); | 741 | action->addTo( iconToolBar ); |
742 | } | 742 | } |
743 | if (p-> mShowIconToday) | 743 | if (p-> mShowIconToday) |
744 | today_action->addTo( iconToolBar ); | 744 | today_action->addTo( iconToolBar ); |
745 | icon = loadPixmap( pathString + "1rightarrowB" ); | 745 | icon = loadPixmap( pathString + "1rightarrowB" ); |
746 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 746 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
747 | if (p-> mShowIconForward) { | 747 | if (p-> mShowIconForward) { |
748 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 748 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
749 | connect( action, SIGNAL( activated() ), | 749 | connect( action, SIGNAL( activated() ), |
750 | mView, SLOT( goNext() ) ); | 750 | mView, SLOT( goNext() ) ); |
751 | action->addTo( iconToolBar ); | 751 | action->addTo( iconToolBar ); |
752 | } | 752 | } |
753 | icon = loadPixmap( pathString + "2rightarrowB" ); | 753 | icon = loadPixmap( pathString + "2rightarrowB" ); |
754 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 754 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
755 | if (p-> mShowIconForwardFast) { | 755 | if (p-> mShowIconForwardFast) { |
756 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 756 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
757 | connect( action, SIGNAL( activated() ), | 757 | connect( action, SIGNAL( activated() ), |
758 | mView, SLOT( goNextMonth() ) ); | 758 | mView, SLOT( goNextMonth() ) ); |
759 | action->addTo( iconToolBar ); | 759 | action->addTo( iconToolBar ); |
760 | } | 760 | } |
761 | 761 | ||
762 | 762 | ||
763 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 763 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
764 | 764 | ||
765 | if (p-> mShowIconNewEvent) | 765 | if (p-> mShowIconNewEvent) |
766 | configureToolBarMenu->setItemChecked( 10, true ); | 766 | configureToolBarMenu->setItemChecked( 10, true ); |
767 | if (p->mShowIconNewTodo ) | 767 | if (p->mShowIconNewTodo ) |
768 | configureToolBarMenu->setItemChecked( 20, true ); | 768 | configureToolBarMenu->setItemChecked( 20, true ); |
769 | if (p-> mShowIconSearch) | 769 | if (p-> mShowIconSearch) |
770 | configureToolBarMenu->setItemChecked( 120, true ); | 770 | configureToolBarMenu->setItemChecked( 120, true ); |
771 | if (p-> mShowIconList) | 771 | if (p-> mShowIconList) |
772 | configureToolBarMenu->setItemChecked( 30, true ); | 772 | configureToolBarMenu->setItemChecked( 30, true ); |
773 | if (p-> mShowIconDay1) | 773 | if (p-> mShowIconDay1) |
774 | configureToolBarMenu->setItemChecked( 40, true ); | 774 | configureToolBarMenu->setItemChecked( 40, true ); |
775 | if (p-> mShowIconDay5) | 775 | if (p-> mShowIconDay5) |
776 | configureToolBarMenu->setItemChecked( 50, true ); | 776 | configureToolBarMenu->setItemChecked( 50, true ); |
777 | if (p-> mShowIconDay7) | 777 | if (p-> mShowIconDay7) |
778 | configureToolBarMenu->setItemChecked( 60, true ); | 778 | configureToolBarMenu->setItemChecked( 60, true ); |
779 | if (p-> mShowIconMonth) | 779 | if (p-> mShowIconMonth) |
780 | configureToolBarMenu->setItemChecked( 70, true ); | 780 | configureToolBarMenu->setItemChecked( 70, true ); |
781 | if (p-> mShowIconTodoview) | 781 | if (p-> mShowIconTodoview) |
782 | configureToolBarMenu->setItemChecked( 80, true ); | 782 | configureToolBarMenu->setItemChecked( 80, true ); |
783 | if (p-> mShowIconBackFast) | 783 | if (p-> mShowIconBackFast) |
784 | configureToolBarMenu->setItemChecked( 200, true ); | 784 | configureToolBarMenu->setItemChecked( 200, true ); |
785 | if (p-> mShowIconBack) | 785 | if (p-> mShowIconBack) |
786 | configureToolBarMenu->setItemChecked( 210, true ); | 786 | configureToolBarMenu->setItemChecked( 210, true ); |
787 | if (p-> mShowIconToday) | 787 | if (p-> mShowIconToday) |
788 | configureToolBarMenu->setItemChecked( 130, true ); | 788 | configureToolBarMenu->setItemChecked( 130, true ); |
789 | if (p-> mShowIconForward) | 789 | if (p-> mShowIconForward) |
790 | configureToolBarMenu->setItemChecked( 220, true ); | 790 | configureToolBarMenu->setItemChecked( 220, true ); |
791 | if (p-> mShowIconForwardFast) | 791 | if (p-> mShowIconForwardFast) |
792 | configureToolBarMenu->setItemChecked( 230, true ); | 792 | configureToolBarMenu->setItemChecked( 230, true ); |
793 | if (p-> mShowIconNextDays) | 793 | if (p-> mShowIconNextDays) |
794 | configureToolBarMenu->setItemChecked( 100, true ); | 794 | configureToolBarMenu->setItemChecked( 100, true ); |
795 | if (p-> mShowIconNext) | 795 | if (p-> mShowIconNext) |
796 | configureToolBarMenu->setItemChecked( 110, true ); | 796 | configureToolBarMenu->setItemChecked( 110, true ); |
797 | if (p-> mShowIconJournal) | 797 | if (p-> mShowIconJournal) |
798 | configureToolBarMenu->setItemChecked( 90, true ); | 798 | configureToolBarMenu->setItemChecked( 90, true ); |
799 | if (p-> mShowIconWhatsThis) | 799 | if (p-> mShowIconWhatsThis) |
800 | configureToolBarMenu->setItemChecked( 300, true ); | 800 | configureToolBarMenu->setItemChecked( 300, true ); |
801 | 801 | ||
802 | QLabel* dummy = new QLabel( iconToolBar ); | 802 | QLabel* dummy = new QLabel( iconToolBar ); |
803 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 803 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
804 | if (!p-> mShowIconStretch) | 804 | if (!p-> mShowIconStretch) |
805 | iconToolBar->setStretchableWidget ( dummy ) ; | 805 | iconToolBar->setStretchableWidget ( dummy ) ; |
806 | else | 806 | else |
807 | configureToolBarMenu->setItemChecked( 5, true ); | 807 | configureToolBarMenu->setItemChecked( 5, true ); |
808 | if (p-> mShowIconWhatsThis) | 808 | if (p-> mShowIconWhatsThis) |
809 | QWhatsThis::whatsThisButton ( iconToolBar ); | 809 | QWhatsThis::whatsThisButton ( iconToolBar ); |
810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 810 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
811 | configureAgenda( p->mHourSize ); | 811 | configureAgenda( p->mHourSize ); |
812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 812 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
813 | } | 813 | } |
814 | void MainWindow::fillSyncMenu() | 814 | void MainWindow::fillSyncMenu() |
815 | { | 815 | { |
816 | syncMenu->clear(); | 816 | syncMenu->clear(); |
817 | syncMenu->insertItem( i18n("Configure..."), 0 ); | 817 | syncMenu->insertItem( i18n("Configure..."), 0 ); |
818 | syncMenu->insertSeparator(); | 818 | syncMenu->insertSeparator(); |
819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); | 819 | syncMenu->insertItem( i18n("Multiple sync"), 1 ); |
820 | syncMenu->insertSeparator(); | 820 | syncMenu->insertSeparator(); |
821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 821 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
822 | config.setGroup("SyncProfiles"); | 822 | config.setGroup("General"); |
823 | QStringList prof = config.readListEntry("SyncProfileNames"); | 823 | QStringList prof = config.readListEntry("SyncProfileNames"); |
824 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 824 | KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
825 | if ( prof.count() < 3 ) { | 825 | if ( prof.count() < 3 ) { |
826 | prof.clear(); | 826 | prof.clear(); |
827 | prof << i18n("Sharp-DTM"); | 827 | prof << i18n("Sharp_DTM"); |
828 | prof << i18n("Local file"); | 828 | prof << i18n("Local_file"); |
829 | prof << i18n("Last file"); | 829 | prof << i18n("Last_file"); |
830 | KSyncProfile* temp = new KSyncProfile (); | 830 | KSyncProfile* temp = new KSyncProfile (); |
831 | temp->setName( prof[0] ); | 831 | temp->setName( prof[0] ); |
832 | temp->writeConfig(&config); | 832 | temp->writeConfig(&config); |
833 | temp->setName( prof[1] ); | 833 | temp->setName( prof[1] ); |
834 | temp->writeConfig(&config); | 834 | temp->writeConfig(&config); |
835 | temp->setName( prof[2] ); | 835 | temp->setName( prof[2] ); |
836 | temp->writeConfig(&config); | 836 | temp->writeConfig(&config); |
837 | config.setGroup("SyncProfiles"); | 837 | config.setGroup("General"); |
838 | config.writeEntry("SyncProfileNames",prof); | 838 | config.writeEntry("SyncProfileNames",prof); |
839 | config.sync(); | 839 | config.sync(); |
840 | delete temp; | 840 | delete temp; |
841 | } | 841 | } |
842 | KOPrefs::instance()->mSyncProfileNames = prof; | 842 | KOPrefs::instance()->mSyncProfileNames = prof; |
843 | int i; | 843 | int i; |
844 | for ( i = 0; i < prof.count(); ++i ) { | 844 | for ( i = 0; i < prof.count(); ++i ) { |
845 | 845 | ||
846 | syncMenu->insertItem( prof[i], 1000+i ); | 846 | syncMenu->insertItem( prof[i], 1000+i ); |
847 | if ( i == 2 ) | 847 | if ( i == 2 ) |
848 | syncMenu->insertSeparator(); | 848 | syncMenu->insertSeparator(); |
849 | } | 849 | } |
850 | QDir app_dir; | 850 | QDir app_dir; |
851 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 851 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
852 | syncMenu->setItemEnabled( false , 1000 ); | 852 | syncMenu->setItemEnabled( false , 1000 ); |
853 | } | 853 | } |
854 | } | 854 | } |
855 | 855 | ||
856 | int MainWindow::ringSync() | 856 | int MainWindow::ringSync() |
857 | { | 857 | { |
858 | int syncedProfiles = 0; | 858 | int syncedProfiles = 0; |
859 | int i; | 859 | int i; |
860 | QTime timer; | 860 | QTime timer; |
861 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 861 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
862 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 862 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
863 | KSyncProfile* temp = new KSyncProfile (); | 863 | KSyncProfile* temp = new KSyncProfile (); |
864 | KOPrefs::instance()->mAskForPreferences = false; | 864 | KOPrefs::instance()->mAskForPreferences = false; |
865 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 865 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
866 | mCurrentSyncProfile = i; | 866 | mCurrentSyncProfile = i; |
867 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 867 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
868 | temp->readConfig(&config); | 868 | temp->readConfig(&config); |
869 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 869 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |
870 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 870 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
871 | ++syncedProfiles; | 871 | ++syncedProfiles; |
872 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 872 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
873 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 873 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
874 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 874 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
875 | KOPrefs::instance()->mShowSyncSummary = false; | 875 | KOPrefs::instance()->mShowSyncSummary = false; |
876 | mView->setSyncDevice(syncProfileNames[i] ); | 876 | mView->setSyncDevice(syncProfileNames[i] ); |
877 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 877 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
878 | if ( i == 0 ) { | 878 | if ( i == 0 ) { |
879 | syncSharp(); | 879 | syncSharp(); |
880 | } else { | 880 | } else { |
881 | if ( temp->getIsLocalFileSync() ) { | 881 | if ( temp->getIsLocalFileSync() ) { |
882 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) | 882 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) |
883 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 883 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
884 | } else { | 884 | } else { |
885 | syncRemote( temp, false ); | 885 | syncRemote( temp, false ); |
886 | 886 | ||
887 | } | 887 | } |
888 | } | 888 | } |
889 | timer.start(); | 889 | timer.start(); |
890 | setCaption(i18n("Multiple sync in progress ... please wait!") ); | 890 | setCaption(i18n("Multiple sync in progress ... please wait!") ); |
891 | while ( timer.elapsed () < 2000 ) { | 891 | while ( timer.elapsed () < 2000 ) { |
892 | qApp->processEvents(); | 892 | qApp->processEvents(); |
893 | #ifndef _WIN32_ | 893 | #ifndef _WIN32_ |
894 | sleep (1); | 894 | sleep (1); |
895 | #endif | 895 | #endif |
896 | } | 896 | } |
897 | 897 | ||
898 | } | 898 | } |
899 | 899 | ||
900 | } | 900 | } |
901 | delete temp; | 901 | delete temp; |
902 | return syncedProfiles; | 902 | return syncedProfiles; |
903 | } | 903 | } |
904 | 904 | ||
905 | void MainWindow::multiSync( bool askforPrefs ) | 905 | void MainWindow::multiSync( bool askforPrefs ) |
906 | { | 906 | { |
907 | if (mBlockSaveFlag) | 907 | if (mBlockSaveFlag) |
908 | return; | 908 | return; |
909 | mBlockSaveFlag = true; | 909 | mBlockSaveFlag = true; |
910 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 910 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
911 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), | 911 | if ( QMessageBox::information( this, i18n("KO/Pi Sync"), |
912 | question, | 912 | question, |
913 | i18n("Yes"), i18n("No"), | 913 | i18n("Yes"), i18n("No"), |
914 | 0, 0 ) != 0 ) { | 914 | 0, 0 ) != 0 ) { |
915 | mBlockSaveFlag = false; | 915 | mBlockSaveFlag = false; |
916 | setCaption(i18n("Aborted! Nothing synced!")); | 916 | setCaption(i18n("Aborted! Nothing synced!")); |
917 | return; | 917 | return; |
918 | } | 918 | } |
919 | mView->setSyncDevice(i18n("Multiple profiles") ); | 919 | mView->setSyncDevice(i18n("Multiple profiles") ); |
920 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; | 920 | KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; |
921 | if ( askforPrefs ) { | 921 | if ( askforPrefs ) { |
922 | mView->edit_sync_options(); | 922 | mView->edit_sync_options(); |
923 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; | 923 | KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; |
924 | } | 924 | } |
925 | setCaption(i18n("Multiple sync started.") ); | 925 | setCaption(i18n("Multiple sync started.") ); |
926 | qApp->processEvents(); | 926 | qApp->processEvents(); |
927 | int num = ringSync() ; | 927 | int num = ringSync() ; |
928 | if ( num > 1 ) | 928 | if ( num > 1 ) |
929 | ringSync(); | 929 | ringSync(); |
930 | mBlockSaveFlag = false; | 930 | mBlockSaveFlag = false; |
931 | if ( num ) | 931 | if ( num ) |
932 | save(); | 932 | save(); |
933 | if ( num ) | 933 | if ( num ) |
934 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); | 934 | setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); |
935 | else | 935 | else |
936 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 936 | setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
937 | return; | 937 | return; |
938 | } | 938 | } |
939 | void MainWindow::slotSyncMenu( int action ) | 939 | void MainWindow::slotSyncMenu( int action ) |
940 | { | 940 | { |
941 | //qDebug("syncaction %d ", action); | 941 | //qDebug("syncaction %d ", action); |
942 | if ( action == 0 ) { | 942 | if ( action == 0 ) { |
943 | 943 | ||
944 | confSync(); | 944 | confSync(); |
945 | 945 | ||
946 | return; | 946 | return; |
947 | } | 947 | } |
948 | if ( action == 1 ) { | 948 | if ( action == 1 ) { |
949 | multiSync( true ); | 949 | multiSync( true ); |
950 | return; | 950 | return; |
951 | } | 951 | } |
952 | 952 | ||
953 | if (mBlockSaveFlag) | 953 | if (mBlockSaveFlag) |
954 | return; | 954 | return; |
955 | mBlockSaveFlag = true; | 955 | mBlockSaveFlag = true; |
956 | mCurrentSyncProfile = action - 1000 ; | 956 | mCurrentSyncProfile = action - 1000 ; |
957 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); | 957 | mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); |
958 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 958 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
959 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 959 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
960 | KSyncProfile* temp = new KSyncProfile (); | 960 | KSyncProfile* temp = new KSyncProfile (); |
961 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); | 961 | temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); |
962 | temp->readConfig(&config); | 962 | temp->readConfig(&config); |
963 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 963 | KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
964 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); | 964 | KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); |
965 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 965 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
966 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 966 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
967 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); | 967 | KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); |
968 | if ( action == 1000 ) { | 968 | if ( action == 1000 ) { |
969 | syncSharp(); | 969 | syncSharp(); |
970 | 970 | ||
971 | } else if ( action == 1001 ) { | 971 | } else if ( action == 1001 ) { |
972 | syncLocalFile(); | 972 | syncLocalFile(); |
973 | 973 | ||
974 | } else if ( action == 1002 ) { | 974 | } else if ( action == 1002 ) { |
975 | quickSyncLocalFile(); | 975 | quickSyncLocalFile(); |
976 | 976 | ||
977 | } else if ( action >= 1003 ) { | 977 | } else if ( action >= 1003 ) { |
978 | if ( temp->getIsLocalFileSync() ) { | 978 | if ( temp->getIsLocalFileSync() ) { |
979 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 979 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
980 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 980 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
981 | } else { | 981 | } else { |
982 | syncRemote( temp ); | 982 | syncRemote( temp ); |
983 | 983 | ||
984 | } | 984 | } |
985 | } | 985 | } |
986 | delete temp; | 986 | delete temp; |
987 | mBlockSaveFlag = false; | 987 | mBlockSaveFlag = false; |
988 | } | 988 | } |
989 | void MainWindow::setDefaultPreferences() | 989 | void MainWindow::setDefaultPreferences() |
990 | { | 990 | { |
991 | KOPrefs *p = KOPrefs::instance(); | 991 | KOPrefs *p = KOPrefs::instance(); |
992 | 992 | ||
993 | p->mCompactDialogs = true; | 993 | p->mCompactDialogs = true; |
994 | p->mConfirm = true; | 994 | p->mConfirm = true; |
995 | // p->mEnableQuickTodo = false; | 995 | // p->mEnableQuickTodo = false; |
996 | } | 996 | } |
997 | 997 | ||
998 | QString MainWindow::resourcePath() | 998 | QString MainWindow::resourcePath() |
999 | { | 999 | { |
1000 | return KGlobal::iconLoader()->iconPath(); | 1000 | return KGlobal::iconLoader()->iconPath(); |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | void MainWindow::displayText( QString text ,QString cap ) | 1003 | void MainWindow::displayText( QString text ,QString cap ) |
1004 | { | 1004 | { |
1005 | QDialog dia( this, "name", true ); ; | 1005 | QDialog dia( this, "name", true ); ; |
1006 | dia.setCaption( cap ); | 1006 | dia.setCaption( cap ); |
1007 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1007 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1008 | lay->setSpacing( 3 ); | 1008 | lay->setSpacing( 3 ); |
1009 | lay->setMargin( 3 ); | 1009 | lay->setMargin( 3 ); |
1010 | QTextBrowser tb ( &dia ); | 1010 | QTextBrowser tb ( &dia ); |
1011 | lay->addWidget( &tb ); | 1011 | lay->addWidget( &tb ); |
1012 | tb.setText( text ); | 1012 | tb.setText( text ); |
1013 | #ifdef DESKTOP_VERSION | 1013 | #ifdef DESKTOP_VERSION |
1014 | dia.resize( 640, 480); | 1014 | dia.resize( 640, 480); |
1015 | #else | 1015 | #else |
1016 | dia.showMaximized(); | 1016 | dia.showMaximized(); |
1017 | #endif | 1017 | #endif |
1018 | dia.exec(); | 1018 | dia.exec(); |
1019 | } | 1019 | } |
1020 | void MainWindow::displayFile( QString fn, QString cap ) | 1020 | void MainWindow::displayFile( QString fn, QString cap ) |
1021 | { | 1021 | { |
1022 | QString fileName = resourcePath() + fn; | 1022 | QString fileName = resourcePath() + fn; |
1023 | QString text; | 1023 | QString text; |
1024 | QFile file( fileName ); | 1024 | QFile file( fileName ); |
1025 | if (!file.open( IO_ReadOnly ) ) { | 1025 | if (!file.open( IO_ReadOnly ) ) { |
1026 | return ; | 1026 | return ; |
1027 | 1027 | ||
1028 | } | 1028 | } |
1029 | QTextStream ts( &file ); | 1029 | QTextStream ts( &file ); |
1030 | text = ts.read(); | 1030 | text = ts.read(); |
1031 | file.close(); | 1031 | file.close(); |
1032 | displayText( text, cap); | 1032 | displayText( text, cap); |
1033 | } | 1033 | } |
1034 | void MainWindow::features() | 1034 | void MainWindow::features() |
1035 | { | 1035 | { |
1036 | 1036 | ||
1037 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1037 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | void MainWindow::usertrans() | 1040 | void MainWindow::usertrans() |
1041 | { | 1041 | { |
1042 | 1042 | ||
1043 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1043 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); |
1044 | } | 1044 | } |
1045 | void MainWindow::synchowto() | 1045 | void MainWindow::synchowto() |
1046 | { | 1046 | { |
1047 | 1047 | ||
1048 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); | 1048 | displayFile( "howtoSYNC.txt",i18n("KO/Pi Synchronization HowTo") ); |
1049 | } | 1049 | } |
1050 | void MainWindow::faq() | 1050 | void MainWindow::faq() |
1051 | { | 1051 | { |
1052 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1052 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); |
1053 | 1053 | ||
1054 | } | 1054 | } |
1055 | void MainWindow::whatsNew() | 1055 | void MainWindow::whatsNew() |
1056 | { | 1056 | { |
1057 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); | 1057 | displayFile( "kopiWhatsNew.txt",i18n("KO/Pi Version Info") ); |
1058 | 1058 | ||
1059 | } | 1059 | } |
1060 | void MainWindow::about() | 1060 | void MainWindow::about() |
1061 | { | 1061 | { |
1062 | QString version; | 1062 | QString version; |
1063 | #include <../version> | 1063 | #include <../version> |
1064 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1064 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1065 | i18n("KOrganizer/Platform-independent\n") + | 1065 | i18n("KOrganizer/Platform-independent\n") + |
1066 | "(KO/Pi) " + version + " - " + | 1066 | "(KO/Pi) " + version + " - " + |
1067 | 1067 | ||
1068 | #ifdef DESKTOP_VERSION | 1068 | #ifdef DESKTOP_VERSION |
1069 | i18n("Desktop Edition\n") + | 1069 | i18n("Desktop Edition\n") + |
1070 | #else | 1070 | #else |
1071 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1071 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1072 | #endif | 1072 | #endif |
1073 | 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") ); | 1073 | 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") ); |
1074 | } | 1074 | } |
1075 | void MainWindow::keyBindings() | 1075 | void MainWindow::keyBindings() |
1076 | { | 1076 | { |
1077 | QString cap = i18n("Key bindings KOrganizer/Pi"); | 1077 | QString cap = i18n("Key bindings KOrganizer/Pi"); |
1078 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1078 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1079 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1079 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1080 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1080 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1081 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1081 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1082 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1082 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1083 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1083 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1084 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1084 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1085 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1085 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1086 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1086 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1087 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1087 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1088 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1088 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1089 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1089 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1090 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1090 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1091 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1091 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1092 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1092 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1093 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1093 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 2f38c83..59c8418 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -290,326 +290,325 @@ 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","syncprofilesrc" ) ); |
546 | config.setGroup("SyncProfiles"); | 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","syncprofilesrc" ) ); |
570 | config.setGroup("SyncProfiles"); | ||
571 | KSyncProfile* prof = mSyncProfiles.first(); | 570 | KSyncProfile* prof = mSyncProfiles.first(); |
572 | while ( prof ) { | 571 | while ( prof ) { |
573 | prof->writeConfig(&config); | 572 | prof->writeConfig(&config); |
574 | prof = mSyncProfiles.next(); | 573 | prof = mSyncProfiles.next(); |
575 | } | 574 | } |
576 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 575 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
577 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 576 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
577 | config.setGroup("General"); | ||
578 | config.writeEntry("SyncProfileNames",mSyncProfileNames); | 578 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
579 | QString name = mMyMachineName->text(); | 579 | config.writeEntry("LocalMachineName",mMyMachineName->text()); |
580 | config.writeEntry("LocalMachineName",name); | ||
581 | } | 580 | } |
582 | 581 | ||
583 | void KSyncPrefsDialog::helpDevice() | 582 | void KSyncPrefsDialog::helpDevice() |
584 | { | 583 | { |
585 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); | 584 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); |
586 | #ifdef _WIN32_ | 585 | #ifdef _WIN32_ |
587 | hint += "leave empty for Irda\n" | 586 | hint += "Leave empty for Irda.\n" |
588 | "com1:\n(first serial port)\n" | 587 | "com1:\n(first serial port)\n" |
589 | "usb not supported\n" | 588 | "usb not supported\n" |
590 | "???\n(bluetooth device address)\n"; | 589 | "???\n(bluetooth device address)\n"; |
591 | 590 | ||
592 | #else | 591 | #else |
593 | hint += "/dev/ircomm\n(Irda)\n" | 592 | hint += "/dev/ircomm\n(Irda)\n" |
594 | "/dev/ttyS0\n(first serial port)\n" | 593 | "/dev/ttyS0\n(first serial port)\n" |
595 | "/dev/ttyUSB0\n(first device usb port)\n" | 594 | "/dev/ttyUSB0\n(first device usb port)\n" |
596 | "???\n(bluetooth device address)\n"; | 595 | "???\n(bluetooth device address)\n"; |
597 | #endif | 596 | #endif |
598 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 597 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
599 | } | 598 | } |
600 | void KSyncPrefsDialog::helpModel() | 599 | void KSyncPrefsDialog::helpModel() |
601 | { | 600 | { |
602 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); | 601 | QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); |
603 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; | 602 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; |
604 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 603 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
605 | 604 | ||
606 | } | 605 | } |
607 | void KSyncPrefsDialog::helpConnection() | 606 | void KSyncPrefsDialog::helpConnection() |
608 | { | 607 | { |
609 | QString hint = i18n("Insert kind of connection,e.g.:\n"); | 608 | QString hint = i18n("Insert kind of connection,e.g.:\n"); |
610 | hint += "irda | Nokia FBUS over infrared\n" | 609 | hint += "irda | Nokia FBUS over infrared\n" |
611 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" | 610 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" |
612 | "irdaobex | set also model as obex\n" | 611 | "irdaobex | set also model as obex\n" |
613 | "fbus | Nokia FBUS2 serial\n"; | 612 | "fbus | Nokia FBUS2 serial\n"; |
614 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 613 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
615 | } | 614 | } |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 425285e..fcbb326 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -1,173 +1,173 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | 24 | ||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 26 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) | 33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) |
34 | { | 34 | { |
35 | setDefault(); | 35 | setDefault(); |
36 | } | 36 | } |
37 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
44 | { | 44 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setPreSyncCommand( mPreSyncCommand ); | 46 | myClone->setPreSyncCommand( mPreSyncCommand ); |
47 | myClone->setPostSyncCommand( mPostSyncCommand ); | 47 | myClone->setPostSyncCommand( mPostSyncCommand ); |
48 | myClone->setLocalTempFile( mLocalTempFile); | 48 | myClone->setLocalTempFile( mLocalTempFile); |
49 | myClone->setRemoteFileName( mRemoteFileName ); | 49 | myClone->setRemoteFileName( mRemoteFileName ); |
50 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); | 50 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); |
51 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); | 51 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); |
52 | myClone->setLocalTempFileAB( mLocalTempFileAB); | 52 | myClone->setLocalTempFileAB( mLocalTempFileAB); |
53 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); | 53 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); |
54 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 54 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
55 | myClone->setAskForPreferences( mAskForPreferences); | 55 | myClone->setAskForPreferences( mAskForPreferences); |
56 | myClone->setWriteBackExisting(mWriteBackExisting ); | 56 | myClone->setWriteBackExisting(mWriteBackExisting ); |
57 | myClone->setWriteBackFile( mWriteBackFile); | 57 | myClone->setWriteBackFile( mWriteBackFile); |
58 | myClone->setWriteBackFuture( mWriteBackFuture ); | 58 | myClone->setWriteBackFuture( mWriteBackFuture ); |
59 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); | 59 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); |
60 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 60 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
61 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | 61 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); |
62 | myClone->setSyncPrefs( mSyncPrefs); | 62 | myClone->setSyncPrefs( mSyncPrefs); |
63 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 63 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
64 | myClone->setIsPhoneSync( mIsPhoneSync ); | 64 | myClone->setIsPhoneSync( mIsPhoneSync ); |
65 | myClone->setName( "noName" ); | 65 | myClone->setName( "noName" ); |
66 | return myClone; | 66 | return myClone; |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
70 | void KSyncProfile::setDefault() | 70 | void KSyncProfile::setDefault() |
71 | { | 71 | { |
72 | mName = "noName"; | 72 | mName = "noName"; |
73 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 73 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
74 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 74 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
75 | mLocalTempFile = "/tmp/mycalendar.ics"; | 75 | mLocalTempFile = "/tmp/mycalendar.ics"; |
76 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 76 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
77 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); | 77 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); |
78 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); | 78 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); |
79 | mLocalTempFileAB = "/tmp/std.vcf"; | 79 | mLocalTempFileAB = "/tmp/std.vcf"; |
80 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | 80 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; |
81 | mShowSummaryAfterSync = true; | 81 | mShowSummaryAfterSync = true; |
82 | mAskForPreferences = true; | 82 | mAskForPreferences = true; |
83 | mWriteBackExisting = false; | 83 | mWriteBackExisting = false; |
84 | mWriteBackFuture = false; | 84 | mWriteBackFuture = false; |
85 | mWriteBackFutureWeeks = 12; | 85 | mWriteBackFutureWeeks = 12; |
86 | mWriteBackFile = true; | 86 | mWriteBackFile = true; |
87 | mIncludeInRingSync = false; | 87 | mIncludeInRingSync = false; |
88 | mIncludeInRingSyncAB = false; | 88 | mIncludeInRingSyncAB = false; |
89 | mSyncPrefs = SYNC_PREF_ASK; | 89 | mSyncPrefs = SYNC_PREF_ASK; |
90 | mIsLocalFileSync = true; | 90 | mIsLocalFileSync = true; |
91 | mIsPhoneSync = false; | 91 | mIsPhoneSync = false; |
92 | mPhoneDevice = "/dev/ircomm"; | 92 | mPhoneDevice = "/dev/ircomm"; |
93 | mPhoneConnection = "irda"; | 93 | mPhoneConnection = "irda"; |
94 | mPhoneModel = "6310i"; | 94 | mPhoneModel = "6310i"; |
95 | 95 | ||
96 | } | 96 | } |
97 | void KSyncProfile::readConfig(KConfig *config ) | 97 | void KSyncProfile::readConfig(KConfig *config ) |
98 | { | 98 | { |
99 | config->setGroup("SyncProfiles"); | 99 | config->setGroup(mName); |
100 | QString prefix = "Profile_"+mName+"_"; | 100 | QString prefix = ""; |
101 | //mName = config->readEntry( prefix+ "Name", mName ); | 101 | //mName = config->readEntry( prefix+ "Name", mName ); |
102 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 102 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
103 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );; | 103 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );; |
104 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 104 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
105 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 105 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
106 | 106 | ||
107 | mPreSyncCommandAB = config->readEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); | 107 | mPreSyncCommandAB = config->readEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); |
108 | mPostSyncCommandAB = config->readEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); | 108 | mPostSyncCommandAB = config->readEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); |
109 | mLocalTempFileAB = config->readEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); | 109 | mLocalTempFileAB = config->readEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); |
110 | mRemoteFileNameAB = config->readEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); | 110 | mRemoteFileNameAB = config->readEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); |
111 | 111 | ||
112 | 112 | ||
113 | mPhoneDevice = config->readEntry( prefix+ "PhoneDevice", mPhoneDevice ); | 113 | mPhoneDevice = config->readEntry( prefix+ "PhoneDevice", mPhoneDevice ); |
114 | mPhoneConnection = config->readEntry( prefix+ "PhoneConnection", mPhoneConnection ); | 114 | mPhoneConnection = config->readEntry( prefix+ "PhoneConnection", mPhoneConnection ); |
115 | mPhoneModel = config->readEntry( prefix+ "PhoneModel", mPhoneModel ); | 115 | mPhoneModel = config->readEntry( prefix+ "PhoneModel", mPhoneModel ); |
116 | 116 | ||
117 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 117 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
118 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 118 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
119 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 119 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
120 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 120 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
121 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 121 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
122 | mWriteBackFuture = config->readBoolEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); | 122 | mWriteBackFuture = config->readBoolEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); |
123 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 123 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
124 | mWriteBackFutureWeeks = config->readNumEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks ); | 124 | mWriteBackFutureWeeks = config->readNumEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks ); |
125 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 125 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
126 | mIsPhoneSync= config->readBoolEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); | 126 | mIsPhoneSync= config->readBoolEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); |
127 | } | 127 | } |
128 | void KSyncProfile::writeConfig( KConfig * config ) | 128 | void KSyncProfile::writeConfig( KConfig * config ) |
129 | { | 129 | { |
130 | config->setGroup("SyncProfiles"); | 130 | config->setGroup(mName ); |
131 | QString prefix = "Profile_"+mName+"_"; | 131 | QString prefix = ""; |
132 | // config->writeEntry( prefix+ "Name", mName ); | 132 | // config->writeEntry( prefix+ "Name", mName ); |
133 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 133 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
134 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 134 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
135 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 135 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
136 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 136 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
137 | 137 | ||
138 | config->writeEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); | 138 | config->writeEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); |
139 | config->writeEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); | 139 | config->writeEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); |
140 | config->writeEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); | 140 | config->writeEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); |
141 | config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); | 141 | config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); |
142 | 142 | ||
143 | config->writeEntry( prefix+ "PhoneDevice", mPhoneDevice ); | 143 | config->writeEntry( prefix+ "PhoneDevice", mPhoneDevice ); |
144 | config->writeEntry( prefix+ "PhoneConnection", mPhoneConnection ); | 144 | config->writeEntry( prefix+ "PhoneConnection", mPhoneConnection ); |
145 | config->writeEntry( prefix+ "PhoneModel", mPhoneModel ); | 145 | config->writeEntry( prefix+ "PhoneModel", mPhoneModel ); |
146 | 146 | ||
147 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 147 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
148 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 148 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
149 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 149 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
150 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 150 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
151 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 151 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
152 | config->writeEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); | 152 | config->writeEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); |
153 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 153 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
154 | config->writeEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks); | 154 | config->writeEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks); |
155 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 155 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
156 | config->writeEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); | 156 | config->writeEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
160 | class KPrefsItemInt : public KPrefsItem { | 160 | class KPrefsItemInt : public KPrefsItem { |
161 | public: | 161 | public: |
162 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); | 162 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); |
163 | virtual ~KPrefsItemInt() {} | 163 | virtual ~KPrefsItemInt() {} |
164 | 164 | ||
165 | void setDefault(); | 165 | void setDefault(); |
166 | void readConfig(KConfig *); | 166 | void readConfig(KConfig *); |
167 | void writeConfig(KConfig *); | 167 | void writeConfig(KConfig *); |
168 | 168 | ||
169 | private: | 169 | private: |
170 | int *mReference; | 170 | int *mReference; |
171 | int mDefault; | 171 | int mDefault; |
172 | }; | 172 | }; |
173 | */ | 173 | */ |