3 This file is part of Minitube.
4 Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
6 Minitube is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Minitube is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Minitube. If not, see <http://www.gnu.org/licenses/>.
21 #include "aboutview.h"
22 #include "constants.h"
27 #include "activation.h"
31 #include "mac_startup.h"
34 AboutView::AboutView(QWidget *parent) : QWidget(parent) {
36 QBoxLayout *hLayout = new QHBoxLayout(this);
37 hLayout->setAlignment(Qt::AlignCenter);
38 hLayout->setMargin(30);
39 hLayout->setSpacing(30);
41 QLabel *logo = new QLabel(this);
42 logo->setPixmap(QPixmap(":/images/app.png"));
43 hLayout->addWidget(logo, 0, Qt::AlignTop);
45 QBoxLayout *layout = new QVBoxLayout();
46 layout->setAlignment(Qt::AlignCenter);
47 layout->setSpacing(30);
48 hLayout->addLayout(layout);
50 QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body>"
51 "<h1 style='font-weight:normal'>" + QString(Constants::NAME) + "</h1>"
52 "<p>" + tr("There's life outside the browser!") + "</p>"
53 "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
54 + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE);
57 if (Activation::instance().isActivated())
58 info += "<p>" + tr("Licensed to: %1").arg("<b>" + Activation::instance().getEmail() + "</b>");
62 info += "<p>" + tr("%1 is Free Software but its development takes precious time.").arg(Constants::NAME) + "<br/>"
63 + tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
64 .arg(QString(Constants::WEBSITE).append("#donate"), Constants::NAME) + "</p>";
67 info += "<p>" + tr("You may want to try my other apps as well:") + "</p>"
70 "<li>" + tr("%1, a YouTube music player")
71 .arg("<a href='http://flavio.tordini.org/musictube'>Musictube</a>")
74 "<li>" + tr("%1, a music player")
75 .arg("<a href='http://flavio.tordini.org/musique'>Musique</a>")
80 "<p>" + tr("Translate %1 to your native language using %2").arg(Constants::NAME)
81 .arg("<a href='http://www.transifex.net/projects/p/" + QString(Constants::UNIX_NAME) + "/'>Transifex</a>")
85 + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.co.za/'>David Nel</a>")
89 "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
90 .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
92 "<p>© 2009-2015 " + Constants::ORG_NAME + "</p>"
94 QLabel *infoLabel = new QLabel(info, this);
95 infoLabel->setOpenExternalLinks(true);
96 infoLabel->setWordWrap(true);
97 layout->addWidget(infoLabel);
99 QLayout *buttonLayout = new QHBoxLayout();
100 buttonLayout->setMargin(0);
101 buttonLayout->setSpacing(0);
102 buttonLayout->setAlignment(Qt::AlignLeft);
104 closeButton = new QPushButton(tr("&Close"));
105 closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
106 closeButton->setDefault(true);
107 connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
108 buttonLayout->addWidget(closeButton);
110 layout->addLayout(buttonLayout);
113 void AboutView::paintEvent(QPaintEvent * /*event*/) {
114 #if defined(APP_MAC) | defined(APP_WIN)
116 if (window()->isActiveWindow()) {
117 brush = QBrush(QColor(0xdd, 0xe4, 0xeb));
119 brush = palette().window();
121 QPainter painter(this);
122 painter.fillRect(0, 0, width(), height(), brush);
126 void AboutView::appear() {
128 mac::uncloseWindow(window()->winId());
129 #ifdef APP_ACTIVATION
130 mac::CheckForUpdates();
133 closeButton->setFocus();