22 #include "configguijescs.h" 24 #include <tqcheckbox.h> 29 #include <klineedit.h> 31 #include <tdelocale.h> 33 ConfigGuiJescs::ConfigGuiJescs( const QSync::Member &member, TQWidget *parent ) 34 : ConfigGui( member, parent ) 39 void ConfigGuiJescs::load( const TQString &xml ) 42 doc.setContent( xml ); 43 TQDomElement docElement = doc.documentElement(); 45 for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { 46 TQDomElement element = node.toElement(); 47 if ( element.tagName() == "url" ) { 48 mUrl->setText( element.text() ); 49 } else if ( element.tagName() == "username" ) { 50 mUsername->setText( element.text() ); 51 } else if ( element.tagName() == "password" ) { 52 mPassword->setText( element.text() ); 53 } else if ( element.tagName() == "del_notify" ) { 54 mDelNotify->setChecked( element.text() == "1" ); 59 TQString ConfigGuiJescs::save() const 62 TQString config = "<config>\n"; 64 config += TQString( "<url>%1</url>\n" ).arg( mUrl->text() ); 65 config += TQString( "<username>%1</username>\n" ).arg( mUsername->text() ); 66 config += TQString( "<password>%1</password>\n" ).arg( mPassword->text() ); 67 if ( mDelNotify->isChecked() ) { delNotifyState = 1; 68 } else { delNotifyState = 0; 70 config += TQString( "<del_notify>%1</del_notify>\n" ).arg( delNotifyState ); 72 config += "</config>"; 77 void ConfigGuiJescs::initGUI() 79 TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 3, KDialog::spacingHint() ); 80 layout->setMargin( KDialog::marginHint() ); 82 layout->addWidget( new TQLabel( i18n( "URL:" ), this ), 0, 0 ); 83 mUrl = new KLineEdit( this ); 84 layout->addMultiCellWidget( mUrl, 0, 0, 1, 2 ); 86 layout->addWidget( new TQLabel( i18n( "Username:" ), this ), 1, 0 ); 87 mUsername = new KLineEdit( this ); 88 layout->addMultiCellWidget( mUsername, 1, 1, 1, 2 ); 90 layout->addWidget( new TQLabel( i18n( "Password:" ), this ), 2, 0 ); 91 mPassword = new KLineEdit( this ); 92 mPassword->setEchoMode( KLineEdit::Password ); 93 layout->addMultiCellWidget( mPassword, 2, 2, 1, 2 ); 95 mDelNotify = new TQCheckBox( this ); 96 mDelNotify->setText( "Notify attendees about event/task deletion" ); 97 layout->addMultiCellWidget( mDelNotify, 3, 3, 0, 2 );
|