]> git.sur5r.net Git - minitube/blob - src/AboutView.cpp
Hebrew translation by Yaron Shahrabani
[minitube] / src / AboutView.cpp
1 #include "AboutView.h"
2 #include "Constants.h"
3
4 AboutView::AboutView(QWidget *parent) : QWidget(parent) {
5
6     QBoxLayout *aboutlayout = new QHBoxLayout(this);
7     aboutlayout->setAlignment(Qt::AlignCenter);
8     aboutlayout->setSpacing(30);
9
10     QLabel *logo = new QLabel(this);
11     logo->setPixmap(QPixmap(":/images/app.png"));
12     aboutlayout->addWidget(logo, 0, Qt::AlignTop);
13
14     QBoxLayout *layout = new QVBoxLayout();
15     layout->setAlignment(Qt::AlignCenter);
16     layout->setSpacing(30);
17     aboutlayout->addLayout(layout);
18
19     QString info = "<h1>" + QString(Constants::APP_NAME) + "</h1>"
20                    "<p>" + tr("There's life outside the browser!") + "</p>"
21                    "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
22                    + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE) +
23
24                    "<p>" + tr("This is a \"Technology Preview\" release, do not expect it to be perfect.") + "<br/>"
25                    + tr("Report bugs and send in your ideas to %1")
26                    .arg(QString("<a href=\"mailto:%1\">%1</a>").arg(Constants::EMAIL)) + "</p>"
27
28                    "<p>" +  tr("%1 is Free Software but its development takes precious time.").arg(Constants::APP_NAME) + "<br/>"
29                    + tr("Please <a href='%1'>donate via PayPal</a> to support the continued development of %2.")
30                    .arg(QString(Constants::WEBSITE).append("#donate"), Constants::APP_NAME) + "</p>"
31
32                    "<p>" + tr("Icon designed by %1.").arg("Sebastian Kraft") + "</p>"
33
34                    "<p>" + tr("Compact mode contributed by %1.").arg("Stefan Brück") + "</p>"
35
36                    "<p>" + tr("Translated by %1").arg("Nikita Lyalin (ru_RU), "
37                                                       "Márcio Moraes (pt_BR), "
38                                                       "Sergio Tocalini Joerg (es_AR), "
39                                                       "Stefan Brück (de_DE), "
40                                                       "Grzegorz Gibas (pl_PL), "
41                                                       "Kiwamu Okabe (ja_JP), "
42                                                       "Dan Vrátil (cs_CZ), "
43                                                       "Yaron Shahrabani (he_IL)"
44                                                       ) + "</p>"
45
46                    "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
47                    .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
48
49                    "<p>&copy; 2009 " + Constants::ORG_NAME + "</p>";
50     QLabel *infoLabel = new QLabel(info, this);
51     infoLabel->setOpenExternalLinks(true);
52     infoLabel->setWordWrap(true);
53     layout->addWidget(infoLabel);
54
55     QLayout *buttonLayout = new QHBoxLayout();
56     buttonLayout->setAlignment(Qt::AlignLeft);
57     QPushButton *closeButton = new QPushButton(tr("&Close"), this);
58     closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
59
60     closeButton->setDefault(true);
61     closeButton->setFocus(Qt::OtherFocusReason);
62     connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
63     buttonLayout->addWidget(closeButton);
64
65     layout->addLayout(buttonLayout);
66
67 }
68
69 void AboutView::paintEvent(QPaintEvent * /*event*/) {
70
71     QPainter painter(this);
72
73 #ifdef Q_WS_MAC
74     QLinearGradient linearGrad(0, 0, 0, height());
75     QPalette palette;
76     linearGrad.setColorAt(0, palette.color(QPalette::Light));
77     linearGrad.setColorAt(1, palette.color(QPalette::Midlight));
78     painter.fillRect(0, 0, width(), height(), QBrush(linearGrad));
79 #endif
80
81 }