author | ulf69 <ulf69> | 2004-07-09 07:58:23 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-09 07:58:23 (UTC) |
commit | 82dabc14cc446fb8c0486cd4c32064e3866d2be9 (patch) (unidiff) | |
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 | 23 | ||||
-rw-r--r-- | microkde/kresources/configdialog.h | 3 | ||||
-rw-r--r-- | microkde/kresources/configwidget.h | 2 |
3 files changed, 25 insertions, 3 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; | |||
45 | ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | 45 | ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, |
46 | /*const QString& type,*/ Resource* resource, /*KConfig *config, */const char *name ) | 46 | /*const QString& type,*/ Resource* resource, /*KConfig *config, */const char *name ) |
47 | : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), | 47 | : KDialogBase( parent, name, true, i18n( "Resource Configuration" ), |
48 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ) | 48 | Ok|Cancel, Ok, true )/*, mConfig( config )*/, mResource( resource ), mPersistentReadOnly(false) |
49 | { | 49 | { |
50 | Factory *factory = Factory::self( resourceFamily ); | 50 | Factory *factory = Factory::self( resourceFamily ); |
51 | 51 | ||
@@ -82,11 +82,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
82 | 82 | ||
83 | mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); | 83 | mConfigWidget = factory->configWidget( resource->type(), resourceGroupBox ); |
84 | if ( mConfigWidget ) { | 84 | if ( mConfigWidget ) { |
85 | connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), | ||
86 | SLOT( setReadOnly( bool ) ) ); | ||
87 | connect( mConfigWidget, SIGNAL( setPersistentReadOnly( bool ) ), | ||
88 | SLOT( setPersistentReadOnly( bool ) ) ); | ||
85 | mConfigWidget->setInEditMode( false ); | 89 | mConfigWidget->setInEditMode( false ); |
86 | mConfigWidget->loadSettings( mResource ); | 90 | mConfigWidget->loadSettings( mResource ); |
87 | mConfigWidget->show(); | 91 | mConfigWidget->show(); |
88 | connect( mConfigWidget, SIGNAL( setReadOnly( bool ) ), | 92 | |
89 | SLOT( setReadOnly( bool ) ) ); | ||
90 | } | 93 | } |
91 | 94 | ||
92 | connect( mName, SIGNAL( textChanged(const QString &)), | 95 | connect( mName, SIGNAL( textChanged(const QString &)), |
@@ -112,7 +115,21 @@ void ConfigDialog::slotNameChanged( const QString &text) | |||
112 | 115 | ||
113 | void ConfigDialog::setReadOnly( bool value ) | 116 | void ConfigDialog::setReadOnly( bool value ) |
114 | { | 117 | { |
118 | if (mPersistentReadOnly == false) | ||
115 | mReadOnly->setChecked( value ); | 119 | mReadOnly->setChecked( value ); |
120 | else | ||
121 | mReadOnly->setChecked( true ); | ||
122 | } | ||
123 | |||
124 | void ConfigDialog::setPersistentReadOnly( bool value ) | ||
125 | { | ||
126 | mPersistentReadOnly = value; | ||
127 | |||
128 | if (value == true) | ||
129 | setReadOnly( true ); | ||
130 | |||
131 | mReadOnly->setEnabled( !value ); | ||
132 | |||
116 | } | 133 | } |
117 | 134 | ||
118 | void ConfigDialog::accept() | 135 | 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 | |||
45 | protected slots: | 45 | protected slots: |
46 | void accept(); | 46 | void accept(); |
47 | void setReadOnly( bool value ); | 47 | void setReadOnly( bool value ); |
48 | void setPersistentReadOnly( bool value ); | ||
48 | void slotNameChanged( const QString &text); | 49 | void slotNameChanged( const QString &text); |
49 | 50 | ||
50 | private: | 51 | private: |
@@ -53,6 +54,8 @@ class ConfigDialog : public KDialogBase | |||
53 | 54 | ||
54 | KLineEdit *mName; | 55 | KLineEdit *mName; |
55 | QCheckBox *mReadOnly; | 56 | QCheckBox *mReadOnly; |
57 | //US add a persistent readonly flag. We need that for opie and qtopia addressbooks. | ||
58 | bool mPersistentReadOnly; | ||
56 | }; | 59 | }; |
57 | 60 | ||
58 | } | 61 | } |
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: | |||
50 | 50 | ||
51 | signals: | 51 | signals: |
52 | void setReadOnly( bool value ); | 52 | void setReadOnly( bool value ); |
53 | void setPersistentReadOnly( bool value ); | ||
54 | |||
53 | 55 | ||
54 | protected: | 56 | protected: |
55 | Resource* mResource; | 57 | Resource* mResource; |