-rw-r--r-- | microkde/kresources/configdialog.cpp | 5 | ||||
-rw-r--r-- | microkde/kresources/configdialog.h | 1 | ||||
-rw-r--r-- | microkde/kresources/resource.cpp | 14 | ||||
-rw-r--r-- | microkde/kresources/resource.h | 2 |
4 files changed, 20 insertions, 2 deletions
diff --git a/microkde/kresources/configdialog.cpp b/microkde/kresources/configdialog.cpp index f8240f9..030b547 100644 --- a/microkde/kresources/configdialog.cpp +++ b/microkde/kresources/configdialog.cpp | |||
@@ -75,8 +75,12 @@ ConfigDialog::ConfigDialog( QWidget *parent, const QString& resourceFamily, | |||
75 | mName = new KLineEdit( generalGroupBox ); | 75 | mName = new KLineEdit( generalGroupBox ); |
76 | 76 | ||
77 | if (!mResource->isSyncable()) { | 77 | if (!mResource->isSyncable()) { |
78 | new QLabel("", generalGroupBox ); | ||
78 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); | 79 | mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox ); |
79 | mReadOnly->setChecked( mResource->readOnly() ); | 80 | mReadOnly->setChecked( mResource->readOnly() ); |
81 | new QLabel("", generalGroupBox ); | ||
82 | mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox ); | ||
83 | mIncludeInSync->setChecked( mResource->includeInSync() ); | ||
80 | } | 84 | } |
81 | 85 | ||
82 | mName->setText( mResource->resourceName() ); | 86 | mName->setText( mResource->resourceName() ); |
@@ -220,6 +224,7 @@ void ConfigDialog::accept() | |||
220 | mResource->setResourceName( mName->text() ); | 224 | mResource->setResourceName( mName->text() ); |
221 | if (!mResource->isSyncable()) | 225 | if (!mResource->isSyncable()) |
222 | mResource->setReadOnly( mReadOnly->isChecked() ); | 226 | mResource->setReadOnly( mReadOnly->isChecked() ); |
227 | mResource->setIncludeInSync( mIncludeInSync->isChecked() ); | ||
223 | 228 | ||
224 | if ( mConfigWidget ) { | 229 | if ( mConfigWidget ) { |
225 | // First save generic information | 230 | // First save generic information |
diff --git a/microkde/kresources/configdialog.h b/microkde/kresources/configdialog.h index 63cd4e9..ed3ecab 100644 --- a/microkde/kresources/configdialog.h +++ b/microkde/kresources/configdialog.h | |||
@@ -58,6 +58,7 @@ class ConfigDialog : public KDialogBase | |||
58 | 58 | ||
59 | KLineEdit *mName; | 59 | KLineEdit *mName; |
60 | QCheckBox *mReadOnly; | 60 | QCheckBox *mReadOnly; |
61 | QCheckBox *mIncludeInSync; | ||
61 | //US add a persistent readonly flag. We need that for opie and qtopia addressbooks. | 62 | //US add a persistent readonly flag. We need that for opie and qtopia addressbooks. |
62 | bool mPersistentReadOnly; | 63 | bool mPersistentReadOnly; |
63 | }; | 64 | }; |
diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp index 4f69540..f79bcd0 100644 --- a/microkde/kresources/resource.cpp +++ b/microkde/kresources/resource.cpp | |||
@@ -39,6 +39,7 @@ class Resource::ResourcePrivate | |||
39 | QString mType; | 39 | QString mType; |
40 | QString mIdentifier; | 40 | QString mIdentifier; |
41 | bool mReadOnly; | 41 | bool mReadOnly; |
42 | bool mIncludeInSync; | ||
42 | QString mName; | 43 | QString mName; |
43 | bool mActive; | 44 | bool mActive; |
44 | bool mIsOpen; | 45 | bool mIsOpen; |
@@ -63,12 +64,14 @@ Resource::Resource( const KConfig* config ) | |||
63 | d->mType = cfg->readEntry( "ResourceType" ); | 64 | d->mType = cfg->readEntry( "ResourceType" ); |
64 | d->mName = cfg->readEntry( "ResourceName" ); | 65 | d->mName = cfg->readEntry( "ResourceName" ); |
65 | d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false ); | 66 | d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false ); |
67 | d->mIncludeInSync = cfg->readBoolEntry( "ResourceIncludeInSync", true );; | ||
66 | d->mActive = cfg->readBoolEntry( "ResourceIsActive", true ); | 68 | d->mActive = cfg->readBoolEntry( "ResourceIsActive", true ); |
67 | d->mIdentifier = cfg->readEntry( "ResourceIdentifier" ); | 69 | d->mIdentifier = cfg->readEntry( "ResourceIdentifier" ); |
68 | } else { | 70 | } else { |
69 | d->mType = "type"; | 71 | d->mType = "type"; |
70 | d->mName = "resource-name"; | 72 | d->mName = "resource-name"; |
71 | d->mReadOnly = false; | 73 | d->mReadOnly = false; |
74 | d->mIncludeInSync = true; | ||
72 | d->mActive = true; | 75 | d->mActive = true; |
73 | d->mIdentifier = KApplication::randomString( 10 ); | 76 | d->mIdentifier = KApplication::randomString( 10 ); |
74 | } | 77 | } |
@@ -82,11 +85,10 @@ Resource::~Resource() | |||
82 | 85 | ||
83 | void Resource::writeConfig( KConfig* config ) | 86 | void Resource::writeConfig( KConfig* config ) |
84 | { | 87 | { |
85 | |||
86 | |||
87 | config->writeEntry( "ResourceType", d->mType ); | 88 | config->writeEntry( "ResourceType", d->mType ); |
88 | config->writeEntry( "ResourceName", d->mName ); | 89 | config->writeEntry( "ResourceName", d->mName ); |
89 | config->writeEntry( "ResourceIsReadOnly", d->mReadOnly ); | 90 | config->writeEntry( "ResourceIsReadOnly", d->mReadOnly ); |
91 | config->writeEntry( "ResourceIncludeInSync", d->mIncludeInSync ); | ||
90 | config->writeEntry( "ResourceIsActive", d->mActive ); | 92 | config->writeEntry( "ResourceIsActive", d->mActive ); |
91 | config->writeEntry( "ResourceIdentifier", d->mIdentifier ); | 93 | config->writeEntry( "ResourceIdentifier", d->mIdentifier ); |
92 | } | 94 | } |
@@ -149,6 +151,14 @@ QString Resource::type() const | |||
149 | return d->mType; | 151 | return d->mType; |
150 | } | 152 | } |
151 | 153 | ||
154 | void Resource::setIncludeInSync( bool value ) | ||
155 | { | ||
156 | d->mIncludeInSync = value; | ||
157 | } | ||
158 | bool Resource::includeInSync() const | ||
159 | { | ||
160 | return d->mIncludeInSync; | ||
161 | } | ||
152 | void Resource::setReadOnly( bool value ) | 162 | void Resource::setReadOnly( bool value ) |
153 | { | 163 | { |
154 | d->mReadOnly = value; | 164 | d->mReadOnly = value; |
diff --git a/microkde/kresources/resource.h b/microkde/kresources/resource.h index 580b5d1..70b5613 100644 --- a/microkde/kresources/resource.h +++ b/microkde/kresources/resource.h | |||
@@ -310,6 +310,8 @@ class Resource : public QObject | |||
310 | */ | 310 | */ |
311 | virtual bool readOnly() const; | 311 | virtual bool readOnly() const; |
312 | 312 | ||
313 | void setIncludeInSync( bool value ); | ||
314 | bool includeInSync() const; | ||
313 | /** | 315 | /** |
314 | * Set the name of resource.You can override this method, | 316 | * Set the name of resource.You can override this method, |
315 | * but also remember to call Resource::setResourceName(). | 317 | * but also remember to call Resource::setResourceName(). |