7 AboutView::AboutView(QWidget *parent) : QWidget(parent) {
9 QBoxLayout *aboutlayout = new QHBoxLayout(this);
10 aboutlayout->setAlignment(Qt::AlignCenter);
11 aboutlayout->setMargin(30);
12 aboutlayout->setSpacing(30);
14 QLabel *logo = new QLabel(this);
15 QString resource = "app";
17 resource = Extra::resourceName(resource);
19 logo->setPixmap(QPixmap(":/images/" + resource + ".png"));
20 aboutlayout->addWidget(logo, 0, Qt::AlignTop);
22 QBoxLayout *layout = new QVBoxLayout();
23 layout->setAlignment(Qt::AlignCenter);
24 layout->setSpacing(30);
25 aboutlayout->addLayout(layout);
27 QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body><h1>" + QString(Constants::NAME) + "</h1>"
28 "<p>" + tr("There's life outside the browser!") + "</p>"
29 "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
30 + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE) +
32 #if !defined(APP_MAC) && !defined(APP_WIN)
33 "<p>" + tr("%1 is Free Software but its development takes precious time.").arg(Constants::NAME) + "<br/>"
34 + tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
35 .arg(QString(Constants::WEBSITE).append("#donate"), Constants::NAME) + "</p>"
38 "<p>" + tr("You may want to try my other apps as well:") + "</p>"
41 + "<li>" + tr("%1, a YouTube music player")
42 .arg("<a href='http://flavio.tordini.org/musictube'>Musictube</a>")
45 + "<li>" + tr("%1, a music player")
46 .arg("<a href='http://flavio.tordini.org/musique'>Musique</a>")
51 "<p>" + tr("Translate %1 to your native language using %2").arg(Constants::NAME)
52 .arg("<a href='http://www.transifex.net/projects/p/" + QString(Constants::UNIX_NAME) + "/resource/main/'>Transifex</a>")
56 + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.com/'>David Nel</a>")
59 #if !defined(APP_MAC) && !defined(APP_WIN)
60 "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
61 .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
63 "<p>© 2009-2012 " + Constants::ORG_NAME + "</p>"
65 QLabel *infoLabel = new QLabel(info, this);
66 infoLabel->setOpenExternalLinks(true);
67 infoLabel->setWordWrap(true);
68 layout->addWidget(infoLabel);
70 QLayout *buttonLayout = new QHBoxLayout();
71 buttonLayout->setAlignment(Qt::AlignLeft);
73 QPushButton *closeButton = new QPushButton(tr("&Close"), this);
74 closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
75 closeButton->setDefault(true);
76 closeButton->setFocus(Qt::OtherFocusReason);
77 connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
78 buttonLayout->addWidget(closeButton);
81 QPushButton *issueButton = new QPushButton(tr("&Report an issue"), this);
82 issueButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
83 connect(issueButton, SIGNAL(clicked()), window(), SLOT(reportIssue()));
84 buttonLayout->addWidget(issueButton);
87 layout->addLayout(buttonLayout);
91 void AboutView::paintEvent(QPaintEvent * /*event*/) {
92 #if defined(APP_MAC) | defined(APP_WIN)
94 if (window()->isActiveWindow()) {
95 brush = QBrush(QColor(0xdd, 0xe4, 0xeb));
97 brush = palette().window();
99 QPainter painter(this);
100 painter.fillRect(0, 0, width(), height(), brush);