• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knotes

  • sources
  • kde-4.12
  • kdepim
  • knotes
  • resource
resourcelocalconfig.cpp
Go to the documentation of this file.
1 /*******************************************************************
2  Copyright (c) 2005, The KNotes Developers
3 
4  This file is part of KNotes.
5 
6  KNotes is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  KNotes is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with KNotes; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *******************************************************************/
20 
21 #include "resourcelocalconfig.h"
22 #include "resourcelocal.h"
23 
24 #include <kdebug.h>
25 #include <klocale.h>
26 #include <kresources/configwidget.h>
27 #include <kurlrequester.h>
28 
29 #include <QHBoxLayout>
30 #include <QLabel>
31 
32 
33 ResourceLocalConfig::ResourceLocalConfig( QWidget *parent, const char *name )
34  : KRES::ConfigWidget( parent )
35 {
36  setObjectName( QLatin1String(name) );
37  QHBoxLayout *layout = new QHBoxLayout( this );
38 
39  QLabel *label = new QLabel( i18n( "Location:" ), this );
40  mURL = new KUrlRequester( this );
41  KFile::Modes mode = KFile::File | KFile::LocalOnly;
42  mURL->setMode( mode );
43  layout->addWidget( label );
44  layout->addWidget( mURL );
45 }
46 
47 ResourceLocalConfig::~ResourceLocalConfig()
48 {
49 }
50 
51 void ResourceLocalConfig::loadSettings( KRES::Resource *resource )
52 {
53  ResourceLocal *res = dynamic_cast<ResourceLocal *>( resource );
54  if ( res ) {
55  mURL->setUrl( res->url().prettyUrl() );
56  } else {
57  kDebug( 5500 ) << "ERROR: ResourceLocalConfig::loadSettings(): "
58  "no ResourceLocal, cast failed";
59  }
60 }
61 
62 void ResourceLocalConfig::saveSettings( KRES::Resource *resource )
63 {
64  ResourceLocal *res = dynamic_cast<ResourceLocal *>( resource );
65  if ( res ) {
66  res->setURL( mURL->url() );
67  } else {
68  kDebug() <<"ERROR: ResourceLocalConfig::saveSettings(): "
69  "no ResourceLocal, cast failed";
70  }
71 }
72 
73 #include "resourcelocalconfig.moc"
ResourceLocal
Definition: resourcelocal.h:43
ResourceLocalConfig::loadSettings
virtual void loadSettings(KRES::Resource *resource)
Definition: resourcelocalconfig.cpp:51
QWidget
ResourceLocalConfig::ResourceLocalConfig
ResourceLocalConfig(QWidget *parent=0, const char *name=0)
Definition: resourcelocalconfig.cpp:33
resourcelocal.h
ResourceLocal::setURL
virtual void setURL(const KUrl &url)
Definition: resourcelocal.h:64
resourcelocalconfig.h
ResourceLocal::url
virtual KUrl url() const
Definition: resourcelocal.h:63
ResourceLocalConfig::saveSettings
virtual void saveSettings(KRES::Resource *resource)
Definition: resourcelocalconfig.cpp:62
ResourceLocalConfig::~ResourceLocalConfig
virtual ~ResourceLocalConfig()
Definition: resourcelocalconfig.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knotes

Skip menu "knotes"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal