Files
strawberry/src/dialogs/about.cpp

81 lines
2.5 KiB
C++

/*
* Strawberry Music Player
* This file was part of Clementine.
* Copyright 2010, David Sansome <me@davidsansome.com>
* Copyright 2013-2021, Jonas Kvinge <jonas@jkvinge.net>
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include <QCoreApplication>
#include <QWidget>
#include <QDialog>
#include <QDialogButtonBox>
#include <QString>
#include <QFlags>
#include <QFont>
#include <QLabel>
#include <QPushButton>
#include <QKeySequence>
#include "about.h"
#include "ui_about.h"
using namespace Qt::Literals::StringLiterals;
About::About(QWidget *parent) : QDialog(parent), ui_{} {
ui_.setupUi(this);
setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);
setWindowTitle(tr("About Strawberry"));
QFont title_font;
title_font.setBold(true);
title_font.setPointSize(title_font.pointSize() + 4);
ui_.label_title->setFont(title_font);
ui_.label_title->setText(windowTitle());
ui_.label_text->setText(MainHtml());
ui_.buttonBox->button(QDialogButtonBox::Close)->setShortcut(QKeySequence::Close);
}
QString About::MainHtml() const {
QString ret;
ret += "<p>"_L1;
ret += tr("Version %1").arg(QCoreApplication::applicationVersion());
ret += "</p>"_L1;
ret += "<p>"_L1;
ret += tr("Fork of %1.").arg(QStringLiteral("<a style=\"color:%1;\" href=\"https://github.com/clementine-player/Clementine\">Clementine</a>").arg(palette().text().color().name()));
ret += "</p>"_L1;
ret += "<p>"_L1;
ret += tr("Source code: %1").arg(QStringLiteral("<a style=\"color:%1;\" href=\"https://gitea.dryark.com/dryark/strawberry\">gitea.dryark.com/dryark/strawberry</a>").arg(palette().text().color().name()));
ret += "</p>"_L1;
ret += "<p>"_L1;
ret += tr("License: %1").arg(QStringLiteral("<a style=\"color:%1;\" href=\"https://www.gnu.org/licenses/gpl-3.0.html\">GPLv3</a>").arg(palette().text().color().name()));
ret += "</p>"_L1;
return ret;
}