summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
authorzautrix <zautrix>2005-01-13 03:53:45 (UTC)
committer zautrix <zautrix>2005-01-13 03:53:45 (UTC)
commit7d00f1441b5e1270dcd447bfb7920dbd3a21503d (patch) (side-by-side diff)
tree8eb3b053e8104914021eff6f39772024784fff64 /libkdepim/ksyncprefsdialog.cpp
parent7a4a866cded40032766acb4fe8d02b6347b1d12e (diff)
downloadkdepimpi-7d00f1441b5e1270dcd447bfb7920dbd3a21503d.zip
kdepimpi-7d00f1441b5e1270dcd447bfb7920dbd3a21503d.tar.gz
kdepimpi-7d00f1441b5e1270dcd447bfb7920dbd3a21503d.tar.bz2
sync dialog fixes
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp113
1 files changed, 80 insertions, 33 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 03265d2..8a3f4cf 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -43,6 +43,8 @@
#include <qapplication.h>
#include <qlayout.h>
#include <qscrollview.h>
+#include <qvgroupbox.h>
+#include <qhgroupbox.h>
#include <kcolorbutton.h>
#include <kdebug.h>
@@ -141,7 +143,9 @@ void KSyncPrefsDialog::setupSyncAlgTab()
topLayout->addWidget(mProfileBox, iii,1);
++iii;
- QHBox *iims = new QHBox( topFrame );
+
+
+ QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame);
new QLabel( i18n("Include in multiple "), iims );
mIncludeInRing = new QCheckBox( i18n("calendar "), iims );
mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims );
@@ -149,13 +153,18 @@ void KSyncPrefsDialog::setupSyncAlgTab()
new QLabel( i18n(" sync"), iims );
topLayout->addMultiCellWidget(iims, iii,iii,0,1);
++iii;
-
- mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
- topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
- ++iii;
- QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
- topLayout->addMultiCellWidget(gr, iii,iii,0,1);
+ QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame);
+ topLayout->addMultiCellWidget(gb0, iii,iii,0,1);
++iii;
+ QButtonGroup* gr;
+ {
+ QVGroupBox* topFrame = gb0;
+ mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
+ //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
+ //++iii;
+ gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
+ //topLayout->addMultiCellWidget(gr, iii,iii,0,1);
+ //++iii;
loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
@@ -165,25 +174,38 @@ void KSyncPrefsDialog::setupSyncAlgTab()
// both = new QRadioButton ( i18n("Take both on conflict"), gr );
mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
- topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
- ++iii;
+ //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
+ //++iii;
mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
- topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
- ++iii;
-
- mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
- topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
- ++iii;
+ // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
+ // ++iii;
- mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame );
- topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
- ++iii;
- topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0);
- mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame);
- topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
- ++iii;
+ QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame);
+ //topLayout->addMultiCellWidget(gb2, iii,iii,0,1);
+ //++iii;
+ {
+ QVGroupBox*topFrame = gb2;
+ mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame );
+ //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
+ //++iii;
+ mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
+ //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
+ //++iii;
+ QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame);
+ connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
+ new QLabel( i18n("From ") , gb3 );
+ mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3);
+ new QLabel( i18n(" weeks in the past to ") , gb3 );
+ mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3);
+ new QLabel( i18n(" weeks in the future ") , gb3 );
+ //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
+ //++iii;
+ gb3->setEnabled( false );
+ }
+ connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
+ }
proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
gr = proGr;
topLayout->addMultiCellWidget(gr, iii,iii,0,1);
@@ -196,10 +218,18 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
+ QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame);
+ topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
+ ++iii;
+ // ******************************************
+ // Profile kind specific settings
+ {
+ // *** phone *******************************
+ QVGroupBox* topFrame = gb1;
phoneWidget = new QVBox( topFrame);
- topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
- ++iii;
+ //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
+ //++iii;
mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
QHBox* temphb = new QHBox( phoneWidget );
new QLabel( i18n("I/O device: "), temphb );
@@ -221,10 +251,10 @@ void KSyncPrefsDialog::setupSyncAlgTab()
button = new QPushButton( i18n("Help..."), temphb );
connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
- // *** local
+ // *** local*******************************
localFileWidget = new QVBox( topFrame);
- topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
- ++iii;
+ //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
+ //++iii;
temphb = new QHBox( localFileWidget );
lab = new QLabel( i18n("Local file Cal:"), temphb );
@@ -245,10 +275,10 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
- // *** remote
+ // *** remote*******************************
remoteFileWidget = new QVBox( topFrame);
- topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
- ++iii;
+ //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
+ //++iii;
temphb = new QHBox( remoteFileWidget );
new QLabel( i18n("Calendar:"), temphb);
new QLabel( i18n("AddressBook:"), temphb);
@@ -280,10 +310,10 @@ void KSyncPrefsDialog::setupSyncAlgTab()
connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
- // *** pi-sync
+ // *** pi-sync*******************************
piWidget = new QVBox( topFrame);
- topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
- ++iii;
+ //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
+ //++iii;
temphb = new QHBox( piWidget );
new QLabel( i18n("Calendar:"), temphb);
new QLabel( i18n("AddressBook:"), temphb);
@@ -306,11 +336,26 @@ void KSyncPrefsDialog::setupSyncAlgTab()
mRemotePort = new QLineEdit(temphb);
mRemotePortAB = new QLineEdit(temphb);
mRemotePortPWM = new QLineEdit(temphb);
+ }
+ // ******************************************
+ // Profile kind specific settings END
}
+void KSyncPrefsDialog::readFilter()
+{
+ mFilterKapi.clear();
+ mFilterKopi.clear();
+ mFilterKopi.append(i18n("No Filter") );
+ mFilterKapi.append(i18n("No Filter") );
+ KConfig cfgko(locateLocal("config","korganizerrc"));
+ KConfig cfgka(locateLocal("config","kaddressbookrc"));
+ cfgko.setGroup("General");
+ mFilterKopi = cfgko.readListEntry("CalendarFilters");
+ mFilterKopi.prepend(i18n("No Filter") );
+}
void KSyncPrefsDialog::slotOK()
@@ -430,6 +475,7 @@ void KSyncPrefsDialog::profileChanged( int item )
mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
mWriteBackFuture->setChecked( prof->getWriteBackFuture());
mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
+ mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
switch ( prof->getSyncPrefs() ) {
case 0:
@@ -593,6 +639,7 @@ void KSyncPrefsDialog::saveProfile()
prof->setIsKapiFile( mIsKapiFileL->isChecked() );
prof->setWriteBackFuture(mWriteBackFuture->isChecked());
prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
+ prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value());
if ( mWriteContactToSIM )
prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
prof->setPhoneDevice( mPhoneDevice->text() );