• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KCal Library

resourcelocaldirconfig.cpp

00001 /*
00002   This file is part of the kcal library.
00003 
00004   Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015 
00016   You should have received a copy of the GNU Library General Public License
00017   along with this library; see the file COPYING.LIB.  If not, write to
00018   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include "resourcelocaldirconfig.h"
00023 #include "resourcelocaldir.h"
00024 #include "resourcelocaldir_p.h"
00025 
00026 #include <klocale.h>
00027 #include <kdebug.h>
00028 #include <kstandarddirs.h>
00029 #include <kurlrequester.h>
00030 
00031 #include <QtGui/QLabel>
00032 #include <QtGui/QLayout>
00033 #include <QtGui/QGridLayout>
00034 
00035 #include <typeinfo>
00036 
00037 #include "resourcelocaldirconfig.moc"
00038 
00039 using namespace KCal;
00040 
00045 //@cond PRIVATE
00046 class KCal::ResourceLocalDirConfig::Private
00047 {
00048   public:
00049     Private()
00050     {}
00051     KUrlRequester *mURL;
00052 };
00053 //@endcond
00054 
00055 ResourceLocalDirConfig::ResourceLocalDirConfig( QWidget *parent )
00056   : KRES::ConfigWidget( parent ), d( new KCal::ResourceLocalDirConfig::Private )
00057 {
00058   resize( 245, 115 );
00059   QGridLayout *mainLayout = new QGridLayout( this );
00060 
00061   QLabel *label = new QLabel( i18n( "Location:" ), this );
00062   d->mURL = new KUrlRequester( this );
00063   d->mURL->setMode( KFile::Directory | KFile::LocalOnly );
00064   mainLayout->addWidget( label, 1, 0 );
00065   mainLayout->addWidget( d->mURL, 1, 1 );
00066 }
00067 
00068 ResourceLocalDirConfig::~ResourceLocalDirConfig()
00069 {
00070   delete d;
00071 }
00072 
00073 void ResourceLocalDirConfig::loadSettings( KRES::Resource *resource )
00074 {
00075   ResourceLocalDir *res = static_cast<ResourceLocalDir*>( resource );
00076   if ( res ) {
00077     d->mURL->setUrl( res->d->mURL.prettyUrl() );
00078   } else {
00079     kDebug() << "ERROR: no ResourceLocalDir, cast failed";
00080   }
00081 }
00082 
00083 void ResourceLocalDirConfig::saveSettings( KRES::Resource *resource )
00084 {
00085   ResourceLocalDir *res = static_cast<ResourceLocalDir*>( resource );
00086   if (res) {
00087     res->d->mURL = d->mURL->url();
00088   } else {
00089     kDebug() << "ERROR: no ResourceLocalDir, cast failed";
00090   }
00091 }

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal