moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kwordquiz / src / wqprintdialogpage.cpp
blob642dda83a5155c81e04481ee0568315ba4ad0e4c
1 /* This file is part of KWordQuiz
2 Copyright (C) 2004 Peter Hedlund <peter@peterandlinda.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA.
19 #include <qbuttongroup.h>
20 #include <qradiobutton.h>
21 #include <qlayout.h>
22 #include <qwhatsthis.h>
24 #include <klocale.h>
26 #include "wqprintdialogpage.h"
28 WQPrintDialogPage::WQPrintDialogPage(QWidget *parent, const char *name )
29 : KPrintDialogPage( parent, name )
31 setTitle(i18n("Vocabulary Options"));
33 QGridLayout * l = new QGridLayout( this, 1, 1, 11, 6);
35 g = new QButtonGroup(i18n("Select Type of Printout"), this );
36 g->setColumnLayout(0, Qt::Vertical );
37 g->layout()->setSpacing( 6 );
38 g->layout()->setMargin( 11 );
39 QGridLayout * v = new QGridLayout( g->layout() );
40 v->setAlignment( Qt::AlignTop );
42 rb0 = new QRadioButton(i18n("Vocabulary &list"), g );
43 v->addWidget( rb0, 0, 0 );
44 rb1 = new QRadioButton(i18n("Vocabulary e&xam"), g);
45 v->addWidget( rb1, 1, 0 );
46 rb2 = new QRadioButton(i18n("&Flashcards"), g);
47 v->addWidget( rb2, 2, 0 );
48 l->addWidget( g, 0, 0 );
50 QWhatsThis::add(g, i18n("Specify type of printout to make"));
51 QWhatsThis::add(rb0, i18n("Select to print the vocabulary as displayed in the editor"));
52 QWhatsThis::add(rb1, i18n("Select to print the vocabulary as a vocabulary exam"));
53 QWhatsThis::add(rb2, i18n("Select to print flashcards"));
57 WQPrintDialogPage::~WQPrintDialogPage()
61 void WQPrintDialogPage::getOptions(QMap< QString, QString > & opts, bool incldef)
63 opts[ "kde-kwordquiz-type" ] = QString::number(g->selectedId());
66 void WQPrintDialogPage::setOptions(const QMap< QString, QString > & opts )
68 QString type = opts[ "kde-kwordquiz-type" ];
69 switch (type.toInt())
71 case 0: rb0->setChecked(true); break;
72 case 1: rb1->setChecked(true); break;
73 case 2: rb2->setChecked(true); break;
77 bool WQPrintDialogPage::isValid(const QString & msg )
79 return true;
83 #include "wqprintdialogpage.moc"