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)
30 QString infoNote, licenseNote, comarchNote;
31 infoNote = "<center><h2><u>mDictionary</u></h2></center>";
32 comarchNote = "<center>Maemo/Meego Multilingual Dictionary</center>";
33 comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br>";
34 comarchNote += "<a href=\"http://mdictionary.garage.maemo.org\">"
35 "http://mdictionary.garage.maemo.org</a>";
36 comarchNote += "<br/><font size=\"small\"><a href=\"https://garage.maemo.org/tracker/?func=add&group_id=58&atid=305\">"
37 "Report bug</a></font></center>";
38 licenseNote = QString("<br><p><font size=\"small\">This program is free"
39 " software: you can redistribute it and/or modify\n"
40 "it under the terms of the GNU General Public License as"
42 "the Free Software Foundation, either version 3 of the License,"
44 "(at your option) any later version.<br>"
45 "This program is distributed in the hope that it will be"
47 "but WITHOUT ANY WARRANTY; without even the implied warranty"
49 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
51 "GNU General Public License for more details.<br>"
52 "You should have received a copy of the GNU General Public "
54 "along with this program. If not, see"
55 "<<a href=\"http://www.gnu.org/licenses/\">"
56 "http://www.gnu.org/licenses/</a>>."
59 setWindowTitle(tr("About"));
60 mainLayout = new QVBoxLayout;
62 /*on desktop we place all content in scroll area, on maemo by default all
63 widgets that are in menu are placed in scroll area created by menu, so we
64 don't have to do it here*/
66 scrollLayout = new QVBoxLayout;
67 scroll = new QScrollArea;
68 w = new QWidget(this);
72 imageLabel = new QLabel;
73 mainLabel = new QLabel;
74 licenseLabel = new QLabel;
77 QImage img(":/icons/logo/mdictionary.png");
78 imageLabel->setPixmap(QPixmap::fromImage(img));
79 imageLabel->setMinimumSize(imageLabel->pixmap()->size());
81 mainLabel->setText(infoNote + comarchNote);
82 mainLabel->setOpenExternalLinks(true);
83 mainLabel->setMinimumSize(mainLabel->sizeHint());
86 licenseLabel->setWordWrap(true);
87 licenseLabel->setText(licenseNote);
88 licenseLabel->setOpenExternalLinks(true);
89 licenseLabel->setMinimumSize(licenseLabel->sizeHint());
92 mainLayout->addWidget(imageLabel, 0, Qt::AlignHCenter);
93 mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter);
94 mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter);
96 //add content to scroll area, and remove fram from it
98 w->setLayout(mainLayout);
100 scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
101 scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter);
102 this->setLayout(scrollLayout);
103 w->setMinimumSize(img.width()*1.6, img.height()*2.45);
104 scroll->setLineWidth(0);
105 scroll->setMidLineWidth(0);
106 scroll->setFrameStyle(QFrame::NoFrame);;
108 setLayout(mainLayout);