author | zautrix <zautrix> | 2004-10-04 21:21:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-04 21:21:00 (UTC) |
commit | f53ef630b9299ceae666e64da8ce022813795ed6 (patch) (unidiff) | |
tree | 26dc94a83f42c2174195817c505c34941246d2e3 /libkdepim/ksyncprefsdialog.cpp | |
parent | dfc6d084410456037bf6f26f741e7b938085de88 (diff) | |
download | kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.zip kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.gz kdepimpi-f53ef630b9299ceae666e64da8ce022813795ed6.tar.bz2 |
added option to sync config dialog
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 28aac45..f05c846 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -145,394 +145,460 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
145 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); | 145 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); |
146 | ++iii; | 146 | ++iii; |
147 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); | 147 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); |
148 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); | 148 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); |
149 | ++iii; | 149 | ++iii; |
150 | mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); | 150 | mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); |
151 | topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); | 151 | topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); |
152 | ++iii; | 152 | ++iii; |
153 | 153 | ||
154 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); | 154 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); |
155 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); | 155 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); |
156 | ++iii; | 156 | ++iii; |
157 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); | 157 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); |
158 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 158 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
159 | ++iii; | 159 | ++iii; |
160 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); | 160 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); |
161 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); | 161 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); |
162 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); | 162 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); |
163 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); | 163 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); |
164 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); | 164 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); |
165 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); | 165 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); |
166 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); | 166 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); |
167 | 167 | ||
168 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); | 168 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); |
169 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); | 169 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); |
170 | ++iii; | 170 | ++iii; |
171 | 171 | ||
172 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); | 172 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); |
173 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); | 173 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); |
174 | ++iii; | 174 | ++iii; |
175 | 175 | ||
176 | mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); | 176 | mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); |
177 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 177 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
178 | ++iii; | 178 | ++iii; |
179 | 179 | ||
180 | mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); | 180 | mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); |
181 | topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); | 181 | topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); |
182 | ++iii; | 182 | ++iii; |
183 | topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); | 183 | topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); |
184 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); | 184 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); |
185 | topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); | 185 | topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); |
186 | ++iii; | 186 | ++iii; |
187 | 187 | ||
188 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 188 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
189 | gr = proGr; | 189 | gr = proGr; |
190 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 190 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
191 | ++iii; | 191 | ++iii; |
192 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 192 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
193 | mIsPi = new QRadioButton ( i18n("Quick Pi-Sync"), gr ); | ||
194 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | ||
193 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 195 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
194 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 196 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
195 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); | 197 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); |
196 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 198 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
197 | 199 | ||
198 | 200 | ||
199 | phoneWidget = new QVBox( topFrame); | 201 | phoneWidget = new QVBox( topFrame); |
200 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); | 202 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); |
201 | ++iii; | 203 | ++iii; |
202 | mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); | 204 | mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); |
203 | QHBox* temphb = new QHBox( phoneWidget ); | 205 | QHBox* temphb = new QHBox( phoneWidget ); |
204 | new QLabel( i18n("I/O device: "), temphb ); | 206 | new QLabel( i18n("I/O device: "), temphb ); |
205 | mPhoneDevice = new QLineEdit( temphb); | 207 | mPhoneDevice = new QLineEdit( temphb); |
206 | button = new QPushButton( i18n("Help..."), temphb ); | 208 | button = new QPushButton( i18n("Help..."), temphb ); |
207 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); | 209 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); |
208 | 210 | ||
209 | 211 | ||
210 | temphb = new QHBox( phoneWidget ); | 212 | temphb = new QHBox( phoneWidget ); |
211 | new QLabel( i18n("Connection: "), temphb ); | 213 | new QLabel( i18n("Connection: "), temphb ); |
212 | mPhoneConnection = new QLineEdit( temphb); | 214 | mPhoneConnection = new QLineEdit( temphb); |
213 | button = new QPushButton( i18n("Help..."), temphb ); | 215 | button = new QPushButton( i18n("Help..."), temphb ); |
214 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); | 216 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); |
215 | 217 | ||
216 | 218 | ||
217 | temphb = new QHBox( phoneWidget ); | 219 | temphb = new QHBox( phoneWidget ); |
218 | new QLabel( i18n("Model(opt.): "), temphb ); | 220 | new QLabel( i18n("Model(opt.): "), temphb ); |
219 | mPhoneModel = new QLineEdit( temphb); | 221 | mPhoneModel = new QLineEdit( temphb); |
220 | button = new QPushButton( i18n("Help..."), temphb ); | 222 | button = new QPushButton( i18n("Help..."), temphb ); |
221 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); | 223 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); |
222 | 224 | ||
223 | // *** local | 225 | // *** local |
224 | localFileWidget = new QVBox( topFrame); | 226 | localFileWidget = new QVBox( topFrame); |
225 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 227 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
226 | ++iii; | 228 | ++iii; |
227 | temphb = new QHBox( localFileWidget ); | 229 | temphb = new QHBox( localFileWidget ); |
228 | 230 | ||
229 | lab = new QLabel( i18n("Local file Cal:"), temphb ); | 231 | lab = new QLabel( i18n("Local file Cal:"), temphb ); |
230 | lab = new QLabel( i18n("Local file ABook:"), temphb ); | 232 | lab = new QLabel( i18n("Local file ABook:"), temphb ); |
231 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); | 233 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); |
232 | temphb = new QHBox( localFileWidget ); | 234 | temphb = new QHBox( localFileWidget ); |
233 | button = new QPushButton( i18n("Choose..."), temphb ); | 235 | button = new QPushButton( i18n("Choose..."), temphb ); |
234 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 236 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
235 | button = new QPushButton( i18n("Choose..."), temphb ); | 237 | button = new QPushButton( i18n("Choose..."), temphb ); |
236 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); | 238 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); |
237 | button = new QPushButton( i18n("Choose..."), temphb ); | 239 | button = new QPushButton( i18n("Choose..."), temphb ); |
238 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); | 240 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); |
239 | temphb = new QHBox( localFileWidget ); | 241 | temphb = new QHBox( localFileWidget ); |
240 | 242 | ||
241 | mRemoteFile = new QLineEdit( temphb); | 243 | mRemoteFile = new QLineEdit( temphb); |
242 | mRemoteFileAB = new QLineEdit( temphb); | 244 | mRemoteFileAB = new QLineEdit( temphb); |
243 | mRemoteFilePWM = new QLineEdit( temphb); | 245 | mRemoteFilePWM = new QLineEdit( temphb); |
244 | 246 | ||
245 | // *** remote | 247 | // *** remote |
246 | remoteFileWidget = new QVBox( topFrame); | 248 | remoteFileWidget = new QVBox( topFrame); |
247 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 249 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
248 | ++iii; | 250 | ++iii; |
249 | temphb = new QHBox( remoteFileWidget ); | 251 | temphb = new QHBox( remoteFileWidget ); |
250 | new QLabel( i18n("Calendar:"), temphb); | 252 | new QLabel( i18n("Calendar:"), temphb); |
251 | new QLabel( i18n("AddressBook:"), temphb); | 253 | new QLabel( i18n("AddressBook:"), temphb); |
252 | new QLabel( i18n("PWManager:"), temphb); | 254 | new QLabel( i18n("PWManager:"), temphb); |
253 | 255 | ||
254 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 256 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
255 | temphb = new QHBox( remoteFileWidget ); | 257 | temphb = new QHBox( remoteFileWidget ); |
256 | mRemotePrecommand = new QLineEdit(temphb); | 258 | mRemotePrecommand = new QLineEdit(temphb); |
257 | mRemotePrecommandAB = new QLineEdit(temphb); | 259 | mRemotePrecommandAB = new QLineEdit(temphb); |
258 | mRemotePrecommandPWM = new QLineEdit(temphb); | 260 | mRemotePrecommandPWM = new QLineEdit(temphb); |
259 | 261 | ||
260 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 262 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
261 | temphb = new QHBox( remoteFileWidget ); | 263 | temphb = new QHBox( remoteFileWidget ); |
262 | mLocalTempFile = new QLineEdit(temphb); | 264 | mLocalTempFile = new QLineEdit(temphb); |
263 | mLocalTempFileAB = new QLineEdit(temphb); | 265 | mLocalTempFileAB = new QLineEdit(temphb); |
264 | mLocalTempFilePWM = new QLineEdit(temphb); | 266 | mLocalTempFilePWM = new QLineEdit(temphb); |
265 | 267 | ||
266 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 268 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
267 | temphb = new QHBox( remoteFileWidget ); | 269 | temphb = new QHBox( remoteFileWidget ); |
268 | mRemotePostcommand = new QLineEdit(temphb ); | 270 | mRemotePostcommand = new QLineEdit(temphb ); |
269 | mRemotePostcommandAB = new QLineEdit(temphb ); | 271 | mRemotePostcommandAB = new QLineEdit(temphb ); |
270 | mRemotePostcommandPWM = new QLineEdit(temphb ); | 272 | mRemotePostcommandPWM = new QLineEdit(temphb ); |
271 | 273 | ||
272 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 274 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
273 | temphb = new QHBox( remoteFileWidget ); | 275 | temphb = new QHBox( remoteFileWidget ); |
274 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 276 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
275 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 277 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
276 | button = new QPushButton( i18n("ftp"), temphb ); | 278 | button = new QPushButton( i18n("ftp"), temphb ); |
277 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 279 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
278 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 280 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
279 | 281 | ||
282 | // *** pi-sync | ||
283 | piWidget = new QVBox( topFrame); | ||
284 | topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); | ||
285 | ++iii; | ||
286 | temphb = new QHBox( piWidget ); | ||
287 | new QLabel( i18n("Calendar:"), temphb); | ||
288 | new QLabel( i18n("AddressBook:"), temphb); | ||
289 | new QLabel( i18n("PWManager:"), temphb); | ||
290 | |||
291 | lab = new QLabel( i18n("Password for remote access:"), piWidget); | ||
292 | temphb = new QHBox( piWidget ); | ||
293 | mRemotePw = new QLineEdit(temphb); | ||
294 | mRemotePwAB = new QLineEdit(temphb); | ||
295 | mRemotePwPWM = new QLineEdit(temphb); | ||
296 | |||
297 | lab = new QLabel( i18n("Remote IP address:"), piWidget); | ||
298 | temphb = new QHBox( piWidget ); | ||
299 | mRemoteIP = new QLineEdit(temphb); | ||
300 | mRemoteIPAB = new QLineEdit(temphb); | ||
301 | mRemoteIPPWM = new QLineEdit(temphb); | ||
302 | |||
303 | lab = new QLabel( i18n("Remote port number:"), piWidget); | ||
304 | temphb = new QHBox( piWidget ); | ||
305 | mRemotePort = new QLineEdit(temphb); | ||
306 | mRemotePortAB = new QLineEdit(temphb); | ||
307 | mRemotePortPWM = new QLineEdit(temphb); | ||
280 | 308 | ||
281 | } | 309 | } |
310 | |||
311 | |||
312 | |||
313 | |||
314 | |||
282 | void KSyncPrefsDialog::slotOK() | 315 | void KSyncPrefsDialog::slotOK() |
283 | { | 316 | { |
284 | if ( mMyMachineName->text() == "undefined" ) { | 317 | if ( mMyMachineName->text() == "undefined" ) { |
285 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 318 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
286 | return; | 319 | return; |
287 | } | 320 | } |
288 | int i; | 321 | int i; |
289 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { | 322 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { |
290 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { | 323 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { |
291 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); | 324 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); |
292 | return; | 325 | return; |
293 | } | 326 | } |
294 | } | 327 | } |
295 | usrWriteConfig(); | 328 | usrWriteConfig(); |
296 | QDialog::accept(); | 329 | QDialog::accept(); |
297 | } | 330 | } |
298 | void KSyncPrefsDialog::accept() | 331 | void KSyncPrefsDialog::accept() |
299 | { | 332 | { |
300 | slotOK(); | 333 | slotOK(); |
301 | } | 334 | } |
302 | void KSyncPrefsDialog::chooseFile() | 335 | void KSyncPrefsDialog::chooseFile() |
303 | { | 336 | { |
304 | QString fn = QDir::homeDirPath(); | 337 | QString fn = QDir::homeDirPath(); |
305 | 338 | ||
306 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 339 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
307 | if ( fn == "" ) | 340 | if ( fn == "" ) |
308 | return; | 341 | return; |
309 | mRemoteFile->setText( fn ); | 342 | mRemoteFile->setText( fn ); |
310 | } | 343 | } |
311 | 344 | ||
312 | void KSyncPrefsDialog::chooseFileAB() | 345 | void KSyncPrefsDialog::chooseFileAB() |
313 | { | 346 | { |
314 | QString fn = QDir::homeDirPath(); | 347 | QString fn = QDir::homeDirPath(); |
315 | 348 | ||
316 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); | 349 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); |
317 | if ( fn == "" ) | 350 | if ( fn == "" ) |
318 | return; | 351 | return; |
319 | mRemoteFileAB->setText( fn ); | 352 | mRemoteFileAB->setText( fn ); |
320 | } | 353 | } |
321 | 354 | ||
322 | void KSyncPrefsDialog::chooseFilePWM() | 355 | void KSyncPrefsDialog::chooseFilePWM() |
323 | { | 356 | { |
324 | QString fn = QDir::homeDirPath(); | 357 | QString fn = QDir::homeDirPath(); |
325 | 358 | ||
326 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); | 359 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); |
327 | if ( fn == "" ) | 360 | if ( fn == "" ) |
328 | return; | 361 | return; |
329 | mRemoteFilePWM->setText( fn ); | 362 | mRemoteFilePWM->setText( fn ); |
330 | } | 363 | } |
331 | 364 | ||
332 | void KSyncPrefsDialog::textChanged( const QString & s ) | 365 | void KSyncPrefsDialog::textChanged( const QString & s ) |
333 | { | 366 | { |
334 | if ( mProfileBox->count() == 0 ) | 367 | if ( mProfileBox->count() == 0 ) |
335 | return; | 368 | return; |
336 | if ( currentSelection < 3 ) { | 369 | if ( currentSelection < 3 ) { |
337 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 370 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
338 | mProfileBox->blockSignals( true ); | 371 | mProfileBox->blockSignals( true ); |
339 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 372 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
340 | mProfileBox->blockSignals( false ); | 373 | mProfileBox->blockSignals( false ); |
341 | return; | 374 | return; |
342 | } | 375 | } |
343 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 376 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
344 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 377 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
345 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 378 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
346 | prof->setName( s ); | 379 | prof->setName( s ); |
347 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 380 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
348 | } | 381 | } |
349 | void KSyncPrefsDialog::profileChanged( int item ) | 382 | void KSyncPrefsDialog::profileChanged( int item ) |
350 | { | 383 | { |
351 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); | 384 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); |
352 | KSyncProfile* prof; | 385 | KSyncProfile* prof; |
353 | saveProfile(); | 386 | saveProfile(); |
354 | currentSelection = item; | 387 | currentSelection = item; |
355 | prof = mSyncProfiles.at(item) ; | 388 | prof = mSyncProfiles.at(item) ; |
389 | |||
390 | mRemotePw->setText(prof->getRemotePw()); | ||
391 | mRemoteIP->setText(prof->getRemoteIP()); | ||
392 | mRemotePort->setText(prof->getRemotePort()); | ||
393 | |||
394 | mRemotePwAB->setText(prof->getRemotePwAB()); | ||
395 | mRemoteIPAB->setText(prof->getRemoteIPAB()); | ||
396 | mRemotePortAB->setText(prof->getRemotePortAB()); | ||
397 | |||
398 | mRemotePwPWM->setText(prof->getRemotePwPWM()); | ||
399 | mRemoteIPPWM->setText(prof->getRemoteIPPWM()); | ||
400 | mRemotePortPWM->setText(prof->getRemotePortPWM()); | ||
401 | |||
356 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 402 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
357 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 403 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
358 | mLocalTempFile->setText(prof->getLocalTempFile()); | 404 | mLocalTempFile->setText(prof->getLocalTempFile()); |
359 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 405 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
360 | 406 | ||
361 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); | 407 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); |
362 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); | 408 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); |
363 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); | 409 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); |
364 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; | 410 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; |
365 | 411 | ||
366 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); | 412 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); |
367 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); | 413 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); |
368 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); | 414 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); |
369 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; | 415 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; |
370 | 416 | ||
371 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); | 417 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); |
372 | mPhoneDevice->setText(prof->getPhoneDevice()); | 418 | mPhoneDevice->setText(prof->getPhoneDevice()); |
373 | mPhoneConnection->setText(prof->getPhoneConnection()); | 419 | mPhoneConnection->setText(prof->getPhoneConnection()); |
374 | mPhoneModel->setText(prof->getPhoneModel()); | 420 | mPhoneModel->setText(prof->getPhoneModel()); |
375 | 421 | ||
376 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); | 422 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); |
377 | mAskForPreferences->setChecked( prof->getAskForPreferences()); | 423 | mAskForPreferences->setChecked( prof->getAskForPreferences()); |
378 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 424 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
379 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 425 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
380 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 426 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
381 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | 427 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); |
382 | mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); | 428 | mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); |
383 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); | 429 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); |
384 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); | 430 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); |
385 | 431 | ||
386 | switch ( prof->getSyncPrefs() ) { | 432 | switch ( prof->getSyncPrefs() ) { |
387 | case 0: | 433 | case 0: |
388 | loc->setChecked( true); | 434 | loc->setChecked( true); |
389 | break; | 435 | break; |
390 | case 1: | 436 | case 1: |
391 | rem->setChecked( true ); | 437 | rem->setChecked( true ); |
392 | break; | 438 | break; |
393 | case 2: | 439 | case 2: |
394 | newest->setChecked( true); | 440 | newest->setChecked( true); |
395 | break; | 441 | break; |
396 | case 3: | 442 | case 3: |
397 | ask->setChecked( true); | 443 | ask->setChecked( true); |
398 | break; | 444 | break; |
399 | case 4: | 445 | case 4: |
400 | f_loc->setChecked( true); | 446 | f_loc->setChecked( true); |
401 | break; | 447 | break; |
402 | case 5: | 448 | case 5: |
403 | f_rem->setChecked( true); | 449 | f_rem->setChecked( true); |
404 | break; | 450 | break; |
405 | case 6: | 451 | case 6: |
406 | //both->setChecked( true); | 452 | //both->setChecked( true); |
407 | break; | 453 | break; |
408 | default: | 454 | default: |
409 | break; | 455 | break; |
410 | } | 456 | } |
411 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; | 457 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; |
412 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; | 458 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; |
413 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); | 459 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); |
414 | proGr->setEnabled( item > 2 ); | 460 | proGr->setEnabled( item > 2 ); |
415 | if ( item < 3 ) { | 461 | if ( item < 3 ) { |
416 | localFileWidget->hide(); | 462 | localFileWidget->hide(); |
417 | remoteFileWidget->hide(); | 463 | remoteFileWidget->hide(); |
418 | phoneWidget->hide(); | 464 | phoneWidget->hide(); |
465 | piWidget->hide(); | ||
419 | 466 | ||
420 | } else | 467 | } else |
421 | kindChanged( prof->getIsLocalFileSync() ); | 468 | kindChanged( prof->getIsLocalFileSync() ); |
422 | } | 469 | } |
423 | 470 | ||
424 | void KSyncPrefsDialog::fillSSH() | 471 | void KSyncPrefsDialog::fillSSH() |
425 | { | 472 | { |
426 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 473 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
427 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 474 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
428 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 475 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
429 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 476 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
430 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 477 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
431 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); | 478 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); |
432 | mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | 479 | mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); |
433 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | 480 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); |
434 | mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); | 481 | mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); |
435 | } | 482 | } |
436 | void KSyncPrefsDialog::fillFTP() | 483 | void KSyncPrefsDialog::fillFTP() |
437 | { | 484 | { |
438 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 485 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
439 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 486 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
440 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 487 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
441 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); | 488 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); |
442 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 489 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
443 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 490 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
444 | 491 | ||
445 | mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); | 492 | mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); |
446 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | 493 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); |
447 | mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | 494 | mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); |
448 | 495 | ||
449 | } | 496 | } |
450 | void KSyncPrefsDialog::kindChanged( bool b ) | 497 | void KSyncPrefsDialog::kindChanged( bool b ) |
451 | { | 498 | { |
452 | 499 | ||
453 | if ( mIsLocal->isChecked () ) | 500 | if ( mIsLocal->isChecked () ) |
454 | localFileWidget->show(); | 501 | localFileWidget->show(); |
455 | else | 502 | else |
456 | localFileWidget->hide(); | 503 | localFileWidget->hide(); |
457 | 504 | ||
458 | if ( mIsNotLocal->isChecked () ) | 505 | if ( mIsNotLocal->isChecked () ) |
459 | remoteFileWidget->show(); | 506 | remoteFileWidget->show(); |
460 | else | 507 | else |
461 | remoteFileWidget->hide(); | 508 | remoteFileWidget->hide(); |
462 | 509 | ||
463 | if ( mIsPhone->isChecked () ) { | 510 | if ( mIsPhone->isChecked () ) { |
464 | phoneWidget->show(); | 511 | phoneWidget->show(); |
465 | } | 512 | } |
466 | else { | 513 | else { |
467 | phoneWidget->hide(); | 514 | phoneWidget->hide(); |
468 | } | 515 | } |
516 | if ( mIsPi->isChecked () ) { | ||
517 | piWidget->show(); | ||
518 | } | ||
519 | else { | ||
520 | piWidget->hide(); | ||
521 | } | ||
469 | 522 | ||
470 | } | 523 | } |
471 | void KSyncPrefsDialog::deleteProfile() | 524 | void KSyncPrefsDialog::deleteProfile() |
472 | { | 525 | { |
473 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 526 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
474 | if ( currentSelection >= 0 ) { | 527 | if ( currentSelection >= 0 ) { |
475 | if ( currentSelection < 3 ) { | 528 | if ( currentSelection < 3 ) { |
476 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); | 529 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); |
477 | return; | 530 | return; |
478 | } | 531 | } |
479 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); | 532 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); |
480 | mSyncProfiles.remove( temp ); | 533 | mSyncProfiles.remove( temp ); |
481 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); | 534 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); |
482 | insertProfiles(); | 535 | insertProfiles(); |
483 | } | 536 | } |
484 | } | 537 | } |
485 | 538 | ||
486 | void KSyncPrefsDialog::saveProfile() | 539 | void KSyncPrefsDialog::saveProfile() |
487 | { | 540 | { |
488 | KSyncProfile* prof; | 541 | KSyncProfile* prof; |
489 | if ( currentSelection >= 0 ) { | 542 | if ( currentSelection >= 0 ) { |
490 | prof = mSyncProfiles.at(currentSelection) ; | 543 | prof = mSyncProfiles.at(currentSelection) ; |
544 | |||
545 | prof->setRemotePw( mRemotePw->text()); | ||
546 | prof->setRemoteIP( mRemoteIP->text()); | ||
547 | prof->setRemotePort( mRemotePort->text()); | ||
548 | |||
549 | prof->setRemotePwAB( mRemotePwAB->text()); | ||
550 | prof->setRemoteIPAB( mRemoteIPAB->text()); | ||
551 | prof->setRemotePortAB( mRemotePortAB->text()); | ||
552 | |||
553 | prof->setRemotePwPWM( mRemotePwPWM->text()); | ||
554 | prof->setRemoteIPPWM( mRemoteIPPWM->text()); | ||
555 | prof->setRemotePortPWM( mRemotePortPWM->text()); | ||
556 | |||
491 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 557 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
492 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 558 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
493 | prof->setLocalTempFile( mLocalTempFile->text()); | 559 | prof->setLocalTempFile( mLocalTempFile->text()); |
494 | prof->setRemoteFileName( mRemoteFile->text() ); | 560 | prof->setRemoteFileName( mRemoteFile->text() ); |
495 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); | 561 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); |
496 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); | 562 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); |
497 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); | 563 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); |
498 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); | 564 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); |
499 | prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); | 565 | prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); |
500 | prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); | 566 | prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); |
501 | prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); | 567 | prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); |
502 | prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); | 568 | prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); |
503 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 569 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
504 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 570 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
505 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 571 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
506 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 572 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
507 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 573 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
508 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | 574 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); |
509 | prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); | 575 | prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); |
510 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 576 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
511 | prof->setSyncPrefs( syncprefs); | 577 | prof->setSyncPrefs( syncprefs); |
512 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 578 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
513 | prof->setIsPhoneSync( mIsPhone->isChecked() ); | 579 | prof->setIsPhoneSync( mIsPhone->isChecked() ); |
514 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); | 580 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); |
515 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); | 581 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); |
516 | 582 | ||
517 | prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); | 583 | prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); |
518 | prof->setPhoneDevice( mPhoneDevice->text() ); | 584 | prof->setPhoneDevice( mPhoneDevice->text() ); |
519 | prof->setPhoneConnection( mPhoneConnection->text() ); | 585 | prof->setPhoneConnection( mPhoneConnection->text() ); |
520 | prof->setPhoneModel( mPhoneModel->text() ); | 586 | prof->setPhoneModel( mPhoneModel->text() ); |
521 | 587 | ||
522 | } | 588 | } |
523 | 589 | ||
524 | } | 590 | } |
525 | 591 | ||
526 | void KSyncPrefsDialog::insertProfiles() | 592 | void KSyncPrefsDialog::insertProfiles() |
527 | { | 593 | { |
528 | int curItem = mProfileBox->currentItem(); | 594 | int curItem = mProfileBox->currentItem(); |
529 | mProfileBox->blockSignals( true ); | 595 | mProfileBox->blockSignals( true ); |
530 | mProfileBox->clear(); | 596 | mProfileBox->clear(); |
531 | mProfileBox->insertStringList (mSyncProfileNames ); | 597 | mProfileBox->insertStringList (mSyncProfileNames ); |
532 | int item = mSyncProfileNames.count() -1; | 598 | int item = mSyncProfileNames.count() -1; |
533 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) | 599 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) |
534 | mProfileBox->setCurrentItem( curItem ); | 600 | mProfileBox->setCurrentItem( curItem ); |
535 | else if ( item >= 0 ) { | 601 | else if ( item >= 0 ) { |
536 | mProfileBox->setCurrentItem( item ); | 602 | mProfileBox->setCurrentItem( item ); |
537 | } | 603 | } |
538 | currentSelection = -1; | 604 | currentSelection = -1; |