]> git.sur5r.net Git - minitube/blob - src/AboutView.cpp
Croatian translation
[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>"
33                    + tr("Icon designed by %1.").arg("Sebastian Kraft")
34                    + "<br>" + tr("Compact mode contributed by %1.").arg("Stefan Brück")
35                    + "<br>" + tr("HTTP proxy support contributed by %1.").arg("Kiwamu Okabe")
36 #ifdef Q_WS_WIN
37                    + "<br>" +  tr("Windows version built by %1").arg("Marco Di Antonio")
38 #endif
39                    + "</p>"
40
41                    "<p>" + tr("Translated by %1").arg("Nikita Lyalin (ru_RU), "
42                                                       "Márcio Moraes (pt_BR), "
43                                                       "Sergio Tocalini Joerg (es_AR), "
44                                                       "Stefan Brück (de_DE), "
45                                                       "Grzegorz Gibas (pl_PL), "
46                                                       "Kiwamu Okabe (ja_JP), "
47                                                       "Dan Vrátil (cs_CZ), "
48                                                       "Rafa (es_ES), "
49                                                       "Yaron Shahrabani (he_IL), "
50                                                       "Oleksandr Korneta (uk), "
51                                                       "Inga Muste (lat), "
52                                                       "Srecko Belaic (hr_HR)"
53                                                       ) + "</p>"
54
55                    "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
56                    .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
57
58                    "<p>&copy; 2009 " + Constants::ORG_NAME + "</p>";
59     QLabel *infoLabel = new QLabel(info, this);
60     infoLabel->setOpenExternalLinks(true);
61     infoLabel->setWordWrap(true);
62     layout->addWidget(infoLabel);
63
64     QLayout *buttonLayout = new QHBoxLayout();
65     buttonLayout->setAlignment(Qt::AlignLeft);
66     QPushButton *closeButton = new QPushButton(tr("&Close"), this);
67     closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
68
69     closeButton->setDefault(true);
70     closeButton->setFocus(Qt::OtherFocusReason);
71     connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
72     buttonLayout->addWidget(closeButton);
73
74     layout->addLayout(buttonLayout);
75
76 }
77
78 void AboutView::paintEvent(QPaintEvent * /*event*/) {
79 #ifdef Q_WS_MAC
80     QPainter painter(this);
81     QLinearGradient linearGrad(0, 0, 0, height());
82     QPalette palette;
83     linearGrad.setColorAt(0, palette.color(QPalette::Light));
84     linearGrad.setColorAt(1, palette.color(QPalette::Midlight));
85     painter.fillRect(0, 0, width(), height(), QBrush(linearGrad));
86 #endif
87 }