diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-02-21 13:14:29 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-10-07 14:28:38 +0300 |
commit | 7a783c233f986544388ad4b61811fa3d6a59c552 (patch) | |
tree | 0d595b7741619cac8799844e150b6b61f8ddf656 /src/gui/aboutdialog.cpp | |
parent | 83c1ba1bcaaf0b24bf289f66cecd99c83f54a5f3 (diff) |
[Gui]Redesign AboutDialog and unify version info
Fixes: #7749
Fixes: #7704
Diffstat (limited to 'src/gui/aboutdialog.cpp')
-rw-r--r-- | src/gui/aboutdialog.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gui/aboutdialog.cpp b/src/gui/aboutdialog.cpp new file mode 100644 index 000000000..e019aa7eb --- /dev/null +++ b/src/gui/aboutdialog.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> + * + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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. + */ +#include "aboutdialog.h" +#include "ui_aboutdialog.h" + +#include "theme.h" +#include "guiutility.h" + +namespace OCC { + +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent) + , ui(new Ui::AboutDialog) +{ + ui->setupUi(this); + setWindowTitle(tr("About %1").arg(Theme::instance()->appNameGUI())); + ui->aboutText->setText(Theme::instance()->about()); + ui->icon->setPixmap(Theme::instance()->applicationIcon().pixmap(256)); + ui->versionInfo->setText(Theme::instance()->aboutVersions(Theme::VersionFormat::RichText)); + + connect(ui->versionInfo, &QTextBrowser::anchorClicked, this, &AboutDialog::openBrowserFromUrl); + connect(ui->aboutText, &QLabel::linkActivated, this, &AboutDialog::openBrowser); + setAttribute(Qt::WA_DeleteOnClose); +} + +AboutDialog::~AboutDialog() +{ + delete ui; +} + +void AboutDialog::openBrowser(const QString &s) +{ + Utility::openBrowser(s, this); +} + +void AboutDialog::openBrowserFromUrl(const QUrl &s) +{ + return openBrowser(s.toString()); +} + +} |