Subversion Repositories Scribus

Rev

Rev 14472 | Rev 18299 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14472 fschmid 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
 /***************************************************************************
8
  *   Copyright (C) 2009 by Jain Basil Aliyas                               *
9
  *   mail@jainbasil.net                                                    *
10
  *                                                                         *
11
  *   This program is free software; you can redistribute it and/or modify  *
12
  *   it under the terms of the GNU General Public License as published by  *
13
  *   the Free Software Foundation; either version 2 of the License, or     *
14
  *   (at your option) any later version.                                   *
15
  *                                                                         *
16
  *   This program is distributed in the hope that it will be useful,       *
17
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
  *   GNU General Public License for more details.                          *
20
  *                                                                         *
21
  *   You should have received a copy of the GNU General Public License     *
22
  *   along with this program; if not, write to the                         *
23
  *   Free Software Foundation, Inc.,                                       *
18122 mrdocs 24
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
14472 fschmid 25
  ***************************************************************************/
26
 
27
#include "fontselectdialog.h"
28
#include "util_icon.h"
29
#include <QDebug>
30
 
31
FontSelect::FontSelect(QStringList list):QDialog(0)
32
{
33
        setModal(true);
34
        setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
35
        setWindowTitle( tr("Select Alternate Font"));
36
 
37
        resize(370, 83);
38
        layoutWidget = new QWidget(this);
39
        layoutWidget->setGeometry(QRect(10, 10, 350, 63));
40
        verticalLayout_2 = new QVBoxLayout(layoutWidget);
41
        verticalLayout_2->setContentsMargins(0, 0, 0, 0);
42
        horizontalLayout_2 = new QHBoxLayout();
43
        label = new QLabel(layoutWidget);
44
        label->setText( tr("Font") );
45
        label->setMinimumSize(QSize(61, 0));
46
 
47
        horizontalLayout_2->addWidget(label);
48
 
49
        fontList = new QComboBox(layoutWidget);
50
        fontList->setMinimumSize(QSize(281, 0));
51
        fontList->addItems(list);
52
 
53
        horizontalLayout_2->addWidget(fontList);
54
 
55
 
56
        verticalLayout_2->addLayout(horizontalLayout_2);
57
 
58
        horizontalLayout_3 = new QHBoxLayout();
59
        horizontalSpacer = new QSpacerItem(128, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
60
 
61
        horizontalLayout_3->addItem(horizontalSpacer);
62
 
63
        okButton = new QPushButton("OK",layoutWidget);
64
        okButton->setEnabled(true);
65
        okButton->setMinimumSize(QSize(105, 0));
66
 
67
        horizontalLayout_3->addWidget(okButton);
68
 
69
        verticalLayout_2->addLayout(horizontalLayout_3);
70
        label->setBuddy(fontList);
71
        font = fontList->currentText();
72
 
73
        connect(fontList, SIGNAL(activated(int)), this, SLOT(selectFont()));
74
        connect(okButton,SIGNAL(clicked()),this,SLOT(accept()));
75
}
76
 
77
void FontSelect::selectFont()
78
{
79
        font = fontList->currentText();
80
}
81
 
82
QString FontSelect::setFont()
83
{
84
        return font;
85
}
86
 
87
void FontSelect::resetFont()
88
{
89
        font = "";
90
}