22 #include "configguievo2.h" 29 #include <kurlrequester.h> 33 #include <tdelocale.h> 35 ConfigGuiEvo2::ConfigGuiEvo2( const QSync::Member &member, TQWidget *parent ) 36 : ConfigGui( member, parent ) 41 void ConfigGuiEvo2::load( const TQString &xml ) 44 doc.setContent( xml ); 45 TQDomElement docElement = doc.documentElement(); 47 for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { 48 TQDomElement element = node.toElement(); 49 if ( element.tagName() == "address_path" ) { 50 mAddressPath->setURL( element.text() ); 51 } else if ( element.tagName() == "calendar_path" ) { 52 mCalendarPath->setURL( element.text() ) ; 53 } else if ( element.tagName() == "tasks_path" ) { 54 mTasksPath->setURL( element.text() ); 59 TQString ConfigGuiEvo2::save() const 61 TQString config = "<config>\n"; 63 config += TQString( "<address_path>%1</address_path>\n" ).arg( mAddressPath->url() ); 64 config += TQString( "<calendar_path>%1</calendar_path>\n" ).arg( mCalendarPath->url() ); 65 config += TQString( "<tasks_path>%1</tasks_path>\n" ).arg( mTasksPath->url() ); 67 config += "</config>"; 72 void ConfigGuiEvo2::initGUI() 74 TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 3, KDialog::spacingHint() ); 75 layout->setMargin( KDialog::marginHint() ); 77 layout->addWidget( new TQLabel( i18n( "Address Book location:" ), this ), 0, 0 ); 78 mAddressPath = new KURLRequester( this ); 79 mAddressPath->setMode( KFile::Directory ); 80 layout->addMultiCellWidget( mAddressPath, 0, 0, 1, 2 ); 82 layout->addWidget( new TQLabel( i18n( "Calendar location:" ), this ), 1, 0 ); 83 mCalendarPath = new KURLRequester( this ); 84 mCalendarPath->setMode( KFile::Directory ); 85 layout->addMultiCellWidget( mCalendarPath, 1, 1, 1, 2 ); 87 layout->addWidget( new TQLabel( i18n( "Task list location:" ), this ), 2, 0 ); 88 mTasksPath = new KURLRequester( this ); 89 mTasksPath->setMode( KFile::Directory ); 90 layout->addMultiCellWidget( mTasksPath, 2, 2, 1, 2 );
|