-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 | |||
@@ -667,532 +667,532 @@ void MainWindow::initActions() | |||
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")+ |
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 67a3f52..857ceac 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -353,268 +353,268 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
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 | } |