summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-18 18:46:29 (UTC)
committer zautrix <zautrix>2004-09-18 18:46:29 (UTC)
commitec8099bf369e5b8327ca6cfd78b34366353e3abf (patch) (side-by-side diff)
tree551c515124f7b1c47b2860803efa3922f494f938
parent3f16c7aa0ab6badf304c537a6981ece743138821 (diff)
downloadkdepimpi-ec8099bf369e5b8327ca6cfd78b34366353e3abf.zip
kdepimpi-ec8099bf369e5b8327ca6cfd78b34366353e3abf.tar.gz
kdepimpi-ec8099bf369e5b8327ca6cfd78b34366353e3abf.tar.bz2
More AB sync
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addresseeview.cpp66
-rw-r--r--kabc/addresseeview.h18
-rw-r--r--kaddressbook/kabcore.cpp7
3 files changed, 89 insertions, 2 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index b4717d7..487e8a5 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -32,3 +32,8 @@
#include <qfile.h>
+#include <qvbox.h>
+#include <qlabel.h>
+#include <qwidget.h>
+#include <qlayout.h>
#include <qapplication.h>
+#include <qpushbutton.h>
@@ -401 +406,62 @@ void AddresseeView::addTag(const QString & tag,const QString & text)
}
+
+AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name,
+ true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false)
+{
+ findButton( Close )->setText( i18n("Cancel Sync"));
+ findButton( Ok )->setText( i18n("Remote"));
+ findButton( User1 )->setText( i18n("Local"));
+ QWidget* topframe = new QWidget( this );
+ //QVBox* topframe = new QVBox( this );
+ setMainWidget( topframe );
+ QBoxLayout* bl;
+ if ( QApplication::desktop()->width() < 640 ) {
+ bl = new QVBoxLayout( topframe );
+
+ } else {
+ bl = new QHBoxLayout( topframe );
+
+ }
+ QVBox* subframe = new QVBox( topframe );
+ bl->addWidget(subframe );
+ QLabel* lab = new QLabel( i18n("Local Addressee"), subframe );
+ AddresseeView * av = new AddresseeView( subframe );
+ av->setAddressee( loc );
+ subframe = new QVBox( topframe );
+ bl->addWidget(subframe );
+ lab = new QLabel( i18n("Remote Addressee"), subframe );
+ av = new AddresseeView( subframe );
+ av->setAddressee( rem );
+
+ QObject::connect(findButton( Ok ),SIGNAL(clicked()),
+ SLOT(slot_remote()));
+ QObject::connect(this,SIGNAL(user1Clicked()),
+ SLOT(slot_local()));
+#ifndef DESKTOP_VERSION
+ showMaximized();
+#else
+ resize ( 640, 400 );
+#endif
+}
+
+int AddresseeChooser::executeD( bool local )
+{
+ mSyncResult = 3;
+ if ( local )
+ findButton( User1 )->setFocus();
+ else
+ findButton( Ok )->setFocus();
+ exec();
+ qDebug("returning %d ",mSyncResult );
+ return mSyncResult;
+}
+void AddresseeChooser::slot_remote()
+{
+ mSyncResult = 2;
+ accept();
+}
+void AddresseeChooser::slot_local()
+{
+ mSyncResult = 1;
+ accept();
+}
diff --git a/kabc/addresseeview.h b/kabc/addresseeview.h
index 1865fc4..689d997 100644
--- a/kabc/addresseeview.h
+++ b/kabc/addresseeview.h
@@ -25,2 +25,3 @@
#include <kabc/addressee.h>
+#include <kdialogbase.h>
@@ -56,2 +57,19 @@ class AddresseeView : public QTextBrowser
};
+class AddresseeChooser : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent = 0, const char *name = 0 );
+
+ int executeD( bool local );
+
+ private:
+ int mSyncResult;
+
+ private slots:
+ void slot_remote();
+ void slot_local();
+
+};
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 74c10d2..b1a951c 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2654,5 +2654,7 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
qDebug("conflict! ************************************** ");
- result = 1;
+ {
+ KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this );
+ result = acd.executeD(localIsNew);
return result;
-
+ }
break;
@@ -2727,2 +2729,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
}
+ fullDateRange = true; // debug only!
if ( fullDateRange )