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.
24 #include "../kconfigwizard.h"
25 #include "../kconfigpropagator.h"
27 #include <kaboutdata.h>
28 #include <kapplication.h>
31 #include <kcmdlineargs.h>
37 class TestConfigWizard
: public KConfigWizard
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() );
71 MyConfig::self()->setFixKMail( mFixKMailCheckBox
->isChecked() );
72 MyConfig::self()->setBreakKMail( mBreakKMailCheckBox
->isChecked() );
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
);
91 KCmdLineArgs
*args
= KCmdLineArgs::parsedArgs();
94 if ( args
->isSet( "verbose" ) ) verbose
= true;
96 TestConfigWizard wizard
;