kabc
21 #include "resourcenetconfig.h"
22 #include "resourcenet.h"
24 #include "kabc/formatfactory.h"
25 #include "kabc/stdaddressbook.h"
28 #include <klocalizedstring.h>
31 #include <QFormLayout>
35 ResourceNetConfig::ResourceNetConfig( QWidget *parent )
36 : ConfigWidget( parent ), mInEditMode( false )
38 QFormLayout *mainLayout =
new QFormLayout(
this );
39 mainLayout->setMargin( 0 );
41 mFormatBox =
new KComboBox(
this );
43 mainLayout->addRow( i18n(
"Format:" ), mFormatBox );
45 mUrlEdit =
new KUrlRequester(
this );
46 mUrlEdit->setMode( KFile::File );
48 mainLayout->addRow( i18n(
"Location:" ), mUrlEdit );
51 QStringList formats = factory->
formats();
52 QStringList::Iterator it;
53 for ( it = formats.begin(); it != formats.end(); ++it ) {
56 mFormatTypes << ( *it );
62 void ResourceNetConfig::setEditMode(
bool value )
64 mFormatBox->setEnabled( !value );
73 kDebug() <<
"cast failed";
77 mFormatBox->setCurrentIndex( mFormatTypes.indexOf( resource->
format() ) );
87 kDebug() <<
"cast failed";
92 resource->
setFormat( mFormatTypes[ mFormatBox->currentIndex() ] );
95 resource->
setUrl( KUrl( mUrlEdit->url() ) );
KUrl url() const
Return url of directory used for loading and saving the address book.
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
void setFormat(const QString &name)
Sets a new format by name.
void setUrl(const KUrl &url)
Set url of directory to be used for saving.
QString format() const
Returns the format name.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 28 2020 00:00:00 by
doxygen 1.8.18 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.