-rw-r--r-- | kabc/resource.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 16 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 15 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 5 |
8 files changed, 32 insertions, 17 deletions
diff --git a/kabc/resource.cpp b/kabc/resource.cpp index d39fd6a..7b91239 100644 --- a/kabc/resource.cpp +++ b/kabc/resource.cpp | |||
@@ -16,50 +16,50 @@ | |||
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 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include <ksyncprofile.h> | 30 | #include <ksyncprofile.h> |
31 | 31 | ||
32 | #include "resource.h" | 32 | #include "resource.h" |
33 | 33 | ||
34 | using namespace KABC; | 34 | using namespace KABC; |
35 | 35 | ||
36 | Resource::Resource( const KConfig *config, bool syncable ) | 36 | Resource::Resource( const KConfig *config, bool syncable ) |
37 | : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 ) | 37 | : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 ) |
38 | { | 38 | { |
39 | if(syncable == true) { | 39 | if(syncable == true) { |
40 | mSyncProfile = new KSyncProfile( identifier() ); | 40 | mSyncProfile = new KSyncProfile( ); |
41 | mSyncProfile->setName(resourceName()); | 41 | mSyncProfile->setName("pending" /*resourceName()*/); |
42 | mSyncProfile->readConfig( (KConfig *)config ); | 42 | mSyncProfile->readConfig( (KConfig *)config ); |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | Resource::~Resource() | 46 | Resource::~Resource() |
47 | { | 47 | { |
48 | if (mSyncProfile != 0) { | 48 | if (mSyncProfile != 0) { |
49 | delete mSyncProfile; | 49 | delete mSyncProfile; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | void Resource::writeConfig( KConfig *config ) | 53 | void Resource::writeConfig( KConfig *config ) |
54 | { | 54 | { |
55 | KRES::Resource::writeConfig( config ); | 55 | KRES::Resource::writeConfig( config ); |
56 | 56 | ||
57 | if(mSyncProfile != 0) | 57 | if(mSyncProfile != 0) |
58 | mSyncProfile->writeConfig( config ); | 58 | mSyncProfile->writeConfig( config ); |
59 | } | 59 | } |
60 | 60 | ||
61 | 61 | ||
62 | void Resource::setAddressBook( AddressBook *ab ) | 62 | void Resource::setAddressBook( AddressBook *ab ) |
63 | { | 63 | { |
64 | mAddressBook = ab; | 64 | mAddressBook = ab; |
65 | } | 65 | } |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index f859b90..689618d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1152,48 +1152,52 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1152 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1152 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1153 | FileStorage* storage = new FileStorage( calendar ); | 1153 | FileStorage* storage = new FileStorage( calendar ); |
1154 | bool syncOK = false; | 1154 | bool syncOK = false; |
1155 | storage->setFileName( filename ); | 1155 | storage->setFileName( filename ); |
1156 | // qDebug("loading ... "); | 1156 | // qDebug("loading ... "); |
1157 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { | 1157 | if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { |
1158 | getEventViewerDialog()->setSyncMode( true ); | 1158 | getEventViewerDialog()->setSyncMode( true ); |
1159 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1159 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1160 | getEventViewerDialog()->setSyncMode( false ); | 1160 | getEventViewerDialog()->setSyncMode( false ); |
1161 | if ( syncOK ) { | 1161 | if ( syncOK ) { |
1162 | if ( KOPrefs::instance()->mWriteBackFile ) | 1162 | if ( KOPrefs::instance()->mWriteBackFile ) |
1163 | { | 1163 | { |
1164 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 1164 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); |
1165 | storage->save(); | 1165 | storage->save(); |
1166 | } | 1166 | } |
1167 | } | 1167 | } |
1168 | setModified( true ); | 1168 | setModified( true ); |
1169 | } | 1169 | } |
1170 | delete storage; | 1170 | delete storage; |
1171 | delete calendar; | 1171 | delete calendar; |
1172 | if ( syncOK ) | 1172 | if ( syncOK ) |
1173 | updateView(); | 1173 | updateView(); |
1174 | return syncOK; | 1174 | return syncOK; |
1175 | } | 1175 | } |
1176 | void CalendarView::syncPhone() | ||
1177 | { | ||
1178 | qDebug("CalendarView::syncPhone() "); | ||
1179 | } | ||
1176 | void CalendarView::syncSharp() | 1180 | void CalendarView::syncSharp() |
1177 | { | 1181 | { |
1178 | #ifndef DESKTOP_VERSION | 1182 | #ifndef DESKTOP_VERSION |
1179 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1183 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1180 | //mCurrentSyncDevice = "sharp-DTM"; | 1184 | //mCurrentSyncDevice = "sharp-DTM"; |
1181 | if ( KOPrefs::instance()->mAskForPreferences ) | 1185 | if ( KOPrefs::instance()->mAskForPreferences ) |
1182 | edit_sync_options(); | 1186 | edit_sync_options(); |
1183 | qApp->processEvents(); | 1187 | qApp->processEvents(); |
1184 | CalendarLocal* calendar = new CalendarLocal(); | 1188 | CalendarLocal* calendar = new CalendarLocal(); |
1185 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1189 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1186 | bool syncOK = false; | 1190 | bool syncOK = false; |
1187 | SharpFormat sharpFormat; | 1191 | SharpFormat sharpFormat; |
1188 | if ( sharpFormat.load( calendar, mCalendar ) ) { | 1192 | if ( sharpFormat.load( calendar, mCalendar ) ) { |
1189 | getEventViewerDialog()->setSyncMode( true ); | 1193 | getEventViewerDialog()->setSyncMode( true ); |
1190 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); | 1194 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); |
1191 | getEventViewerDialog()->setSyncMode( false ); | 1195 | getEventViewerDialog()->setSyncMode( false ); |
1192 | qApp->processEvents(); | 1196 | qApp->processEvents(); |
1193 | if ( syncOK ) { | 1197 | if ( syncOK ) { |
1194 | if ( KOPrefs::instance()->mWriteBackFile ) | 1198 | if ( KOPrefs::instance()->mWriteBackFile ) |
1195 | { | 1199 | { |
1196 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1200 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1197 | Incidence* inc = iL.first(); | 1201 | Incidence* inc = iL.first(); |
1198 | /* obsolete | 1202 | /* obsolete |
1199 | while ( inc ) { | 1203 | while ( inc ) { |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index d564473..b2838db 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -404,48 +404,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
404 | void toggleExpand(); | 404 | void toggleExpand(); |
405 | void toggleDateNavigatorWidget(); | 405 | void toggleDateNavigatorWidget(); |
406 | void toggleAllDaySize(); | 406 | void toggleAllDaySize(); |
407 | void dialogClosing(Incidence *); | 407 | void dialogClosing(Incidence *); |
408 | 408 | ||
409 | /** Look for new messages in the inbox */ | 409 | /** Look for new messages in the inbox */ |
410 | void lookForIncomingMessages(); | 410 | void lookForIncomingMessages(); |
411 | /** Look for new messages in the outbox */ | 411 | /** Look for new messages in the outbox */ |
412 | void lookForOutgoingMessages(); | 412 | void lookForOutgoingMessages(); |
413 | 413 | ||
414 | void processMainViewSelection( Incidence * ); | 414 | void processMainViewSelection( Incidence * ); |
415 | void processTodoListSelection( Incidence * ); | 415 | void processTodoListSelection( Incidence * ); |
416 | 416 | ||
417 | void processIncidenceSelection( Incidence * ); | 417 | void processIncidenceSelection( Incidence * ); |
418 | 418 | ||
419 | void purgeCompleted(); | 419 | void purgeCompleted(); |
420 | bool removeCompletedSubTodos( Todo* ); | 420 | bool removeCompletedSubTodos( Todo* ); |
421 | void slotCalendarChanged(); | 421 | void slotCalendarChanged(); |
422 | bool importBday(); | 422 | bool importBday(); |
423 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); | 423 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); |
424 | bool importQtopia( const QString &categoriesFile, | 424 | bool importQtopia( const QString &categoriesFile, |
425 | const QString &datebookFile, | 425 | const QString &datebookFile, |
426 | const QString &tasklistFile ); | 426 | const QString &tasklistFile ); |
427 | void syncSharp( ); | 427 | void syncSharp( ); |
428 | void syncPhone( ); | ||
428 | void slotSelectPickerDate( QDate ) ; | 429 | void slotSelectPickerDate( QDate ) ; |
429 | void showDatePicker( ) ; | 430 | void showDatePicker( ) ; |
430 | void moveIncidence(Incidence *) ; | 431 | void moveIncidence(Incidence *) ; |
431 | void beamIncidence(Incidence *) ; | 432 | void beamIncidence(Incidence *) ; |
432 | void beamCalendar() ; | 433 | void beamCalendar() ; |
433 | void beamFilteredCalendar() ; | 434 | void beamFilteredCalendar() ; |
434 | void beamIncidenceList(QPtrList<Incidence>) ; | 435 | void beamIncidenceList(QPtrList<Incidence>) ; |
435 | void manageCategories(); | 436 | void manageCategories(); |
436 | int addCategories(); | 437 | int addCategories(); |
437 | void removeCategories(); | 438 | void removeCategories(); |
438 | void setSyncDevice( QString ); | 439 | void setSyncDevice( QString ); |
439 | void setSyncName( QString ); | 440 | void setSyncName( QString ); |
440 | protected slots: | 441 | protected slots: |
441 | void timerAlarm(); | 442 | void timerAlarm(); |
442 | void suspendAlarm(); | 443 | void suspendAlarm(); |
443 | void beamDone( Ir *ir ); | 444 | void beamDone( Ir *ir ); |
444 | /** Select a view or adapt the current view to display the specified dates. */ | 445 | /** Select a view or adapt the current view to display the specified dates. */ |
445 | void showDates( const KCal::DateList & ); | 446 | void showDates( const KCal::DateList & ); |
446 | void selectWeekNum ( int ); | 447 | void selectWeekNum ( int ); |
447 | 448 | ||
448 | public: | 449 | public: |
449 | // show a standard warning | 450 | // show a standard warning |
450 | // returns KMsgBox::yesNoCancel() | 451 | // returns KMsgBox::yesNoCancel() |
451 | int msgCalModified(); | 452 | int msgCalModified(); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 424fa98..446fe2e 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -189,48 +189,51 @@ class KOPrefs : public KPimPrefs | |||
189 | bool mShowIconNextDays; | 189 | bool mShowIconNextDays; |
190 | bool mShowIconNext; | 190 | bool mShowIconNext; |
191 | bool mShowIconJournal; | 191 | bool mShowIconJournal; |
192 | 192 | ||
193 | bool mShowIconStretch; | 193 | bool mShowIconStretch; |
194 | 194 | ||
195 | bool mToolBarHor; | 195 | bool mToolBarHor; |
196 | bool mToolBarUp; | 196 | bool mToolBarUp; |
197 | bool mToolBarMiniIcons; | 197 | bool mToolBarMiniIcons; |
198 | 198 | ||
199 | bool mAskForQuit; | 199 | bool mAskForQuit; |
200 | bool mUsePassWd; | 200 | bool mUsePassWd; |
201 | bool mWriteBackFile; | 201 | bool mWriteBackFile; |
202 | bool mAskForPreferences; | 202 | bool mAskForPreferences; |
203 | bool mShowSyncSummary; | 203 | bool mShowSyncSummary; |
204 | bool mShowSyncEvents; | 204 | bool mShowSyncEvents; |
205 | bool mShowTodoInAgenda; | 205 | bool mShowTodoInAgenda; |
206 | bool mWriteBackExistingOnly; | 206 | bool mWriteBackExistingOnly; |
207 | 207 | ||
208 | QString mRemoteIP; | 208 | QString mRemoteIP; |
209 | QString mRemoteUser; | 209 | QString mRemoteUser; |
210 | QString mRemotePassWd; | 210 | QString mRemotePassWd; |
211 | QString mRemoteFile; | 211 | QString mRemoteFile; |
212 | QString mLocalTempFile; | 212 | QString mLocalTempFile; |
213 | QString mPhoneDevice; | ||
214 | QString mPhoneConnection; | ||
215 | QString mPhoneModel; | ||
213 | 216 | ||
214 | int mLastSyncTime; | 217 | int mLastSyncTime; |
215 | int mSyncAlgoPrefs; | 218 | int mSyncAlgoPrefs; |
216 | int mRingSyncAlgoPrefs; | 219 | int mRingSyncAlgoPrefs; |
217 | QStringList mSyncProfileNames; | 220 | QStringList mSyncProfileNames; |
218 | QStringList mExternSyncProfiles; | 221 | QStringList mExternSyncProfiles; |
219 | QString mLocalMachineName; | 222 | QString mLocalMachineName; |
220 | void setCategoryColor(QString cat,const QColor & color); | 223 | void setCategoryColor(QString cat,const QColor & color); |
221 | QColor *categoryColor(QString cat); | 224 | QColor *categoryColor(QString cat); |
222 | 225 | ||
223 | QString mArchiveFile; | 226 | QString mArchiveFile; |
224 | QString mHtmlExportFile; | 227 | QString mHtmlExportFile; |
225 | bool mHtmlWithSave; | 228 | bool mHtmlWithSave; |
226 | 229 | ||
227 | QStringList mSelectedPlugins; | 230 | QStringList mSelectedPlugins; |
228 | 231 | ||
229 | QString mLastImportFile; | 232 | QString mLastImportFile; |
230 | QString mLastVcalFile; | 233 | QString mLastVcalFile; |
231 | QString mLastSaveFile; | 234 | QString mLastSaveFile; |
232 | QString mLastLoadFile; | 235 | QString mLastLoadFile; |
233 | QString mLastSyncedLocalFile; | 236 | QString mLastSyncedLocalFile; |
234 | 237 | ||
235 | 238 | ||
236 | QString mDefaultAlarmFile; | 239 | QString mDefaultAlarmFile; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index c3c4c26..062c95f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -876,49 +876,55 @@ int MainWindow::ringSync() | |||
876 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 876 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
877 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 877 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
878 | KSyncProfile* temp = new KSyncProfile (); | 878 | KSyncProfile* temp = new KSyncProfile (); |
879 | KOPrefs::instance()->mAskForPreferences = false; | 879 | KOPrefs::instance()->mAskForPreferences = false; |
880 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 880 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
881 | mCurrentSyncProfile = i; | 881 | mCurrentSyncProfile = i; |
882 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 882 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
883 | temp->readConfig(&config); | 883 | temp->readConfig(&config); |
884 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 884 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |
885 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 885 | setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
886 | ++syncedProfiles; | 886 | ++syncedProfiles; |
887 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); | 887 | // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); |
888 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); | 888 | KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); |
889 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); | 889 | KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); |
890 | KOPrefs::instance()->mShowSyncSummary = false; | 890 | KOPrefs::instance()->mShowSyncSummary = false; |
891 | mView->setSyncDevice(syncProfileNames[i] ); | 891 | mView->setSyncDevice(syncProfileNames[i] ); |
892 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); | 892 | mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); |
893 | if ( i == 0 ) { | 893 | if ( i == 0 ) { |
894 | syncSharp(); | 894 | syncSharp(); |
895 | } else { | 895 | } else { |
896 | if ( temp->getIsLocalFileSync() ) { | 896 | if ( temp->getIsLocalFileSync() ) { |
897 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) | 897 | if ( syncWithFile( temp->getRemoteFileName( ), true ) ) |
898 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); | 898 | KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); |
899 | } else { | 899 | } else { |
900 | syncRemote( temp, false ); | 900 | if ( temp->getIsPhoneSync() ) { |
901 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; | ||
902 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); | ||
903 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); | ||
904 | syncPhone(); | ||
905 | } else | ||
906 | syncRemote( temp, false ); | ||
901 | 907 | ||
902 | } | 908 | } |
903 | } | 909 | } |
904 | timer.start(); | 910 | timer.start(); |
905 | setCaption(i18n("Multiple sync in progress ... please wait!") ); | 911 | setCaption(i18n("Multiple sync in progress ... please wait!") ); |
906 | while ( timer.elapsed () < 2000 ) { | 912 | while ( timer.elapsed () < 2000 ) { |
907 | qApp->processEvents(); | 913 | qApp->processEvents(); |
908 | #ifndef _WIN32_ | 914 | #ifndef _WIN32_ |
909 | sleep (1); | 915 | sleep (1); |
910 | #endif | 916 | #endif |
911 | } | 917 | } |
912 | 918 | ||
913 | } | 919 | } |
914 | 920 | ||
915 | } | 921 | } |
916 | delete temp; | 922 | delete temp; |
917 | return syncedProfiles; | 923 | return syncedProfiles; |
918 | } | 924 | } |
919 | 925 | ||
920 | void MainWindow::multiSync( bool askforPrefs ) | 926 | void MainWindow::multiSync( bool askforPrefs ) |
921 | { | 927 | { |
922 | if (mBlockSaveFlag) | 928 | if (mBlockSaveFlag) |
923 | return; | 929 | return; |
924 | mBlockSaveFlag = true; | 930 | mBlockSaveFlag = true; |
@@ -2016,34 +2022,42 @@ void MainWindow::syncSSH() | |||
2016 | #if 0 | 2022 | #if 0 |
2017 | system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics"); | 2023 | system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics"); |
2018 | while ( timer.elapsed() < 5000 ) | 2024 | while ( timer.elapsed() < 5000 ) |
2019 | qApp->processEvents(); | 2025 | qApp->processEvents(); |
2020 | 2026 | ||
2021 | qDebug("MainWindow::merging) "); | 2027 | qDebug("MainWindow::merging) "); |
2022 | mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); | 2028 | mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); |
2023 | while ( mBlockSaveFlag ) | 2029 | while ( mBlockSaveFlag ) |
2024 | qApp->processEvents(); | 2030 | qApp->processEvents(); |
2025 | save(); | 2031 | save(); |
2026 | system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); | 2032 | system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); |
2027 | #endif | 2033 | #endif |
2028 | 2034 | ||
2029 | } | 2035 | } |
2030 | 2036 | ||
2031 | 2037 | ||
2032 | void MainWindow::syncSharp() | 2038 | void MainWindow::syncSharp() |
2033 | { | 2039 | { |
2034 | if ( mCalendarModifiedFlag ) | 2040 | if ( mCalendarModifiedFlag ) |
2035 | save(); | 2041 | save(); |
2036 | mView->syncSharp(); | 2042 | mView->syncSharp(); |
2037 | slotModifiedChanged( true ); | 2043 | slotModifiedChanged( true ); |
2038 | 2044 | ||
2039 | } | 2045 | } |
2046 | void MainWindow::syncPhone() | ||
2047 | { | ||
2048 | if ( mCalendarModifiedFlag ) | ||
2049 | save(); | ||
2050 | mView->syncPhone(); | ||
2051 | slotModifiedChanged( true ); | ||
2052 | |||
2053 | } | ||
2040 | 2054 | ||
2041 | void MainWindow::printSel( ) | 2055 | void MainWindow::printSel( ) |
2042 | { | 2056 | { |
2043 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2057 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2044 | } | 2058 | } |
2045 | 2059 | ||
2046 | void MainWindow::printCal() | 2060 | void MainWindow::printCal() |
2047 | { | 2061 | { |
2048 | mView->print();//mCp->showDialog(); | 2062 | mView->print();//mCp->showDialog(); |
2049 | } | 2063 | } |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index fba8c52..1d87db0 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -54,48 +54,49 @@ class MainWindow : public QMainWindow | |||
54 | 54 | ||
55 | void importQtopia(); | 55 | void importQtopia(); |
56 | void importBday(); | 56 | void importBday(); |
57 | void importOL(); | 57 | void importOL(); |
58 | void importIcal(); | 58 | void importIcal(); |
59 | void importFile( QString, bool ); | 59 | void importFile( QString, bool ); |
60 | void quickImportIcal(); | 60 | void quickImportIcal(); |
61 | 61 | ||
62 | void slotModifiedChanged( bool ); | 62 | void slotModifiedChanged( bool ); |
63 | 63 | ||
64 | void save(); | 64 | void save(); |
65 | void configureToolBar( int ); | 65 | void configureToolBar( int ); |
66 | void printSel(); | 66 | void printSel(); |
67 | void printCal(); | 67 | void printCal(); |
68 | void saveCalendar(); | 68 | void saveCalendar(); |
69 | void loadCalendar(); | 69 | void loadCalendar(); |
70 | void exportVCalendar(); | 70 | void exportVCalendar(); |
71 | void fillFilterMenu(); | 71 | void fillFilterMenu(); |
72 | void selectFilter( int ); | 72 | void selectFilter( int ); |
73 | 73 | ||
74 | void slotSyncMenu( int ); | 74 | void slotSyncMenu( int ); |
75 | void syncSSH(); | 75 | void syncSSH(); |
76 | void confSync(); | 76 | void confSync(); |
77 | void syncSharp(); | 77 | void syncSharp(); |
78 | void syncPhone(); | ||
78 | void syncLocalFile(); | 79 | void syncLocalFile(); |
79 | bool syncWithFile( QString, bool ); | 80 | bool syncWithFile( QString, bool ); |
80 | void quickSyncLocalFile(); | 81 | void quickSyncLocalFile(); |
81 | 82 | ||
82 | 83 | ||
83 | protected: | 84 | protected: |
84 | void displayText( QString, QString); | 85 | void displayText( QString, QString); |
85 | void displayFile( QString, QString); | 86 | void displayFile( QString, QString); |
86 | 87 | ||
87 | void enableIncidenceActions( bool ); | 88 | void enableIncidenceActions( bool ); |
88 | 89 | ||
89 | private: | 90 | private: |
90 | void saveOnClose(); | 91 | void saveOnClose(); |
91 | int mCurrentSyncProfile; | 92 | int mCurrentSyncProfile; |
92 | void syncRemote( KSyncProfile* , bool ask = true); | 93 | void syncRemote( KSyncProfile* , bool ask = true); |
93 | void fillSyncMenu(); | 94 | void fillSyncMenu(); |
94 | bool mFlagKeyPressed; | 95 | bool mFlagKeyPressed; |
95 | bool mBlockAtStartup; | 96 | bool mBlockAtStartup; |
96 | QPEToolBar *iconToolBar; | 97 | QPEToolBar *iconToolBar; |
97 | void initActions(); | 98 | void initActions(); |
98 | void setDefaultPreferences(); | 99 | void setDefaultPreferences(); |
99 | void keyPressEvent ( QKeyEvent * ) ; | 100 | void keyPressEvent ( QKeyEvent * ) ; |
100 | void keyReleaseEvent ( QKeyEvent * ) ; | 101 | void keyReleaseEvent ( QKeyEvent * ) ; |
101 | QPopupMenu *configureToolBarMenu; | 102 | QPopupMenu *configureToolBarMenu; |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 15dc152..e7c35fb 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -9,164 +9,159 @@ | |||
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | 24 | ||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 26 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile( const char * identifier): QObject (0, identifier ) | 33 | KSyncProfile::KSyncProfile(): QObject () |
34 | { | 34 | { |
35 | setIdentifier( identifier ); | ||
36 | |||
37 | if (getIdentifier().isEmpty()) | ||
38 | setIdentifier( "noID" ); | ||
39 | |||
40 | setDefault(); | 35 | setDefault(); |
41 | } | 36 | } |
42 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
43 | { | 38 | { |
44 | 39 | ||
45 | } | 40 | } |
46 | 41 | ||
47 | 42 | ||
48 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
49 | { | 44 | { |
50 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
51 | myClone->setPreSyncCommand( mPreSyncCommand ); | 46 | myClone->setPreSyncCommand( mPreSyncCommand ); |
52 | myClone->setPostSyncCommand( mPostSyncCommand ); | 47 | myClone->setPostSyncCommand( mPostSyncCommand ); |
53 | myClone->setLocalTempFile( mLocalTempFile); | 48 | myClone->setLocalTempFile( mLocalTempFile); |
54 | myClone->setRemoteFileName( mRemoteFileName ); | 49 | myClone->setRemoteFileName( mRemoteFileName ); |
55 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); | 50 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); |
56 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); | 51 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); |
57 | myClone->setLocalTempFileAB( mLocalTempFileAB); | 52 | myClone->setLocalTempFileAB( mLocalTempFileAB); |
58 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); | 53 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); |
59 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 54 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
60 | myClone->setAskForPreferences( mAskForPreferences); | 55 | myClone->setAskForPreferences( mAskForPreferences); |
61 | myClone->setWriteBackExisting(mWriteBackExisting ); | 56 | myClone->setWriteBackExisting(mWriteBackExisting ); |
62 | myClone->setWriteBackFile( mWriteBackFile); | 57 | myClone->setWriteBackFile( mWriteBackFile); |
63 | myClone->setWriteBackFuture( mWriteBackFuture ); | 58 | myClone->setWriteBackFuture( mWriteBackFuture ); |
64 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); | 59 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); |
65 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 60 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
66 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | 61 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); |
67 | myClone->setSyncPrefs( mSyncPrefs); | 62 | myClone->setSyncPrefs( mSyncPrefs); |
68 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 63 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
69 | myClone->setIsPhoneSync( mIsPhoneSync ); | 64 | myClone->setIsPhoneSync( mIsPhoneSync ); |
70 | myClone->setName( "noName" ); | 65 | myClone->setName( "noName" ); |
71 | myClone->setIdentifier( "noID" ); | 66 | //myClone->setIdentifier( "noID" ); |
72 | return myClone; | 67 | return myClone; |
73 | } | 68 | } |
74 | 69 | ||
75 | 70 | ||
76 | void KSyncProfile::setDefault() | 71 | void KSyncProfile::setDefault() |
77 | { | 72 | { |
78 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 73 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
79 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 74 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
80 | mLocalTempFile = "/tmp/mycalendar.ics"; | 75 | mLocalTempFile = "/tmp/mycalendar.ics"; |
81 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 76 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
82 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); | 77 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); |
83 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); | 78 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); |
84 | mLocalTempFileAB = "/tmp/std.vcf"; | 79 | mLocalTempFileAB = "/tmp/std.vcf"; |
85 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | 80 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; |
86 | mShowSummaryAfterSync = true; | 81 | mShowSummaryAfterSync = true; |
87 | mAskForPreferences = true; | 82 | mAskForPreferences = true; |
88 | mWriteBackExisting = false; | 83 | mWriteBackExisting = false; |
89 | mWriteBackFuture = false; | 84 | mWriteBackFuture = false; |
90 | mWriteBackFutureWeeks = 12; | 85 | mWriteBackFutureWeeks = 12; |
91 | mWriteBackFile = true; | 86 | mWriteBackFile = true; |
92 | mIncludeInRingSync = false; | 87 | mIncludeInRingSync = false; |
93 | mIncludeInRingSyncAB = false; | 88 | mIncludeInRingSyncAB = false; |
94 | mSyncPrefs = SYNC_PREF_ASK; | 89 | mSyncPrefs = SYNC_PREF_ASK; |
95 | mIsLocalFileSync = true; | 90 | mIsLocalFileSync = true; |
96 | mName = "noName"; | 91 | mName = "noName"; |
97 | mIsPhoneSync = false; | 92 | mIsPhoneSync = false; |
98 | mPhoneDevice = "/dev/ircomm"; | 93 | mPhoneDevice = "/dev/ircomm"; |
99 | mPhoneConnection = "irda"; | 94 | mPhoneConnection = "irda"; |
100 | mPhoneModel = "6310i"; | 95 | mPhoneModel = "6310i"; |
101 | } | 96 | } |
102 | void KSyncProfile::readConfig(KConfig *config ) | 97 | void KSyncProfile::readConfig(KConfig *config ) |
103 | { | 98 | { |
104 | if (config) | 99 | if (config) |
105 | { | 100 | { |
106 | 101 | ||
107 | config->setGroup("SyncProfile_" + mIdentifier); | 102 | config->setGroup( mName ); |
108 | 103 | ||
109 | mName = config->readEntry( "Name", mName ); | 104 | mName = config->readEntry( "Name", mName ); |
110 | mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); | 105 | mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); |
111 | mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); | 106 | mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); |
112 | mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); | 107 | mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); |
113 | mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); | 108 | mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); |
114 | 109 | ||
115 | mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); | 110 | mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
116 | mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); | 111 | mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); |
117 | mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); | 112 | mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); |
118 | mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); | 113 | mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
119 | 114 | ||
120 | mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); | 115 | mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); |
121 | mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); | 116 | mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); |
122 | mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); | 117 | mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); |
123 | 118 | ||
124 | mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); | 119 | mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); |
125 | mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 120 | mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
126 | mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 121 | mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
127 | mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); | 122 | mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); |
128 | mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); | 123 | mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); |
129 | mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); | 124 | mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); |
130 | mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); | 125 | mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); |
131 | mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); | 126 | mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); |
132 | mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); | 127 | mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); |
133 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); | 128 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); |
134 | } | 129 | } |
135 | else | 130 | else |
136 | { | 131 | { |
137 | setDefault(); | 132 | setDefault(); |
138 | } | 133 | } |
139 | } | 134 | } |
140 | 135 | ||
141 | void KSyncProfile::deleteConfig(KConfig *config ) | 136 | void KSyncProfile::deleteConfig(KConfig *config ) |
142 | { | 137 | { |
143 | config->deleteGroup( "SyncProfile_" + mIdentifier ); | 138 | config->deleteGroup( mName ); |
144 | } | 139 | } |
145 | 140 | ||
146 | void KSyncProfile::writeConfig( KConfig * config ) | 141 | void KSyncProfile::writeConfig( KConfig * config ) |
147 | { | 142 | { |
148 | config->setGroup("SyncProfile_" + mIdentifier); | 143 | config->setGroup(mName); |
149 | 144 | ||
150 | config->writeEntry( "Name", mName ); | 145 | config->writeEntry( "Name", mName ); |
151 | config->writeEntry( "PreSyncCommand",mPreSyncCommand ); | 146 | config->writeEntry( "PreSyncCommand",mPreSyncCommand ); |
152 | config->writeEntry( "PostSyncCommand", mPostSyncCommand ); | 147 | config->writeEntry( "PostSyncCommand", mPostSyncCommand ); |
153 | config->writeEntry( "LocalTempFile", mLocalTempFile ); | 148 | config->writeEntry( "LocalTempFile", mLocalTempFile ); |
154 | config->writeEntry( "RemoteFileName", mRemoteFileName ); | 149 | config->writeEntry( "RemoteFileName", mRemoteFileName ); |
155 | 150 | ||
156 | config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); | 151 | config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
157 | config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); | 152 | config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); |
158 | config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); | 153 | config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); |
159 | config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); | 154 | config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
160 | 155 | ||
161 | config->writeEntry( "PhoneDevice", mPhoneDevice ); | 156 | config->writeEntry( "PhoneDevice", mPhoneDevice ); |
162 | config->writeEntry( "PhoneConnection", mPhoneConnection ); | 157 | config->writeEntry( "PhoneConnection", mPhoneConnection ); |
163 | config->writeEntry( "PhoneModel", mPhoneModel ); | 158 | config->writeEntry( "PhoneModel", mPhoneModel ); |
164 | 159 | ||
165 | config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); | 160 | config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); |
166 | config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 161 | config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
167 | config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 162 | config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
168 | config->writeEntry( "AskForPreferences",mAskForPreferences ); | 163 | config->writeEntry( "AskForPreferences",mAskForPreferences ); |
169 | config->writeEntry( "WriteBackExisting",mWriteBackExisting ); | 164 | config->writeEntry( "WriteBackExisting",mWriteBackExisting ); |
170 | config->writeEntry( "WriteBackFuture",mWriteBackFuture ); | 165 | config->writeEntry( "WriteBackFuture",mWriteBackFuture ); |
171 | config->writeEntry( "SyncPrefs", mSyncPrefs ); | 166 | config->writeEntry( "SyncPrefs", mSyncPrefs ); |
172 | config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); | 167 | config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); |
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 8995def..a0cfb71 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -25,59 +25,57 @@ | |||
25 | #include <qfont.h> | 25 | #include <qfont.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | 29 | ||
30 | #include <libkcal/syncdefines.h> | 30 | #include <libkcal/syncdefines.h> |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | class KConfig; | 34 | class KConfig; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | @short Class for storing a preferences setting | 37 | @short Class for storing a preferences setting |
38 | @author Cornelius Schumacher | 38 | @author Cornelius Schumacher |
39 | @see KPref | 39 | @see KPref |
40 | 40 | ||
41 | This class represents one preferences setting as used by @ref KPrefs. | 41 | This class represents one preferences setting as used by @ref KPrefs. |
42 | Subclasses of KPrefsItem implement storage functions for a certain type of | 42 | Subclasses of KPrefsItem implement storage functions for a certain type of |
43 | setting. Normally you don't have to use this class directly. Use the special | 43 | setting. Normally you don't have to use this class directly. Use the special |
44 | addItem() functions of KPrefs instead. If you subclass this class you will | 44 | addItem() functions of KPrefs instead. If you subclass this class you will |
45 | have to register instances with the function KPrefs::addItem(). | 45 | have to register instances with the function KPrefs::addItem(). |
46 | */ | 46 | */ |
47 | class KSyncProfile : public QObject { | 47 | class KSyncProfile : public QObject { |
48 | public: | 48 | public: |
49 | KSyncProfile( const char * identifier = 0); | 49 | KSyncProfile(); |
50 | ~KSyncProfile() ; | 50 | ~KSyncProfile() ; |
51 | 51 | ||
52 | KSyncProfile* clone(); | 52 | KSyncProfile* clone(); |
53 | void setDefault(); | 53 | void setDefault(); |
54 | void readConfig(KConfig *); | 54 | void readConfig(KConfig *); |
55 | void writeConfig(KConfig *); | 55 | void writeConfig(KConfig *); |
56 | void deleteConfig(KConfig *); | 56 | void deleteConfig(KConfig *); |
57 | 57 | ||
58 | void setIdentifier( const QString& i ) {mIdentifier = i;} | ||
59 | QString getIdentifier( ) { return mIdentifier;} | ||
60 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} | 58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} |
61 | QString getPreSyncCommand( ) { return mPreSyncCommand; } | 59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } |
62 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} | 60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} |
63 | QString getPostSyncCommand( ) { return mPostSyncCommand;} | 61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} |
64 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} | 62 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} |
65 | QString getLocalTempFile( ) { return mLocalTempFile;} | 63 | QString getLocalTempFile( ) { return mLocalTempFile;} |
66 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} | 64 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} |
67 | QString getRemoteFileName( ) { return mRemoteFileName;} | 65 | QString getRemoteFileName( ) { return mRemoteFileName;} |
68 | 66 | ||
69 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} | 67 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} |
70 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } | 68 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } |
71 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} | 69 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} |
72 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} | 70 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} |
73 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} | 71 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} |
74 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} | 72 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} |
75 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} | 73 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} |
76 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} | 74 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} |
77 | 75 | ||
78 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} | 76 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} |
79 | QString getPhoneDevice( ) { return mPhoneDevice;} | 77 | QString getPhoneDevice( ) { return mPhoneDevice;} |
80 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} | 78 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} |
81 | QString getPhoneConnection( ) { return mPhoneConnection;} | 79 | QString getPhoneConnection( ) { return mPhoneConnection;} |
82 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} | 80 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} |
83 | QString getPhoneModel( ) { return mPhoneModel;} | 81 | QString getPhoneModel( ) { return mPhoneModel;} |
@@ -91,49 +89,48 @@ class KSyncProfile : public QObject { | |||
91 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} | 89 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} |
92 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} | 90 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} |
93 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} | 91 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} |
94 | bool getAskForPreferences( ) { return mAskForPreferences;} | 92 | bool getAskForPreferences( ) { return mAskForPreferences;} |
95 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} | 93 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} |
96 | bool getWriteBackExisting( ) { return mWriteBackExisting;} | 94 | bool getWriteBackExisting( ) { return mWriteBackExisting;} |
97 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} | 95 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} |
98 | bool getWriteBackFuture( ) { return mWriteBackFuture;} | 96 | bool getWriteBackFuture( ) { return mWriteBackFuture;} |
99 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} | 97 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} |
100 | bool getWriteBackFile( ) { return mWriteBackFile;} | 98 | bool getWriteBackFile( ) { return mWriteBackFile;} |
101 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} | 99 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} |
102 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} | 100 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} |
103 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} | 101 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} |
104 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} | 102 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} |
105 | void setSyncPrefs( int n ) { mSyncPrefs= n;} | 103 | void setSyncPrefs( int n ) { mSyncPrefs= n;} |
106 | int getSyncPrefs( ) { return mSyncPrefs;} | 104 | int getSyncPrefs( ) { return mSyncPrefs;} |
107 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} | 105 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} |
108 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} | 106 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} |
109 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} | 107 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} |
110 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} | 108 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} |
111 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} | 109 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} |
112 | bool getIsPhoneSync( ) { return mIsPhoneSync;} | 110 | bool getIsPhoneSync( ) { return mIsPhoneSync;} |
113 | private: | 111 | private: |
114 | QString mName; | 112 | QString mName; |
115 | QString mIdentifier; | ||
116 | QString mPreSyncCommand; | 113 | QString mPreSyncCommand; |
117 | QString mPostSyncCommand; | 114 | QString mPostSyncCommand; |
118 | QString mLocalTempFile; | 115 | QString mLocalTempFile; |
119 | QString mRemoteFileName; | 116 | QString mRemoteFileName; |
120 | QString mPreSyncCommandAB; | 117 | QString mPreSyncCommandAB; |
121 | QString mPostSyncCommandAB; | 118 | QString mPostSyncCommandAB; |
122 | QString mLocalTempFileAB; | 119 | QString mLocalTempFileAB; |
123 | QString mRemoteFileNameAB; | 120 | QString mRemoteFileNameAB; |
124 | 121 | ||
125 | QString mPhoneDevice; | 122 | QString mPhoneDevice; |
126 | QString mPhoneConnection; | 123 | QString mPhoneConnection; |
127 | QString mPhoneModel; | 124 | QString mPhoneModel; |
128 | 125 | ||
129 | bool mIncludeInRingSync; | 126 | bool mIncludeInRingSync; |
130 | bool mIncludeInRingSyncAB; | 127 | bool mIncludeInRingSyncAB; |
131 | int mSyncPrefs; | 128 | int mSyncPrefs; |
132 | bool mWriteBackFile; | 129 | bool mWriteBackFile; |
133 | bool mWriteBackExisting; | 130 | bool mWriteBackExisting; |
134 | bool mWriteBackFuture; | 131 | bool mWriteBackFuture; |
135 | int mWriteBackFutureWeeks; | 132 | int mWriteBackFutureWeeks; |
136 | bool mAskForPreferences; | 133 | bool mAskForPreferences; |
137 | bool mShowSummaryAfterSync; | 134 | bool mShowSummaryAfterSync; |
138 | bool mIsLocalFileSync; | 135 | bool mIsLocalFileSync; |
139 | bool mIsPhoneSync; | 136 | bool mIsPhoneSync; |