Diffstat (limited to 'microkde/kresources/configdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/configdialog.cpp | 78 |
1 files changed, 62 insertions, 16 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 @@ -30,6 +30,8 @@ #include <qlayout.h> #include <qpushbutton.h> +#include <qvbox.h> #include <qcheckbox.h> +#include <qscrollview.h> #include <kbuttonbox.h> @@ -47,5 +49,5 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, Resource* resource, const char *name ) : 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) { @@ -55,9 +57,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, resize( KMIN(KGlobal::getDesktopWidth(), 250), KMIN(KGlobal::getDesktopHeight(), 240)); -//US QFrame *main = makeMainWidget(); - QFrame *main = plainPage(); + QFrame *main; + + if (!mResource->isSyncable()) + main = plainPage(); + else + main = addPage("Profile"); QVBoxLayout *mainLayout = new QVBoxLayout( main, 0, spacingHint() ); + QGroupBox *generalGroupBox = new QGroupBox( 2, Qt::Horizontal, main ); generalGroupBox->layout()->setSpacing( spacingHint() ); @@ -99,12 +106,45 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, if (mResource->isSyncable()) { - 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() ); + + 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 ); + - mainLayout->addStretch(); + 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 ) { mSyncWidget->setInEditMode( false ); @@ -112,4 +152,5 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, mSyncWidget->show(); } + */ } @@ -132,6 +173,10 @@ void ConfigDialog::setInEditMode( bool value ) mConfigWidget->setInEditMode( 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 ); } @@ -183,9 +228,10 @@ 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 ); |