summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configdialog.cpp25
-rw-r--r--microkde/kresources/configdialog.h3
-rw-r--r--microkde/kresources/configwidget.h2
3 files changed, 26 insertions, 4 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp
index 48d9137..0fc199c 100644
--- a/microkde/kresources/configdialog.cpp
+++ b/microkde/kresources/configdialog.cpp
@@ -45,7 +45,7 @@ using namespace KRES;
ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
/*const QString& type,*/ Resource* resource, /*KConfig *config, */const char *name )
: KDialogBase( parent, name, true, i18n( "Resource Configuration" ),
- Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource )
+ Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false)
{
Factory *factory = Factory::self( resourceFamily );
@@ -82,11 +82,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily,
mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox );
if ( mConfigWidget ) {
+ connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ),
+ SLOT( setReadOnly( bool ) ) );
+ connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ),
+ SLOT( setPersistentReadOnly( bool ) ) );
mConfigWidget->setInEditMode( false );
mConfigWidget->loadSettings( mResource );
mConfigWidget->show();
- connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ),
- SLOT( setReadOnly( bool ) ) );
+
}
connect( mName, SIGNAL( textChanged(const QString &)),
@@ -112,7 +115,21 @@ void ConfigDialog::slotNameChanged( const QString &text)
void ConfigDialog::setReadOnly( bool value )
{
- mReadOnly->setChecked( value );
+ if (mPersistentReadOnly == false)
+ mReadOnly->setChecked( value );
+ else
+ mReadOnly->setChecked( true );
+}
+
+void ConfigDialog::setPersistentReadOnly( bool value )
+{
+ mPersistentReadOnly = value;
+
+ if (value == true)
+ setReadOnly( true );
+
+ mReadOnly->setEnabled( !value );
+
}
void ConfigDialog::accept()
diff --git a/microkde/kresources/configdialog.h b/microkde/kresources/configdialog.h
index 6acc5d9..ba66f8e 100644
--- a/microkde/kresources/configdialog.h
+++ b/microkde/kresources/configdialog.h
@@ -45,6 +45,7 @@ class ConfigDialog : public KDialogBase
protected slots:
void accept();
void setReadOnly( bool value );
+ void setPersistentReadOnly( bool value );
void slotNameChanged( const QString &text);
private:
@@ -53,6 +54,8 @@ class ConfigDialog : public KDialogBase
KLineEdit *mName;
QCheckBox *mReadOnly;
+//US add a persistent readonly flag. We need that for opie and qtopia addressbooks.
+ bool mPersistentReadOnly;
};
}
diff --git a/microkde/kresources/configwidget.h b/microkde/kresources/configwidget.h
index 04dd696..b97e278 100644
--- a/microkde/kresources/configwidget.h
+++ b/microkde/kresources/configwidget.h
@@ -50,6 +50,8 @@ public slots:
signals:
void setReadOnly( bool value );
+ void setPersistentReadOnly( bool value );
+
protected:
Resource* mResource;