-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 7 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 3 |
4 files changed, 14 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 3df2a3b..7c04f48 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -95,99 +95,102 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
95 | 95 | ||
96 | QPushButton* button = new QPushButton( i18n("Ok"), b_box ); | 96 | QPushButton* button = new QPushButton( i18n("Ok"), b_box ); |
97 | connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); | 97 | connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); |
98 | button = new QPushButton( i18n("Cancel"), b_box ); | 98 | button = new QPushButton( i18n("Cancel"), b_box ); |
99 | connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); | 99 | connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); |
100 | //QBoxLayout * sl = new QVBoxLayout(this ); | 100 | //QBoxLayout * sl = new QVBoxLayout(this ); |
101 | //sl->addWidget ( sv ); | 101 | //sl->addWidget ( sv ); |
102 | sv->setResizePolicy ( QScrollView::AutoOneFit ); | 102 | sv->setResizePolicy ( QScrollView::AutoOneFit ); |
103 | QFrame *topFrame = new QFrame ( sv ); | 103 | QFrame *topFrame = new QFrame ( sv ); |
104 | sv->addChild( topFrame ); | 104 | sv->addChild( topFrame ); |
105 | mSetupSyncAlgTab = topFrame; | 105 | mSetupSyncAlgTab = topFrame; |
106 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 106 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
107 | topLayout->setSpacing(spacingHint()); | 107 | topLayout->setSpacing(spacingHint()); |
108 | topLayout->setMargin(marginHint()); | 108 | topLayout->setMargin(marginHint()); |
109 | 109 | ||
110 | //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); | 110 | //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); |
111 | int iii = 0; | 111 | int iii = 0; |
112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 112 | //topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
113 | //++iii; | 113 | //++iii; |
114 | 114 | ||
115 | mMyMachineName = new QLineEdit(topFrame); | 115 | mMyMachineName = new QLineEdit(topFrame); |
116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); | 116 | lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); |
117 | topLayout->addWidget(lab ,iii,0); | 117 | topLayout->addWidget(lab ,iii,0); |
118 | topLayout->addWidget(mMyMachineName,iii,1); | 118 | topLayout->addWidget(mMyMachineName,iii,1); |
119 | ++iii; | 119 | ++iii; |
120 | 120 | ||
121 | QHBox* buttonbox = new QHBox( topFrame); | 121 | QHBox* buttonbox = new QHBox( topFrame); |
122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); | 122 | topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); |
123 | ++iii; | 123 | ++iii; |
124 | button = new QPushButton( i18n("New profile"), buttonbox ); | 124 | button = new QPushButton( i18n("New profile"), buttonbox ); |
125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); | 125 | connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); |
126 | 126 | ||
127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); | 127 | button = new QPushButton( i18n("Clone profile"), buttonbox ); |
128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); | 128 | connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); |
129 | 129 | ||
130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); | 130 | button = new QPushButton( i18n("Delete profile"), buttonbox ); |
131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); | 131 | connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); |
132 | 132 | ||
133 | mProfileBox = new QComboBox(topFrame); | 133 | mProfileBox = new QComboBox(topFrame); |
134 | mProfileBox->setEditable ( true ); | 134 | mProfileBox->setEditable ( true ); |
135 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); | 135 | connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); |
136 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); | 136 | connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); |
137 | 137 | ||
138 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); | 138 | lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); |
139 | topLayout->addWidget(lab ,iii,0); | 139 | topLayout->addWidget(lab ,iii,0); |
140 | topLayout->addWidget(mProfileBox, iii,1); | 140 | topLayout->addWidget(mProfileBox, iii,1); |
141 | ++iii; | 141 | ++iii; |
142 | 142 | ||
143 | mIncludeInRing = new QCheckBox( i18n("Include in multiple sync"), topFrame ); | 143 | mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); |
144 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); | 144 | topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); |
145 | ++iii; | 145 | ++iii; |
146 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); | ||
147 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); | ||
148 | ++iii; | ||
146 | 149 | ||
147 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); | 150 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); |
148 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); | 151 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); |
149 | ++iii; | 152 | ++iii; |
150 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); | 153 | QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); |
151 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 154 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
152 | ++iii; | 155 | ++iii; |
153 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); | 156 | loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); |
154 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); | 157 | rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); |
155 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); | 158 | newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); |
156 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); | 159 | ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); |
157 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); | 160 | f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); |
158 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); | 161 | f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); |
159 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); | 162 | // both = new QRadioButton ( i18n("Take both on conflict"), gr ); |
160 | 163 | ||
161 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); | 164 | mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); |
162 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); | 165 | topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); |
163 | ++iii; | 166 | ++iii; |
164 | 167 | ||
165 | mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame ); | 168 | mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame ); |
166 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 169 | topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
167 | ++iii; | 170 | ++iii; |
168 | 171 | ||
169 | mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame ); | 172 | mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame ); |
170 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); | 173 | topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); |
171 | ++iii; | 174 | ++iii; |
172 | 175 | ||
173 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 176 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
174 | gr = proGr; | 177 | gr = proGr; |
175 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 178 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
176 | ++iii; | 179 | ++iii; |
177 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 180 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
178 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 181 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
179 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 182 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
180 | 183 | ||
181 | localFileWidget = new QVBox( topFrame); | 184 | localFileWidget = new QVBox( topFrame); |
182 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 185 | topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
183 | ++iii; | 186 | ++iii; |
184 | QHBox* temphb = new QHBox( localFileWidget ); | 187 | QHBox* temphb = new QHBox( localFileWidget ); |
185 | lab = new QLabel( i18n("Local file:"), temphb); | 188 | lab = new QLabel( i18n("Local file:"), temphb); |
186 | mRemoteFile = new QLineEdit(localFileWidget); | 189 | mRemoteFile = new QLineEdit(localFileWidget); |
187 | 190 | ||
188 | button = new QPushButton( i18n("Choose..."), temphb ); | 191 | button = new QPushButton( i18n("Choose..."), temphb ); |
189 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 192 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
190 | 193 | ||
191 | 194 | ||
192 | remoteFileWidget = new QVBox( topFrame); | 195 | remoteFileWidget = new QVBox( topFrame); |
193 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 196 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
@@ -230,182 +233,184 @@ void KSyncPrefsDialog::slotOK() | |||
230 | } | 233 | } |
231 | void KSyncPrefsDialog::accept() | 234 | void KSyncPrefsDialog::accept() |
232 | { | 235 | { |
233 | slotOK(); | 236 | slotOK(); |
234 | } | 237 | } |
235 | void KSyncPrefsDialog::chooseFile() | 238 | void KSyncPrefsDialog::chooseFile() |
236 | { | 239 | { |
237 | QString fn = QDir::homeDirPath(); | 240 | QString fn = QDir::homeDirPath(); |
238 | 241 | ||
239 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 242 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
240 | if ( fn == "" ) | 243 | if ( fn == "" ) |
241 | return; | 244 | return; |
242 | mRemoteFile->setText( fn ); | 245 | mRemoteFile->setText( fn ); |
243 | } | 246 | } |
244 | 247 | ||
245 | void KSyncPrefsDialog::textChanged( const QString & s ) | 248 | void KSyncPrefsDialog::textChanged( const QString & s ) |
246 | { | 249 | { |
247 | if ( mProfileBox->count() == 0 ) | 250 | if ( mProfileBox->count() == 0 ) |
248 | return; | 251 | return; |
249 | if ( currentSelection < 3 ) { | 252 | if ( currentSelection < 3 ) { |
250 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 253 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
251 | mProfileBox->blockSignals( true ); | 254 | mProfileBox->blockSignals( true ); |
252 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 255 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
253 | mProfileBox->blockSignals( false ); | 256 | mProfileBox->blockSignals( false ); |
254 | return; | 257 | return; |
255 | } | 258 | } |
256 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 259 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
257 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 260 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
258 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 261 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
259 | prof->setName( s ); | 262 | prof->setName( s ); |
260 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 263 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
261 | } | 264 | } |
262 | void KSyncPrefsDialog::profileChanged( int item ) | 265 | void KSyncPrefsDialog::profileChanged( int item ) |
263 | { | 266 | { |
264 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); | 267 | //qDebug("KSyncPrefsDialog::profileChanged %d ", item ); |
265 | KSyncProfile* prof; | 268 | KSyncProfile* prof; |
266 | saveProfile(); | 269 | saveProfile(); |
267 | currentSelection = item; | 270 | currentSelection = item; |
268 | prof = mSyncProfiles.at(item) ; | 271 | prof = mSyncProfiles.at(item) ; |
269 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 272 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
270 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 273 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
271 | mLocalTempFile->setText(prof->getLocalTempFile()); | 274 | mLocalTempFile->setText(prof->getLocalTempFile()); |
272 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 275 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
273 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); | 276 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); |
274 | mAskForPreferences->setChecked( prof->getAskForPreferences()); | 277 | mAskForPreferences->setChecked( prof->getAskForPreferences()); |
275 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 278 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
276 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 279 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
277 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 280 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
281 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | ||
278 | 282 | ||
279 | switch ( prof->getSyncPrefs() ) { | 283 | switch ( prof->getSyncPrefs() ) { |
280 | case 0: | 284 | case 0: |
281 | loc->setChecked( true); | 285 | loc->setChecked( true); |
282 | break; | 286 | break; |
283 | case 1: | 287 | case 1: |
284 | rem->setChecked( true ); | 288 | rem->setChecked( true ); |
285 | break; | 289 | break; |
286 | case 2: | 290 | case 2: |
287 | newest->setChecked( true); | 291 | newest->setChecked( true); |
288 | break; | 292 | break; |
289 | case 3: | 293 | case 3: |
290 | ask->setChecked( true); | 294 | ask->setChecked( true); |
291 | break; | 295 | break; |
292 | case 4: | 296 | case 4: |
293 | f_loc->setChecked( true); | 297 | f_loc->setChecked( true); |
294 | break; | 298 | break; |
295 | case 5: | 299 | case 5: |
296 | f_rem->setChecked( true); | 300 | f_rem->setChecked( true); |
297 | break; | 301 | break; |
298 | case 6: | 302 | case 6: |
299 | //both->setChecked( true); | 303 | //both->setChecked( true); |
300 | break; | 304 | break; |
301 | default: | 305 | default: |
302 | break; | 306 | break; |
303 | } | 307 | } |
304 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; | 308 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; |
305 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync()); | 309 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync()); |
306 | proGr->setEnabled( item > 2 ); | 310 | proGr->setEnabled( item > 2 ); |
307 | if ( item < 3 ) { | 311 | if ( item < 3 ) { |
308 | localFileWidget->setEnabled(false); | 312 | localFileWidget->setEnabled(false); |
309 | remoteFileWidget->setEnabled(false); | 313 | remoteFileWidget->setEnabled(false); |
310 | 314 | ||
311 | } else | 315 | } else |
312 | kindChanged( prof->getIsLocalFileSync() ); | 316 | kindChanged( prof->getIsLocalFileSync() ); |
313 | } | 317 | } |
314 | 318 | ||
315 | void KSyncPrefsDialog::fillSSH() | 319 | void KSyncPrefsDialog::fillSSH() |
316 | { | 320 | { |
317 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 321 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
318 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 322 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
319 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 323 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
320 | } | 324 | } |
321 | void KSyncPrefsDialog::fillFTP() | 325 | void KSyncPrefsDialog::fillFTP() |
322 | { | 326 | { |
323 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 327 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
324 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 328 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
325 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 329 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
326 | 330 | ||
327 | } | 331 | } |
328 | void KSyncPrefsDialog::kindChanged( bool b ) | 332 | void KSyncPrefsDialog::kindChanged( bool b ) |
329 | { | 333 | { |
330 | 334 | ||
331 | localFileWidget->setEnabled(b); | 335 | localFileWidget->setEnabled(b); |
332 | remoteFileWidget->setEnabled(!b); | 336 | remoteFileWidget->setEnabled(!b); |
333 | 337 | ||
334 | } | 338 | } |
335 | void KSyncPrefsDialog::deleteProfile() | 339 | void KSyncPrefsDialog::deleteProfile() |
336 | { | 340 | { |
337 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 341 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
338 | if ( currentSelection >= 0 ) { | 342 | if ( currentSelection >= 0 ) { |
339 | if ( currentSelection < 3 ) { | 343 | if ( currentSelection < 3 ) { |
340 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); | 344 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); |
341 | return; | 345 | return; |
342 | } | 346 | } |
343 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); | 347 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); |
344 | mSyncProfiles.remove( temp ); | 348 | mSyncProfiles.remove( temp ); |
345 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); | 349 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); |
346 | insertProfiles(); | 350 | insertProfiles(); |
347 | } | 351 | } |
348 | } | 352 | } |
349 | 353 | ||
350 | void KSyncPrefsDialog::saveProfile() | 354 | void KSyncPrefsDialog::saveProfile() |
351 | { | 355 | { |
352 | KSyncProfile* prof; | 356 | KSyncProfile* prof; |
353 | if ( currentSelection >= 0 ) { | 357 | if ( currentSelection >= 0 ) { |
354 | prof = mSyncProfiles.at(currentSelection) ; | 358 | prof = mSyncProfiles.at(currentSelection) ; |
355 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 359 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
356 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 360 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
357 | prof->setLocalTempFile( mLocalTempFile->text()); | 361 | prof->setLocalTempFile( mLocalTempFile->text()); |
358 | prof->setRemoteFileName( mRemoteFile->text() ); | 362 | prof->setRemoteFileName( mRemoteFile->text() ); |
359 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 363 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
360 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 364 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
361 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 365 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
362 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 366 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
363 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 367 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
368 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | ||
364 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 369 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
365 | prof->setSyncPrefs( syncprefs); | 370 | prof->setSyncPrefs( syncprefs); |
366 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 371 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
367 | } | 372 | } |
368 | 373 | ||
369 | } | 374 | } |
370 | 375 | ||
371 | void KSyncPrefsDialog::insertProfiles() | 376 | void KSyncPrefsDialog::insertProfiles() |
372 | { | 377 | { |
373 | int curItem = mProfileBox->currentItem(); | 378 | int curItem = mProfileBox->currentItem(); |
374 | mProfileBox->blockSignals( true ); | 379 | mProfileBox->blockSignals( true ); |
375 | mProfileBox->clear(); | 380 | mProfileBox->clear(); |
376 | mProfileBox->insertStringList (mSyncProfileNames ); | 381 | mProfileBox->insertStringList (mSyncProfileNames ); |
377 | int item = mSyncProfileNames.count() -1; | 382 | int item = mSyncProfileNames.count() -1; |
378 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) | 383 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) |
379 | mProfileBox->setCurrentItem( curItem ); | 384 | mProfileBox->setCurrentItem( curItem ); |
380 | else if ( item >= 0 ) { | 385 | else if ( item >= 0 ) { |
381 | mProfileBox->setCurrentItem( item ); | 386 | mProfileBox->setCurrentItem( item ); |
382 | } | 387 | } |
383 | currentSelection = -1; | 388 | currentSelection = -1; |
384 | if ( mSyncProfileNames.count() > 0 ) { | 389 | if ( mSyncProfileNames.count() > 0 ) { |
385 | //qDebug(" profileChanged( mProfileBox->currentItem() "); | 390 | //qDebug(" profileChanged( mProfileBox->currentItem() "); |
386 | profileChanged( mProfileBox->currentItem() ); | 391 | profileChanged( mProfileBox->currentItem() ); |
387 | currentSelection = mProfileBox->currentItem(); | 392 | currentSelection = mProfileBox->currentItem(); |
388 | } | 393 | } |
389 | mProfileBox->blockSignals( false ); | 394 | mProfileBox->blockSignals( false ); |
390 | } | 395 | } |
391 | 396 | ||
392 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) | 397 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) |
393 | { | 398 | { |
394 | saveProfile(); | 399 | saveProfile(); |
395 | mSyncProfiles.append( temp ); | 400 | mSyncProfiles.append( temp ); |
396 | mSyncProfileNames << temp->getName(); | 401 | mSyncProfileNames << temp->getName(); |
397 | insertProfiles(); | 402 | insertProfiles(); |
398 | int last = mProfileBox->count() -1; | 403 | int last = mProfileBox->count() -1; |
399 | mProfileBox->blockSignals( true ); | 404 | mProfileBox->blockSignals( true ); |
400 | mProfileBox->setCurrentItem( last ); | 405 | mProfileBox->setCurrentItem( last ); |
401 | mProfileBox->blockSignals( false ); | 406 | mProfileBox->blockSignals( false ); |
402 | profileChanged(last); | 407 | profileChanged(last); |
403 | } | 408 | } |
404 | void KSyncPrefsDialog::newProfile() | 409 | void KSyncPrefsDialog::newProfile() |
405 | { | 410 | { |
406 | addProfile ( new KSyncProfile () ); | 411 | addProfile ( new KSyncProfile () ); |
407 | } | 412 | } |
408 | 413 | ||
409 | void KSyncPrefsDialog::cloneProfile() | 414 | void KSyncPrefsDialog::cloneProfile() |
410 | { | 415 | { |
411 | if ( currentSelection >= 0 ) | 416 | if ( currentSelection >= 0 ) |
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index 90fa286..c663d22 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h | |||
@@ -40,71 +40,72 @@ class QButtonGroup; | |||
40 | class QLineEdit; | 40 | class QLineEdit; |
41 | class QVBox; | 41 | class QVBox; |
42 | class QStringList; | 42 | class QStringList; |
43 | class KSyncProfile; | 43 | class KSyncProfile; |
44 | 44 | ||
45 | /** Dialog to change the korganizer configuration. | 45 | /** Dialog to change the korganizer configuration. |
46 | */ | 46 | */ |
47 | class KSyncPrefsDialog : public KDialog | 47 | class KSyncPrefsDialog : public KDialog |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | /** Initialize dialog and pages */ | 51 | /** Initialize dialog and pages */ |
52 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 52 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
53 | ~KSyncPrefsDialog(); | 53 | ~KSyncPrefsDialog(); |
54 | void usrReadConfig(); | 54 | void usrReadConfig(); |
55 | void setLocalMachineName ( const QString& name ); | 55 | void setLocalMachineName ( const QString& name ); |
56 | QString getLocalMachineName ( ); | 56 | QString getLocalMachineName ( ); |
57 | 57 | ||
58 | QStringList getSyncProfileNames(); | 58 | QStringList getSyncProfileNames(); |
59 | 59 | ||
60 | public slots: | 60 | public slots: |
61 | protected slots: | 61 | protected slots: |
62 | void accept(); | 62 | void accept(); |
63 | void deleteProfile(); | 63 | void deleteProfile(); |
64 | void newProfile(); | 64 | void newProfile(); |
65 | void cloneProfile(); | 65 | void cloneProfile(); |
66 | void kindChanged(bool); | 66 | void kindChanged(bool); |
67 | void fillSSH(); | 67 | void fillSSH(); |
68 | void fillFTP(); | 68 | void fillFTP(); |
69 | void textChanged( const QString & ); | 69 | void textChanged( const QString & ); |
70 | void profileChanged( int ); | 70 | void profileChanged( int ); |
71 | void chooseFile(); | 71 | void chooseFile(); |
72 | void slotOK(); | 72 | void slotOK(); |
73 | 73 | ||
74 | protected: | 74 | protected: |
75 | void usrWriteConfig(); | 75 | void usrWriteConfig(); |
76 | 76 | ||
77 | void setupSyncAlgTab(); | 77 | void setupSyncAlgTab(); |
78 | 78 | ||
79 | private: | 79 | private: |
80 | int currentSelection; | 80 | int currentSelection; |
81 | QPtrList<KSyncProfile> mSyncProfiles; | 81 | QPtrList<KSyncProfile> mSyncProfiles; |
82 | QStringList mSyncProfileNames; | 82 | QStringList mSyncProfileNames; |
83 | QLineEdit * mMyMachineName; | 83 | QLineEdit * mMyMachineName; |
84 | QComboBox * mProfileBox; | 84 | QComboBox * mProfileBox; |
85 | QRadioButton* mIsLocal; | 85 | QRadioButton* mIsLocal; |
86 | QRadioButton* mIsNotLocal; | 86 | QRadioButton* mIsNotLocal; |
87 | QCheckBox* mIncludeInRing; | 87 | QCheckBox* mIncludeInRing; |
88 | QCheckBox* mIncludeInRingAB; | ||
88 | void addProfile ( KSyncProfile* ); | 89 | void addProfile ( KSyncProfile* ); |
89 | void insertProfiles(); | 90 | void insertProfiles(); |
90 | void saveProfile(); | 91 | void saveProfile(); |
91 | QButtonGroup* proGr; | 92 | QButtonGroup* proGr; |
92 | 93 | ||
93 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; | 94 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; |
94 | 95 | ||
95 | 96 | ||
96 | QLineEdit * mRemotePostcommand; | 97 | QLineEdit * mRemotePostcommand; |
97 | QLineEdit * mRemotePrecommand; | 98 | QLineEdit * mRemotePrecommand; |
98 | QLineEdit * mRemoteFile; | 99 | QLineEdit * mRemoteFile; |
99 | QLineEdit * mLocalTempFile; | 100 | QLineEdit * mLocalTempFile; |
100 | QWidget* mSetupSyncAlgTab; | 101 | QWidget* mSetupSyncAlgTab; |
101 | 102 | ||
102 | QVBox* localFileWidget; | 103 | QVBox* localFileWidget; |
103 | QVBox* remoteFileWidget; | 104 | QVBox* remoteFileWidget; |
104 | QCheckBox* mWriteBackFile; | 105 | QCheckBox* mWriteBackFile; |
105 | QCheckBox* mWriteBackExisting; | 106 | QCheckBox* mWriteBackExisting; |
106 | QCheckBox* mAskForPreferences; | 107 | QCheckBox* mAskForPreferences; |
107 | QCheckBox* mShowSummaryAfterSync; | 108 | QCheckBox* mShowSummaryAfterSync; |
108 | }; | 109 | }; |
109 | 110 | ||
110 | #endif | 111 | #endif |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index d6d8fa3..ea41a85 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -7,119 +7,123 @@ | |||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $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 * name): QObject (0, name ) | 33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) |
34 | { | 34 | { |
35 | setDefault(); | 35 | setDefault(); |
36 | } | 36 | } |
37 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
44 | { | 44 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setPreSyncCommand( mPreSyncCommand ); | 46 | myClone->setPreSyncCommand( mPreSyncCommand ); |
47 | myClone->setPostSyncCommand( mPostSyncCommand ); | 47 | myClone->setPostSyncCommand( mPostSyncCommand ); |
48 | myClone->setLocalTempFile( mLocalTempFile); | 48 | myClone->setLocalTempFile( mLocalTempFile); |
49 | myClone->setRemoteFileName( mRemoteFileName ); | 49 | myClone->setRemoteFileName( mRemoteFileName ); |
50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 50 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
51 | myClone->setAskForPreferences( mAskForPreferences); | 51 | myClone->setAskForPreferences( mAskForPreferences); |
52 | myClone->setWriteBackExisting(mWriteBackExisting ); | 52 | myClone->setWriteBackExisting(mWriteBackExisting ); |
53 | myClone->setWriteBackFile( mWriteBackFile); | 53 | myClone->setWriteBackFile( mWriteBackFile); |
54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 54 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
55 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | ||
55 | myClone->setSyncPrefs( mSyncPrefs); | 56 | myClone->setSyncPrefs( mSyncPrefs); |
56 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 57 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
57 | myClone->setName( "noName" ); | 58 | myClone->setName( "noName" ); |
58 | return myClone; | 59 | return myClone; |
59 | } | 60 | } |
60 | 61 | ||
61 | 62 | ||
62 | void KSyncProfile::setDefault() | 63 | void KSyncProfile::setDefault() |
63 | { | 64 | { |
64 | mName = "noName"; | 65 | mName = "noName"; |
65 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 66 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
66 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 67 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
67 | mLocalTempFile = "/tmp/mycalendar.ics"; | 68 | mLocalTempFile = "/tmp/mycalendar.ics"; |
68 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 69 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
69 | mShowSummaryAfterSync = true; | 70 | mShowSummaryAfterSync = true; |
70 | mAskForPreferences = true; | 71 | mAskForPreferences = true; |
71 | mWriteBackExisting = false; | 72 | mWriteBackExisting = false; |
72 | mWriteBackFile = true; | 73 | mWriteBackFile = true; |
73 | mIncludeInRingSync = false; | 74 | mIncludeInRingSync = false; |
75 | mIncludeInRingSyncAB = false; | ||
74 | mSyncPrefs = SYNC_PREF_ASK; | 76 | mSyncPrefs = SYNC_PREF_ASK; |
75 | mIsLocalFileSync = true; | 77 | mIsLocalFileSync = true; |
76 | 78 | ||
77 | } | 79 | } |
78 | void KSyncProfile::readConfig(KConfig *config ) | 80 | void KSyncProfile::readConfig(KConfig *config ) |
79 | { | 81 | { |
80 | config->setGroup("SyncProfiles"); | 82 | config->setGroup("SyncProfiles"); |
81 | QString prefix = "Profile_"+mName+"_"; | 83 | QString prefix = "Profile_"+mName+"_"; |
82 | //mName = config->readEntry( prefix+ "Name", mName ); | 84 | //mName = config->readEntry( prefix+ "Name", mName ); |
83 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 85 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
84 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 86 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
85 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 87 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
88 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
86 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 89 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
87 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 90 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
88 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 91 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
89 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 92 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
90 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 93 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
91 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 94 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
92 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 95 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
93 | } | 96 | } |
94 | void KSyncProfile::writeConfig( KConfig * config ) | 97 | void KSyncProfile::writeConfig( KConfig * config ) |
95 | { | 98 | { |
96 | config->setGroup("SyncProfiles"); | 99 | config->setGroup("SyncProfiles"); |
97 | QString prefix = "Profile_"+mName+"_"; | 100 | QString prefix = "Profile_"+mName+"_"; |
98 | // config->writeEntry( prefix+ "Name", mName ); | 101 | // config->writeEntry( prefix+ "Name", mName ); |
99 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 102 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); |
100 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 103 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); |
101 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 104 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); |
105 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | ||
102 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 106 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); |
103 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 107 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); |
104 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 108 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
105 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 109 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); |
106 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 110 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); |
107 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 111 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); |
108 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 112 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); |
109 | } | 113 | } |
110 | 114 | ||
111 | /* | 115 | /* |
112 | class KPrefsItemInt : public KPrefsItem { | 116 | class KPrefsItemInt : public KPrefsItem { |
113 | public: | 117 | public: |
114 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); | 118 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); |
115 | virtual ~KPrefsItemInt() {} | 119 | virtual ~KPrefsItemInt() {} |
116 | 120 | ||
117 | void setDefault(); | 121 | void setDefault(); |
118 | void readConfig(KConfig *); | 122 | void readConfig(KConfig *); |
119 | void writeConfig(KConfig *); | 123 | void writeConfig(KConfig *); |
120 | 124 | ||
121 | private: | 125 | private: |
122 | int *mReference; | 126 | int *mReference; |
123 | int mDefault; | 127 | int mDefault; |
124 | }; | 128 | }; |
125 | */ | 129 | */ |
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 3f7f1ac..df1b49e 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -34,69 +34,72 @@ | |||
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 * name = 0); | 49 | KSyncProfile( const char * name = 0); |
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 setName( const QString& n ) {mName = n;} | 56 | void setName( const QString& n ) {mName = n;} |
57 | QString getName( ) { return mName;} | 57 | QString getName( ) { return mName;} |
58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} | 58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} |
59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } | 59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } |
60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} | 60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} |
61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} | 61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} |
62 | 62 | ||
63 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} | 63 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} |
64 | QString getLocalTempFile( ) { return mLocalTempFile;} | 64 | QString getLocalTempFile( ) { return mLocalTempFile;} |
65 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} | 65 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} |
66 | QString getRemoteFileName( ) { return mRemoteFileName;} | 66 | QString getRemoteFileName( ) { return mRemoteFileName;} |
67 | /* | 67 | /* |
68 | void set( const QString& n ) { = n;} | 68 | void set( const QString& n ) { = n;} |
69 | QString get( ) { return ;} | 69 | QString get( ) { return ;} |
70 | */ | 70 | */ |
71 | 71 | ||
72 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} | 72 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} |
73 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} | 73 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} |
74 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} | 74 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} |
75 | bool getAskForPreferences( ) { return mAskForPreferences;} | 75 | bool getAskForPreferences( ) { return mAskForPreferences;} |
76 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} | 76 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} |
77 | bool getWriteBackExisting( ) { return mWriteBackExisting;} | 77 | bool getWriteBackExisting( ) { return mWriteBackExisting;} |
78 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} | 78 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} |
79 | bool getWriteBackFile( ) { return mWriteBackFile;} | 79 | bool getWriteBackFile( ) { return mWriteBackFile;} |
80 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} | 80 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} |
81 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} | 81 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} |
82 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} | ||
83 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} | ||
82 | void setSyncPrefs( int n ) { mSyncPrefs= n;} | 84 | void setSyncPrefs( int n ) { mSyncPrefs= n;} |
83 | int getSyncPrefs( ) { return mSyncPrefs;} | 85 | int getSyncPrefs( ) { return mSyncPrefs;} |
84 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} | 86 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} |
85 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} | 87 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} |
86 | 88 | ||
87 | private: | 89 | private: |
88 | QString mName; | 90 | QString mName; |
89 | QString mPreSyncCommand; | 91 | QString mPreSyncCommand; |
90 | QString mPostSyncCommand; | 92 | QString mPostSyncCommand; |
91 | QString mLocalTempFile; | 93 | QString mLocalTempFile; |
92 | QString mRemoteFileName; | 94 | QString mRemoteFileName; |
93 | bool mIncludeInRingSync; | 95 | bool mIncludeInRingSync; |
96 | bool mIncludeInRingSyncAB; | ||
94 | int mSyncPrefs; | 97 | int mSyncPrefs; |
95 | bool mWriteBackFile; | 98 | bool mWriteBackFile; |
96 | bool mWriteBackExisting; | 99 | bool mWriteBackExisting; |
97 | bool mAskForPreferences; | 100 | bool mAskForPreferences; |
98 | bool mShowSummaryAfterSync; | 101 | bool mShowSummaryAfterSync; |
99 | bool mIsLocalFileSync; | 102 | bool mIsLocalFileSync; |
100 | }; | 103 | }; |
101 | 104 | ||
102 | #endif | 105 | #endif |