27 #include <tdelocale.h> 29 #include <tdemessagebox.h> 30 #include <tdestandarddirs.h> 33 #include "vcalformat.h" 34 #include "icalformat.h" 36 #include "resourcelocaldir.h" 38 #include "resourcelocaldirconfig.h" 42 ResourceLocalDirConfig::ResourceLocalDirConfig( TQWidget* parent, const char* name ) 43 : KRES::ConfigWidget( parent, name ) 46 TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2 ); 48 TQLabel *label = new TQLabel( i18n( "Location:" ), this ); 49 mURL = new KURLRequester( this ); 50 mURL->setMode( KFile::Directory | KFile::LocalOnly ); 51 mainLayout->addWidget( label, 1, 0 ); 52 mainLayout->addWidget( mURL, 1, 1 ); 55 void ResourceLocalDirConfig::loadSettings( KRES::Resource *resource ) 57 ResourceLocalDir* res = static_cast<ResourceLocalDir* >( resource ); 59 mURL->setURL( res->mURL.prettyURL() ); 61 kdDebug(5700) << "ERROR: ResourceLocalDirConfig::loadSettings(): no ResourceLocalDir, cast failed" << endl; 64 void ResourceLocalDirConfig::saveSettings( KRES::Resource *resource ) 66 ResourceLocalDir* res = static_cast<ResourceLocalDir* >( resource ); 68 res->mURL = mURL->url(); 69 if ( mURL->url().isEmpty() && !resource->readOnly() ) { 70 KMessageBox::information( 72 i18n( "No location specified. The calendar will be read-only." ), 74 "ResourceLocalDirUrl" ); 75 resource->setReadOnly( true ); 78 kdDebug(5700) << "ERROR: ResourceLocalDirConfig::saveSettings(): no ResourceLocalDir, cast failed" << endl; 81 #include "resourcelocaldirconfig.moc" Namespace KCal is for global classes, objects and/or functions in libkcal.
|