From: Michael Schuster Date: Sat, 7 Mar 2020 05:45:41 +0000 (+0100) Subject: Settings dialog: Move detailed version info from About section to Legal notice dialog X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~323^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d8c407ac9728e26d9898a9869fe7b4bfd3e5987f;p=nextcloud-desktop.git Settings dialog: Move detailed version info from About section to Legal notice dialog - Enlarge dialog widget to show full content - Implement Dark-/Light-Mode switching (hyperlinks) Signed-off-by: Michael Schuster --- diff --git a/src/gui/legalnotice.cpp b/src/gui/legalnotice.cpp index 9cf33c2e8..034c22e9d 100644 --- a/src/gui/legalnotice.cpp +++ b/src/gui/legalnotice.cpp @@ -14,6 +14,7 @@ #include "legalnotice.h" #include "ui_legalnotice.h" +#include "theme.h" namespace OCC { @@ -24,21 +25,47 @@ LegalNotice::LegalNotice(QDialog *parent) { _ui->setupUi(this); + connect(_ui->closeButton, &QPushButton::clicked, this, &LegalNotice::accept); + + customizeStyle(); +} + +LegalNotice::~LegalNotice() +{ + delete _ui; +} + +void LegalNotice::changeEvent(QEvent *e) +{ + switch (e->type()) { + case QEvent::StyleChange: + case QEvent::PaletteChange: + case QEvent::ThemeChange: + customizeStyle(); + break; + default: + break; + } + + QDialog::changeEvent(e); +} + +void LegalNotice::customizeStyle() +{ QString notice = tr("

Copyright 2017-2020 Nextcloud GmbH
" "Copyright 2012-2018 ownCloud GmbH

"); notice += tr("

Licensed under the GNU General Public License (GPL) Version 2.0 or any later version.

"); + notice += "

 

"; + notice += Theme::instance()->aboutDetails(); + + Theme::replaceLinkColorStringBackgroundAware(notice); + _ui->notice->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction); _ui->notice->setText(notice); _ui->notice->setWordWrap(true); - - connect(_ui->closeButton, &QPushButton::clicked, this, &LegalNotice::accept); + _ui->notice->setOpenExternalLinks(true); } -LegalNotice::~LegalNotice() -{ - delete _ui; -} - -} +} // namespace OCC diff --git a/src/gui/legalnotice.h b/src/gui/legalnotice.h index 38cbdd16f..ee0cb9d4e 100644 --- a/src/gui/legalnotice.h +++ b/src/gui/legalnotice.h @@ -37,7 +37,12 @@ public: explicit LegalNotice(QDialog *parent = nullptr); ~LegalNotice(); +protected: + void changeEvent(QEvent *) override; + private: + void customizeStyle(); + Ui::LegalNotice *_ui; }; diff --git a/src/gui/legalnotice.ui b/src/gui/legalnotice.ui index 1411ad892..5f0f69703 100644 --- a/src/gui/legalnotice.ui +++ b/src/gui/legalnotice.ui @@ -6,8 +6,8 @@ 0 0 - 291 - 260 + 591 + 360