add more spacing
[personal-kdebase.git] / workspace / kcontrol / kfontinst / kcmfontinst / PrintDialog.cpp
blob4258363306febbd5b960a79c578187808f469712
1 /*
2 * KFontInst - KDE Font Installer
4 * Copyright 2003-2007 Craig Drummond <craig@kde.org>
6 * ----
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; see the file COPYING. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #include "PrintDialog.h"
25 #include <QtGui/QFrame>
26 #include <QtGui/QLabel>
27 #include <QtGui/QGridLayout>
28 #include <KDE/KLocale>
30 namespace KFI
33 CPrintDialog::CPrintDialog(QWidget *parent)
34 : KDialog(parent)
36 setModal(true);
37 setCaption(i18n("Print Font Samples"));
38 setButtons(Ok|Cancel);
39 showButtonSeparator(true);
41 QFrame *page = new QFrame(this);
42 setMainWidget(page);
44 QGridLayout *layout=new QGridLayout(page);
45 layout->setMargin(0);
46 layout->setSpacing(KDialog::spacingHint());
48 QLabel *lbl=new QLabel(i18n("Select size to print font:"), page);
49 lbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
50 layout->addWidget(lbl, 0, 0);
51 itsSize=new QComboBox(page);
52 itsSize->insertItem(0, i18n("Waterfall"));
53 itsSize->insertItem(1, i18n("12pt"));
54 itsSize->insertItem(2, i18n("18pt"));
55 itsSize->insertItem(3, i18n("24pt"));
56 itsSize->insertItem(4, i18n("36pt"));
57 itsSize->insertItem(5, i18n("48pt"));
58 itsSize->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
59 layout->addWidget(itsSize, 0, 1);
60 layout->addItem(new QSpacerItem(2, 2), 2, 0);
63 bool CPrintDialog::exec(int size)
65 itsSize->setCurrentIndex(size);
66 return KDialog::Accepted==KDialog::exec();