author | zautrix <zautrix> | 2004-10-06 16:02:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-06 16:02:56 (UTC) |
commit | a22de800110d8350a5200a994b041e47d51bf4c6 (patch) (unidiff) | |
tree | a4de195003d1ceabc3fd9ca4e5cd0510570bcb97 /korganizer | |
parent | ef71411c2f248d1dc908aa2f119c9b281e0e8bb9 (diff) | |
download | kdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.zip kdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.tar.gz kdepimpi-a22de800110d8350a5200a994b041e47d51bf4c6.tar.bz2 |
added phone export
-rw-r--r-- | korganizer/koprefs.cpp | 4 | ||||
-rw-r--r-- | korganizer/koprefs.h | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 19 |
3 files changed, 10 insertions, 16 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 716a125..84e3d00 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -58,52 +58,48 @@ KOPrefs::KOPrefs() : | |||
58 | KPimPrefs("korganizerrc") | 58 | KPimPrefs("korganizerrc") |
59 | { | 59 | { |
60 | mCategoryColors.setAutoDelete(true); | 60 | mCategoryColors.setAutoDelete(true); |
61 | mLocaleDict = 0; | 61 | mLocaleDict = 0; |
62 | fillMailDefaults(); | 62 | fillMailDefaults(); |
63 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); | 63 | mDefaultCategoryColor = QColor(175,210,255);//196,196,196); |
64 | QColor defaultHolidayColor = QColor(255,0,0); | 64 | QColor defaultHolidayColor = QColor(255,0,0); |
65 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); | 65 | QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); |
66 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); | 66 | QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); |
67 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); | 67 | QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); |
68 | QColor defaultTodoDueTodayColor = QColor(255,220,100); | 68 | QColor defaultTodoDueTodayColor = QColor(255,220,100); |
69 | QColor defaultTodoOverdueColor = QColor(255,153,125); | 69 | QColor defaultTodoOverdueColor = QColor(255,153,125); |
70 | 70 | ||
71 | mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); | 71 | mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); |
72 | mDefaultViewFont = QFont("helvetica",10); | 72 | mDefaultViewFont = QFont("helvetica",10); |
73 | mDefaultMonthViewFont = QFont("helvetica",8); | 73 | mDefaultMonthViewFont = QFont("helvetica",8); |
74 | mMarcusBainsFont= QFont("helvetica",10); | 74 | mMarcusBainsFont= QFont("helvetica",10); |
75 | mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); | 75 | mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); |
76 | mEditBoxFont = QFont("helvetica",12); | 76 | mEditBoxFont = QFont("helvetica",12); |
77 | mJornalViewFont = QFont("helvetica",12); | 77 | mJornalViewFont = QFont("helvetica",12); |
78 | 78 | ||
79 | KPrefs::setCurrentGroup("General"); | 79 | KPrefs::setCurrentGroup("General"); |
80 | 80 | ||
81 | 81 | ||
82 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); | ||
83 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); | ||
84 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); | ||
85 | |||
86 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); | 82 | addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); |
87 | 83 | ||
88 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); | 84 | addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); |
89 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); | 85 | addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); |
90 | addItemBool("ShowIconSearch",&mShowIconSearch,true); | 86 | addItemBool("ShowIconSearch",&mShowIconSearch,true); |
91 | addItemBool("ShowIconList",&mShowIconList,true); | 87 | addItemBool("ShowIconList",&mShowIconList,true); |
92 | addItemBool("ShowIconDay1",&mShowIconDay1,true); | 88 | addItemBool("ShowIconDay1",&mShowIconDay1,true); |
93 | addItemBool("ShowIconDay5",&mShowIconDay5,true); | 89 | addItemBool("ShowIconDay5",&mShowIconDay5,true); |
94 | addItemBool("ShowIconDay7",&mShowIconDay7,true); | 90 | addItemBool("ShowIconDay7",&mShowIconDay7,true); |
95 | addItemBool("ShowIconMonth",&mShowIconMonth,true); | 91 | addItemBool("ShowIconMonth",&mShowIconMonth,true); |
96 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); | 92 | addItemBool("ShowIconTodoview",&mShowIconTodoview,true); |
97 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); | 93 | addItemBool("ShowIconBackFast",&mShowIconBackFast,true); |
98 | addItemBool("ShowIconBack",&mShowIconBack,true); | 94 | addItemBool("ShowIconBack",&mShowIconBack,true); |
99 | addItemBool("ShowIconToday",&mShowIconToday,true); | 95 | addItemBool("ShowIconToday",&mShowIconToday,true); |
100 | addItemBool("ShowIconForward",&mShowIconForward,true); | 96 | addItemBool("ShowIconForward",&mShowIconForward,true); |
101 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); | 97 | addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); |
102 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); | 98 | addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); |
103 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); | 99 | addItemBool("ShowIconNextDays",&mShowIconNextDays,true); |
104 | addItemBool("ShowIconNext",&mShowIconNext,true); | 100 | addItemBool("ShowIconNext",&mShowIconNext,true); |
105 | addItemBool("ShowIconJournal",&mShowIconJournal,true); | 101 | addItemBool("ShowIconJournal",&mShowIconJournal,true); |
106 | addItemBool("ShowIconStretch",&mShowIconStretch,true); | 102 | addItemBool("ShowIconStretch",&mShowIconStretch,true); |
107 | addItemBool("LanguageChanged",&mLanguageChanged,false); | 103 | addItemBool("LanguageChanged",&mLanguageChanged,false); |
108 | 104 | ||
109 | addItemBool("AskForQuit",&mAskForQuit,false); | 105 | addItemBool("AskForQuit",&mAskForQuit,false); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index a1ba8b3..d9ac851 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -189,51 +189,48 @@ class KOPrefs : public KPimPrefs | |||
189 | bool mShowIconStretch; | 189 | bool mShowIconStretch; |
190 | 190 | ||
191 | bool mToolBarHor; | 191 | bool mToolBarHor; |
192 | bool mToolBarUp; | 192 | bool mToolBarUp; |
193 | bool mToolBarMiniIcons; | 193 | bool mToolBarMiniIcons; |
194 | 194 | ||
195 | bool mAskForQuit; | 195 | bool mAskForQuit; |
196 | bool mUsePassWd; | 196 | bool mUsePassWd; |
197 | bool mWriteBackFile; | 197 | bool mWriteBackFile; |
198 | int mWriteBackInFuture; | 198 | int mWriteBackInFuture; |
199 | bool mAskForPreferences; | 199 | bool mAskForPreferences; |
200 | bool mShowSyncSummary; | 200 | bool mShowSyncSummary; |
201 | bool mShowSyncEvents; | 201 | bool mShowSyncEvents; |
202 | bool mShowTodoInAgenda; | 202 | bool mShowTodoInAgenda; |
203 | bool mWriteBackExistingOnly; | 203 | bool mWriteBackExistingOnly; |
204 | 204 | ||
205 | QString mRemoteIP; | 205 | QString mRemoteIP; |
206 | QString mRemoteUser; | 206 | QString mRemoteUser; |
207 | QString mRemotePassWd; | 207 | QString mRemotePassWd; |
208 | QString mRemoteFile; | 208 | QString mRemoteFile; |
209 | QString mLocalTempFile; | 209 | QString mLocalTempFile; |
210 | QString mPhoneDevice; | 210 | QString mPhoneDevice; |
211 | QString mPhoneConnection; | 211 | QString mPhoneConnection; |
212 | QString mPhoneModel; | 212 | QString mPhoneModel; |
213 | QString mEx2PhoneDevice; | ||
214 | QString mEx2PhoneConnection; | ||
215 | QString mEx2PhoneModel; | ||
216 | 213 | ||
217 | int mLastSyncTime; | 214 | int mLastSyncTime; |
218 | int mSyncAlgoPrefs; | 215 | int mSyncAlgoPrefs; |
219 | int mRingSyncAlgoPrefs; | 216 | int mRingSyncAlgoPrefs; |
220 | QStringList mSyncProfileNames; | 217 | QStringList mSyncProfileNames; |
221 | QStringList mExternSyncProfiles; | 218 | QStringList mExternSyncProfiles; |
222 | QString mLocalMachineName; | 219 | QString mLocalMachineName; |
223 | void setCategoryColor(QString cat,const QColor & color); | 220 | void setCategoryColor(QString cat,const QColor & color); |
224 | QColor *categoryColor(QString cat); | 221 | QColor *categoryColor(QString cat); |
225 | 222 | ||
226 | QString mArchiveFile; | 223 | QString mArchiveFile; |
227 | QString mHtmlExportFile; | 224 | QString mHtmlExportFile; |
228 | bool mHtmlWithSave; | 225 | bool mHtmlWithSave; |
229 | 226 | ||
230 | QStringList mSelectedPlugins; | 227 | QStringList mSelectedPlugins; |
231 | 228 | ||
232 | QString mLastImportFile; | 229 | QString mLastImportFile; |
233 | QString mLastVcalFile; | 230 | QString mLastVcalFile; |
234 | QString mLastSaveFile; | 231 | QString mLastSaveFile; |
235 | QString mLastLoadFile; | 232 | QString mLastLoadFile; |
236 | QString mLastSyncedLocalFile; | 233 | QString mLastSyncedLocalFile; |
237 | 234 | ||
238 | 235 | ||
239 | QString mDefaultAlarmFile; | 236 | QString mDefaultAlarmFile; |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index bd14fbf..2f286e0 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1154,108 +1154,109 @@ void MainWindow::slotSyncMenu( int action ) | |||
1154 | if ( temp->getIsPhoneSync() ) { | 1154 | if ( temp->getIsPhoneSync() ) { |
1155 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; | 1155 | KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; |
1156 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); | 1156 | KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); |
1157 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); | 1157 | KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); |
1158 | syncPhone(); | 1158 | syncPhone(); |
1159 | } else if ( temp->getIsPiSync() ) { | 1159 | } else if ( temp->getIsPiSync() ) { |
1160 | mPassWordPiSync = temp->getRemotePw(); | 1160 | mPassWordPiSync = temp->getRemotePw(); |
1161 | KOPrefs::instance()->mActiveSyncPort = temp->getRemotePort(); | 1161 | KOPrefs::instance()->mActiveSyncPort = temp->getRemotePort(); |
1162 | KOPrefs::instance()->mActiveSyncIP = temp->getRemoteIP(); | 1162 | KOPrefs::instance()->mActiveSyncIP = temp->getRemoteIP(); |
1163 | syncPi(); | 1163 | syncPi(); |
1164 | } else | 1164 | } else |
1165 | syncRemote( temp ); | 1165 | syncRemote( temp ); |
1166 | 1166 | ||
1167 | } | 1167 | } |
1168 | } | 1168 | } |
1169 | delete temp; | 1169 | delete temp; |
1170 | mBlockSaveFlag = false; | 1170 | mBlockSaveFlag = false; |
1171 | } | 1171 | } |
1172 | void MainWindow::exportToPhone( int mode ) | 1172 | void MainWindow::exportToPhone( int mode ) |
1173 | { | 1173 | { |
1174 | 1174 | ||
1175 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1175 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1176 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1176 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1177 | KOex2phonePrefs ex2phone; | 1177 | KOex2phonePrefs ex2phone; |
1178 | ex2phone.mPhoneConnection->setText( KOPrefs::instance()->mEx2PhoneConnection ); | 1178 | |
1179 | ex2phone.mPhoneDevice->setText( KOPrefs::instance()->mEx2PhoneDevice ); | 1179 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1180 | ex2phone.mPhoneModel->setText( KOPrefs::instance()->mEx2PhoneModel ); | 1180 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1181 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | ||
1181 | if ( mode == 1 ) | 1182 | if ( mode == 1 ) |
1182 | ex2phone.setCaption(i18n("Export complete calendar")); | 1183 | ex2phone.setCaption(i18n("Export complete calendar")); |
1183 | if ( mode == 2 ) | 1184 | if ( mode == 2 ) |
1184 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1185 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1185 | 1186 | ||
1186 | if ( !ex2phone.exec() ) { | 1187 | if ( !ex2phone.exec() ) { |
1187 | return; | 1188 | return; |
1188 | } | 1189 | } |
1189 | KOPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1190 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1190 | KOPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1191 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1191 | KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1192 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1192 | 1193 | ||
1193 | int inFuture = 0; | 1194 | int inFuture = 0; |
1194 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1195 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1195 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1196 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1196 | QPtrList<Incidence> delSel; | 1197 | QPtrList<Incidence> delSel; |
1197 | if ( mode == 1 ) | 1198 | if ( mode == 1 ) |
1198 | delSel = mCalendar->rawIncidences(); | 1199 | delSel = mCalendar->rawIncidences(); |
1199 | if ( mode == 2 ) | 1200 | if ( mode == 2 ) |
1200 | delSel = mCalendar->incidences(); | 1201 | delSel = mCalendar->incidences(); |
1201 | CalendarLocal* cal = new CalendarLocal(); | 1202 | CalendarLocal* cal = new CalendarLocal(); |
1202 | cal->setLocalTime(); | 1203 | cal->setLocalTime(); |
1203 | Incidence *incidence = delSel.first(); | 1204 | Incidence *incidence = delSel.first(); |
1204 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1205 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1205 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1206 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1206 | while ( incidence ) { | 1207 | while ( incidence ) { |
1207 | if ( incidence->type() != "Journal" ) { | 1208 | if ( incidence->type() != "Journal" ) { |
1208 | bool add = true; | 1209 | bool add = true; |
1209 | if ( inFuture ) { | 1210 | if ( inFuture ) { |
1210 | QDateTime dt; | 1211 | QDateTime dt; |
1211 | if ( incidence->type() == "Todo" ) { | 1212 | if ( incidence->type() == "Todo" ) { |
1212 | Todo * t = (Todo*)incidence; | 1213 | Todo * t = (Todo*)incidence; |
1213 | if ( t->hasDueDate() ) | 1214 | if ( t->hasDueDate() ) |
1214 | dt = t->dtDue(); | 1215 | dt = t->dtDue(); |
1215 | else | 1216 | else |
1216 | dt = cur.addSecs( 62 ); | 1217 | dt = cur.addSecs( 62 ); |
1217 | } | 1218 | } |
1218 | else { | 1219 | else { |
1219 | bool ok; | 1220 | bool ok; |
1220 | dt = incidence->getNextOccurence( cur, &ok ); | 1221 | dt = incidence->getNextOccurence( cur, &ok ); |
1221 | if ( !ok ) | 1222 | if ( !ok ) |
1222 | dt = cur.addSecs( -62 ); | 1223 | dt = cur.addSecs( -62 ); |
1223 | } | 1224 | } |
1224 | if ( dt < cur || dt > end ) { | 1225 | if ( dt < cur || dt > end ) { |
1225 | add = false; | 1226 | add = false; |
1226 | } | 1227 | } |
1227 | } | 1228 | } |
1228 | if ( add ) { | 1229 | if ( add ) { |
1229 | Incidence *in = incidence->clone(); | 1230 | Incidence *in = incidence->clone(); |
1230 | cal->addIncidence( in ); | 1231 | cal->addIncidence( in ); |
1231 | } | 1232 | } |
1232 | } | 1233 | } |
1233 | incidence = delSel.next(); | 1234 | incidence = delSel.next(); |
1234 | } | 1235 | } |
1235 | PhoneFormat::writeConfig( KOPrefs::instance()->mEx2PhoneDevice, | 1236 | PhoneFormat::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1236 | KOPrefs::instance()->mEx2PhoneConnection, | 1237 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1237 | KOPrefs::instance()->mEx2PhoneModel ); | 1238 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1238 | 1239 | ||
1239 | setCaption( i18n("Writing to phone...")); | 1240 | setCaption( i18n("Writing to phone...")); |
1240 | if ( PhoneFormat::writeToPhone( cal ) ) | 1241 | if ( PhoneFormat::writeToPhone( cal ) ) |
1241 | setCaption( i18n("Export to phone successful!")); | 1242 | setCaption( i18n("Export to phone successful!")); |
1242 | else | 1243 | else |
1243 | setCaption( i18n("Error exporting to phone!")); | 1244 | setCaption( i18n("Error exporting to phone!")); |
1244 | delete cal; | 1245 | delete cal; |
1245 | } | 1246 | } |
1246 | 1247 | ||
1247 | 1248 | ||
1248 | void MainWindow::setDefaultPreferences() | 1249 | void MainWindow::setDefaultPreferences() |
1249 | { | 1250 | { |
1250 | KOPrefs *p = KOPrefs::instance(); | 1251 | KOPrefs *p = KOPrefs::instance(); |
1251 | 1252 | ||
1252 | p->mCompactDialogs = true; | 1253 | p->mCompactDialogs = true; |
1253 | p->mConfirm = true; | 1254 | p->mConfirm = true; |
1254 | // p->mEnableQuickTodo = false; | 1255 | // p->mEnableQuickTodo = false; |
1255 | 1256 | ||
1256 | } | 1257 | } |
1257 | 1258 | ||
1258 | QString MainWindow::resourcePath() | 1259 | QString MainWindow::resourcePath() |
1259 | { | 1260 | { |
1260 | return KGlobal::iconLoader()->iconPath(); | 1261 | return KGlobal::iconLoader()->iconPath(); |
1261 | } | 1262 | } |