Fixed AboutWidget text size
[mdictionary] / trunk / src / base / gui / AboutWidget.cpp
1 /*******************************************************************************
2
3     This file is part of mDictionary.
4
5     mDictionary is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9
10     mDictionary is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
17
18     Copyright 2010 Comarch S.A.
19
20 *******************************************************************************/
21 /*! \file AboutWidget.cpp
22 \brief Simple "about" widget - product, company, license info
23
24
25 \author Bartosz Szatkowski <bulislaw@linux.com>
26 */
27
28 #include "AboutWidget.h"
29
30 AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
31 {
32     QString infoNote, licenseNote, comarchNote;
33     infoNote = "<center><h2><u>mDictionary</u></h2></center>";
34     comarchNote = "<center>Meamo/Meego Mulitlingual Dictionary</center>";
35     comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br>";
36     comarchNote += "<a href=\"http://mdictionary.garage.maemo.org\">http://mdictionary.garage.maemo.org</a></center>";
37     licenseNote = QString("<br><p><font size=\"small\">This program is free software: you can redistribute it and/or modify\n")+
38                   QString("it under the terms of the GNU General Public License as published by\n")+
39                   QString("the Free Software Foundation, either version 3 of the License, or\n")+
40                   QString("(at your option) any later version.<br>")+
41                   QString("This program is distributed in the hope that it will be useful,\n")+
42                   QString("but WITHOUT ANY WARRANTY; without even the implied warranty of\n")+
43                   QString("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n")+
44                   QString("GNU General Public License for more details.<br>") +
45                   QString("You should have received a copy of the GNU General Public License<br>") +
46                   QString("along with this program.  If not, see") +
47                   QString("&lt;<a href=\"http://www.gnu.org/licenses/\">") +
48                   QString("http://www.gnu.org/licenses/</a>&gt;.") +
49                   QString("</p></font>");
50
51     setWindowTitle(tr("About"));
52     mainLayout = new QVBoxLayout;
53
54     #ifndef Q_WS_MAEMO_5
55         scrollLayout = new QVBoxLayout;
56         scroll = new QScrollArea;
57         w = new QWidget(this);
58
59     #endif
60
61
62     imageLabel = new QLabel;
63     mainLabel = new QLabel;
64     licenseLabel = new QLabel;
65
66
67     QImage img(":/icons/logo/mdictionary.png");
68     imageLabel->setPixmap(QPixmap::fromImage(img));
69     imageLabel->setMinimumSize(imageLabel->pixmap()->size());
70
71     mainLabel->setText(infoNote + comarchNote);
72     mainLabel->setOpenExternalLinks(true);
73     mainLabel->setMinimumSize(mainLabel->sizeHint());
74
75
76     licenseLabel->setWordWrap(true);
77     licenseLabel->setText(licenseNote);
78     licenseLabel->setOpenExternalLinks(true);
79     licenseLabel->setMinimumSize(licenseLabel->sizeHint());
80
81
82     mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
83     mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
84     mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
85
86
87     #ifndef Q_WS_MAEMO_5
88         w->setLayout(mainLayout);
89         scroll->setWidget(w);
90         scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
91         scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
92         this->setLayout(scrollLayout);
93         w->setMinimumSize(img.width()*1.6, img.height()*2.45);
94     #else
95         setLayout(mainLayout);
96     #endif
97 }