1 /*******************************************************************************
3 This file is part of mDictionary.
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.
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.
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/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
21 /*! \file AboutWidget.cpp
22 \brief Simple "about" widget - product, company, license info
25 \author Bartosz Szatkowski <bulislaw@linux.com>
28 #include "AboutWidget.h"
30 AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
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("<<a href=\"http://www.gnu.org/licenses/\">") +
48 QString("http://www.gnu.org/licenses/</a>>.") +
49 QString("</p></font>");
51 setWindowTitle(tr("About"));
52 mainLayout = new QVBoxLayout;
55 scrollLayout = new QVBoxLayout;
56 scroll = new QScrollArea;
57 w = new QWidget(this);
62 imageLabel = new QLabel;
63 mainLabel = new QLabel;
64 licenseLabel = new QLabel;
67 QImage img(":/icons/logo/mdictionary.png");
68 imageLabel->setPixmap(QPixmap::fromImage(img));
69 imageLabel->setMinimumSize(imageLabel->pixmap()->size());
71 mainLabel->setText(infoNote + comarchNote);
72 mainLabel->setOpenExternalLinks(true);
73 mainLabel->setMinimumSize(mainLabel->sizeHint());
76 licenseLabel->setWordWrap(true);
77 licenseLabel->setText(licenseNote);
78 licenseLabel->setOpenExternalLinks(true);
79 licenseLabel->setMinimumSize(licenseLabel->sizeHint());
82 mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
83 mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
84 mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
88 w->setLayout(mainLayout);
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);
95 setLayout(mainLayout);