~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kcontrol/kfontinst/kcmfontinst/PrintDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * KFontInst - KDE Font Installer
 
3
 *
 
4
 * Copyright 2003-2007 Craig Drummond <craig@kde.org>
 
5
 *
 
6
 * ----
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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.
 
22
 */
 
23
 
 
24
#include "PrintDialog.h"
 
25
#include <QtGui/QFrame>
 
26
#include <QtGui/QLabel>
 
27
#include <QtGui/QGridLayout>
 
28
#include <KDE/KLocale>
 
29
 
 
30
namespace KFI
 
31
{
 
32
 
 
33
CPrintDialog::CPrintDialog(QWidget *parent)
 
34
            : KDialog(parent)
 
35
{
 
36
    setModal(true);
 
37
    setCaption(i18n("Print Font Samples"));
 
38
    setButtons(Ok|Cancel);
 
39
 
 
40
    QFrame *page = new QFrame(this);
 
41
    setMainWidget(page);
 
42
 
 
43
    QGridLayout *layout=new QGridLayout(page);
 
44
    layout->setMargin(0);
 
45
    layout->setSpacing(KDialog::spacingHint());
 
46
 
 
47
    QLabel *lbl=new QLabel(i18n("Select size to print font:"), page);
 
48
    lbl->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
 
49
    layout->addWidget(lbl, 0, 0);
 
50
    itsSize=new QComboBox(page);
 
51
    itsSize->insertItem(0, i18n("Waterfall"));
 
52
    itsSize->insertItem(1, i18n("12pt"));
 
53
    itsSize->insertItem(2, i18n("18pt"));
 
54
    itsSize->insertItem(3, i18n("24pt"));
 
55
    itsSize->insertItem(4, i18n("36pt"));
 
56
    itsSize->insertItem(5, i18n("48pt"));
 
57
    itsSize->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
 
58
    layout->addWidget(itsSize, 0, 1);
 
59
    layout->addItem(new QSpacerItem(2, 2), 2, 0);
 
60
}
 
61
 
 
62
bool CPrintDialog::exec(int size)
 
63
{
 
64
    itsSize->setCurrentIndex(size);
 
65
    return KDialog::Accepted==KDialog::exec();
 
66
}
 
67
 
 
68
}