author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kresources/kcmkresources.cpp | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
Diffstat (limited to 'microkde/kresources/kcmkresources.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kresources/kcmkresources.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/microkde/kresources/kcmkresources.cpp b/microkde/kresources/kcmkresources.cpp new file mode 100644 index 0000000..d600a31 --- a/dev/null +++ b/microkde/kresources/kcmkresources.cpp | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | This file is part of libkresources. | ||
3 | |||
4 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | ||
5 | |||
6 | This library is free software; you can redistribute it and/or | ||
7 | modify it under the terms of the GNU Library General Public | ||
8 | License as published by the Free Software Foundation; either | ||
9 | version 2 of the License, or (at your option) any later version. | ||
10 | |||
11 | This library 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 GNU | ||
14 | Library General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU Library General Public License | ||
17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
19 | Boston, MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #include <qlayout.h> | ||
23 | |||
24 | //US #include <kaboutdata.h> | ||
25 | //US #include <kgenericfactory.h> | ||
26 | #include <klocale.h> | ||
27 | |||
28 | #include "configpage.h" | ||
29 | |||
30 | #include "kcmkresources.h" | ||
31 | |||
32 | using namespace KRES; | ||
33 | |||
34 | //US typedef KGenericFactory<KCMKResources, QWidget> ResourcesFactory; | ||
35 | //US K_EXPORT_COMPONENT_FACTORY( kcm_kresources, ResourcesFactory( "kcmkresources" ) ); | ||
36 | |||
37 | //US KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& ) | ||
38 | //US : KCModule( ResourcesFactory::instance(), parent, name ) | ||
39 | KCMKResources::KCMKResources( QWidget *parent, const char *name, const QStringList& ) | ||
40 | : KDialogBase( parent, name, true, i18n( "Configure Resources" ), | ||
41 | Ok|Cancel, Ok, true ) | ||
42 | { | ||
43 | QFrame *main = plainPage(); | ||
44 | |||
45 | QVBoxLayout *layout = new QVBoxLayout( main ); | ||
46 | mConfigPage = new KRES::ConfigPage( main ); | ||
47 | layout->addWidget( mConfigPage ); | ||
48 | |||
49 | |||
50 | connect( mConfigPage, SIGNAL( changed( bool ) ), SLOT( changed( bool ) ) ); | ||
51 | #ifndef DESKTOP_VERSION | ||
52 | showMaximized(); | ||
53 | #endif | ||
54 | } | ||
55 | |||
56 | void KCMKResources::changed( bool changed) | ||
57 | { | ||
58 | modified = changed; | ||
59 | } | ||
60 | |||
61 | void KCMKResources::slotOk() | ||
62 | { | ||
63 | if (modified) { | ||
64 | mConfigPage->save(); | ||
65 | modified = false; | ||
66 | } | ||
67 | |||
68 | KDialogBase::slotOk(); | ||
69 | } | ||
70 | |||
71 | void KCMKResources::load() | ||
72 | { | ||
73 | qDebug("KCMKResources::load" ); | ||
74 | mConfigPage->load(); | ||
75 | } | ||
76 | |||
77 | void KCMKResources::save() | ||
78 | { | ||
79 | qDebug("KCMKResources::save" ); | ||
80 | mConfigPage->save(); | ||
81 | } | ||
82 | |||
83 | void KCMKResources::defaults() | ||
84 | { | ||
85 | qDebug("KCMKResources::defaults" ); | ||
86 | mConfigPage->defaults(); | ||
87 | } | ||
88 | |||
89 | //US #include "kcmkresources.moc" | ||