summaryrefslogtreecommitdiffabout
path: root/microkde/kresources
authorzautrix <zautrix>2004-10-13 14:23:28 (UTC)
committer zautrix <zautrix>2004-10-13 14:23:28 (UTC)
commit2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6 (patch) (side-by-side diff)
treef1e664ddf31aae347b1a119c9111cbd1c931bf89 /microkde/kresources
parentd41893fb0a49fbb080326a4c1fd98e1a032a182a (diff)
downloadkdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.zip
kdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.tar.gz
kdepimpi-2cfda2af7cba3c9aff2d7722421b5d33b7f56cb6.tar.bz2
more sync fixes
Diffstat (limited to 'microkde/kresources') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/configdialog.cpp5
-rw-r--r--microkde/kresources/configdialog.h1
-rw-r--r--microkde/kresources/resource.cpp14
-rw-r--r--microkde/kresources/resource.h2
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,
mName = new KLineEdit( generalGroupBox );
if (!mResource->isSyncable()) {
+ new QLabel("", generalGroupBox );
mReadOnly = new QCheckBox( i18n( "Read-only" ), generalGroupBox );
mReadOnly->setChecked( mResource->readOnly() );
+ new QLabel("", generalGroupBox );
+ mIncludeInSync = new QCheckBox( i18n( "Include in sync" ), generalGroupBox );
+ mIncludeInSync->setChecked( mResource->includeInSync() );
}
mName->setText( mResource->resourceName() );
@@ -220,6 +224,7 @@ void ConfigDialog::accept()
mResource->setResourceName( mName->text() );
if (!mResource->isSyncable())
mResource->setReadOnly( mReadOnly->isChecked() );
+ mResource->setIncludeInSync( mIncludeInSync->isChecked() );
if ( mConfigWidget ) {
// 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
KLineEdit *mName;
QCheckBox *mReadOnly;
+ QCheckBox *mIncludeInSync;
//US add a persistent readonly flag. We need that for opie and qtopia addressbooks.
bool mPersistentReadOnly;
};
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
QString mType;
QString mIdentifier;
bool mReadOnly;
+ bool mIncludeInSync;
QString mName;
bool mActive;
bool mIsOpen;
@@ -63,12 +64,14 @@ Resource::Resource( const KConfig* config )
d->mType = cfg->readEntry( "ResourceType" );
d->mName = cfg->readEntry( "ResourceName" );
d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false );
+ d->mIncludeInSync = cfg->readBoolEntry( "ResourceIncludeInSync", true );;
d->mActive = cfg->readBoolEntry( "ResourceIsActive", true );
d->mIdentifier = cfg->readEntry( "ResourceIdentifier" );
} else {
d->mType = "type";
d->mName = "resource-name";
d->mReadOnly = false;
+ d->mIncludeInSync = true;
d->mActive = true;
d->mIdentifier = KApplication::randomString( 10 );
}
@@ -82,11 +85,10 @@ Resource::~Resource()
void Resource::writeConfig( KConfig* config )
{
-
-
config->writeEntry( "ResourceType", d->mType );
config->writeEntry( "ResourceName", d->mName );
config->writeEntry( "ResourceIsReadOnly", d->mReadOnly );
+ config->writeEntry( "ResourceIncludeInSync", d->mIncludeInSync );
config->writeEntry( "ResourceIsActive", d->mActive );
config->writeEntry( "ResourceIdentifier", d->mIdentifier );
}
@@ -149,6 +151,14 @@ QString Resource::type() const
return d->mType;
}
+void Resource::setIncludeInSync( bool value )
+{
+ d->mIncludeInSync = value;
+}
+bool Resource::includeInSync() const
+{
+ return d->mIncludeInSync;
+}
void Resource::setReadOnly( bool value )
{
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
*/
virtual bool readOnly() const;
+ void setIncludeInSync( bool value );
+ bool includeInSync() const;
/**
* Set the name of resource.You can override this method,
* but also remember to call Resource::setResourceName().