author | ulf69 <ulf69> | 2004-07-09 07:58:23 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-09 07:58:23 (UTC) |
commit | 82dabc14cc446fb8c0486cd4c32064e3866d2be9 (patch) (side-by-side diff) | |
tree | 189f55a1b7184900f7237314bce06121d12ec980 /microkde | |
parent | 3729f356c14ecf49bf5484ab2662736e5aa5d53a (diff) | |
download | kdepimpi-82dabc14cc446fb8c0486cd4c32064e3866d2be9.zip kdepimpi-82dabc14cc446fb8c0486cd4c32064e3866d2be9.tar.gz kdepimpi-82dabc14cc446fb8c0486cd4c32064e3866d2be9.tar.bz2 |
added support for a persistent readonly flags
-rw-r--r-- | microkde/kresources/configdialog.cpp | 25 | ||||
-rw-r--r-- | microkde/kresources/configdialog.h | 3 | ||||
-rw-r--r-- | microkde/kresources/configwidget.h | 2 |
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 @@ -47,3 +47,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, : 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) { @@ -84,2 +84,6 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, if ( mConfigWidget ) { + connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), + SLOT( setReadOnly( bool ) ) ); + connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), + SLOT( setPersistentReadOnly( bool ) ) ); mConfigWidget->setInEditMode( false ); @@ -87,4 +91,3 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, mConfigWidget->show(); - connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), - SLOT( setReadOnly( bool ) ) ); + } @@ -114,3 +117,17 @@ 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 ); + } 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 @@ -47,2 +47,3 @@ class ConfigDialog : public KDialogBase void setReadOnly( bool value ); + void setPersistentReadOnly( bool value ); void slotNameChanged( const QString &text); @@ -55,2 +56,4 @@ class ConfigDialog : public KDialogBase 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 @@ -52,2 +52,4 @@ signals: void setReadOnly( bool value ); + void setPersistentReadOnly( bool value ); + |