author | zautrix <zautrix> | 2004-08-01 14:19:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 14:19:41 (UTC) |
commit | 3a4186926d078692ad3c2261b70406c391f27554 (patch) (unidiff) | |
tree | 6f71c51606a786711ca2885beb8ee20068e3ccd0 /korganizer | |
parent | 43d6cf3619675856333d82ae2fcad6ce81d824b8 (diff) | |
download | kdepimpi-3a4186926d078692ad3c2261b70406c391f27554.zip kdepimpi-3a4186926d078692ad3c2261b70406c391f27554.tar.gz kdepimpi-3a4186926d078692ad3c2261b70406c391f27554.tar.bz2 |
Fixed sync config
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d0d1f3b..298fa82 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -733,358 +733,358 @@ void MainWindow::initActions() | |||
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("SyncProfiles"); |
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("SyncProfiles"); |
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 = KOGlobals::config(); | 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 = KOGlobals::config(); | 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")+ |