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
23 //! \author Bartosz Szatkowski <bulislaw@linux.com>
25 #include "AboutWidget.h"
27 AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent)
29 QString infoNote, licenseNote, comarchNote;
30 infoNote = "<center><h2><u>mDictionary</u></h2></center>";
31 comarchNote = "<center>Maemo/Meego Multilingual Dictionary</center>";
32 comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br>";
33 comarchNote += "<a href=\"http://mdictionary.garage.maemo.org\">"
34 "http://mdictionary.garage.maemo.org</a></center>";
35 licenseNote = QString("<br><p><font size=\"small\">This program is free"
36 "software: you can redistribute it and/or modify\n"
37 "it under the terms of the GNU General Public License as"
39 "the Free Software Foundation, either version 3 of the License,"
41 "(at your option) any later version.<br>"
42 "This program is distributed in the hope that it will be"
44 "but WITHOUT ANY WARRANTY; without even the implied warranty"
46 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
48 "GNU General Public License for more details.<br>"
49 "You should have received a copy of the GNU General Public "
51 "along with this program. If not, see"
52 "<<a href=\"http://www.gnu.org/licenses/\">"
53 "http://www.gnu.org/licenses/</a>>."
56 setWindowTitle(tr("About"));
57 mainLayout = new QVBoxLayout;
60 scrollLayout = new QVBoxLayout;
61 scroll = new QScrollArea;
62 w = new QWidget(this);
67 imageLabel = new QLabel;
68 mainLabel = new QLabel;
69 licenseLabel = new QLabel;
72 QImage img(":/icons/logo/mdictionary.png");
73 imageLabel->setPixmap(QPixmap::fromImage(img));
74 imageLabel->setMinimumSize(imageLabel->pixmap()->size());
76 mainLabel->setText(infoNote + comarchNote);
77 mainLabel->setOpenExternalLinks(true);
78 mainLabel->setMinimumSize(mainLabel->sizeHint());
81 licenseLabel->setWordWrap(true);
82 licenseLabel->setText(licenseNote);
83 licenseLabel->setOpenExternalLinks(true);
84 licenseLabel->setMinimumSize(licenseLabel->sizeHint());
87 mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
88 mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
89 mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
93 w->setLayout(mainLayout);
95 scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
96 scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
97 this->setLayout(scrollLayout);
98 w->setMinimumSize(img.width()*1.6, img.height()*2.45);
100 setLayout(mainLayout);