Skip to content

Commit

Permalink
Improve Settings dialog design.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Oct 23, 2023
1 parent 96fecb6 commit bc91eac
Show file tree
Hide file tree
Showing 6 changed files with 649 additions and 422 deletions.
27 changes: 16 additions & 11 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "theme.h"
#include "configfile.h"
#include "application.h"
#include "configfile.h"
#include "owncloudsetupwizard.h"
#include "accountmanager.h"
#include "guiutility.h"
Expand Down Expand Up @@ -124,7 +123,7 @@ void createDebugArchive(const QString &filename)
zip.writeData(clientParameters, clientParameters.size());
zip.finishWriting(clientParameters.size());

const auto buildInfo = QString(OCC::Theme::instance()->about() + "\n\n" + OCC::Theme::instance()->aboutDetails()).toUtf8();
const auto buildInfo = QString(OCC::Theme::instance()->aboutInfo() + "\n\n" + OCC::Theme::instance()->aboutDetails()).toUtf8();
zip.prepareWriting("__nextcloud_client_buildinfo.txt", {}, {}, buildInfo.size());
zip.writeData(buildInfo, buildInfo.size());
zip.finishWriting(buildInfo.size());
Expand Down Expand Up @@ -169,14 +168,17 @@ GeneralSettings::GeneralSettings(QWidget *parent)
}

// setup about section
QString about = Theme::instance()->about();
_ui->aboutLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
_ui->aboutLabel->setText(about);
_ui->aboutLabel->setOpenExternalLinks(true);
_ui->infoAndUpdatesLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
_ui->infoAndUpdatesLabel->setText(Theme::instance()->about());
_ui->infoAndUpdatesLabel->setOpenExternalLinks(true);

// About legal notice
connect(_ui->legalNoticeButton, &QPushButton::clicked, this, &GeneralSettings::slotShowLegalNotice);

connect(_ui->usageDocumentationButton, &QPushButton::clicked, this, []() {
Utility::openBrowser(QUrl(Theme::instance()->helpUrl()));
});

loadMiscSettings();
// updater info now set in: customizeStyle
//slotUpdateInfo();
Expand Down Expand Up @@ -277,7 +279,7 @@ void GeneralSettings::slotUpdateInfo()
const auto updater = Updater::instance();
if (ConfigFile().skipUpdateCheck() || !updater) {
// updater disabled on compile
_ui->updatesGroupBox->setVisible(false);
_ui->updatesContainer->setVisible(false);
return;
}

Expand Down Expand Up @@ -517,15 +519,18 @@ void GeneralSettings::slotStyleChanged()
void GeneralSettings::customizeStyle()
{
// setup about section
QString about = Theme::instance()->about();
Theme::replaceLinkColorStringBackgroundAware(about);
_ui->aboutLabel->setText(about);
const auto aboutText = []() {
auto aboutText = Theme::instance()->about();
Theme::replaceLinkColorStringBackgroundAware(aboutText);
return aboutText;
}();
_ui->infoAndUpdatesLabel->setText(aboutText);

#if defined(BUILD_UPDATER)
// updater info
slotUpdateInfo();
#else
_ui->updatesGroupBox->setVisible(false);
_ui->updatesContainer->setVisible(false);
#endif
}

Expand Down
Loading

0 comments on commit bc91eac

Please sign in to comment.