From 75502cb30b6b56c4ab65ef7f3e315c3298408937 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 28 Aug 2010 01:04:18 +0000 Subject: Added tasks support to CalDAV resource This nearly completes Zimbra integration git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1168963 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/caldav/config.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'kresources/caldav/config.cpp') diff --git a/kresources/caldav/config.cpp b/kresources/caldav/config.cpp index da9bd8473..550e00c97 100644 --- a/kresources/caldav/config.cpp +++ b/kresources/caldav/config.cpp @@ -88,6 +88,8 @@ void ResourceCalDavConfig::loadSettings( KRES::Resource *resource ) { mUsername->setText(p->username()); mRememberPassword->setChecked(p->rememberPassword()); mPassword->setText(p->password()); + mTasksUrl->setText(p->tasksUrl()); + mUseSTasks->setChecked(p->useSTasks()); mReloadConfig->loadSettings(res); mSaveConfig->loadSettings(res); @@ -106,6 +108,8 @@ void ResourceCalDavConfig::saveSettings( KRES::Resource *resource ) { p->setUsername(mUsername->text()); p->setRememberPassword(mRememberPassword->isChecked()); p->setPassword(mPassword->text()); + p->setTasksUrl(mTasksUrl->text()); + p->setUseSTasks(mUseSTasks->isChecked()); } } } @@ -121,22 +125,36 @@ void ResourceCalDavConfig::setupUI() { mainLayout->addWidget( label, 1, 0 ); mainLayout->addWidget( mUrl, 1, 1 ); + // Tasks URL + TQLabel *tlabel = new TQLabel( i18n( "Tasks URL:" ), this ); + mTasksUrl = new TQLineEdit( this ); + mainLayout->addWidget( tlabel, 2, 0 ); + mainLayout->addWidget( mTasksUrl, 2, 1 ); + + // Use Task URL checkbox + mUseSTasks = new TQCheckBox( i18n("Use separate Tasks URL"), this ); + mainLayout->addWidget(mUseSTasks, 3, 0 ); + // Username label = new TQLabel( i18n( "Username:" ), this ); mUsername = new TQLineEdit( this ); - mainLayout->addWidget( label, 2, 0 ); - mainLayout->addWidget( mUsername, 2, 1 ); + mainLayout->addWidget( label, 4, 0 ); + mainLayout->addWidget( mUsername, 4, 1 ); // Password label = new TQLabel( i18n( "Password:" ), this ); mPassword = new TQLineEdit( this ); mPassword->setEchoMode( TQLineEdit::Password ); - mainLayout->addWidget( label, 3, 0 ); - mainLayout->addWidget( mPassword, 3, 1 ); + mainLayout->addWidget( label, 5, 0 ); + mainLayout->addWidget( mPassword, 5, 1 ); // Remember password checkbox mRememberPassword = new TQCheckBox( i18n("Remember password"), this ); - mainLayout->addWidget(mRememberPassword, 4, 1); + mainLayout->addWidget(mRememberPassword, 6, 1); + + mTasksUrl->setEnabled(mUseSTasks->isChecked()); + connect( mUseSTasks, TQT_SIGNAL( toggled( bool ) ), + TQT_SLOT( slotSTasksToggled( bool ) ) ); // configs TQHBoxLayout* horizontal = new TQHBoxLayout(this); @@ -159,4 +177,8 @@ void ResourceCalDavConfig::setupUI() { vertical->addLayout(horizontal); } +void ResourceCalDavConfig::slotSTasksToggled( bool enabled ) { + mTasksUrl->setEnabled(enabled); +} + // EOF ======================================================================== -- cgit v1.2.1