remove kcontrolcenter
[kdepim.git] / wizards / tests / testwizard.cpp
blob4465590f7fbad9ced66851604e06ff84a4a7d751
1 /*
2 This file is part of libkdepim.
4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
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.
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.
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., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #include "myconfig.h"
24 #include "../kconfigwizard.h"
25 #include "../kconfigpropagator.h"
27 #include <kaboutdata.h>
28 #include <kapplication.h>
29 #include <kdebug.h>
30 #include <klocale.h>
31 #include <kcmdlineargs.h>
33 #include <QCheckBox>
34 #include <QFrame>
35 #include <QLayout>
37 class TestConfigWizard : public KConfigWizard
39 public:
40 TestConfigWizard() :
41 KConfigWizard( new KConfigPropagator( MyConfig::self(),
42 "propagator_test.kcfg" ) )
44 QWidget *page = createWizardPage( "My Wizard Page" );
45 QVBoxLayout *topLayout = new QVBoxLayout( page );
47 mFixKMailCheckBox = new QCheckBox( i18n("Fix KMail"), page );
48 topLayout->addWidget( mFixKMailCheckBox );
50 mFixKMailCheckBox->setChecked( MyConfig::fixKMail() );
52 mBreakKMailCheckBox = new QCheckBox( i18n("Break KMail"), page );
53 topLayout->addWidget( mBreakKMailCheckBox );
55 mBreakKMailCheckBox->setChecked( MyConfig::breakKMail() );
57 setupRulesPage();
58 setupChangesPage();
61 ~TestConfigWizard()
65 void usrReadConfig()
69 void usrWriteConfig()
71 MyConfig::self()->setFixKMail( mFixKMailCheckBox->isChecked() );
72 MyConfig::self()->setBreakKMail( mBreakKMailCheckBox->isChecked() );
75 private:
76 QCheckBox *mFixKMailCheckBox;
77 QCheckBox *mBreakKMailCheckBox;
80 int main(int argc,char **argv)
82 KAboutData aboutData("testwizard", 0,ki18n("Test KConfigWizard"),"0.1");
83 KCmdLineArgs::init(argc,argv,&aboutData);
85 KCmdLineOptions options;
86 options.add("verbose", ki18n("Verbose output"));
87 KCmdLineArgs::addCmdLineOptions( options );
89 KApplication app;
91 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
93 bool verbose = false;
94 if ( args->isSet( "verbose" ) ) verbose = true;
96 TestConfigWizard wizard;
98 wizard.exec();