summaryrefslogtreecommitdiffabout
path: root/microkde/kresources
authorulf69 <ulf69>2004-08-04 22:45:22 (UTC)
committer ulf69 <ulf69>2004-08-04 22:45:22 (UTC)
commitc3a704f5acda9cf9fee66e5c0b1b864f3b7dd852 (patch) (side-by-side diff)
treedc59744a6d59ba241e793ce051da485d0bf16d06 /microkde/kresources
parentb83866e08ddcc5cb2734801977927f48b53a2e1c (diff)
downloadkdepimpi-c3a704f5acda9cf9fee66e5c0b1b864f3b7dd852.zip
kdepimpi-c3a704f5acda9cf9fee66e5c0b1b864f3b7dd852.tar.gz
kdepimpi-c3a704f5acda9cf9fee66e5c0b1b864f3b7dd852.tar.bz2
final changes for addressbook sync config dialog
Diffstat (limited to 'microkde/kresources') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kresources/configdialog.cpp78
-rw-r--r--microkde/kresources/configdialog.h4
-rw-r--r--microkde/kresources/configpage.cpp13
-rw-r--r--microkde/kresources/factory.cpp4
-rw-r--r--microkde/kresources/factory.h5
-rw-r--r--microkde/kresources/resource.h8
-rw-r--r--microkde/kresources/syncwidget.h10
7 files changed, 96 insertions, 26 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp
index 90febca..f8240f9 100644
--- a/microkde/kresources/configdialog.cpp
+++ b/microkde/kresources/configdialog.cpp
@@ -31,4 +31,6 @@
#include <qpushbutton.h>
+#include <qvbox.h>
#include <qcheckbox.h>
+#include <qscrollview.h>
@@ -48,3 +50,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
: KDialogBase( parent, name, true, resource->isSyncable()?i18n( "Sync Profile Configuration" ):i18n( "Resource Configuration" ),
- Ok|Cancel, Ok, true )/*, mConfig( config )*/, mSyncWidget(0), mResource( resource ), mPersistentReadOnly(false)
+ Ok|Cancel, Ok, true )/*, mConfig( config )*/, mSyncWidget_Settings(0), mSyncWidget_Conflicts(0),mSyncWidget_Remote(0), mResource( resource ), mPersistentReadOnly(false)
{
@@ -56,4 +58,8 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
-//US QFrame *main = makeMainWidget();
- QFrame *main = plainPage();
+ QFrame *main;
+
+ if (!mResource->isSyncable())
+ main = plainPage();
+ else
+ main = addPage("Profile");
@@ -61,2 +67,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
+
QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main );
@@ -100,10 +107,43 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
{
- QGroupBox *syncGroupBox = new QGroupBox( 2, Qt::Horizontal, main );
- syncGroupBox->layout()->setSpacing( spacingHint());
- syncGroupBox->setTitle( i18n( "Syncronize Preferences" ) );
- mainLayout->addWidget( syncGroupBox );
+ SyncWidgetContainer* c = factory->syncWidgetContainer( resource->type() );
- mainLayout->addStretch();
+ QFrame* syncPage = addPage("Settings");
+ QVBoxLayout *syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() );
+ mSyncWidget_Settings = c->generateSettingsTab(syncPage);
+ syncLayout->addWidget( mSyncWidget_Settings );
+
+ syncPage = addPage("Conflicts");
+ syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() );
+ mSyncWidget_Conflicts = c->generateConflictsTab(syncPage);
+ syncLayout->addWidget( mSyncWidget_Conflicts );
+
+ syncPage = addPage("Remote");
+ syncLayout = new QVBoxLayout( syncPage, 0, spacingHint() );
+ mSyncWidget_Remote = c->generateRemoteTab(syncPage);
+ syncLayout->addWidget( mSyncWidget_Remote );
+
+
+ mSyncWidget_Settings->setInEditMode( false );
+ mSyncWidget_Settings->loadSettings( mResource );
+ mSyncWidget_Settings->show();
- mSyncWidget = factory->syncWidget( resource->type(), syncGroupBox );
+ mSyncWidget_Conflicts->setInEditMode( false );
+ mSyncWidget_Conflicts->loadSettings( mResource );
+ mSyncWidget_Conflicts->show();
+
+ mSyncWidget_Remote->setInEditMode( false );
+ mSyncWidget_Remote->loadSettings( mResource );
+ mSyncWidget_Remote->show();
+
+ delete c;
+
+// QGroupBox *syncGroupBox = new QGroupBox( 2, Qt::Horizontal, syncPage );
+// syncGroupBox->layout()->setSpacing( spacingHint());
+// syncGroupBox->setTitle( i18n( "Syncronize Preferences" ) );
+// syncLayout->addWidget( syncGroupBox );
+
+// syncLayout->addStretch();
+/*US
+ mSyncWidget = factory->syncWidget( resource->type(), syncPage );
+ syncLayout->addWidget( mSyncWidget );
if ( mSyncWidget ) {
@@ -113,2 +153,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
}
+ */
}
@@ -133,4 +174,8 @@ void ConfigDialog::setInEditMode( bool value )
- if ( mSyncWidget )
- mSyncWidget->setInEditMode( value );
+ if ( mSyncWidget_Settings )
+ mSyncWidget_Settings->setInEditMode( value );
+ if ( mSyncWidget_Conflicts )
+ mSyncWidget_Conflicts->setInEditMode( value );
+ if ( mSyncWidget_Remote )
+ mSyncWidget_Remote->setInEditMode( value );
@@ -184,7 +229,8 @@ void ConfigDialog::accept()
- if ( mSyncWidget ) {
- // First save generic information
- // Also save setting of specific resource type
- mSyncWidget->saveSettings( mResource );
- }
+ if ( mSyncWidget_Settings )
+ mSyncWidget_Settings->saveSettings( mResource );
+ if ( mSyncWidget_Conflicts )
+ mSyncWidget_Conflicts->saveSettings( mResource );
+ if ( mSyncWidget_Remote )
+ mSyncWidget_Remote->saveSettings( mResource );
diff --git a/microkde/kresources/configdialog.h b/microkde/kresources/configdialog.h
index b629347..63cd4e9 100644
--- a/microkde/kresources/configdialog.h
+++ b/microkde/kresources/configdialog.h
@@ -53,3 +53,5 @@ class ConfigDialog : public KDialogBase
ConfigWidget *mConfigWidget;
- SyncWidget *mSyncWidget;
+ SyncWidget *mSyncWidget_Settings;
+ SyncWidget *mSyncWidget_Conflicts;
+ SyncWidget *mSyncWidget_Remote;
Resource* mResource;
diff --git a/microkde/kresources/configpage.cpp b/microkde/kresources/configpage.cpp
index 2fe021d..1a3a22c 100644
--- a/microkde/kresources/configpage.cpp
+++ b/microkde/kresources/configpage.cpp
@@ -207,2 +207,4 @@ void ConfigPage::load()
info.mConfig = new KConfig( locateLocal( "config", "kcalrc" ) );
+ } else if ( family == syncfamily && QFile::exists( configDir + "/kabcsyncrc" ) ) {
+ info.mConfig = new KConfig( locateLocal( "config", "kabcsyncrc" ) );
} else {
@@ -313,3 +315,3 @@ void ConfigPage::slotAdd()
desc = QInputDialog::getItem( i18n( "Sync Configuration" ),
- i18n( "Please select resource type for new sync profile:" ), descs, 0,
+ i18n( "Select resource type for the new sync profile:" ), descs, 0,
false, &ok, this );
@@ -319,3 +321,3 @@ void ConfigPage::slotAdd()
desc = QInputDialog::getItem( i18n( "Resource Configuration" ),
- i18n( "Please select type of the new resource:" ), descs, 0,
+ i18n( "Select type of the new resource:" ), descs, 0,
false, &ok, this );
@@ -336,3 +338,10 @@ void ConfigPage::slotAdd()
+ if (mFamily == syncfamily)
+ {
+ resource->setResourceName( type + "-syncprofile" );
+ }
+ else
+ {
resource->setResourceName( type + "-resource" );
+ }
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 7a5c2f6..e44fce3 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -189,3 +189,3 @@ ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent )
-SyncWidget *Factory::syncWidget( const QString& type, QWidget *parent )
+SyncWidgetContainer *Factory::syncWidgetContainer( const QString& type )
{
@@ -212,3 +212,3 @@ SyncWidget *Factory::syncWidget( const QString& type, QWidget *parent )
- SyncWidget *wdg = pluginFactory->syncWidget( parent );
+ SyncWidgetContainer *wdg = pluginFactory->syncWidgetContainer( );
if ( !wdg ) {
diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h
index a265bc8..0e4231b 100644
--- a/microkde/kresources/factory.h
+++ b/microkde/kresources/factory.h
@@ -36,2 +36,5 @@ namespace KRES {
+class SyncWidgetContainer;
+class ConfigWidget;
+
//US
@@ -94,3 +97,3 @@ class Factory
*/
- SyncWidget *syncWidget( const QString& type, QWidget *parent = 0 );
+ SyncWidgetContainer *syncWidgetContainer( const QString& type );
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h
index c9202c9..580b5d1 100644
--- a/microkde/kresources/resource.h
+++ b/microkde/kresources/resource.h
@@ -42,3 +42,3 @@ namespace KRES {
class ConfigWidget;
-class SyncWidget;
+class SyncWidgetContainer;
@@ -380,3 +380,3 @@ class PluginFactoryBase : public KLibFactory
- virtual SyncWidget *syncWidget( QWidget *parent ) = 0;
+ virtual SyncWidgetContainer *syncWidgetContainer() = 0;
@@ -404,5 +404,5 @@ class PluginFactory : public PluginFactoryBase
- virtual SyncWidget *syncWidget( QWidget *parent )
+ SyncWidgetContainer *syncWidgetContainer()
{
- return new TS( parent );
+ return new TS();
}
diff --git a/microkde/kresources/syncwidget.h b/microkde/kresources/syncwidget.h
index e94252c..6632b69 100644
--- a/microkde/kresources/syncwidget.h
+++ b/microkde/kresources/syncwidget.h
@@ -60,2 +60,12 @@ protected:
+class SyncWidgetContainer : public QObject
+{
+ Q_OBJECT
+
+public:
+ virtual SyncWidget* generateSettingsTab(QWidget *parent = 0, const char *name = 0) = 0;
+ virtual SyncWidget* generateConflictsTab(QWidget *parent = 0, const char *name = 0) = 0;
+ virtual SyncWidget* generateRemoteTab(QWidget *parent = 0, const char *name = 0) = 0;
+};
+
}