1 /*******************************************************************
2 Copyright (c) 2005, The KNotes Developers
4 This file is part of KNotes.
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.
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.
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 *******************************************************************/
21 #include "resourcelocalconfig.h"
22 #include "resourcelocal.h"
26 #include <kresources/configwidget.h>
27 #include <kurlrequester.h>
29 #include <QHBoxLayout>
33 ResourceLocalConfig::ResourceLocalConfig( QWidget
*parent
, const char *name
)
34 : KRES::ConfigWidget( parent
)
36 setObjectName( name
);
37 QHBoxLayout
*layout
= new QHBoxLayout( this );
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
);
47 ResourceLocalConfig::~ResourceLocalConfig()
51 void ResourceLocalConfig::loadSettings( KRES::Resource
*resource
)
53 ResourceLocal
*res
= dynamic_cast<ResourceLocal
*>( resource
);
55 mURL
->setUrl( res
->url().prettyUrl() );
57 kDebug( 5500 ) << "ERROR: ResourceLocalConfig::loadSettings(): "
58 "no ResourceLocal, cast failed";
62 void ResourceLocalConfig::saveSettings( KRES::Resource
*resource
)
64 ResourceLocal
*res
= dynamic_cast<ResourceLocal
*>( resource
);
66 res
->setURL( mURL
->url() );
68 kDebug() <<"ERROR: ResourceLocalConfig::saveSettings(): "
69 "no ResourceLocal, cast failed";
73 #include "resourcelocalconfig.moc"