summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-19 00:37:51 (UTC)
committer zautrix <zautrix>2004-10-19 00:37:51 (UTC)
commit0f35c6660ed4c304b7c75f2a607f0f27ba436601 (patch) (side-by-side diff)
treeb5e43d5bb00528d40eb0f94eeef5cf7d6cf00995
parent9fd09e806dfe3df5abdf70991b6ec170fed51078 (diff)
downloadkdepimpi-0f35c6660ed4c304b7c75f2a607f0f27ba436601.zip
kdepimpi-0f35c6660ed4c304b7c75f2a607f0f27ba436601.tar.gz
kdepimpi-0f35c6660ed4c304b7c75f2a607f0f27ba436601.tar.bz2
added pisync auto start
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--libkdepim/kpimprefs.cpp2
-rw-r--r--libkdepim/kpimprefs.h2
-rw-r--r--libkdepim/ksyncmanager.cpp87
-rw-r--r--libkdepim/ksyncmanager.h2
5 files changed, 64 insertions, 31 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c3e9f75..02ca523 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -275,3 +275,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
#endif
-
+
}
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp
index c21ebaa..a05e65f 100644
--- a/libkdepim/kpimprefs.cpp
+++ b/libkdepim/kpimprefs.cpp
@@ -49,2 +49,4 @@ KPimPrefs::KPimPrefs( const QString &name ) :
addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" );
+ addItemBool("PassiveSyncWithDesktop",&mPassiveSyncWithDesktop,false );
+ addItemBool("PassiveSyncAutoStart",&mPassiveSyncAutoStart,false );
addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3);
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h
index 9346f7d..c177bd6 100644
--- a/libkdepim/kpimprefs.h
+++ b/libkdepim/kpimprefs.h
@@ -59,2 +59,4 @@ class KPimPrefs : public KPrefs
QString mPassiveSyncPw;
+ bool mPassiveSyncWithDesktop;
+ bool mPassiveSyncAutoStart;
int mRingSyncAlgoPrefs;
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 40d8e47..75c0b2b 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -50,2 +50,3 @@
#include <qlabel.h>
+#include <qcheckbox.h>
@@ -70,2 +71,4 @@ KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, Targ
bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
+ if ( mPrefs->mPassiveSyncAutoStart )
+ enableQuick( false );
@@ -269,33 +272,57 @@ void KSyncManager::slotSyncMenu( int action )
-void KSyncManager::enableQuick()
+void KSyncManager::enableQuick( bool ask )
{
- QDialog dia ( 0, "input-dialog", true );
- QLineEdit lab ( &dia );
- QVBoxLayout lay( &dia );
- lab.setText( mPrefs->mPassiveSyncPort );
- lay.setMargin(7);
- lay.setSpacing(7);
- int po = 9197+mTargetApp;
- QLabel label ( i18n("Port number (Default: %1)").arg(po), &dia );
- lay.addWidget( &label);
- lay.addWidget( &lab);
-
- QLineEdit lepw ( &dia );
- lepw.setText( mPrefs->mPassiveSyncPw );
- QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia );
- lay.addWidget( &label2);
- lay.addWidget( &lepw);
- dia.setFixedSize( 230,80 );
- dia.setCaption( i18n("Enter port for Pi-Sync") );
- QPushButton pb ( "OK", &dia);
- lay.addWidget( &pb );
- connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
- dia.show();
- if ( ! dia.exec() )
- return;
- dia.hide();
- qApp->processEvents();
- mPrefs->mPassiveSyncPw = lepw.text();
- mPrefs->mPassiveSyncPort = lab.text();
+ bool autoStart;
+ if ( ask ) {
+ QDialog dia ( 0, "input-dialog", true );
+ QLineEdit lab ( &dia );
+ QVBoxLayout lay( &dia );
+ lab.setText( mPrefs->mPassiveSyncPort );
+ lay.setMargin(7);
+ lay.setSpacing(7);
+ int po = 9197+mTargetApp;
+ QLabel label ( i18n("Port number (Default: %1)").arg(po), &dia );
+ lay.addWidget( &label);
+ lay.addWidget( &lab);
+
+ QLineEdit lepw ( &dia );
+ lepw.setText( mPrefs->mPassiveSyncPw );
+ QLabel label2 ( i18n("Password to enable\naccess from remote:"), &dia );
+ lay.addWidget( &label2);
+ lay.addWidget( &lepw);
+ QCheckBox autostart(i18n("Automatically start\nat application startup"), &dia );
+ lay.addWidget( &autostart);
+ autostart.setChecked( mPrefs->mPassiveSyncAutoStart );
+#ifdef DESKTOP_VERSION
+#ifdef _WIN32_
+ QCheckBox syncdesktop( i18n("Automatically sync with Outlook\nwhen receiving sync request"),&dia );
+#else
+ QCheckBox syncdesktop( i18n("Automatically sync with KDE-Desktop\nwhen receiving sync request"),&dia );
+#endif
+ lay.addWidget( &syncdesktop);
+#else
+ QCheckBox syncdesktop( i18n("Automatically sync\nwith KDE-Desktop"),&dia );
+ syncdesktop.hide();
+#endif
+ syncdesktop.setChecked( mPrefs->mPassiveSyncWithDesktop );
+
+ dia.setFixedSize( 230,120 );
+ dia.setCaption( i18n("Enter port for Pi-Sync") );
+ QPushButton pb ( "OK", &dia);
+ lay.addWidget( &pb );
+ connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
+ dia.show();
+ if ( ! dia.exec() )
+ return;
+ dia.hide();
+ qApp->processEvents();
+ mPrefs->mPassiveSyncPw = lepw.text();
+ mPrefs->mPassiveSyncPort = lab.text();
+ autoStart = autostart.isChecked();
+ mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked();
+ }
+ else
+ autoStart = mPrefs->mPassiveSyncAutoStart;
bool ok;
+ mPrefs->mPassiveSyncAutoStart = false;
Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok);
@@ -315,2 +342,4 @@ void KSyncManager::enableQuick()
}
+
+ mPrefs->mPassiveSyncAutoStart = autoStart;
connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) );
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index ffb1ea4..7b9c499 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -122,2 +122,3 @@ class KSyncManager : public QObject
QString syncFileName();
+ void enableQuick( bool ask = true);
@@ -162,3 +163,2 @@ class KSyncManager : public QObject
KServerSocket * mServerSocket;
- void enableQuick();
KPimPrefs* mPrefs;