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