-rw-r--r-- | korganizer/calendarview.cpp | 11 | ||||
-rw-r--r-- | korganizer/filteredit_base.cpp | 73 | ||||
-rw-r--r-- | korganizer/filteredit_base.h | 18 | ||||
-rw-r--r-- | korganizer/filteredit_base.ui | 123 | ||||
-rw-r--r-- | korganizer/korganizer.pro | 4 | ||||
-rw-r--r-- | libkcal/calfilter.h | 2 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 10 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 4 |
8 files changed, 170 insertions, 75 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 378c7d4..8258c74 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -871,256 +871,267 @@ Event* CalendarView::getLastSyncEvent() | |||
871 | lse->setDtStart( mLastCalendarSync ); | 871 | lse->setDtStart( mLastCalendarSync ); |
872 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); | 872 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); |
873 | lse->setCategories( i18n("SyncEvent") ); | 873 | lse->setCategories( i18n("SyncEvent") ); |
874 | lse->setReadOnly( true ); | 874 | lse->setReadOnly( true ); |
875 | mCalendar->addEvent( lse ); | 875 | mCalendar->addEvent( lse ); |
876 | } | 876 | } |
877 | 877 | ||
878 | return lse; | 878 | return lse; |
879 | 879 | ||
880 | } | 880 | } |
881 | 881 | ||
882 | // we check, if the to delete event has a id for a profile | 882 | // we check, if the to delete event has a id for a profile |
883 | // if yes, we set this id in the profile to delete | 883 | // if yes, we set this id in the profile to delete |
884 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) | 884 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) |
885 | { | 885 | { |
886 | if ( lastSync.count() == 0 ) { | 886 | if ( lastSync.count() == 0 ) { |
887 | //qDebug(" lastSync.count() == 0"); | 887 | //qDebug(" lastSync.count() == 0"); |
888 | return; | 888 | return; |
889 | } | 889 | } |
890 | if ( toDelete->type() == "Journal" ) | 890 | if ( toDelete->type() == "Journal" ) |
891 | return; | 891 | return; |
892 | 892 | ||
893 | Event* eve = lastSync.first(); | 893 | Event* eve = lastSync.first(); |
894 | 894 | ||
895 | while ( eve ) { | 895 | while ( eve ) { |
896 | QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name | 896 | QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name |
897 | if ( !id.isEmpty() ) { | 897 | if ( !id.isEmpty() ) { |
898 | QString des = eve->description(); | 898 | QString des = eve->description(); |
899 | QString pref = "e"; | 899 | QString pref = "e"; |
900 | if ( toDelete->type() == "Todo" ) | 900 | if ( toDelete->type() == "Todo" ) |
901 | pref = "t"; | 901 | pref = "t"; |
902 | des += pref+ id + ","; | 902 | des += pref+ id + ","; |
903 | eve->setReadOnly( false ); | 903 | eve->setReadOnly( false ); |
904 | eve->setDescription( des ); | 904 | eve->setDescription( des ); |
905 | //qDebug("setdes %s ", des.latin1()); | 905 | //qDebug("setdes %s ", des.latin1()); |
906 | eve->setReadOnly( true ); | 906 | eve->setReadOnly( true ); |
907 | } | 907 | } |
908 | eve = lastSync.next(); | 908 | eve = lastSync.next(); |
909 | } | 909 | } |
910 | 910 | ||
911 | } | 911 | } |
912 | void CalendarView::checkExternalId( Incidence * inc ) | 912 | void CalendarView::checkExternalId( Incidence * inc ) |
913 | { | 913 | { |
914 | QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; | 914 | QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; |
915 | checkExternSyncEvent( lastSync, inc ); | 915 | checkExternSyncEvent( lastSync, inc ); |
916 | 916 | ||
917 | } | 917 | } |
918 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) | 918 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) |
919 | { | 919 | { |
920 | bool syncOK = true; | 920 | bool syncOK = true; |
921 | int addedEvent = 0; | 921 | int addedEvent = 0; |
922 | int addedEventR = 0; | 922 | int addedEventR = 0; |
923 | int deletedEventR = 0; | 923 | int deletedEventR = 0; |
924 | int deletedEventL = 0; | 924 | int deletedEventL = 0; |
925 | int changedLocal = 0; | 925 | int changedLocal = 0; |
926 | int changedRemote = 0; | 926 | int changedRemote = 0; |
927 | //QPtrList<Event> el = local->rawEvents(); | 927 | //QPtrList<Event> el = local->rawEvents(); |
928 | Event* eventR; | 928 | Event* eventR; |
929 | QString uid; | 929 | QString uid; |
930 | int take; | 930 | int take; |
931 | Event* eventL; | 931 | Event* eventL; |
932 | Event* eventRSync; | 932 | Event* eventRSync; |
933 | Event* eventLSync; | 933 | Event* eventLSync; |
934 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); | 934 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); |
935 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); | 935 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); |
936 | bool fullDateRange = false; | 936 | bool fullDateRange = false; |
937 | local->resetTempSyncStat(); | 937 | local->resetTempSyncStat(); |
938 | mLastCalendarSync = QDateTime::currentDateTime(); | 938 | mLastCalendarSync = QDateTime::currentDateTime(); |
939 | if ( mSyncManager->syncWithDesktop() ) { | 939 | if ( mSyncManager->syncWithDesktop() ) { |
940 | remote->resetPilotStat(1); | 940 | remote->resetPilotStat(1); |
941 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 941 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
942 | mLastCalendarSync = KSyncManager::mRequestedSyncEvent; | 942 | mLastCalendarSync = KSyncManager::mRequestedSyncEvent; |
943 | qDebug("using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); | 943 | qDebug("using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); |
944 | } else { | 944 | } else { |
945 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); | 945 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); |
946 | } | 946 | } |
947 | } | 947 | } |
948 | QDateTime modifiedCalendar = mLastCalendarSync; | 948 | QDateTime modifiedCalendar = mLastCalendarSync; |
949 | eventLSync = getLastSyncEvent(); | 949 | eventLSync = getLastSyncEvent(); |
950 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); | 950 | eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); |
951 | if ( eventR ) { | 951 | if ( eventR ) { |
952 | eventRSync = (Event*) eventR->clone(); | 952 | eventRSync = (Event*) eventR->clone(); |
953 | remote->deleteEvent(eventR ); | 953 | remote->deleteEvent(eventR ); |
954 | 954 | ||
955 | } else { | 955 | } else { |
956 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { | 956 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { |
957 | eventRSync = (Event*)eventLSync->clone(); | 957 | eventRSync = (Event*)eventLSync->clone(); |
958 | } else { | 958 | } else { |
959 | fullDateRange = true; | 959 | fullDateRange = true; |
960 | eventRSync = new Event(); | 960 | eventRSync = new Event(); |
961 | eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); | 961 | eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); |
962 | eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); | 962 | eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); |
963 | eventRSync->setDtStart( mLastCalendarSync ); | 963 | eventRSync->setDtStart( mLastCalendarSync ); |
964 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); | 964 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); |
965 | eventRSync->setCategories( i18n("SyncEvent") ); | 965 | eventRSync->setCategories( i18n("SyncEvent") ); |
966 | } | 966 | } |
967 | } | 967 | } |
968 | if ( eventLSync->dtStart() == mLastCalendarSync ) | 968 | if ( eventLSync->dtStart() == mLastCalendarSync ) |
969 | fullDateRange = true; | 969 | fullDateRange = true; |
970 | 970 | ||
971 | if ( ! fullDateRange ) { | 971 | if ( ! fullDateRange ) { |
972 | if ( eventLSync->dtStart() != eventRSync->dtStart() ) { | 972 | if ( eventLSync->dtStart() != eventRSync->dtStart() ) { |
973 | 973 | ||
974 | // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); | 974 | // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); |
975 | //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); | 975 | //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); |
976 | fullDateRange = true; | 976 | fullDateRange = true; |
977 | } | 977 | } |
978 | } | 978 | } |
979 | if ( mSyncManager->syncWithDesktop() ) { | 979 | if ( mSyncManager->syncWithDesktop() ) { |
980 | fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); | 980 | fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); |
981 | } | 981 | } |
982 | if ( fullDateRange ) | 982 | if ( fullDateRange ) |
983 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); | 983 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); |
984 | else | 984 | else |
985 | mLastCalendarSync = eventLSync->dtStart(); | 985 | mLastCalendarSync = eventLSync->dtStart(); |
986 | // for resyncing if own file has changed | 986 | // for resyncing if own file has changed |
987 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 987 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
988 | mLastCalendarSync = loadedFileVersion; | 988 | mLastCalendarSync = loadedFileVersion; |
989 | //qDebug("setting mLastCalendarSync "); | 989 | //qDebug("setting mLastCalendarSync "); |
990 | } | 990 | } |
991 | //qDebug("*************************** "); | 991 | //qDebug("*************************** "); |
992 | qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); | 992 | qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); |
993 | QPtrList<Incidence> er = remote->rawIncidences(); | 993 | QPtrList<Incidence> er = remote->rawIncidences(); |
994 | Incidence* inR = er.first(); | 994 | Incidence* inR = er.first(); |
995 | Incidence* inL; | 995 | Incidence* inL; |
996 | QProgressBar bar( er.count(),0 ); | 996 | QProgressBar bar( er.count(),0 ); |
997 | bar.setCaption (i18n("Syncing - close to abort!") ); | 997 | bar.setCaption (i18n("Syncing - close to abort!") ); |
998 | 998 | ||
999 | // ************** setting up filter ************* | ||
1000 | CalFilter *filterIN = 0; | ||
1001 | CalFilter *filterOUT = 0; | ||
1002 | CalFilter *filter = mFilters.first(); | ||
1003 | while(filter) { | ||
1004 | if ( filter->name() == mSyncManager->mFilterInCal ) | ||
1005 | filterIN = filter; | ||
1006 | if ( filter->name() == mSyncManager->mFilterOutCal ) | ||
1007 | filterOUT = filter; | ||
1008 | filter = mFilters.next(); | ||
1009 | } | ||
999 | int w = 300; | 1010 | int w = 300; |
1000 | if ( QApplication::desktop()->width() < 320 ) | 1011 | if ( QApplication::desktop()->width() < 320 ) |
1001 | w = 220; | 1012 | w = 220; |
1002 | int h = bar.sizeHint().height() ; | 1013 | int h = bar.sizeHint().height() ; |
1003 | int dw = QApplication::desktop()->width(); | 1014 | int dw = QApplication::desktop()->width(); |
1004 | int dh = QApplication::desktop()->height(); | 1015 | int dh = QApplication::desktop()->height(); |
1005 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1016 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1006 | bar.show(); | 1017 | bar.show(); |
1007 | int modulo = (er.count()/10)+1; | 1018 | int modulo = (er.count()/10)+1; |
1008 | int incCounter = 0; | 1019 | int incCounter = 0; |
1009 | while ( inR ) { | 1020 | while ( inR ) { |
1010 | if ( ! bar.isVisible() ) | 1021 | if ( ! bar.isVisible() ) |
1011 | return false; | 1022 | return false; |
1012 | if ( incCounter % modulo == 0 ) | 1023 | if ( incCounter % modulo == 0 ) |
1013 | bar.setProgress( incCounter ); | 1024 | bar.setProgress( incCounter ); |
1014 | ++incCounter; | 1025 | ++incCounter; |
1015 | uid = inR->uid(); | 1026 | uid = inR->uid(); |
1016 | bool skipIncidence = false; | 1027 | bool skipIncidence = false; |
1017 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1028 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1018 | skipIncidence = true; | 1029 | skipIncidence = true; |
1019 | QString idS; | 1030 | QString idS; |
1020 | qApp->processEvents(); | 1031 | qApp->processEvents(); |
1021 | if ( !skipIncidence ) { | 1032 | if ( !skipIncidence ) { |
1022 | inL = local->incidence( uid ); | 1033 | inL = local->incidence( uid ); |
1023 | if ( inL ) { // maybe conflict - same uid in both calendars | 1034 | if ( inL ) { // maybe conflict - same uid in both calendars |
1024 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1035 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1025 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1036 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1026 | if ( take == 3 ) | 1037 | if ( take == 3 ) |
1027 | return false; | 1038 | return false; |
1028 | if ( take == 1 ) {// take local ********************** | 1039 | if ( take == 1 ) {// take local ********************** |
1029 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 1040 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
1030 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1041 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1031 | else | 1042 | else |
1032 | idS = inR->IDStr(); | 1043 | idS = inR->IDStr(); |
1033 | remote->deleteIncidence( inR ); | 1044 | remote->deleteIncidence( inR ); |
1034 | inR = inL->clone(); | 1045 | inR = inL->clone(); |
1035 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1046 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1036 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) | 1047 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) |
1037 | inR->setIDStr( idS ); | 1048 | inR->setIDStr( idS ); |
1038 | remote->addIncidence( inR ); | 1049 | remote->addIncidence( inR ); |
1039 | if ( mSyncManager->syncWithDesktop() ) | 1050 | if ( mSyncManager->syncWithDesktop() ) |
1040 | inR->setPilotId( 2 ); | 1051 | inR->setPilotId( 2 ); |
1041 | ++changedRemote; | 1052 | ++changedRemote; |
1042 | } else {// take remote ********************** | 1053 | } else {// take remote ********************** |
1043 | idS = inL->IDStr(); | 1054 | idS = inL->IDStr(); |
1044 | int pid = inL->pilotId(); | 1055 | int pid = inL->pilotId(); |
1045 | local->deleteIncidence( inL ); | 1056 | local->deleteIncidence( inL ); |
1046 | inL = inR->clone(); | 1057 | inL = inR->clone(); |
1047 | if ( mSyncManager->syncWithDesktop() ) | 1058 | if ( mSyncManager->syncWithDesktop() ) |
1048 | inL->setPilotId( pid ); | 1059 | inL->setPilotId( pid ); |
1049 | inL->setIDStr( idS ); | 1060 | inL->setIDStr( idS ); |
1050 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1061 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1051 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1062 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1052 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | 1063 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); |
1053 | } | 1064 | } |
1054 | local->addIncidence( inL ); | 1065 | local->addIncidence( inL ); |
1055 | ++changedLocal; | 1066 | ++changedLocal; |
1056 | } | 1067 | } |
1057 | } | 1068 | } |
1058 | } else { // no conflict ********** add or delete remote | 1069 | } else { // no conflict ********** add or delete remote |
1059 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1070 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1060 | QString des = eventLSync->description(); | 1071 | QString des = eventLSync->description(); |
1061 | QString pref = "e"; | 1072 | QString pref = "e"; |
1062 | if ( inR->type() == "Todo" ) | 1073 | if ( inR->type() == "Todo" ) |
1063 | pref = "t"; | 1074 | pref = "t"; |
1064 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 1075 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
1065 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 1076 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
1066 | //remote->deleteIncidence( inR ); | 1077 | //remote->deleteIncidence( inR ); |
1067 | ++deletedEventR; | 1078 | ++deletedEventR; |
1068 | } else { | 1079 | } else { |
1069 | inR->setLastModified( modifiedCalendar ); | 1080 | inR->setLastModified( modifiedCalendar ); |
1070 | inL = inR->clone(); | 1081 | inL = inR->clone(); |
1071 | inL->setIDStr( ":" ); | 1082 | inL->setIDStr( ":" ); |
1072 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1083 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1073 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | 1084 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); |
1074 | local->addIncidence( inL ); | 1085 | local->addIncidence( inL ); |
1075 | ++addedEvent; | 1086 | ++addedEvent; |
1076 | } | 1087 | } |
1077 | } else { | 1088 | } else { |
1078 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { | 1089 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { |
1079 | inR->setLastModified( modifiedCalendar ); | 1090 | inR->setLastModified( modifiedCalendar ); |
1080 | inL = inR->clone(); | 1091 | inL = inR->clone(); |
1081 | inL->setIDStr( ":" ); | 1092 | inL->setIDStr( ":" ); |
1082 | local->addIncidence( inL ); | 1093 | local->addIncidence( inL ); |
1083 | ++addedEvent; | 1094 | ++addedEvent; |
1084 | } else { | 1095 | } else { |
1085 | checkExternSyncEvent(eventRSyncSharp, inR); | 1096 | checkExternSyncEvent(eventRSyncSharp, inR); |
1086 | remote->deleteIncidence( inR ); | 1097 | remote->deleteIncidence( inR ); |
1087 | ++deletedEventR; | 1098 | ++deletedEventR; |
1088 | } | 1099 | } |
1089 | } | 1100 | } |
1090 | } | 1101 | } |
1091 | } | 1102 | } |
1092 | inR = er.next(); | 1103 | inR = er.next(); |
1093 | } | 1104 | } |
1094 | QPtrList<Incidence> el = local->rawIncidences(); | 1105 | QPtrList<Incidence> el = local->rawIncidences(); |
1095 | inL = el.first(); | 1106 | inL = el.first(); |
1096 | modulo = (el.count()/10)+1; | 1107 | modulo = (el.count()/10)+1; |
1097 | bar.setCaption (i18n("Add / remove events") ); | 1108 | bar.setCaption (i18n("Add / remove events") ); |
1098 | bar.setTotalSteps ( el.count() ) ; | 1109 | bar.setTotalSteps ( el.count() ) ; |
1099 | bar.show(); | 1110 | bar.show(); |
1100 | incCounter = 0; | 1111 | incCounter = 0; |
1101 | 1112 | ||
1102 | while ( inL ) { | 1113 | while ( inL ) { |
1103 | 1114 | ||
1104 | qApp->processEvents(); | 1115 | qApp->processEvents(); |
1105 | if ( ! bar.isVisible() ) | 1116 | if ( ! bar.isVisible() ) |
1106 | return false; | 1117 | return false; |
1107 | if ( incCounter % modulo == 0 ) | 1118 | if ( incCounter % modulo == 0 ) |
1108 | bar.setProgress( incCounter ); | 1119 | bar.setProgress( incCounter ); |
1109 | ++incCounter; | 1120 | ++incCounter; |
1110 | uid = inL->uid(); | 1121 | uid = inL->uid(); |
1111 | bool skipIncidence = false; | 1122 | bool skipIncidence = false; |
1112 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1123 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1113 | skipIncidence = true; | 1124 | skipIncidence = true; |
1114 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) | 1125 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) |
1115 | skipIncidence = true; | 1126 | skipIncidence = true; |
1116 | if ( !skipIncidence ) { | 1127 | if ( !skipIncidence ) { |
1117 | inR = remote->incidence( uid ); | 1128 | inR = remote->incidence( uid ); |
1118 | if ( ! inR ) { // no conflict ********** add or delete local | 1129 | if ( ! inR ) { // no conflict ********** add or delete local |
1119 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1130 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1120 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1131 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1121 | checkExternSyncEvent(eventLSyncSharp, inL); | 1132 | checkExternSyncEvent(eventLSyncSharp, inL); |
1122 | local->deleteIncidence( inL ); | 1133 | local->deleteIncidence( inL ); |
1123 | ++deletedEventL; | 1134 | ++deletedEventL; |
1124 | } else { | 1135 | } else { |
1125 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1136 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1126 | inL->removeID(mCurrentSyncDevice ); | 1137 | inL->removeID(mCurrentSyncDevice ); |
diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp index 21a0954..e724da4 100644 --- a/korganizer/filteredit_base.cpp +++ b/korganizer/filteredit_base.cpp | |||
@@ -1,128 +1,145 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form implementation generated from reading ui file 'filteredit_base.ui' | 2 | ** Form implementation generated from reading ui file 'filteredit_base.ui' |
3 | ** | 3 | ** |
4 | ** Created: Di Mai 4 15:30:31 2004 | 4 | ** Created: So Jan 16 11:23:21 2005 |
5 | ** by: The User Interface Compiler ($Id$) | 5 | ** by: The User Interface Compiler ($Id$) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | 9 | ||
10 | #include "filteredit_base.h" | 10 | #include "filteredit_base.h" |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
14 | #include <qframe.h> | 14 | #include <qframe.h> |
15 | #include <qbuttongroup.h> | 15 | #include <qbuttongroup.h> |
16 | #include <qradiobutton.h> | 16 | #include <qradiobutton.h> |
17 | #include <qlistbox.h> | 17 | #include <qlistbox.h> |
18 | #include <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qtooltip.h> | 21 | #include <qtooltip.h> |
22 | #include <qwhatsthis.h> | 22 | #include <qwhatsthis.h> |
23 | #include "filteredit_base.ui.h" | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * Constructs a FilterEdit_base as a child of 'parent', with the | 26 | * Constructs a FilterEdit_base as a child of 'parent', with the |
26 | * name 'name' and widget flags set to 'f'. | 27 | * name 'name' and widget flags set to 'f'. |
27 | */ | 28 | */ |
28 | FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) | 29 | FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) |
29 | : QWidget( parent, name, fl ) | 30 | : QWidget( parent, name, fl ) |
30 | { | 31 | { |
31 | if ( !name ) | 32 | if ( !name ) |
32 | setName( "FilterEdit_base" ); | 33 | setName( "FilterEdit_base" ); |
33 | FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); | 34 | FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); |
34 | 35 | ||
35 | mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); | 36 | mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); |
36 | mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); | 37 | mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); |
37 | mCriteriaFrame->setFrameShadow( QFrame::Raised ); | 38 | mCriteriaFrame->setFrameShadow( QFrame::Raised ); |
38 | mCriteriaFrameLayout = new QGridLayout( mCriteriaFrame, 1, 1, 3, 2, "mCriteriaFrameLayout"); | 39 | mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); |
39 | 40 | ||
40 | ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); | 41 | ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); |
41 | ButtonGroup1->setColumnLayout(0, Qt::Vertical ); | 42 | ButtonGroup1->setColumnLayout(0, Qt::Vertical ); |
42 | ButtonGroup1->layout()->setSpacing( 6 ); | 43 | ButtonGroup1->layout()->setSpacing( 6 ); |
43 | ButtonGroup1->layout()->setMargin( 11 ); | 44 | ButtonGroup1->layout()->setMargin( 6 ); |
44 | ButtonGroup1Layout = new QVBoxLayout( ButtonGroup1->layout() ); | 45 | ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); |
45 | ButtonGroup1Layout->setAlignment( Qt::AlignTop ); | 46 | ButtonGroup1Layout->setAlignment( Qt::AlignTop ); |
46 | 47 | ||
48 | layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); | ||
49 | |||
47 | mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); | 50 | mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); |
48 | ButtonGroup1Layout->addWidget( mCatShowCheck ); | 51 | layout4->addWidget( mCatShowCheck ); |
49 | 52 | ||
50 | mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); | 53 | mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); |
51 | ButtonGroup1Layout->addWidget( mCatHideCheck ); | 54 | layout4->addWidget( mCatHideCheck ); |
52 | |||
53 | mCatList = new QListBox( ButtonGroup1, "mCatList" ); | ||
54 | ButtonGroup1Layout->addWidget( mCatList ); | ||
55 | 55 | ||
56 | mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); | 56 | mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); |
57 | ButtonGroup1Layout->addWidget( mCatEditButton ); | 57 | layout4->addWidget( mCatEditButton ); |
58 | 58 | ||
59 | mCriteriaFrameLayout->addWidget( ButtonGroup1, 0, 0 ); | 59 | ButtonGroup1Layout->addLayout( layout4, 0, 0 ); |
60 | 60 | ||
61 | layout1 = new QHBoxLayout( 0, 0, 0, "layout1"); | 61 | mCatList = new QListBox( ButtonGroup1, "mCatList" ); |
62 | |||
63 | ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); | ||
64 | mCriteriaFrameLayout->addWidget( ButtonGroup1 ); | ||
65 | |||
66 | layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); | ||
62 | 67 | ||
63 | textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); | 68 | textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); |
64 | layout1->addWidget( textLabel1 ); | 69 | layout7->addWidget( textLabel1 ); |
65 | 70 | ||
66 | mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); | 71 | mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); |
67 | layout1->addWidget( mRecurringCheck ); | 72 | layout7->addWidget( mRecurringCheck ); |
68 | 73 | ||
69 | mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); | 74 | mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); |
70 | layout1->addWidget( mCompletedCheck ); | 75 | layout7->addWidget( mCompletedCheck ); |
76 | mCriteriaFrameLayout->addLayout( layout7 ); | ||
77 | |||
78 | layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); | ||
71 | 79 | ||
72 | mCriteriaFrameLayout->addLayout( layout1, 1, 0 ); | 80 | textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); |
81 | layout9->addWidget( textLabel1_2 ); | ||
82 | |||
83 | mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" ); | ||
84 | layout9->addWidget( mEventCheck ); | ||
85 | |||
86 | mTodoCheck = new QCheckBox( mCriteriaFrame, "mTodoCheck" ); | ||
87 | layout9->addWidget( mTodoCheck ); | ||
88 | |||
89 | mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" ); | ||
90 | layout9->addWidget( mJournalCheck ); | ||
91 | mCriteriaFrameLayout->addLayout( layout9 ); | ||
73 | 92 | ||
74 | layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); | 93 | layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); |
75 | 94 | ||
76 | textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); | 95 | textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); |
77 | layout2->addWidget( textLabel2 ); | 96 | layout2->addWidget( textLabel2 ); |
78 | 97 | ||
79 | mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); | 98 | mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); |
80 | layout2->addWidget( mPublicCheck ); | 99 | layout2->addWidget( mPublicCheck ); |
81 | 100 | ||
82 | mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" ); | 101 | mPrivateCheck = new QCheckBox( mCriteriaFrame, "mPrivateCheck" ); |
83 | layout2->addWidget( mPrivateCheck ); | 102 | layout2->addWidget( mPrivateCheck ); |
84 | 103 | ||
85 | mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" ); | 104 | mConfidentialCheck = new QCheckBox( mCriteriaFrame, "mConfidentialCheck" ); |
86 | mConfidentialCheck->setChecked( FALSE ); | 105 | mConfidentialCheck->setChecked( FALSE ); |
87 | layout2->addWidget( mConfidentialCheck ); | 106 | layout2->addWidget( mConfidentialCheck ); |
88 | 107 | mCriteriaFrameLayout->addLayout( layout2 ); | |
89 | mCriteriaFrameLayout->addLayout( layout2, 2, 0 ); | ||
90 | FilterEdit_baseLayout->addWidget( mCriteriaFrame ); | 108 | FilterEdit_baseLayout->addWidget( mCriteriaFrame ); |
91 | languageChange(); | 109 | languageChange(); |
92 | resize( QSize(284, 241).expandedTo(minimumSizeHint()) ); | 110 | resize( QSize(351, 275).expandedTo(minimumSizeHint()) ); |
93 | clearWState( WState_Polished ); | 111 | clearWState( WState_Polished ); |
94 | } | 112 | } |
95 | 113 | ||
96 | /* | 114 | /* |
97 | * Destroys the object and frees any allocated resources | 115 | * Destroys the object and frees any allocated resources |
98 | */ | 116 | */ |
99 | FilterEdit_base::~FilterEdit_base() | 117 | FilterEdit_base::~FilterEdit_base() |
100 | { | 118 | { |
101 | // no need to delete child widgets, Qt does it all for us | 119 | // no need to delete child widgets, Qt does it all for us |
102 | } | 120 | } |
103 | 121 | ||
104 | /* | 122 | /* |
105 | * Sets the strings of the subwidgets using the current | 123 | * Sets the strings of the subwidgets using the current |
106 | * language. | 124 | * language. |
107 | */ | 125 | */ |
108 | void FilterEdit_base::languageChange() | 126 | void FilterEdit_base::languageChange() |
109 | { | 127 | { |
110 | setCaption( tr( "FilterEditor" ) ); | 128 | setCaption( tr( "FilterEditor" ) ); |
111 | ButtonGroup1->setTitle( tr( "Categories" ) ); | 129 | ButtonGroup1->setTitle( tr( "Categories" ) ); |
112 | mCatShowCheck->setText( tr( "Show only selected" ) ); | 130 | mCatShowCheck->setText( tr( "Include" ) ); |
113 | mCatHideCheck->setText( tr( "Show all but selected" ) ); | 131 | mCatHideCheck->setText( tr( "Exclude" ) ); |
114 | mCatEditButton->setText( tr( "Edit Selection..." ) ); | 132 | mCatEditButton->setText( tr( "Edit Selection..." ) ); |
115 | textLabel1->setText( tr( "Hide" ) ); | 133 | textLabel1->setText( tr( "Exclude" ) ); |
116 | mRecurringCheck->setText( tr( "recurring events" ) ); | 134 | mRecurringCheck->setText( tr( "recurring events" ) ); |
117 | mCompletedCheck->setText( tr( "completed to-dos" ) ); | 135 | mCompletedCheck->setText( tr( "completed to-dos" ) ); |
118 | textLabel2->setText( tr( "Show" ) ); | 136 | textLabel1_2->setText( tr( "Exclude" ) ); |
137 | mEventCheck->setText( tr( "events" ) ); | ||
138 | mTodoCheck->setText( tr( "todos" ) ); | ||
139 | mJournalCheck->setText( tr( "journals" ) ); | ||
140 | textLabel2->setText( tr( "Include" ) ); | ||
119 | mPublicCheck->setText( tr( "public" ) ); | 141 | mPublicCheck->setText( tr( "public" ) ); |
120 | mPrivateCheck->setText( tr( "private" ) ); | 142 | mPrivateCheck->setText( tr( "private" ) ); |
121 | mConfidentialCheck->setText( tr( "confidential" ) ); | 143 | mConfidentialCheck->setText( tr( "confidential" ) ); |
122 | } | 144 | } |
123 | 145 | ||
124 | void FilterEdit_base::updateFilter() | ||
125 | { | ||
126 | qWarning( "FilterEdit_base::updateFilter(): Not implemented yet" ); | ||
127 | } | ||
128 | |||
diff --git a/korganizer/filteredit_base.h b/korganizer/filteredit_base.h index 664598a..0c2988a 100644 --- a/korganizer/filteredit_base.h +++ b/korganizer/filteredit_base.h | |||
@@ -1,66 +1,72 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form interface generated from reading ui file 'filteredit_base.ui' | 2 | ** Form interface generated from reading ui file 'filteredit_base.ui' |
3 | ** | 3 | ** |
4 | ** Created: Di Mai 4 15:24:50 2004 | 4 | ** Created: So Jan 16 11:23:21 2005 |
5 | ** by: The User Interface Compiler ($Id$) | 5 | ** by: The User Interface Compiler ($Id$) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | 9 | ||
10 | #ifndef FILTEREDIT_BASE_H | 10 | #ifndef FILTEREDIT_BASE_H |
11 | #define FILTEREDIT_BASE_H | 11 | #define FILTEREDIT_BASE_H |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qwidget.h> | 14 | #include <qwidget.h> |
15 | 15 | ||
16 | class QVBoxLayout; | 16 | class QVBoxLayout; |
17 | class QHBoxLayout; | 17 | class QHBoxLayout; |
18 | class QGridLayout; | 18 | class QGridLayout; |
19 | class QSpacerItem; | 19 | class QSpacerItem; |
20 | class QFrame; | 20 | class QFrame; |
21 | class QButtonGroup; | 21 | class QButtonGroup; |
22 | class QRadioButton; | 22 | class QRadioButton; |
23 | class QPushButton; | ||
23 | class QListBox; | 24 | class QListBox; |
24 | class QListBoxItem; | 25 | class QListBoxItem; |
25 | class QPushButton; | ||
26 | class QLabel; | 26 | class QLabel; |
27 | class QCheckBox; | 27 | class QCheckBox; |
28 | 28 | ||
29 | class FilterEdit_base : public QWidget | 29 | class FilterEdit_base : public QWidget |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | 32 | ||
33 | public: | 33 | public: |
34 | FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 34 | FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
35 | ~FilterEdit_base(); | 35 | ~FilterEdit_base(); |
36 | 36 | ||
37 | QFrame* mCriteriaFrame; | 37 | QFrame* mCriteriaFrame; |
38 | QButtonGroup* ButtonGroup1; | 38 | QButtonGroup* ButtonGroup1; |
39 | QRadioButton* mCatShowCheck; | 39 | QRadioButton* mCatShowCheck; |
40 | QRadioButton* mCatHideCheck; | 40 | QRadioButton* mCatHideCheck; |
41 | QListBox* mCatList; | ||
42 | QPushButton* mCatEditButton; | 41 | QPushButton* mCatEditButton; |
42 | QListBox* mCatList; | ||
43 | QLabel* textLabel1; | 43 | QLabel* textLabel1; |
44 | QCheckBox* mRecurringCheck; | 44 | QCheckBox* mRecurringCheck; |
45 | QCheckBox* mCompletedCheck; | 45 | QCheckBox* mCompletedCheck; |
46 | QLabel* textLabel1_2; | ||
47 | QCheckBox* mEventCheck; | ||
48 | QCheckBox* mTodoCheck; | ||
49 | QCheckBox* mJournalCheck; | ||
46 | QLabel* textLabel2; | 50 | QLabel* textLabel2; |
47 | QCheckBox* mPublicCheck; | 51 | QCheckBox* mPublicCheck; |
48 | QCheckBox* mPrivateCheck; | 52 | QCheckBox* mPrivateCheck; |
49 | QCheckBox* mConfidentialCheck; | 53 | QCheckBox* mConfidentialCheck; |
50 | 54 | ||
51 | public slots: | 55 | public slots: |
52 | virtual void updateFilter(); | 56 | virtual void updateFilter(); |
53 | 57 | ||
54 | protected: | 58 | protected: |
55 | QVBoxLayout* FilterEdit_baseLayout; | 59 | QVBoxLayout* FilterEdit_baseLayout; |
56 | QGridLayout* mCriteriaFrameLayout; | 60 | QVBoxLayout* mCriteriaFrameLayout; |
57 | QVBoxLayout* ButtonGroup1Layout; | 61 | QGridLayout* ButtonGroup1Layout; |
58 | QHBoxLayout* layout1; | 62 | QHBoxLayout* layout4; |
63 | QHBoxLayout* layout7; | ||
64 | QHBoxLayout* layout9; | ||
59 | QHBoxLayout* layout2; | 65 | QHBoxLayout* layout2; |
60 | 66 | ||
61 | protected slots: | 67 | protected slots: |
62 | virtual void languageChange(); | 68 | virtual void languageChange(); |
63 | 69 | ||
64 | }; | 70 | }; |
65 | 71 | ||
66 | #endif // FILTEREDIT_BASE_H | 72 | #endif // FILTEREDIT_BASE_H |
diff --git a/korganizer/filteredit_base.ui b/korganizer/filteredit_base.ui index b7cbb59..2436f57 100644 --- a/korganizer/filteredit_base.ui +++ b/korganizer/filteredit_base.ui | |||
@@ -1,201 +1,250 @@ | |||
1 | <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> | 1 | <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> |
2 | <class>FilterEdit_base</class> | 2 | <class>FilterEdit_base</class> |
3 | <widget class="QWidget"> | 3 | <widget class="QWidget"> |
4 | <property name="name"> | 4 | <property name="name"> |
5 | <cstring>FilterEdit_base</cstring> | 5 | <cstring>FilterEdit_base</cstring> |
6 | </property> | 6 | </property> |
7 | <property name="geometry"> | 7 | <property name="geometry"> |
8 | <rect> | 8 | <rect> |
9 | <x>0</x> | 9 | <x>0</x> |
10 | <y>0</y> | 10 | <y>0</y> |
11 | <width>284</width> | 11 | <width>351</width> |
12 | <height>241</height> | 12 | <height>275</height> |
13 | </rect> | 13 | </rect> |
14 | </property> | 14 | </property> |
15 | <property name="caption"> | 15 | <property name="caption"> |
16 | <string>FilterEditor</string> | 16 | <string>FilterEditor</string> |
17 | </property> | 17 | </property> |
18 | <property name="layoutMargin" stdset="0"> | 18 | <property name="layoutMargin" stdset="0"> |
19 | </property> | 19 | </property> |
20 | <property name="layoutSpacing" stdset="0"> | 20 | <property name="layoutSpacing" stdset="0"> |
21 | </property> | 21 | </property> |
22 | <vbox> | 22 | <vbox> |
23 | <property name="name"> | 23 | <property name="name"> |
24 | <cstring>unnamed</cstring> | 24 | <cstring>unnamed</cstring> |
25 | </property> | 25 | </property> |
26 | <property name="margin"> | 26 | <property name="margin"> |
27 | <number>0</number> | 27 | <number>0</number> |
28 | </property> | 28 | </property> |
29 | <property name="spacing"> | 29 | <property name="spacing"> |
30 | <number>0</number> | 30 | <number>0</number> |
31 | </property> | 31 | </property> |
32 | <widget class="QFrame"> | 32 | <widget class="QFrame"> |
33 | <property name="name"> | 33 | <property name="name"> |
34 | <cstring>mCriteriaFrame</cstring> | 34 | <cstring>mCriteriaFrame</cstring> |
35 | </property> | 35 | </property> |
36 | <property name="frameShape"> | 36 | <property name="frameShape"> |
37 | <enum>StyledPanel</enum> | 37 | <enum>StyledPanel</enum> |
38 | </property> | 38 | </property> |
39 | <property name="frameShadow"> | 39 | <property name="frameShadow"> |
40 | <enum>Raised</enum> | 40 | <enum>Raised</enum> |
41 | </property> | 41 | </property> |
42 | <property name="layoutMargin" stdset="0"> | 42 | <property name="layoutMargin" stdset="0"> |
43 | </property> | 43 | </property> |
44 | <grid> | 44 | <vbox> |
45 | <property name="name"> | 45 | <property name="name"> |
46 | <cstring>unnamed</cstring> | 46 | <cstring>unnamed</cstring> |
47 | </property> | 47 | </property> |
48 | <property name="margin"> | 48 | <property name="margin"> |
49 | <number>3</number> | 49 | <number>3</number> |
50 | </property> | 50 | </property> |
51 | <property name="spacing"> | 51 | <property name="spacing"> |
52 | <number>2</number> | 52 | <number>2</number> |
53 | </property> | 53 | </property> |
54 | <widget class="QButtonGroup" row="0" column="0"> | 54 | <widget class="QButtonGroup"> |
55 | <property name="name"> | 55 | <property name="name"> |
56 | <cstring>ButtonGroup1</cstring> | 56 | <cstring>ButtonGroup1</cstring> |
57 | </property> | 57 | </property> |
58 | <property name="title"> | 58 | <property name="title"> |
59 | <string>Categories</string> | 59 | <string>Categories</string> |
60 | </property> | 60 | </property> |
61 | <vbox> | 61 | <grid> |
62 | <property name="name"> | 62 | <property name="name"> |
63 | <cstring>unnamed</cstring> | 63 | <cstring>unnamed</cstring> |
64 | </property> | 64 | </property> |
65 | <property name="margin"> | 65 | <property name="margin"> |
66 | <number>11</number> | 66 | <number>6</number> |
67 | </property> | 67 | </property> |
68 | <property name="spacing"> | 68 | <property name="spacing"> |
69 | <number>6</number> | 69 | <number>6</number> |
70 | </property> | 70 | </property> |
71 | <widget class="QRadioButton"> | 71 | <widget class="QLayoutWidget" row="0" column="0"> |
72 | <property name="name"> | 72 | <property name="name"> |
73 | <cstring>mCatShowCheck</cstring> | 73 | <cstring>layout4</cstring> |
74 | </property> | 74 | </property> |
75 | <property name="text"> | 75 | <hbox> |
76 | <string>Show only selected</string> | 76 | <property name="name"> |
77 | <cstring>unnamed</cstring> | ||
78 | </property> | ||
79 | <widget class="QRadioButton"> | ||
80 | <property name="name"> | ||
81 | <cstring>mCatShowCheck</cstring> | ||
82 | </property> | ||
83 | <property name="text"> | ||
84 | <string>Include</string> | ||
85 | </property> | ||
86 | </widget> | ||
87 | <widget class="QRadioButton"> | ||
88 | <property name="name"> | ||
89 | <cstring>mCatHideCheck</cstring> | ||
90 | </property> | ||
91 | <property name="text"> | ||
92 | <string>Exclude</string> | ||
93 | </property> | ||
94 | </widget> | ||
95 | <widget class="QPushButton"> | ||
96 | <property name="name"> | ||
97 | <cstring>mCatEditButton</cstring> | ||
98 | </property> | ||
99 | <property name="text"> | ||
100 | <string>Edit Selection...</string> | ||
101 | </property> | ||
102 | </widget> | ||
103 | </hbox> | ||
104 | </widget> | ||
105 | <widget class="QListBox" row="1" column="0"> | ||
106 | <property name="name"> | ||
107 | <cstring>mCatList</cstring> | ||
77 | </property> | 108 | </property> |
78 | </widget> | 109 | </widget> |
79 | <widget class="QRadioButton"> | 110 | </grid> |
111 | </widget> | ||
112 | <widget class="QLayoutWidget"> | ||
113 | <property name="name"> | ||
114 | <cstring>layout7</cstring> | ||
115 | </property> | ||
116 | <hbox> | ||
117 | <property name="name"> | ||
118 | <cstring>unnamed</cstring> | ||
119 | </property> | ||
120 | <widget class="QLabel"> | ||
80 | <property name="name"> | 121 | <property name="name"> |
81 | <cstring>mCatHideCheck</cstring> | 122 | <cstring>textLabel1</cstring> |
82 | </property> | 123 | </property> |
83 | <property name="text"> | 124 | <property name="text"> |
84 | <string>Show all but selected</string> | 125 | <string>Exclude</string> |
85 | </property> | 126 | </property> |
86 | </widget> | 127 | </widget> |
87 | <widget class="QListBox"> | 128 | <widget class="QCheckBox"> |
88 | <property name="name"> | 129 | <property name="name"> |
89 | <cstring>mCatList</cstring> | 130 | <cstring>mRecurringCheck</cstring> |
131 | </property> | ||
132 | <property name="text"> | ||
133 | <string>recurring events</string> | ||
90 | </property> | 134 | </property> |
91 | </widget> | 135 | </widget> |
92 | <widget class="QPushButton"> | 136 | <widget class="QCheckBox"> |
93 | <property name="name"> | 137 | <property name="name"> |
94 | <cstring>mCatEditButton</cstring> | 138 | <cstring>mCompletedCheck</cstring> |
95 | </property> | 139 | </property> |
96 | <property name="text"> | 140 | <property name="text"> |
97 | <string>Edit Selection...</string> | 141 | <string>completed to-dos</string> |
98 | </property> | 142 | </property> |
99 | </widget> | 143 | </widget> |
100 | </vbox> | 144 | </hbox> |
101 | </widget> | 145 | </widget> |
102 | <widget class="QLayoutWidget" row="1" column="0"> | 146 | <widget class="QLayoutWidget"> |
103 | <property name="name"> | 147 | <property name="name"> |
104 | <cstring>layout1</cstring> | 148 | <cstring>layout9</cstring> |
105 | </property> | 149 | </property> |
106 | <hbox> | 150 | <hbox> |
107 | <property name="name"> | 151 | <property name="name"> |
108 | <cstring>unnamed</cstring> | 152 | <cstring>unnamed</cstring> |
109 | </property> | 153 | </property> |
110 | <property name="margin"> | ||
111 | <number>0</number> | ||
112 | </property> | ||
113 | <property name="spacing"> | ||
114 | <number>0</number> | ||
115 | </property> | ||
116 | <widget class="QLabel"> | 154 | <widget class="QLabel"> |
117 | <property name="name"> | 155 | <property name="name"> |
118 | <cstring>textLabel1</cstring> | 156 | <cstring>textLabel1_2</cstring> |
119 | </property> | 157 | </property> |
120 | <property name="text"> | 158 | <property name="text"> |
121 | <string>Hide</string> | 159 | <string>Exclude</string> |
122 | </property> | 160 | </property> |
123 | </widget> | 161 | </widget> |
124 | <widget class="QCheckBox"> | 162 | <widget class="QCheckBox"> |
125 | <property name="name"> | 163 | <property name="name"> |
126 | <cstring>mRecurringCheck</cstring> | 164 | <cstring>mEventCheck</cstring> |
127 | </property> | 165 | </property> |
128 | <property name="text"> | 166 | <property name="text"> |
129 | <string>recurring events</string> | 167 | <string>events</string> |
130 | </property> | 168 | </property> |
131 | </widget> | 169 | </widget> |
132 | <widget class="QCheckBox"> | 170 | <widget class="QCheckBox"> |
133 | <property name="name"> | 171 | <property name="name"> |
134 | <cstring>mCompletedCheck</cstring> | 172 | <cstring>mTodoCheck</cstring> |
135 | </property> | 173 | </property> |
136 | <property name="text"> | 174 | <property name="text"> |
137 | <string>completed to-dos</string> | 175 | <string>todos</string> |
176 | </property> | ||
177 | </widget> | ||
178 | <widget class="QCheckBox"> | ||
179 | <property name="name"> | ||
180 | <cstring>mJournalCheck</cstring> | ||
181 | </property> | ||
182 | <property name="text"> | ||
183 | <string>journals</string> | ||
138 | </property> | 184 | </property> |
139 | </widget> | 185 | </widget> |
140 | </hbox> | 186 | </hbox> |
141 | </widget> | 187 | </widget> |
142 | <widget class="QLayoutWidget" row="2" column="0"> | 188 | <widget class="QLayoutWidget"> |
143 | <property name="name"> | 189 | <property name="name"> |
144 | <cstring>layout2</cstring> | 190 | <cstring>layout2</cstring> |
145 | </property> | 191 | </property> |
146 | <hbox> | 192 | <hbox> |
147 | <property name="name"> | 193 | <property name="name"> |
148 | <cstring>unnamed</cstring> | 194 | <cstring>unnamed</cstring> |
149 | </property> | 195 | </property> |
150 | <property name="margin"> | 196 | <property name="margin"> |
151 | <number>0</number> | 197 | <number>0</number> |
152 | </property> | 198 | </property> |
153 | <property name="spacing"> | 199 | <property name="spacing"> |
154 | <number>0</number> | 200 | <number>0</number> |
155 | </property> | 201 | </property> |
156 | <widget class="QLabel"> | 202 | <widget class="QLabel"> |
157 | <property name="name"> | 203 | <property name="name"> |
158 | <cstring>textLabel2</cstring> | 204 | <cstring>textLabel2</cstring> |
159 | </property> | 205 | </property> |
160 | <property name="text"> | 206 | <property name="text"> |
161 | <string>Show</string> | 207 | <string>Include</string> |
162 | </property> | 208 | </property> |
163 | </widget> | 209 | </widget> |
164 | <widget class="QCheckBox"> | 210 | <widget class="QCheckBox"> |
165 | <property name="name"> | 211 | <property name="name"> |
166 | <cstring>mPublicCheck</cstring> | 212 | <cstring>mPublicCheck</cstring> |
167 | </property> | 213 | </property> |
168 | <property name="text"> | 214 | <property name="text"> |
169 | <string>public</string> | 215 | <string>public</string> |
170 | </property> | 216 | </property> |
171 | </widget> | 217 | </widget> |
172 | <widget class="QCheckBox"> | 218 | <widget class="QCheckBox"> |
173 | <property name="name"> | 219 | <property name="name"> |
174 | <cstring>mPrivateCheck</cstring> | 220 | <cstring>mPrivateCheck</cstring> |
175 | </property> | 221 | </property> |
176 | <property name="text"> | 222 | <property name="text"> |
177 | <string>private</string> | 223 | <string>private</string> |
178 | </property> | 224 | </property> |
179 | </widget> | 225 | </widget> |
180 | <widget class="QCheckBox"> | 226 | <widget class="QCheckBox"> |
181 | <property name="name"> | 227 | <property name="name"> |
182 | <cstring>mConfidentialCheck</cstring> | 228 | <cstring>mConfidentialCheck</cstring> |
183 | </property> | 229 | </property> |
184 | <property name="text"> | 230 | <property name="text"> |
185 | <string>confidential</string> | 231 | <string>confidential</string> |
186 | </property> | 232 | </property> |
187 | <property name="checked"> | 233 | <property name="checked"> |
188 | <bool>false</bool> | 234 | <bool>false</bool> |
189 | </property> | 235 | </property> |
190 | </widget> | 236 | </widget> |
191 | </hbox> | 237 | </hbox> |
192 | </widget> | 238 | </widget> |
193 | </grid> | 239 | </vbox> |
194 | </widget> | 240 | </widget> |
195 | </vbox> | 241 | </vbox> |
196 | </widget> | 242 | </widget> |
243 | <includes> | ||
244 | <include location="local" impldecl="in implementation">filteredit_base.ui.h</include> | ||
245 | </includes> | ||
197 | <slots> | 246 | <slots> |
198 | <slot>updateFilter()</slot> | 247 | <slot>updateFilter()</slot> |
199 | </slots> | 248 | </slots> |
200 | <layoutdefaults spacing="6" margin="11"/> | 249 | <layoutdefaults spacing="6" margin="11"/> |
201 | </UI> | 250 | </UI> |
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro index 2816c6e..628d84e 100644 --- a/korganizer/korganizer.pro +++ b/korganizer/korganizer.pro | |||
@@ -1,177 +1,177 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | TARGET = kopi | 3 | TARGET = kopi |
4 | OBJECTS_DIR = _obj/ | 4 | OBJECTS_DIR = _obj/ |
5 | MOC_DIR = _moc | 5 | MOC_DIR = _moc |
6 | DESTDIR= ../bin | 6 | DESTDIR= ../bin |
7 | 7 | ||
8 | include( ../variables.pri ) | 8 | include( ../variables.pri ) |
9 | 9 | ||
10 | INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim | 10 | INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim |
11 | #../qtcompat | 11 | #../qtcompat |
12 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL | 12 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL |
13 | DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 13 | DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
14 | #KORG_NOPRINTER KORG_NOKABC | 14 | #KORG_NOPRINTER KORG_NOKABC |
15 | DEFINES += KORG_NOLVALTERNATION | 15 | DEFINES += KORG_NOLVALTERNATION |
16 | DEFINES += DESKTOP_VERSION | 16 | DEFINES += DESKTOP_VERSION |
17 | unix : { | 17 | unix : { |
18 | LIBS += ../bin/libmicrokdepim.so | 18 | LIBS += ../bin/libmicrokdepim.so |
19 | LIBS += ../bin/libmicrokcal.so | 19 | LIBS += ../bin/libmicrokcal.so |
20 | LIBS += ../bin/libmicrokde.so | 20 | LIBS += ../bin/libmicrokde.so |
21 | LIBS += ../bin/libmicrokabc.so | 21 | LIBS += ../bin/libmicrokabc.so |
22 | #LIBS += -lbluetooth | 22 | #LIBS += -lbluetooth |
23 | #LIBS += -lsdp | 23 | #LIBS += -lsdp |
24 | 24 | ||
25 | #LIBS += -lldap | 25 | #LIBS += -lldap |
26 | OBJECTS_DIR = obj/unix | 26 | OBJECTS_DIR = obj/unix |
27 | MOC_DIR = moc/unix | 27 | MOC_DIR = moc/unix |
28 | } | 28 | } |
29 | win32: { | 29 | win32: { |
30 | RC_FILE = winicons.rc | 30 | RC_FILE = winicons.rc |
31 | DEFINES += _WIN32_ | 31 | DEFINES += _WIN32_ |
32 | LIBS += ../bin/microkdepim.lib | 32 | LIBS += ../bin/microkdepim.lib |
33 | LIBS += ../bin/microkcal.lib | 33 | LIBS += ../bin/microkcal.lib |
34 | LIBS += ../bin/microkde.lib | 34 | LIBS += ../bin/microkde.lib |
35 | LIBS += ../bin/microkabc.lib | 35 | LIBS += ../bin/microkabc.lib |
36 | LIBS += ../libical/lib/ical.lib | 36 | LIBS += ../libical/lib/ical.lib |
37 | LIBS += ../libical/lib/icalss.lib | 37 | LIBS += ../libical/lib/icalss.lib |
38 | #LIBS += atls.lib | 38 | #LIBS += atls.lib |
39 | LIBS += mfc71u.lib | 39 | LIBS += mfc71u.lib |
40 | QMAKE_LINK += /NODEFAULTLIB:LIBC | 40 | QMAKE_LINK += /NODEFAULTLIB:LIBC |
41 | #QMAKE_LINK += /NODEFAULTLIB:MSVCRT | 41 | #QMAKE_LINK += /NODEFAULTLIB:MSVCRT |
42 | #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib | 42 | #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib |
43 | OBJECTS_DIR = obj/win | 43 | OBJECTS_DIR = obj/win |
44 | MOC_DIR = moc/win | 44 | MOC_DIR = moc/win |
45 | } | 45 | } |
46 | 46 | ||
47 | 47 | ||
48 | INTERFACES = kofilterview_base.ui | 48 | INTERFACES = kofilterview_base.ui |
49 | # filteredit_base.ui | 49 | # filteredit_base.ui |
50 | 50 | ||
51 | # kdateedit.h \ | 51 | # kdateedit.h \ |
52 | 52 | ||
53 | HEADERS = \ | 53 | HEADERS = \ |
54 | filteredit_base.h \ | 54 | filteredit_base.h \ |
55 | alarmclient.h \ | 55 | alarmclient.h \ |
56 | calendarview.h \ | 56 | calendarview.h \ |
57 | customlistviewitem.h \ | 57 | customlistviewitem.h \ |
58 | datenavigator.h \ | 58 | datenavigator.h \ |
59 | docprefs.h \ | 59 | docprefs.h \ |
60 | filtereditdialog.h \ | 60 | filtereditdialog.h \ |
61 | incomingdialog.h \ | 61 | incomingdialog.h \ |
62 | incomingdialog_base.h \ | 62 | incomingdialog_base.h \ |
63 | interfaces/korganizer/baseview.h \ | 63 | interfaces/korganizer/baseview.h \ |
64 | interfaces/korganizer/calendarviewbase.h \ | 64 | interfaces/korganizer/calendarviewbase.h \ |
65 | journalentry.h \ | 65 | journalentry.h \ |
66 | kdatenavigator.h \ | 66 | kdatenavigator.h \ |
67 | koagenda.h \ | 67 | koagenda.h \ |
68 | koagendaitem.h \ | 68 | koagendaitem.h \ |
69 | koagendaview.h \ | 69 | koagendaview.h \ |
70 | kocounterdialog.h \ | 70 | kocounterdialog.h \ |
71 | kodaymatrix.h \ | 71 | kodaymatrix.h \ |
72 | kodialogmanager.h \ | 72 | kodialogmanager.h \ |
73 | koeditordetails.h \ | 73 | koeditordetails.h \ |
74 | koeditorgeneral.h \ | 74 | koeditorgeneral.h \ |
75 | koeditorgeneralevent.h \ | 75 | koeditorgeneralevent.h \ |
76 | koeditorgeneraltodo.h \ | 76 | koeditorgeneraltodo.h \ |
77 | koeditorrecurrence.h \ | 77 | koeditorrecurrence.h \ |
78 | koeventeditor.h \ | 78 | koeventeditor.h \ |
79 | koeventpopupmenu.h \ | 79 | koeventpopupmenu.h \ |
80 | koeventview.h \ | 80 | koeventview.h \ |
81 | koeventviewer.h \ | 81 | koeventviewer.h \ |
82 | koeventviewerdialog.h \ | 82 | koeventviewerdialog.h \ |
83 | kofilterview.h \ | 83 | kofilterview.h \ |
84 | koglobals.h \ | 84 | koglobals.h \ |
85 | koincidenceeditor.h \ | 85 | koincidenceeditor.h \ |
86 | kojournalview.h \ | 86 | kojournalview.h \ |
87 | kolistview.h \ | 87 | kolistview.h \ |
88 | kolocationbox.h \ | 88 | kolocationbox.h \ |
89 | komonthview.h \ | 89 | komonthview.h \ |
90 | koprefs.h \ | 90 | koprefs.h \ |
91 | koprefsdialog.h \ | 91 | koprefsdialog.h \ |
92 | kotimespanview.h \ | 92 | kotimespanview.h \ |
93 | kotodoeditor.h \ | 93 | kotodoeditor.h \ |
94 | kotodoview.h \ | 94 | kotodoview.h \ |
95 | kotodoviewitem.h \ | 95 | kotodoviewitem.h \ |
96 | koviewmanager.h \ | 96 | koviewmanager.h \ |
97 | kowhatsnextview.h \ | 97 | kowhatsnextview.h \ |
98 | ktimeedit.h \ | 98 | ktimeedit.h \ |
99 | lineview.h \ | 99 | lineview.h \ |
100 | mainwindow.h \ | 100 | mainwindow.h \ |
101 | navigatorbar.h \ | 101 | navigatorbar.h \ |
102 | outgoingdialog.h \ | 102 | outgoingdialog.h \ |
103 | outgoingdialog_base.h \ | 103 | outgoingdialog_base.h \ |
104 | publishdialog.h \ | 104 | publishdialog.h \ |
105 | publishdialog_base.h \ | 105 | publishdialog_base.h \ |
106 | savetemplatedialog.h \ | 106 | savetemplatedialog.h \ |
107 | searchdialog.h \ | 107 | searchdialog.h \ |
108 | simplealarmclient.h \ | 108 | simplealarmclient.h \ |
109 | statusdialog.h \ | 109 | statusdialog.h \ |
110 | timeline.h \ | 110 | timeline.h \ |
111 | timespanview.h \ | 111 | timespanview.h \ |
112 | version.h \ | 112 | version.h \ |
113 | ../kalarmd/alarmdialog.h \ | 113 | ../kalarmd/alarmdialog.h \ |
114 | 114 | ||
115 | 115 | ||
116 | SOURCES = \ | 116 | SOURCES = \ |
117 | filteredit_base.cpp \ | 117 | filteredit_base.cpp \ |
118 | calendarview.cpp \ | 118 | calendarview.cpp \ |
119 | datenavigator.cpp \ | 119 | datenavigator.cpp \ |
120 | docprefs.cpp \ | 120 | docprefs.cpp \ |
121 | filtereditdialog.cpp \ | 121 | filtereditdialog.cpp \ |
122 | incomingdialog.cpp \ | 122 | incomingdialog.cpp \ |
123 | incomingdialog_base.cpp \ | 123 | incomingdialog_base.cpp \ |
124 | journalentry.cpp \ | 124 | journalentry.cpp \ |
125 | kdatenavigator.cpp \ | 125 | kdatenavigator.cpp \ |
126 | koagenda.cpp \ | 126 | koagenda.cpp \ |
127 | koagendaitem.cpp \ | 127 | koagendaitem.cpp \ |
128 | koagendaview.cpp \ | 128 | koagendaview.cpp \ |
129 | kocounterdialog.cpp \ | 129 | kocounterdialog.cpp \ |
130 | kodaymatrix.cpp \ | 130 | kodaymatrix.cpp \ |
131 | kodialogmanager.cpp \ | 131 | kodialogmanager.cpp \ |
132 | koeditordetails.cpp \ | 132 | koeditordetails.cpp \ |
133 | koeditorgeneral.cpp \ | 133 | koeditorgeneral.cpp \ |
134 | koeditorgeneralevent.cpp \ | 134 | koeditorgeneralevent.cpp \ |
135 | koeditorgeneraltodo.cpp \ | 135 | koeditorgeneraltodo.cpp \ |
136 | koeditorrecurrence.cpp \ | 136 | koeditorrecurrence.cpp \ |
137 | koeventeditor.cpp \ | 137 | koeventeditor.cpp \ |
138 | koeventpopupmenu.cpp \ | 138 | koeventpopupmenu.cpp \ |
139 | koeventview.cpp \ | 139 | koeventview.cpp \ |
140 | koeventviewer.cpp \ | 140 | koeventviewer.cpp \ |
141 | koeventviewerdialog.cpp \ | 141 | koeventviewerdialog.cpp \ |
142 | kofilterview.cpp \ | 142 | kofilterview.cpp \ |
143 | koglobals.cpp \ | 143 | koglobals.cpp \ |
144 | koincidenceeditor.cpp \ | 144 | koincidenceeditor.cpp \ |
145 | kojournalview.cpp \ | 145 | kojournalview.cpp \ |
146 | kolistview.cpp \ | 146 | kolistview.cpp \ |
147 | kolocationbox.cpp \ | 147 | kolocationbox.cpp \ |
148 | komonthview.cpp \ | 148 | komonthview.cpp \ |
149 | koprefs.cpp \ | 149 | koprefs.cpp \ |
150 | koprefsdialog.cpp \ | 150 | koprefsdialog.cpp \ |
151 | kotimespanview.cpp \ | 151 | kotimespanview.cpp \ |
152 | kotodoeditor.cpp \ | 152 | kotodoeditor.cpp \ |
153 | kotodoview.cpp \ | 153 | kotodoview.cpp \ |
154 | kotodoviewitem.cpp \ | 154 | kotodoviewitem.cpp \ |
155 | koviewmanager.cpp \ | 155 | koviewmanager.cpp \ |
156 | kowhatsnextview.cpp \ | 156 | kowhatsnextview.cpp \ |
157 | ktimeedit.cpp \ | 157 | ktimeedit.cpp \ |
158 | lineview.cpp \ | 158 | lineview.cpp \ |
159 | main.cpp \ | 159 | main.cpp \ |
160 | mainwindow.cpp \ | 160 | mainwindow.cpp \ |
161 | navigatorbar.cpp \ | 161 | navigatorbar.cpp \ |
162 | outgoingdialog.cpp \ | 162 | outgoingdialog.cpp \ |
163 | outgoingdialog_base.cpp \ | 163 | outgoingdialog_base.cpp \ |
164 | publishdialog.cpp \ | 164 | publishdialog.cpp \ |
165 | publishdialog_base.cpp \ | 165 | publishdialog_base.cpp \ |
166 | savetemplatedialog.cpp \ | 166 | savetemplatedialog.cpp \ |
167 | searchdialog.cpp \ | 167 | searchdialog.cpp \ |
168 | simplealarmclient.cpp \ | 168 | simplealarmclient.cpp \ |
169 | statusdialog.cpp \ | 169 | statusdialog.cpp \ |
170 | timeline.cpp \ | 170 | timeline.cpp \ |
171 | timespanview.cpp \ | 171 | timespanview.cpp \ |
172 | ../kalarmd/alarmdialog.cpp | 172 | ../kalarmd/alarmdialog.cpp |
173 | 173 | ||
174 | HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h | 174 | HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h |
175 | INTERFACES += calprintdayconfig_base.ui \ | 175 | INTERFACES += calprintdayconfig_base.ui \ |
176 | calprintmonthconfig_base.ui \ | 176 | calprintmonthconfig_base.ui \ |
177 | calprinttodoconfig_base.ui \ | 177 | calprinttodoconfig_base.ui \ |
diff --git a/libkcal/calfilter.h b/libkcal/calfilter.h index d6d4717..5ad0064 100644 --- a/libkcal/calfilter.h +++ b/libkcal/calfilter.h | |||
@@ -1,128 +1,128 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef _CALFILTER_H | 21 | #ifndef _CALFILTER_H |
22 | #define _CALFILTER_H | 22 | #define _CALFILTER_H |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qptrlist.h> | 25 | #include <qptrlist.h> |
26 | 26 | ||
27 | #include "event.h" | 27 | #include "event.h" |
28 | #include "todo.h" | 28 | #include "todo.h" |
29 | 29 | ||
30 | namespace KCal { | 30 | namespace KCal { |
31 | 31 | ||
32 | /** | 32 | /** |
33 | Filter for calendar objects. | 33 | Filter for calendar objects. |
34 | */ | 34 | */ |
35 | class CalFilter { | 35 | class CalFilter { |
36 | public: | 36 | public: |
37 | /** Construct filter. */ | 37 | /** Construct filter. */ |
38 | CalFilter(); | 38 | CalFilter(); |
39 | /** Construct filter with name */ | 39 | /** Construct filter with name */ |
40 | CalFilter(const QString &name); | 40 | CalFilter(const QString &name); |
41 | /** Destruct filter. */ | 41 | /** Destruct filter. */ |
42 | ~CalFilter(); | 42 | ~CalFilter(); |
43 | 43 | ||
44 | /** | 44 | /** |
45 | Set name of filter. | 45 | Set name of filter. |
46 | */ | 46 | */ |
47 | void setName(const QString &name) { mName = name; } | 47 | void setName(const QString &name) { mName = name; } |
48 | /** | 48 | /** |
49 | Return name of filter. | 49 | Return name of filter. |
50 | */ | 50 | */ |
51 | QString name() const { return mName; } | 51 | QString name() const { return mName; } |
52 | 52 | ||
53 | /** | 53 | /** |
54 | Apply filter to eventlist, all events not matching filter criterias are | 54 | Apply filter to eventlist, all events not matching filter criterias are |
55 | removed from the list. | 55 | removed from the list. |
56 | */ | 56 | */ |
57 | void apply(QPtrList<Event> *eventlist); | 57 | void apply(QPtrList<Event> *eventlist); |
58 | 58 | ||
59 | /** | 59 | /** |
60 | Apply filter to todolist, all todos not matching filter criterias are | 60 | Apply filter to todolist, all todos not matching filter criterias are |
61 | removed from the list. | 61 | removed from the list. |
62 | */ | 62 | */ |
63 | void apply(QPtrList<Todo> *todolist); | 63 | void apply(QPtrList<Todo> *todolist); |
64 | 64 | ||
65 | /** | 65 | /** |
66 | Apply filter criteria on the specified event. Return true, if event passes | 66 | Apply filter criteria on the specified event. Return true, if event passes |
67 | criteria, otherwise return false. | 67 | criteria, otherwise return false. |
68 | */ | 68 | */ |
69 | bool filterEvent(Event *); | 69 | bool filterEvent(Event *); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | Apply filter criteria on the specified todo. Return true, if event passes | 72 | Apply filter criteria on the specified todo. Return true, if event passes |
73 | criteria, otherwise return false. | 73 | criteria, otherwise return false. |
74 | */ | 74 | */ |
75 | bool filterTodo(Todo *); | 75 | bool filterTodo(Todo *); |
76 | 76 | ||
77 | /** | 77 | /** |
78 | Apply filter criteria on the specified incidence. Return true, if event passes | 78 | Apply filter criteria on the specified incidence. Return true, if event passes |
79 | criteria, otherwise return false. | 79 | criteria, otherwise return false. |
80 | */ | 80 | */ |
81 | bool filterIncidence(Incidence *); | 81 | bool filterIncidence(Incidence *); |
82 | 82 | ||
83 | /** | 83 | /** |
84 | Enable or disable filter. | 84 | Enable or disable filter. |
85 | */ | 85 | */ |
86 | void setEnabled(bool); | 86 | void setEnabled(bool); |
87 | /** | 87 | /** |
88 | Return wheter the filter is enabled or not. | 88 | Return wheter the filter is enabled or not. |
89 | */ | 89 | */ |
90 | bool isEnabled(); | 90 | bool isEnabled(); |
91 | bool showCategories(); | 91 | bool showCategories(); |
92 | int getSecrecy(); | 92 | int getSecrecy(); |
93 | /** | 93 | /** |
94 | Set list of categories, which is used for showing/hiding categories of | 94 | Set list of categories, which is used for showing/hiding categories of |
95 | events. | 95 | events. |
96 | See related functions. | 96 | See related functions. |
97 | */ | 97 | */ |
98 | void setCategoryList(const QStringList &); | 98 | void setCategoryList(const QStringList &); |
99 | /** | 99 | /** |
100 | Return category list, used for showing/hiding categories of events. | 100 | Return category list, used for showing/hiding categories of events. |
101 | See related functions. | 101 | See related functions. |
102 | */ | 102 | */ |
103 | QStringList categoryList(); | 103 | QStringList categoryList(); |
104 | 104 | ||
105 | enum { HideRecurring = 1, HideCompleted = 2, ShowCategories = 4 ,ShowPublic = 8, ShowPrivate = 16, ShowConfidential = 32 }; | 105 | enum { HideRecurring = 1, HideCompleted = 2, ShowCategories = 4 ,ShowPublic = 8, ShowPrivate = 16, ShowConfidential = 32, HideEvents = 64, HideTodos = 128, HideJournals = 256 }; |
106 | 106 | ||
107 | /** | 107 | /** |
108 | Set criteria, which have to be fulfilled by events passing the filter. | 108 | Set criteria, which have to be fulfilled by events passing the filter. |
109 | */ | 109 | */ |
110 | void setCriteria(int); | 110 | void setCriteria(int); |
111 | /** | 111 | /** |
112 | Get inclusive filter criteria. | 112 | Get inclusive filter criteria. |
113 | */ | 113 | */ |
114 | int criteria(); | 114 | int criteria(); |
115 | 115 | ||
116 | private: | 116 | private: |
117 | QString mName; | 117 | QString mName; |
118 | 118 | ||
119 | int mCriteria; | 119 | int mCriteria; |
120 | 120 | ||
121 | bool mEnabled; | 121 | bool mEnabled; |
122 | 122 | ||
123 | QStringList mCategoryList; | 123 | QStringList mCategoryList; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | } | 126 | } |
127 | 127 | ||
128 | #endif /* _CALFILTER_H */ | 128 | #endif /* _CALFILTER_H */ |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 33b4a65..6c1f444 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -127,257 +127,261 @@ void KSyncManager::fillSyncMenu() | |||
127 | temp->setName( prof[0] ); | 127 | temp->setName( prof[0] ); |
128 | temp->writeConfig(&config); | 128 | temp->writeConfig(&config); |
129 | temp->setName( prof[1] ); | 129 | temp->setName( prof[1] ); |
130 | temp->writeConfig(&config); | 130 | temp->writeConfig(&config); |
131 | temp->setName( prof[2] ); | 131 | temp->setName( prof[2] ); |
132 | temp->writeConfig(&config); | 132 | temp->writeConfig(&config); |
133 | config.setGroup("General"); | 133 | config.setGroup("General"); |
134 | config.writeEntry("SyncProfileNames",prof); | 134 | config.writeEntry("SyncProfileNames",prof); |
135 | config.writeEntry("ExternSyncProfiles",externalName); | 135 | config.writeEntry("ExternSyncProfiles",externalName); |
136 | config.sync(); | 136 | config.sync(); |
137 | delete temp; | 137 | delete temp; |
138 | } | 138 | } |
139 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 139 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
140 | mSyncProfileNames = prof; | 140 | mSyncProfileNames = prof; |
141 | unsigned int i; | 141 | unsigned int i; |
142 | for ( i = 0; i < prof.count(); ++i ) { | 142 | for ( i = 0; i < prof.count(); ++i ) { |
143 | mSyncMenu->insertItem( prof[i], 1000+i ); | 143 | mSyncMenu->insertItem( prof[i], 1000+i ); |
144 | clearMenu->insertItem( prof[i], 1000+i ); | 144 | clearMenu->insertItem( prof[i], 1000+i ); |
145 | if ( i == 2 ) | 145 | if ( i == 2 ) |
146 | mSyncMenu->insertSeparator(); | 146 | mSyncMenu->insertSeparator(); |
147 | } | 147 | } |
148 | QDir app_dir; | 148 | QDir app_dir; |
149 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available | 149 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available |
150 | if ( mTargetApp == PWMPI) { | 150 | if ( mTargetApp == PWMPI) { |
151 | mSyncMenu->removeItem( 1000 ); | 151 | mSyncMenu->removeItem( 1000 ); |
152 | clearMenu->removeItem( 1000 ); | 152 | clearMenu->removeItem( 1000 ); |
153 | } | 153 | } |
154 | #ifndef DESKTOP_VERSION | 154 | #ifndef DESKTOP_VERSION |
155 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 155 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
156 | mSyncMenu->removeItem( 1000 ); | 156 | mSyncMenu->removeItem( 1000 ); |
157 | clearMenu->removeItem( 1000 ); | 157 | clearMenu->removeItem( 1000 ); |
158 | } | 158 | } |
159 | #endif | 159 | #endif |
160 | mSyncMenu->removeItem( 1002 ); | 160 | mSyncMenu->removeItem( 1002 ); |
161 | clearMenu->removeItem( 1002 ); | 161 | clearMenu->removeItem( 1002 ); |
162 | } | 162 | } |
163 | void KSyncManager::slotClearMenu( int action ) | 163 | void KSyncManager::slotClearMenu( int action ) |
164 | { | 164 | { |
165 | QString syncDevice; | 165 | QString syncDevice; |
166 | if ( action > 999 ) { | 166 | if ( action > 999 ) { |
167 | syncDevice = mSyncProfileNames[action - 1000] ; | 167 | syncDevice = mSyncProfileNames[action - 1000] ; |
168 | } | 168 | } |
169 | 169 | ||
170 | 170 | ||
171 | 171 | ||
172 | int result = 0; | 172 | int result = 0; |
173 | QString sd; | 173 | QString sd; |
174 | if ( syncDevice.isEmpty() ) | 174 | if ( syncDevice.isEmpty() ) |
175 | sd = i18n("Do you want to\nclear all sync info\nof all profiles?"); | 175 | sd = i18n("Do you want to\nclear all sync info\nof all profiles?"); |
176 | else | 176 | else |
177 | sd = i18n("Do you want to\nclear the sync\ninfo of profile\n%1?\n"). arg( syncDevice ); | 177 | sd = i18n("Do you want to\nclear the sync\ninfo of profile\n%1?\n"). arg( syncDevice ); |
178 | 178 | ||
179 | result = QMessageBox::warning( mParent, i18n("Warning!"),sd,i18n("OK"), i18n("Cancel"), 0, | 179 | result = QMessageBox::warning( mParent, i18n("Warning!"),sd,i18n("OK"), i18n("Cancel"), 0, |
180 | 0, 1 ); | 180 | 0, 1 ); |
181 | if ( result ) | 181 | if ( result ) |
182 | return; | 182 | return; |
183 | mImplementation->removeSyncInfo( syncDevice ); | 183 | mImplementation->removeSyncInfo( syncDevice ); |
184 | } | 184 | } |
185 | void KSyncManager::slotSyncMenu( int action ) | 185 | void KSyncManager::slotSyncMenu( int action ) |
186 | { | 186 | { |
187 | qDebug("syncaction %d ", action); | 187 | qDebug("syncaction %d ", action); |
188 | if ( action == 5000 ) | 188 | if ( action == 5000 ) |
189 | return; | 189 | return; |
190 | mSyncWithDesktop = false; | 190 | mSyncWithDesktop = false; |
191 | if ( action == 0 ) { | 191 | if ( action == 0 ) { |
192 | 192 | ||
193 | // seems to be a Qt2 event handling bug | 193 | // seems to be a Qt2 event handling bug |
194 | // syncmenu.clear causes a segfault at first time | 194 | // syncmenu.clear causes a segfault at first time |
195 | // when we call it after the main event loop, it is ok | 195 | // when we call it after the main event loop, it is ok |
196 | // same behaviour when calling OM/Pi via QCOP for the first time | 196 | // same behaviour when calling OM/Pi via QCOP for the first time |
197 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); | 197 | QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); |
198 | //confSync(); | 198 | //confSync(); |
199 | 199 | ||
200 | return; | 200 | return; |
201 | } | 201 | } |
202 | if ( action == 1 ) { | 202 | if ( action == 1 ) { |
203 | multiSync( true ); | 203 | multiSync( true ); |
204 | return; | 204 | return; |
205 | } | 205 | } |
206 | if ( action == 2 ) { | 206 | if ( action == 2 ) { |
207 | enableQuick(); | 207 | enableQuick(); |
208 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 208 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
209 | return; | 209 | return; |
210 | } | 210 | } |
211 | if ( action == 3 ) { | 211 | if ( action == 3 ) { |
212 | delete mServerSocket; | 212 | delete mServerSocket; |
213 | mServerSocket = 0; | 213 | mServerSocket = 0; |
214 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 214 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | 217 | ||
218 | if (blockSave()) | 218 | if (blockSave()) |
219 | return; | 219 | return; |
220 | 220 | ||
221 | setBlockSave(true); | 221 | setBlockSave(true); |
222 | bool silent = false; | 222 | bool silent = false; |
223 | if ( action == 999 ) { | 223 | if ( action == 999 ) { |
224 | //special mode for silent syncing | 224 | //special mode for silent syncing |
225 | action = 1000; | 225 | action = 1000; |
226 | silent = true; | 226 | silent = true; |
227 | } | 227 | } |
228 | 228 | ||
229 | mCurrentSyncProfile = action - 1000 ; | 229 | mCurrentSyncProfile = action - 1000 ; |
230 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; | 230 | mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; |
231 | mCurrentSyncName = mLocalMachineName ; | 231 | mCurrentSyncName = mLocalMachineName ; |
232 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 232 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
233 | KSyncProfile* temp = new KSyncProfile (); | 233 | KSyncProfile* temp = new KSyncProfile (); |
234 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); | 234 | temp->setName(mSyncProfileNames[mCurrentSyncProfile]); |
235 | temp->readConfig(&config); | 235 | temp->readConfig(&config); |
236 | if (silent) { | 236 | if (silent) { |
237 | mAskForPreferences = false; | 237 | mAskForPreferences = false; |
238 | mShowSyncSummary = false; | 238 | mShowSyncSummary = false; |
239 | mWriteBackFile = true; | 239 | mWriteBackFile = true; |
240 | mSyncAlgoPrefs = 2;// take newest | 240 | mSyncAlgoPrefs = 2;// take newest |
241 | } | 241 | } |
242 | else { | 242 | else { |
243 | mAskForPreferences = temp->getAskForPreferences(); | 243 | mAskForPreferences = temp->getAskForPreferences(); |
244 | mShowSyncSummary = temp->getShowSummaryAfterSync(); | 244 | mShowSyncSummary = temp->getShowSummaryAfterSync(); |
245 | mWriteBackFile = temp->getWriteBackFile(); | 245 | mWriteBackFile = temp->getWriteBackFile(); |
246 | mSyncAlgoPrefs = temp->getSyncPrefs(); | 246 | mSyncAlgoPrefs = temp->getSyncPrefs(); |
247 | } | 247 | } |
248 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 248 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
249 | mIsKapiFile = temp->getIsKapiFile(); | 249 | mIsKapiFile = temp->getIsKapiFile(); |
250 | mWriteBackInFuture = 0; | 250 | mWriteBackInFuture = 0; |
251 | if ( temp->getWriteBackFuture() ) { | 251 | if ( temp->getWriteBackFuture() ) { |
252 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 252 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
253 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); | 253 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); |
254 | } | 254 | } |
255 | 255 | mFilterInCal = temp->getFilterInCal(); | |
256 | mFilterOutCal = temp->getFilterOutCal(); | ||
257 | mFilterInAB = temp->getFilterInAB(); | ||
258 | mFilterOutAB = temp->getFilterOutAB(); | ||
259 | |||
256 | if ( action == 1000 ) { | 260 | if ( action == 1000 ) { |
257 | mIsKapiFile = false; | 261 | mIsKapiFile = false; |
258 | #ifdef DESKTOP_VERSION | 262 | #ifdef DESKTOP_VERSION |
259 | syncKDE(); | 263 | syncKDE(); |
260 | #else | 264 | #else |
261 | syncSharp(); | 265 | syncSharp(); |
262 | #endif | 266 | #endif |
263 | 267 | ||
264 | } else if ( action == 1001 ) { | 268 | } else if ( action == 1001 ) { |
265 | syncLocalFile(); | 269 | syncLocalFile(); |
266 | 270 | ||
267 | } else if ( action == 1002 ) { | 271 | } else if ( action == 1002 ) { |
268 | mWriteBackFile = false; | 272 | mWriteBackFile = false; |
269 | mAskForPreferences = false; | 273 | mAskForPreferences = false; |
270 | mShowSyncSummary = false; | 274 | mShowSyncSummary = false; |
271 | mSyncAlgoPrefs = 3; | 275 | mSyncAlgoPrefs = 3; |
272 | quickSyncLocalFile(); | 276 | quickSyncLocalFile(); |
273 | 277 | ||
274 | } else if ( action >= 1003 ) { | 278 | } else if ( action >= 1003 ) { |
275 | if ( temp->getIsLocalFileSync() ) { | 279 | if ( temp->getIsLocalFileSync() ) { |
276 | switch(mTargetApp) | 280 | switch(mTargetApp) |
277 | { | 281 | { |
278 | case (KAPI): | 282 | case (KAPI): |
279 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) | 283 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) |
280 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); | 284 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); |
281 | break; | 285 | break; |
282 | case (KOPI): | 286 | case (KOPI): |
283 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 287 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
284 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); | 288 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); |
285 | break; | 289 | break; |
286 | case (PWMPI): | 290 | case (PWMPI): |
287 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) | 291 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) |
288 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); | 292 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); |
289 | break; | 293 | break; |
290 | default: | 294 | default: |
291 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); | 295 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); |
292 | break; | 296 | break; |
293 | 297 | ||
294 | } | 298 | } |
295 | } else { | 299 | } else { |
296 | if ( temp->getIsPhoneSync() ) { | 300 | if ( temp->getIsPhoneSync() ) { |
297 | mPhoneDevice = temp->getPhoneDevice( ) ; | 301 | mPhoneDevice = temp->getPhoneDevice( ) ; |
298 | mPhoneConnection = temp->getPhoneConnection( ); | 302 | mPhoneConnection = temp->getPhoneConnection( ); |
299 | mPhoneModel = temp->getPhoneModel( ); | 303 | mPhoneModel = temp->getPhoneModel( ); |
300 | syncPhone(); | 304 | syncPhone(); |
301 | } else if ( temp->getIsPiSync() ) { | 305 | } else if ( temp->getIsPiSync() ) { |
302 | if ( mTargetApp == KAPI ) { | 306 | if ( mTargetApp == KAPI ) { |
303 | mPassWordPiSync = temp->getRemotePwAB(); | 307 | mPassWordPiSync = temp->getRemotePwAB(); |
304 | mActiveSyncPort = temp->getRemotePortAB(); | 308 | mActiveSyncPort = temp->getRemotePortAB(); |
305 | mActiveSyncIP = temp->getRemoteIPAB(); | 309 | mActiveSyncIP = temp->getRemoteIPAB(); |
306 | } else if ( mTargetApp == KOPI ) { | 310 | } else if ( mTargetApp == KOPI ) { |
307 | mPassWordPiSync = temp->getRemotePw(); | 311 | mPassWordPiSync = temp->getRemotePw(); |
308 | mActiveSyncPort = temp->getRemotePort(); | 312 | mActiveSyncPort = temp->getRemotePort(); |
309 | mActiveSyncIP = temp->getRemoteIP(); | 313 | mActiveSyncIP = temp->getRemoteIP(); |
310 | } else { | 314 | } else { |
311 | mPassWordPiSync = temp->getRemotePwPWM(); | 315 | mPassWordPiSync = temp->getRemotePwPWM(); |
312 | mActiveSyncPort = temp->getRemotePortPWM(); | 316 | mActiveSyncPort = temp->getRemotePortPWM(); |
313 | mActiveSyncIP = temp->getRemoteIPPWM(); | 317 | mActiveSyncIP = temp->getRemoteIPPWM(); |
314 | } | 318 | } |
315 | syncPi(); | 319 | syncPi(); |
316 | while ( !mPisyncFinished ) { | 320 | while ( !mPisyncFinished ) { |
317 | //qDebug("waiting "); | 321 | //qDebug("waiting "); |
318 | qApp->processEvents(); | 322 | qApp->processEvents(); |
319 | } | 323 | } |
320 | } else | 324 | } else |
321 | syncRemote( temp ); | 325 | syncRemote( temp ); |
322 | 326 | ||
323 | } | 327 | } |
324 | } | 328 | } |
325 | delete temp; | 329 | delete temp; |
326 | setBlockSave(false); | 330 | setBlockSave(false); |
327 | } | 331 | } |
328 | 332 | ||
329 | void KSyncManager::enableQuick( bool ask ) | 333 | void KSyncManager::enableQuick( bool ask ) |
330 | { | 334 | { |
331 | bool autoStart; | 335 | bool autoStart; |
332 | bool changed = false; | 336 | bool changed = false; |
333 | if ( ask ) { | 337 | if ( ask ) { |
334 | QDialog dia ( 0, "input-dialog", true ); | 338 | QDialog dia ( 0, "input-dialog", true ); |
335 | QLineEdit lab ( &dia ); | 339 | QLineEdit lab ( &dia ); |
336 | QVBoxLayout lay( &dia ); | 340 | QVBoxLayout lay( &dia ); |
337 | lab.setText( mPrefs->mPassiveSyncPort ); | 341 | lab.setText( mPrefs->mPassiveSyncPort ); |
338 | lay.setMargin(7); | 342 | lay.setMargin(7); |
339 | lay.setSpacing(7); | 343 | lay.setSpacing(7); |
340 | int po = 9197+mTargetApp; | 344 | int po = 9197+mTargetApp; |
341 | QLabel label ( i18n("Port number (Default: %1)").arg(po), &dia ); | 345 | QLabel label ( i18n("Port number (Default: %1)").arg(po), &dia ); |
342 | lay.addWidget( &label); | 346 | lay.addWidget( &label); |
343 | lay.addWidget( &lab); | 347 | lay.addWidget( &lab); |
344 | 348 | ||
345 | QLineEdit lepw ( &dia ); | 349 | QLineEdit lepw ( &dia ); |
346 | lepw.setText( mPrefs->mPassiveSyncPw ); | 350 | lepw.setText( mPrefs->mPassiveSyncPw ); |
347 | QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia ); | 351 | QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia ); |
348 | lay.addWidget( &label2); | 352 | lay.addWidget( &label2); |
349 | lay.addWidget( &lepw); | 353 | lay.addWidget( &lepw); |
350 | QCheckBox autostart(i18n("Automatically start\nat application startup"), &dia ); | 354 | QCheckBox autostart(i18n("Automatically start\nat application startup"), &dia ); |
351 | lay.addWidget( &autostart); | 355 | lay.addWidget( &autostart); |
352 | autostart.setChecked( mPrefs->mPassiveSyncAutoStart ); | 356 | autostart.setChecked( mPrefs->mPassiveSyncAutoStart ); |
353 | #ifdef DESKTOP_VERSION | 357 | #ifdef DESKTOP_VERSION |
354 | #ifdef _WIN32_ | 358 | #ifdef _WIN32_ |
355 | QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia ); | 359 | QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia ); |
356 | syncdesktop.hide();// not implemented! | 360 | syncdesktop.hide();// not implemented! |
357 | #else | 361 | #else |
358 | QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia ); | 362 | QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia ); |
359 | #endif | 363 | #endif |
360 | lay.addWidget( &syncdesktop); | 364 | lay.addWidget( &syncdesktop); |
361 | #else | 365 | #else |
362 | mPrefs->mPassiveSyncWithDesktop = false; | 366 | mPrefs->mPassiveSyncWithDesktop = false; |
363 | QCheckBox syncdesktop( i18n("Automatically sync\nwith KDE-Desktop"),&dia ); | 367 | QCheckBox syncdesktop( i18n("Automatically sync\nwith KDE-Desktop"),&dia ); |
364 | syncdesktop.hide(); | 368 | syncdesktop.hide(); |
365 | #endif | 369 | #endif |
366 | syncdesktop.setChecked( mPrefs->mPassiveSyncWithDesktop ); | 370 | syncdesktop.setChecked( mPrefs->mPassiveSyncWithDesktop ); |
367 | 371 | ||
368 | dia.setFixedSize( 230,120 ); | 372 | dia.setFixedSize( 230,120 ); |
369 | dia.setCaption( i18n("Enter port for Pi-Sync") ); | 373 | dia.setCaption( i18n("Enter port for Pi-Sync") ); |
370 | QPushButton pb ( "OK", &dia); | 374 | QPushButton pb ( "OK", &dia); |
371 | lay.addWidget( &pb ); | 375 | lay.addWidget( &pb ); |
372 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 376 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
373 | dia.show(); | 377 | dia.show(); |
374 | if ( ! dia.exec() ) | 378 | if ( ! dia.exec() ) |
375 | return; | 379 | return; |
376 | dia.hide(); | 380 | dia.hide(); |
377 | qApp->processEvents(); | 381 | qApp->processEvents(); |
378 | if ( mPrefs->mPassiveSyncPw != lepw.text() ) { | 382 | if ( mPrefs->mPassiveSyncPw != lepw.text() ) { |
379 | changed = true; | 383 | changed = true; |
380 | mPrefs->mPassiveSyncPw = lepw.text(); | 384 | mPrefs->mPassiveSyncPw = lepw.text(); |
381 | } | 385 | } |
382 | if ( mPrefs->mPassiveSyncPort != lab.text() ) { | 386 | if ( mPrefs->mPassiveSyncPort != lab.text() ) { |
383 | mPrefs->mPassiveSyncPort = lab.text(); | 387 | mPrefs->mPassiveSyncPort = lab.text(); |
@@ -459,256 +463,260 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) | |||
459 | bool loadbup = true; | 463 | bool loadbup = true; |
460 | if ( !info. exists() ) { | 464 | if ( !info. exists() ) { |
461 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); | 465 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); |
462 | int result = QMessageBox::warning( mParent, i18n("Warning!"), | 466 | int result = QMessageBox::warning( mParent, i18n("Warning!"), |
463 | mess ); | 467 | mess ); |
464 | return ret; | 468 | return ret; |
465 | } | 469 | } |
466 | int result = 0; | 470 | int result = 0; |
467 | if ( !quick ) { | 471 | if ( !quick ) { |
468 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 472 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
469 | result = QMessageBox::warning( mParent, i18n("Warning!"), | 473 | result = QMessageBox::warning( mParent, i18n("Warning!"), |
470 | mess, | 474 | mess, |
471 | i18n("Sync"), i18n("Cancel"), 0, | 475 | i18n("Sync"), i18n("Cancel"), 0, |
472 | 0, 1 ); | 476 | 0, 1 ); |
473 | if ( result ) | 477 | if ( result ) |
474 | return false; | 478 | return false; |
475 | } | 479 | } |
476 | if ( mAskForPreferences ) | 480 | if ( mAskForPreferences ) |
477 | if ( !edit_sync_options()) { | 481 | if ( !edit_sync_options()) { |
478 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 482 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
479 | return false; | 483 | return false; |
480 | } | 484 | } |
481 | if ( result == 0 ) { | 485 | if ( result == 0 ) { |
482 | //qDebug("Now sycing ... "); | 486 | //qDebug("Now sycing ... "); |
483 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) | 487 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) |
484 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); | 488 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); |
485 | else | 489 | else |
486 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); | 490 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); |
487 | if ( ! quick ) | 491 | if ( ! quick ) |
488 | mPrefs->mLastSyncedLocalFile = fn; | 492 | mPrefs->mLastSyncedLocalFile = fn; |
489 | } | 493 | } |
490 | return ret; | 494 | return ret; |
491 | } | 495 | } |
492 | 496 | ||
493 | void KSyncManager::quickSyncLocalFile() | 497 | void KSyncManager::quickSyncLocalFile() |
494 | { | 498 | { |
495 | 499 | ||
496 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { | 500 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { |
497 | qDebug("quick syncLocalFile() successful "); | 501 | qDebug("quick syncLocalFile() successful "); |
498 | 502 | ||
499 | } | 503 | } |
500 | } | 504 | } |
501 | 505 | ||
502 | void KSyncManager::multiSync( bool askforPrefs ) | 506 | void KSyncManager::multiSync( bool askforPrefs ) |
503 | { | 507 | { |
504 | if (blockSave()) | 508 | if (blockSave()) |
505 | return; | 509 | return; |
506 | setBlockSave(true); | 510 | setBlockSave(true); |
507 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 511 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
508 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), | 512 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), |
509 | question, | 513 | question, |
510 | i18n("Yes"), i18n("No"), | 514 | i18n("Yes"), i18n("No"), |
511 | 0, 0 ) != 0 ) { | 515 | 0, 0 ) != 0 ) { |
512 | setBlockSave(false); | 516 | setBlockSave(false); |
513 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); | 517 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); |
514 | return; | 518 | return; |
515 | } | 519 | } |
516 | mCurrentSyncDevice = i18n("Multiple profiles") ; | 520 | mCurrentSyncDevice = i18n("Multiple profiles") ; |
517 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; | 521 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; |
518 | if ( askforPrefs ) { | 522 | if ( askforPrefs ) { |
519 | if ( !edit_sync_options()) { | 523 | if ( !edit_sync_options()) { |
520 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); | 524 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); |
521 | return; | 525 | return; |
522 | } | 526 | } |
523 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; | 527 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; |
524 | } | 528 | } |
525 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); | 529 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); |
526 | qApp->processEvents(); | 530 | qApp->processEvents(); |
527 | int num = ringSync() ; | 531 | int num = ringSync() ; |
528 | if ( num > 1 ) | 532 | if ( num > 1 ) |
529 | ringSync(); | 533 | ringSync(); |
530 | setBlockSave(false); | 534 | setBlockSave(false); |
531 | if ( num ) | 535 | if ( num ) |
532 | emit save(); | 536 | emit save(); |
533 | if ( num ) | 537 | if ( num ) |
534 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); | 538 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); |
535 | else | 539 | else |
536 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 540 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
537 | return; | 541 | return; |
538 | } | 542 | } |
539 | 543 | ||
540 | int KSyncManager::ringSync() | 544 | int KSyncManager::ringSync() |
541 | { | 545 | { |
542 | 546 | ||
543 | int syncedProfiles = 0; | 547 | int syncedProfiles = 0; |
544 | unsigned int i; | 548 | unsigned int i; |
545 | QTime timer; | 549 | QTime timer; |
546 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 550 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
547 | QStringList syncProfileNames = mSyncProfileNames; | 551 | QStringList syncProfileNames = mSyncProfileNames; |
548 | KSyncProfile* temp = new KSyncProfile (); | 552 | KSyncProfile* temp = new KSyncProfile (); |
549 | mAskForPreferences = false; | 553 | mAskForPreferences = false; |
550 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 554 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
551 | mCurrentSyncProfile = i; | 555 | mCurrentSyncProfile = i; |
552 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 556 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
553 | temp->readConfig(&config); | 557 | temp->readConfig(&config); |
554 | 558 | ||
555 | bool includeInRingSync; | 559 | bool includeInRingSync; |
556 | switch(mTargetApp) | 560 | switch(mTargetApp) |
557 | { | 561 | { |
558 | case (KAPI): | 562 | case (KAPI): |
559 | includeInRingSync = temp->getIncludeInRingSyncAB(); | 563 | includeInRingSync = temp->getIncludeInRingSyncAB(); |
560 | break; | 564 | break; |
561 | case (KOPI): | 565 | case (KOPI): |
562 | includeInRingSync = temp->getIncludeInRingSync(); | 566 | includeInRingSync = temp->getIncludeInRingSync(); |
563 | break; | 567 | break; |
564 | case (PWMPI): | 568 | case (PWMPI): |
565 | includeInRingSync = temp->getIncludeInRingSyncPWM(); | 569 | includeInRingSync = temp->getIncludeInRingSyncPWM(); |
566 | break; | 570 | break; |
567 | default: | 571 | default: |
568 | qDebug("KSyncManager::ringSync: invalid apptype selected"); | 572 | qDebug("KSyncManager::ringSync: invalid apptype selected"); |
569 | break; | 573 | break; |
570 | 574 | ||
571 | } | 575 | } |
572 | 576 | ||
573 | 577 | ||
574 | if ( includeInRingSync && ( i < 1 || i > 2 )) { | 578 | if ( includeInRingSync && ( i < 1 || i > 2 )) { |
575 | mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 579 | mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
576 | ++syncedProfiles; | 580 | ++syncedProfiles; |
577 | mSyncWithDesktop = false; | 581 | mSyncWithDesktop = false; |
578 | // mAskForPreferences = temp->getAskForPreferences(); | 582 | // mAskForPreferences = temp->getAskForPreferences(); |
579 | mWriteBackFile = temp->getWriteBackFile(); | 583 | mWriteBackFile = temp->getWriteBackFile(); |
580 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 584 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
581 | mIsKapiFile = temp->getIsKapiFile(); | 585 | mIsKapiFile = temp->getIsKapiFile(); |
582 | mWriteBackInFuture = 0; | 586 | mWriteBackInFuture = 0; |
583 | if ( temp->getWriteBackFuture() ) { | 587 | if ( temp->getWriteBackFuture() ) { |
584 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 588 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
585 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); | 589 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); |
586 | } | 590 | } |
591 | mFilterInCal = temp->getFilterInCal(); | ||
592 | mFilterOutCal = temp->getFilterOutCal(); | ||
593 | mFilterInAB = temp->getFilterInAB(); | ||
594 | mFilterOutAB = temp->getFilterOutAB(); | ||
587 | mShowSyncSummary = false; | 595 | mShowSyncSummary = false; |
588 | mCurrentSyncDevice = syncProfileNames[i] ; | 596 | mCurrentSyncDevice = syncProfileNames[i] ; |
589 | mCurrentSyncName = mLocalMachineName; | 597 | mCurrentSyncName = mLocalMachineName; |
590 | if ( i == 0 ) { | 598 | if ( i == 0 ) { |
591 | mIsKapiFile = false; | 599 | mIsKapiFile = false; |
592 | #ifdef DESKTOP_VERSION | 600 | #ifdef DESKTOP_VERSION |
593 | syncKDE(); | 601 | syncKDE(); |
594 | #else | 602 | #else |
595 | syncSharp(); | 603 | syncSharp(); |
596 | #endif | 604 | #endif |
597 | } else { | 605 | } else { |
598 | if ( temp->getIsLocalFileSync() ) { | 606 | if ( temp->getIsLocalFileSync() ) { |
599 | switch(mTargetApp) | 607 | switch(mTargetApp) |
600 | { | 608 | { |
601 | case (KAPI): | 609 | case (KAPI): |
602 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) | 610 | if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) |
603 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); | 611 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); |
604 | break; | 612 | break; |
605 | case (KOPI): | 613 | case (KOPI): |
606 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) | 614 | if ( syncWithFile( temp->getRemoteFileName( ), false ) ) |
607 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); | 615 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); |
608 | break; | 616 | break; |
609 | case (PWMPI): | 617 | case (PWMPI): |
610 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) | 618 | if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) |
611 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); | 619 | mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); |
612 | break; | 620 | break; |
613 | default: | 621 | default: |
614 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); | 622 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); |
615 | break; | 623 | break; |
616 | } | 624 | } |
617 | } else { | 625 | } else { |
618 | if ( temp->getIsPhoneSync() ) { | 626 | if ( temp->getIsPhoneSync() ) { |
619 | mPhoneDevice = temp->getPhoneDevice( ) ; | 627 | mPhoneDevice = temp->getPhoneDevice( ) ; |
620 | mPhoneConnection = temp->getPhoneConnection( ); | 628 | mPhoneConnection = temp->getPhoneConnection( ); |
621 | mPhoneModel = temp->getPhoneModel( ); | 629 | mPhoneModel = temp->getPhoneModel( ); |
622 | syncPhone(); | 630 | syncPhone(); |
623 | } else if ( temp->getIsPiSync() ) { | 631 | } else if ( temp->getIsPiSync() ) { |
624 | if ( mTargetApp == KAPI ) { | 632 | if ( mTargetApp == KAPI ) { |
625 | mPassWordPiSync = temp->getRemotePwAB(); | 633 | mPassWordPiSync = temp->getRemotePwAB(); |
626 | mActiveSyncPort = temp->getRemotePortAB(); | 634 | mActiveSyncPort = temp->getRemotePortAB(); |
627 | mActiveSyncIP = temp->getRemoteIPAB(); | 635 | mActiveSyncIP = temp->getRemoteIPAB(); |
628 | } else if ( mTargetApp == KOPI ) { | 636 | } else if ( mTargetApp == KOPI ) { |
629 | mPassWordPiSync = temp->getRemotePw(); | 637 | mPassWordPiSync = temp->getRemotePw(); |
630 | mActiveSyncPort = temp->getRemotePort(); | 638 | mActiveSyncPort = temp->getRemotePort(); |
631 | mActiveSyncIP = temp->getRemoteIP(); | 639 | mActiveSyncIP = temp->getRemoteIP(); |
632 | } else { | 640 | } else { |
633 | mPassWordPiSync = temp->getRemotePwPWM(); | 641 | mPassWordPiSync = temp->getRemotePwPWM(); |
634 | mActiveSyncPort = temp->getRemotePortPWM(); | 642 | mActiveSyncPort = temp->getRemotePortPWM(); |
635 | mActiveSyncIP = temp->getRemoteIPPWM(); | 643 | mActiveSyncIP = temp->getRemoteIPPWM(); |
636 | } | 644 | } |
637 | syncPi(); | 645 | syncPi(); |
638 | while ( !mPisyncFinished ) { | 646 | while ( !mPisyncFinished ) { |
639 | //qDebug("waiting "); | 647 | //qDebug("waiting "); |
640 | qApp->processEvents(); | 648 | qApp->processEvents(); |
641 | } | 649 | } |
642 | timer.start(); | 650 | timer.start(); |
643 | while ( timer.elapsed () < 2000 ) { | 651 | while ( timer.elapsed () < 2000 ) { |
644 | qApp->processEvents(); | 652 | qApp->processEvents(); |
645 | } | 653 | } |
646 | } else | 654 | } else |
647 | syncRemote( temp, false ); | 655 | syncRemote( temp, false ); |
648 | 656 | ||
649 | } | 657 | } |
650 | } | 658 | } |
651 | timer.start(); | 659 | timer.start(); |
652 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync in progress ... please wait!") ); | 660 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync in progress ... please wait!") ); |
653 | while ( timer.elapsed () < 2000 ) { | 661 | while ( timer.elapsed () < 2000 ) { |
654 | qApp->processEvents(); | 662 | qApp->processEvents(); |
655 | #ifndef _WIN32_ | 663 | #ifndef _WIN32_ |
656 | sleep (1); | 664 | sleep (1); |
657 | #endif | 665 | #endif |
658 | } | 666 | } |
659 | 667 | ||
660 | } | 668 | } |
661 | 669 | ||
662 | } | 670 | } |
663 | delete temp; | 671 | delete temp; |
664 | return syncedProfiles; | 672 | return syncedProfiles; |
665 | } | 673 | } |
666 | 674 | ||
667 | void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) | 675 | void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) |
668 | { | 676 | { |
669 | QString question; | 677 | QString question; |
670 | if ( ask ) { | 678 | if ( ask ) { |
671 | question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; | 679 | question = i18n("Do you really want\nto remote sync\nwith profile \n")+ prof->getName()+" ?\n"; |
672 | if ( QMessageBox::information( mParent, i18n("Sync"), | 680 | if ( QMessageBox::information( mParent, i18n("Sync"), |
673 | question, | 681 | question, |
674 | i18n("Yes"), i18n("No"), | 682 | i18n("Yes"), i18n("No"), |
675 | 0, 0 ) != 0 ) | 683 | 0, 0 ) != 0 ) |
676 | return; | 684 | return; |
677 | } | 685 | } |
678 | 686 | ||
679 | QString preCommand; | 687 | QString preCommand; |
680 | QString localTempFile; | 688 | QString localTempFile; |
681 | QString postCommand; | 689 | QString postCommand; |
682 | 690 | ||
683 | switch(mTargetApp) | 691 | switch(mTargetApp) |
684 | { | 692 | { |
685 | case (KAPI): | 693 | case (KAPI): |
686 | preCommand = prof->getPreSyncCommandAB(); | 694 | preCommand = prof->getPreSyncCommandAB(); |
687 | postCommand = prof->getPostSyncCommandAB(); | 695 | postCommand = prof->getPostSyncCommandAB(); |
688 | localTempFile = prof->getLocalTempFileAB(); | 696 | localTempFile = prof->getLocalTempFileAB(); |
689 | break; | 697 | break; |
690 | case (KOPI): | 698 | case (KOPI): |
691 | preCommand = prof->getPreSyncCommand(); | 699 | preCommand = prof->getPreSyncCommand(); |
692 | postCommand = prof->getPostSyncCommand(); | 700 | postCommand = prof->getPostSyncCommand(); |
693 | localTempFile = prof->getLocalTempFile(); | 701 | localTempFile = prof->getLocalTempFile(); |
694 | break; | 702 | break; |
695 | case (PWMPI): | 703 | case (PWMPI): |
696 | preCommand = prof->getPreSyncCommandPWM(); | 704 | preCommand = prof->getPreSyncCommandPWM(); |
697 | postCommand = prof->getPostSyncCommandPWM(); | 705 | postCommand = prof->getPostSyncCommandPWM(); |
698 | localTempFile = prof->getLocalTempFilePWM(); | 706 | localTempFile = prof->getLocalTempFilePWM(); |
699 | break; | 707 | break; |
700 | default: | 708 | default: |
701 | qDebug("KSyncManager::syncRemote: invalid apptype selected"); | 709 | qDebug("KSyncManager::syncRemote: invalid apptype selected"); |
702 | break; | 710 | break; |
703 | } | 711 | } |
704 | 712 | ||
705 | 713 | ||
706 | int fi; | 714 | int fi; |
707 | if ( (fi = preCommand.find("$PWD$")) > 0 ) { | 715 | if ( (fi = preCommand.find("$PWD$")) > 0 ) { |
708 | QString pwd = getPassword(); | 716 | QString pwd = getPassword(); |
709 | preCommand = preCommand.left( fi )+ pwd + preCommand.mid( fi+5 ); | 717 | preCommand = preCommand.left( fi )+ pwd + preCommand.mid( fi+5 ); |
710 | 718 | ||
711 | } | 719 | } |
712 | int maxlen = 30; | 720 | int maxlen = 30; |
713 | if ( QApplication::desktop()->width() > 320 ) | 721 | if ( QApplication::desktop()->width() > 320 ) |
714 | maxlen += 25; | 722 | maxlen += 25; |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 2d0a4ab..6d89950 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -23,195 +23,199 @@ | |||
23 | #define _KSYNCMANAGER_H | 23 | #define _KSYNCMANAGER_H |
24 | 24 | ||
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qsocket.h> | 27 | #include <qsocket.h> |
28 | #include <qdatetime.h> | 28 | #include <qdatetime.h> |
29 | #include <qserversocket.h> | 29 | #include <qserversocket.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | 32 | ||
33 | class QPopupMenu; | 33 | class QPopupMenu; |
34 | class KSyncProfile; | 34 | class KSyncProfile; |
35 | class KPimPrefs; | 35 | class KPimPrefs; |
36 | class QWidget; | 36 | class QWidget; |
37 | class KSyncManager; | 37 | class KSyncManager; |
38 | class KSyncInterface; | 38 | class KSyncInterface; |
39 | class QProgressBar; | 39 | class QProgressBar; |
40 | 40 | ||
41 | 41 | ||
42 | class KServerSocket : public QServerSocket | 42 | class KServerSocket : public QServerSocket |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | 45 | ||
46 | public: | 46 | public: |
47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); | 47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); |
48 | 48 | ||
49 | void newConnection ( int socket ) ; | 49 | void newConnection ( int socket ) ; |
50 | void setFileName( QString fn ) {mFileName = fn;}; | 50 | void setFileName( QString fn ) {mFileName = fn;}; |
51 | signals: | 51 | signals: |
52 | void file_received( bool ); | 52 | void file_received( bool ); |
53 | void request_file(); | 53 | void request_file(); |
54 | void saveFile(); | 54 | void saveFile(); |
55 | void endConnect(); | 55 | void endConnect(); |
56 | private slots: | 56 | private slots: |
57 | void discardClient(); | 57 | void discardClient(); |
58 | void readClient(); | 58 | void readClient(); |
59 | void readBackFileFromSocket(); | 59 | void readBackFileFromSocket(); |
60 | private : | 60 | private : |
61 | bool blockRC; | 61 | bool blockRC; |
62 | void send_file(); | 62 | void send_file(); |
63 | void get_file(); | 63 | void get_file(); |
64 | void end_connect(); | 64 | void end_connect(); |
65 | QDialog* mSyncActionDialog; | 65 | QDialog* mSyncActionDialog; |
66 | QSocket* mSocket; | 66 | QSocket* mSocket; |
67 | QString mPassWord; | 67 | QString mPassWord; |
68 | QString mFileName; | 68 | QString mFileName; |
69 | QTime piTime; | 69 | QTime piTime; |
70 | QString piFileString; | 70 | QString piFileString; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | class KCommandSocket : public QObject | 73 | class KCommandSocket : public QObject |
74 | { | 74 | { |
75 | Q_OBJECT | 75 | Q_OBJECT |
76 | public: | 76 | public: |
77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; | 77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; |
78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); | 78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); |
79 | void readFile( QString ); | 79 | void readFile( QString ); |
80 | void writeFile( QString ); | 80 | void writeFile( QString ); |
81 | void sendStop(); | 81 | void sendStop(); |
82 | 82 | ||
83 | signals: | 83 | signals: |
84 | void commandFinished( KCommandSocket*, int ); | 84 | void commandFinished( KCommandSocket*, int ); |
85 | private slots: | 85 | private slots: |
86 | void startReadFileFromSocket(); | 86 | void startReadFileFromSocket(); |
87 | void readFileFromSocket(); | 87 | void readFileFromSocket(); |
88 | void deleteSocket(); | 88 | void deleteSocket(); |
89 | void writeFileToSocket(); | 89 | void writeFileToSocket(); |
90 | private : | 90 | private : |
91 | QSocket* mSocket; | 91 | QSocket* mSocket; |
92 | QString mPassWord; | 92 | QString mPassWord; |
93 | Q_UINT16 mPort; | 93 | Q_UINT16 mPort; |
94 | QString mHost; | 94 | QString mHost; |
95 | QString mFileName; | 95 | QString mFileName; |
96 | QTimer* mTimerSocket; | 96 | QTimer* mTimerSocket; |
97 | int mRetVal; | 97 | int mRetVal; |
98 | QTime mTime; | 98 | QTime mTime; |
99 | QString mFileString; | 99 | QString mFileString; |
100 | bool mFirst; | 100 | bool mFirst; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | 103 | ||
104 | class KSyncManager : public QObject | 104 | class KSyncManager : public QObject |
105 | { | 105 | { |
106 | Q_OBJECT | 106 | Q_OBJECT |
107 | 107 | ||
108 | public: | 108 | public: |
109 | enum TargetApp { | 109 | enum TargetApp { |
110 | KOPI = 0, | 110 | KOPI = 0, |
111 | KAPI = 1, | 111 | KAPI = 1, |
112 | PWMPI = 2 }; | 112 | PWMPI = 2 }; |
113 | 113 | ||
114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
115 | ~KSyncManager() ; | 115 | ~KSyncManager() ; |
116 | 116 | ||
117 | void multiSync( bool askforPrefs ); | 117 | void multiSync( bool askforPrefs ); |
118 | bool blockSave() { return mBlockSaveFlag; } | 118 | bool blockSave() { return mBlockSaveFlag; } |
119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
120 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 120 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
121 | QString defaultFileName() { return mDefFileName ;} | 121 | QString defaultFileName() { return mDefFileName ;} |
122 | QString syncFileName(); | 122 | QString syncFileName(); |
123 | void enableQuick( bool ask = true); | 123 | void enableQuick( bool ask = true); |
124 | 124 | ||
125 | bool syncWithDesktop () { return mSyncWithDesktop;} | 125 | bool syncWithDesktop () { return mSyncWithDesktop;} |
126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
127 | QString getCurrentSyncName() { return mCurrentSyncName; } | 127 | QString getCurrentSyncName() { return mCurrentSyncName; } |
128 | 128 | ||
129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
130 | void hideProgressBar(); | 130 | void hideProgressBar(); |
131 | bool isProgressBarCanceled(); | 131 | bool isProgressBarCanceled(); |
132 | 132 | ||
133 | // sync stuff | 133 | // sync stuff |
134 | QString mLocalMachineName; | 134 | QString mLocalMachineName; |
135 | QStringList mExternSyncProfiles; | 135 | QStringList mExternSyncProfiles; |
136 | QStringList mSyncProfileNames; | 136 | QStringList mSyncProfileNames; |
137 | bool mAskForPreferences; | 137 | bool mAskForPreferences; |
138 | bool mShowSyncSummary; | 138 | bool mShowSyncSummary; |
139 | bool mIsKapiFile; | 139 | bool mIsKapiFile; |
140 | bool mWriteBackExistingOnly; | 140 | bool mWriteBackExistingOnly; |
141 | int mSyncAlgoPrefs; | 141 | int mSyncAlgoPrefs; |
142 | bool mWriteBackFile; | 142 | bool mWriteBackFile; |
143 | int mWriteBackInFuture; | 143 | int mWriteBackInFuture; |
144 | int mWriteBackInPast; | 144 | int mWriteBackInPast; |
145 | QString mPhoneDevice; | 145 | QString mPhoneDevice; |
146 | QString mPhoneConnection; | 146 | QString mPhoneConnection; |
147 | QString mPhoneModel; | 147 | QString mPhoneModel; |
148 | QString mPassWordPiSync; | 148 | QString mPassWordPiSync; |
149 | QString mActiveSyncPort; | 149 | QString mActiveSyncPort; |
150 | QString mActiveSyncIP ; | 150 | QString mActiveSyncIP ; |
151 | QString mFilterInCal; | ||
152 | QString mFilterOutCal; | ||
153 | QString mFilterInAB; | ||
154 | QString mFilterOutAB; | ||
151 | static QDateTime mRequestedSyncEvent; | 155 | static QDateTime mRequestedSyncEvent; |
152 | 156 | ||
153 | signals: | 157 | signals: |
154 | void save(); | 158 | void save(); |
155 | void request_file(); | 159 | void request_file(); |
156 | void getFile( bool ); | 160 | void getFile( bool ); |
157 | 161 | ||
158 | public slots: | 162 | public slots: |
159 | void slotSyncMenu( int ); | 163 | void slotSyncMenu( int ); |
160 | void slotClearMenu( int action ); | 164 | void slotClearMenu( int action ); |
161 | void deleteCommandSocket(KCommandSocket*s, int state); | 165 | void deleteCommandSocket(KCommandSocket*s, int state); |
162 | void readFileFromSocket(); | 166 | void readFileFromSocket(); |
163 | void fillSyncMenu(); | 167 | void fillSyncMenu(); |
164 | 168 | ||
165 | private: | 169 | private: |
166 | void syncPi(); | 170 | void syncPi(); |
167 | KServerSocket * mServerSocket; | 171 | KServerSocket * mServerSocket; |
168 | KPimPrefs* mPrefs; | 172 | KPimPrefs* mPrefs; |
169 | QString mDefFileName; | 173 | QString mDefFileName; |
170 | QString mCurrentSyncDevice; | 174 | QString mCurrentSyncDevice; |
171 | QString mCurrentSyncName; | 175 | QString mCurrentSyncName; |
172 | void quickSyncLocalFile(); | 176 | void quickSyncLocalFile(); |
173 | bool syncWithFile( QString fn , bool quick ); | 177 | bool syncWithFile( QString fn , bool quick ); |
174 | void syncLocalFile(); | 178 | void syncLocalFile(); |
175 | void syncPhone(); | 179 | void syncPhone(); |
176 | void syncSharp(); | 180 | void syncSharp(); |
177 | void syncKDE(); | 181 | void syncKDE(); |
178 | bool syncExternalApplication(QString); | 182 | bool syncExternalApplication(QString); |
179 | int mCurrentSyncProfile ; | 183 | int mCurrentSyncProfile ; |
180 | void syncRemote( KSyncProfile* prof, bool ask = true); | 184 | void syncRemote( KSyncProfile* prof, bool ask = true); |
181 | bool edit_sync_options(); | 185 | bool edit_sync_options(); |
182 | bool edit_pisync_options(); | 186 | bool edit_pisync_options(); |
183 | int ringSync(); | 187 | int ringSync(); |
184 | QString getPassword( ); | 188 | QString getPassword( ); |
185 | bool mPisyncFinished; | 189 | bool mPisyncFinished; |
186 | bool mBlockSaveFlag; | 190 | bool mBlockSaveFlag; |
187 | QWidget* mParent; | 191 | QWidget* mParent; |
188 | KSyncInterface* mImplementation; | 192 | KSyncInterface* mImplementation; |
189 | TargetApp mTargetApp; | 193 | TargetApp mTargetApp; |
190 | QPopupMenu* mSyncMenu; | 194 | QPopupMenu* mSyncMenu; |
191 | QProgressBar* bar; | 195 | QProgressBar* bar; |
192 | bool mSyncWithDesktop; | 196 | bool mSyncWithDesktop; |
193 | 197 | ||
194 | private slots: | 198 | private slots: |
195 | void confSync(); | 199 | void confSync(); |
196 | 200 | ||
197 | 201 | ||
198 | }; | 202 | }; |
199 | 203 | ||
200 | 204 | ||
201 | class KSyncInterface | 205 | class KSyncInterface |
202 | { | 206 | { |
203 | public : | 207 | public : |
204 | virtual void removeSyncInfo( QString syncProfile) = 0; | 208 | virtual void removeSyncInfo( QString syncProfile) = 0; |
205 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 209 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; |
206 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 210 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
207 | { | 211 | { |
208 | // empty implementation, because some syncable applications do not | 212 | // empty implementation, because some syncable applications do not |
209 | // have an external(sharpdtm) syncmode, like pwmanager. | 213 | // have an external(sharpdtm) syncmode, like pwmanager. |
210 | return false; | 214 | return false; |
211 | } | 215 | } |
212 | 216 | ||
213 | 217 | ||
214 | }; | 218 | }; |
215 | 219 | ||
216 | 220 | ||
217 | #endif | 221 | #endif |