mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
feat: add remote server version to the about dialog (#1603)
This commit is contained in:
parent
7e3068d87a
commit
270a937909
3 changed files with 24 additions and 4 deletions
|
@ -16,15 +16,34 @@
|
|||
|
||||
#include "AboutDialog.h"
|
||||
#include "LicenseDialog.h"
|
||||
#include "Session.h"
|
||||
#include "Utils.h"
|
||||
|
||||
AboutDialog::AboutDialog(QWidget* parent) :
|
||||
AboutDialog::AboutDialog(Session& session, QWidget* parent) :
|
||||
BaseDialog(parent)
|
||||
{
|
||||
ui_.setupUi(this);
|
||||
|
||||
ui_.iconLabel->setPixmap(QApplication::windowIcon().pixmap(48));
|
||||
ui_.titleLabel->setText(tr("<b style='font-size:x-large'>Transmission %1</b>").arg(QStringLiteral(LONG_VERSION_STRING)));
|
||||
|
||||
if (session.isServer())
|
||||
{
|
||||
auto const title = QStringLiteral("<b style='font-size:x-large'>Transmission %1</b>")
|
||||
.arg(QStringLiteral(LONG_VERSION_STRING));
|
||||
ui_.titleLabel->setText(title);
|
||||
}
|
||||
else
|
||||
{
|
||||
QString title = QStringLiteral(
|
||||
"<div style='font-size:x-large; font-weight: bold; text-align: center'>Transmission</div>");
|
||||
title += QStringLiteral("<div style='text-align: center'>%1: %2</div>")
|
||||
.arg(tr("This GUI"))
|
||||
.arg(QStringLiteral(LONG_VERSION_STRING));
|
||||
title += QStringLiteral("<div style='text-align: center'>%1: %2</div>")
|
||||
.arg(tr("Remote"))
|
||||
.arg(session.sessionVersion());
|
||||
ui_.titleLabel->setText(title);
|
||||
}
|
||||
|
||||
QPushButton const* b = ui_.dialogButtons->addButton(tr("C&redits"), QDialogButtonBox::ActionRole);
|
||||
connect(b, &QAbstractButton::clicked, this, &AboutDialog::showCredits);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "ui_AboutDialog.h"
|
||||
|
||||
class LicenseDialog;
|
||||
class Session;
|
||||
|
||||
class AboutDialog : public BaseDialog
|
||||
{
|
||||
|
@ -22,7 +23,7 @@ class AboutDialog : public BaseDialog
|
|||
TR_DISABLE_COPY_MOVE(AboutDialog)
|
||||
|
||||
public:
|
||||
explicit AboutDialog(QWidget* parent = nullptr);
|
||||
explicit AboutDialog(Session& session, QWidget* parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void showCredits();
|
||||
|
|
|
@ -676,7 +676,7 @@ void MainWindow::openDonate() const
|
|||
|
||||
void MainWindow::openAbout()
|
||||
{
|
||||
Utils::openDialog(about_dialog_, this);
|
||||
Utils::openDialog(about_dialog_, session_, this);
|
||||
}
|
||||
|
||||
void MainWindow::openHelp() const
|
||||
|
|
Loading…
Reference in a new issue