7 #include "activation.h"
11 #include "mac_startup.h"
14 AboutView::AboutView(QWidget *parent) : QWidget(parent) {
16 QBoxLayout *hLayout = new QHBoxLayout(this);
17 hLayout->setAlignment(Qt::AlignCenter);
18 hLayout->setMargin(30);
19 hLayout->setSpacing(30);
21 QLabel *logo = new QLabel(this);
22 logo->setPixmap(QPixmap(":/images/app.png"));
23 hLayout->addWidget(logo, 0, Qt::AlignTop);
25 QBoxLayout *layout = new QVBoxLayout();
26 layout->setAlignment(Qt::AlignCenter);
27 layout->setSpacing(30);
28 hLayout->addLayout(layout);
30 QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body>"
31 "<h1>" + QString(Constants::NAME) + "</h1>"
32 "<p>" + tr("There's life outside the browser!") + "</p>"
33 "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
34 + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE);
37 if (Activation::instance().isActivated())
38 info += "<p>" + tr("Licensed to: %1").arg("<b>" + Activation::instance().getEmail() + "</b>");
42 info += "<p>" + tr("%1 is Free Software but its development takes precious time.").arg(Constants::NAME) + "<br/>"
43 + tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
44 .arg(QString(Constants::WEBSITE).append("#donate"), Constants::NAME) + "</p>";
47 info += "<p>" + tr("You may want to try my other apps as well:") + "</p>"
50 "<li>" + tr("%1, a YouTube music player")
51 .arg("<a href='http://flavio.tordini.org/musictube'>Musictube</a>")
54 "<li>" + tr("%1, a music player")
55 .arg("<a href='http://flavio.tordini.org/musique'>Musique</a>")
60 "<p>" + tr("Translate %1 to your native language using %2").arg(Constants::NAME)
61 .arg("<a href='http://www.transifex.net/projects/p/" + QString(Constants::UNIX_NAME) + "/'>Transifex</a>")
65 + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.com/'>David Nel</a>")
69 "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
70 .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
72 "<p>© 2009-2013 " + Constants::ORG_NAME + "</p>"
74 QLabel *infoLabel = new QLabel(info, this);
75 infoLabel->setOpenExternalLinks(true);
76 infoLabel->setWordWrap(true);
77 layout->addWidget(infoLabel);
79 QLayout *buttonLayout = new QHBoxLayout();
80 buttonLayout->setMargin(0);
81 buttonLayout->setSpacing(0);
82 buttonLayout->setAlignment(Qt::AlignLeft);
84 QPushButton *closeButton = new QPushButton(tr("&Close"), this);
85 closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
86 closeButton->setDefault(true);
87 closeButton->setFocus(Qt::OtherFocusReason);
88 connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
89 buttonLayout->addWidget(closeButton);
91 layout->addLayout(buttonLayout);
94 void AboutView::paintEvent(QPaintEvent * /*event*/) {
95 #if defined(APP_MAC) | defined(APP_WIN)
97 if (window()->isActiveWindow()) {
98 brush = QBrush(QColor(0xdd, 0xe4, 0xeb));
100 brush = palette().window();
102 QPainter painter(this);
103 painter.fillRect(0, 0, width(), height(), brush);
107 void AboutView::appear() {
109 mac::uncloseWindow(window()->winId());
110 #ifdef APP_ACTIVATION
111 mac::CheckForUpdates();