summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-22 01:13:09 (UTC)
committer zautrix <zautrix>2004-09-22 01:13:09 (UTC)
commited2feaa9f7e2064e5b26ff678a25eb79ceae599b (patch) (side-by-side diff)
treebd698d689aa16ce8c52c5060402d9560f95a713e
parent01572248367c63119514d15d7401a5b2b83349a0 (diff)
downloadkdepimpi-ed2feaa9f7e2064e5b26ff678a25eb79ceae599b.zip
kdepimpi-ed2feaa9f7e2064e5b26ff678a25eb79ceae599b.tar.gz
kdepimpi-ed2feaa9f7e2064e5b26ff678a25eb79ceae599b.tar.bz2
Sync dialog fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--libkdepim/ksyncprefsdialog.cpp4
-rw-r--r--libkdepim/ksyncprefsdialog.h1
-rw-r--r--libkdepim/ksyncprofile.cpp23
-rw-r--r--libkdepim/ksyncprofile.h15
5 files changed, 18 insertions, 29 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7fae4a9..bc8625d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1150,10 +1150,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( KOPrefs::instance()->mWriteBackInFuture ) {
er = remote->rawIncidences();
inR = er.first();
QDateTime dt;
- QDateTime cur = QDateTime::currentDateTime();
- QDateTime end = cur.addSecs( KOPrefs::instance()->mWriteBackInFuture * 3600 *24 *7 );
+ QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
+ QDateTime end = cur.addDays( (KOPrefs::instance()->mWriteBackInFuture +1 ) *7 );
while ( inR ) {
if ( inR->type() == "Todo" ) {
Todo * t = (Todo*)inR;
if ( t->hasDueDate() )
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 857ceac..a1eebec 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -194,8 +194,9 @@ void KSyncPrefsDialog::setupSyncAlgTab()
phoneWidget = new QVBox( topFrame);
topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
++iii;
+ mWriteContactToSIM= 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 );
mPhoneDevice = new QLineEdit( temphb);
button = new QPushButton( i18n("Help..."), temphb );
@@ -339,8 +340,9 @@ void KSyncPrefsDialog::profileChanged( int item )
mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
mLocalTempFileAB->setText(prof->getLocalTempFileAB());
mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
+ mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
mPhoneDevice->setText(prof->getPhoneDevice());
mPhoneConnection->setText(prof->getPhoneConnection());
mPhoneModel->setText(prof->getPhoneModel());
@@ -470,8 +472,10 @@ void KSyncPrefsDialog::saveProfile()
prof->setIsLocalFileSync( mIsLocal->isChecked() );
prof->setIsPhoneSync( mIsPhone->isChecked() );
prof->setWriteBackFuture(mWriteBackFuture->isChecked());
prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
+
+ prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
prof->setPhoneDevice( mPhoneDevice->text() );
prof->setPhoneConnection( mPhoneConnection->text() );
prof->setPhoneModel( mPhoneModel->text() );
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 3060e78..d4e1559 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -122,7 +122,8 @@ class KSyncPrefsDialog : public KDialog
QSpinBox* mWriteBackFutureWeeks;
QCheckBox* mWriteBackExisting;
QCheckBox* mAskForPreferences;
QCheckBox* mShowSummaryAfterSync;
+ QCheckBox* mWriteContactToSIM;
};
#endif
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index e7c35fb..c599208 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -1,6 +1,6 @@
/*
- This file is part of KOrganizer.
+ This file is part of KDE-Pim/Pi.
Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -61,8 +61,9 @@ KSyncProfile* KSyncProfile::clone()
myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
myClone->setSyncPrefs( mSyncPrefs);
myClone->setIsLocalFileSync( mIsLocalFileSync );
myClone->setIsPhoneSync( mIsPhoneSync );
+ myClone->setWriteContactToSIM( mWriteContactToSIM );
myClone->setName( "noName" );
//myClone->setIdentifier( "noID" );
return myClone;
}
@@ -89,8 +90,9 @@ void KSyncProfile::setDefault()
mSyncPrefs = SYNC_PREF_ASK;
mIsLocalFileSync = true;
mName = "noName";
mIsPhoneSync = false;
+ mWriteContactToSIM = false;
mPhoneDevice = "/dev/ircomm";
mPhoneConnection = "irda";
mPhoneModel = "6310i";
}
@@ -121,8 +123,10 @@ void KSyncProfile::readConfig(KConfig *config )
mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
+ mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
+ mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
@@ -162,25 +166,12 @@ void KSyncProfile::writeConfig( KConfig * config )
config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
config->writeEntry( "AskForPreferences",mAskForPreferences );
config->writeEntry( "WriteBackExisting",mWriteBackExisting );
config->writeEntry( "WriteBackFuture",mWriteBackFuture );
+ config->writeEntry( "WriteBackFile",mWriteBackFile );
+ config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
config->writeEntry( "SyncPrefs", mSyncPrefs );
config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
config->writeEntry( "IsPhoneSync", mIsPhoneSync );
}
-/*
-class KPrefsItemInt : public KPrefsItem {
- public:
- KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0);
- virtual ~KPrefsItemInt() {}
-
- void setDefault();
- void readConfig(KConfig *);
- void writeConfig(KConfig *);
-
- private:
- int *mReference;
- int mDefault;
-};
-*/
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index a0cfb71..0039a4b 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -1,6 +1,6 @@
/*
- This file is part of KOrganizer.
+ This file is part of KDE-Pim/Pi.
Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -32,19 +32,9 @@
class KConfig;
-/**
- @short Class for storing a preferences setting
- @author Cornelius Schumacher
- @see KPref
- This class represents one preferences setting as used by @ref KPrefs.
- Subclasses of KPrefsItem implement storage functions for a certain type of
- setting. Normally you don't have to use this class directly. Use the special
- addItem() functions of KPrefs instead. If you subclass this class you will
- have to register instances with the function KPrefs::addItem().
-*/
class KSyncProfile : public QObject {
public:
KSyncProfile();
~KSyncProfile() ;
@@ -95,8 +85,10 @@ class KSyncProfile : public QObject {
void setWriteBackFuture( bool b ) { mWriteBackFuture = b;}
bool getWriteBackFuture( ) { return mWriteBackFuture;}
void setWriteBackFile( bool b ) { mWriteBackFile= b;}
bool getWriteBackFile( ) { return mWriteBackFile;}
+ void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;}
+ bool getWriteContactToSIM( ) { return mWriteContactToSIM;}
void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;}
bool getIncludeInRingSync( ) { return mIncludeInRingSync;}
void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;}
bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;}
@@ -133,7 +125,8 @@ class KSyncProfile : public QObject {
bool mAskForPreferences;
bool mShowSummaryAfterSync;
bool mIsLocalFileSync;
bool mIsPhoneSync;
+ bool mWriteContactToSIM;
};
#endif