From c007dd473458c6a26e40c1e423e3f65b39fa9108 Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 11:32:53 +0100 Subject: [PATCH 01/18] general settings dialog changes --- src/gui/CMakeLists.txt | 7 + src/gui/generalsettings.h | 6 + src/gui/nmcgui/nmcgeneralsettings.cpp | 194 +++++++++++++++++++++++ src/gui/nmcgui/nmcgeneralsettings.h | 66 ++++++++ src/gui/settingsdialog.cpp | 10 ++ src/libsync/CMakeLists.txt | 4 + src/libsync/configfile.h | 4 +- src/libsync/nmclibsync/nmcconfigfile.cpp | 47 ++++++ src/libsync/nmclibsync/nmcconfigfile.h | 64 ++++++++ 9 files changed, 400 insertions(+), 2 deletions(-) create mode 100644 src/gui/nmcgui/nmcgeneralsettings.cpp create mode 100644 src/gui/nmcgui/nmcgeneralsettings.h create mode 100644 src/libsync/nmclibsync/nmcconfigfile.cpp create mode 100644 src/libsync/nmclibsync/nmcconfigfile.h diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b68e5fd9287e4..05b7d3143899d 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,6 +6,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) +#NMC customization: needed to find the ui file in a different location than the header file +set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") + if(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -248,6 +251,10 @@ set(client_SRCS integration/fileactionsmodel.cpp ) +file(GLOB NMC_FILES "nmcgui/*") +set(NMC_SRCS ${NMC_FILES}) +list(APPEND client_SRCS ${NMC_SRCS}) + if (NOT DISABLE_ACCOUNT_MIGRATION) list(APPEND client_SRCS legacyaccountselectiondialog.h diff --git a/src/gui/generalsettings.h b/src/gui/generalsettings.h index 9b69b94e59d99..ece7afe50d16b 100644 --- a/src/gui/generalsettings.h +++ b/src/gui/generalsettings.h @@ -28,6 +28,12 @@ class GeneralSettings : public QWidget ~GeneralSettings() override; [[nodiscard]] QSize sizeHint() const override; +protected: + Ui::GeneralSettings *getUi() const + { + return _ui; + } + public slots: void slotStyleChanged(); diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp new file mode 100644 index 0000000000000..f2335ff114f6e --- /dev/null +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (C) by Eugen Fischer + * + * 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 "nmcgeneralsettings.h" +#include "generalsettings.h" +#include "nmclibsync/nmcconfigfile.h" +#include "ui_generalsettings.h" +#include "theme.h" + + +namespace OCC { + +NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) + : GeneralSettings(parent) +{ + setDefaultSettings(); + setNMCLayout(); +} + +void NMCGeneralSettings::setDefaultSettings() +{ + //Set default settings + //General settings + getUi()->autostartCheckBox->setCheckState(Qt::Checked); + getUi()->monoIconsCheckBox->setCheckState(Qt::Unchecked); + getUi()->serverNotificationsCheckBox->setCheckState(Qt::Unchecked); + getUi()->callNotificationsCheckBox->setCheckState(Qt::Unchecked); + //Advanced settings + getUi()->newFolderLimitCheckBox->setCheckState(Qt::Unchecked); + //Info settings + getUi()->aboutAndUpdatesGroupBox->setTitle(tr("Update")); + //Hide unsupported settings + //General settings + getUi()->monoIconsCheckBox->setVisible(false); + getUi()->callNotificationsCheckBox->setVisible(false); + //Advanced settings + getUi()->groupBox->setVisible(false); + //Info settings + getUi()->aboutAndUpdatesGroupBox->setVisible(false); +} + +void NMCGeneralSettings::setNMCLayout() +{ + // General settings + auto generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS")); + generalSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + getUi()->chatNotificationsCheckBox->hide(); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); + getUi()->generalGroupBox->setTitle({}); + static_cast(getUi()->generalGroupBox->layout())->addWidget(generalSettingsLabel, 0, 0); + static_cast(getUi()->generalGroupBox->layout())->addWidget(getUi()->autostartCheckBox, 1, 0); + static_cast(getUi()->generalGroupBox->layout())->addWidget(getUi()->serverNotificationsCheckBox, 2, 0); + getUi()->generalGroupBox->layout()->setContentsMargins(16, 16, 16, 16); + getUi()->generalGroupBox->layout()->setSpacing(8); + getUi()->generalGroupBox->setStyleSheet("border-radius: 4px;"); + getUi()->generalGroupBox->setStyleSheet(getUi()->generalGroupBox->styleSheet()); + + getUi()->autostartCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + getUi()->serverNotificationsCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + + // Advanced settings + auto advancedSettingsLabel = new QLabel(QCoreApplication::translate("", "ADVANCED_SETTINGS")); + advancedSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + QGroupBox *advancedSettingsBox = new QGroupBox(this); + advancedSettingsBox->setTitle(""); + advancedSettingsBox->setLayout(new QVBoxLayout); + advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); + advancedSettingsBox->layout()->setSpacing(8); + advancedSettingsBox->setStyleSheet("border-radius: 4px;"); + + getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); + getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); + + getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); + getUi()->ignoredFilesButton->setStyleSheet(R"( + QPushButton { + min-height: 32px; + min-width: 200px; + border: 1px solid black; + color: black; + background-color: #ededed; + font-size: 13px; + border-radius: 4px; + } + QPushButton:hover { + background-color: white; + } + )"); + + advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); + advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); + advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); + advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); + advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); + getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + + getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); + + //Datenschutz + auto updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS")); + updatesLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + QGroupBox *dataProtectionBox = new QGroupBox(this); + dataProtectionBox->setTitle(""); + dataProtectionBox->setLayout(new QVBoxLayout); + dataProtectionBox->layout()->setContentsMargins(16, 16, 16, 16); + dataProtectionBox->layout()->setSpacing(8); + dataProtectionBox->setStyleSheet("border-radius: 4px;"); + dataProtectionBox->setStyleSheet(dataProtectionBox->styleSheet()); + + auto *dataAnalysisCheckBox = new QCheckBox(this); + dataAnalysisCheckBox->setText(QCoreApplication::translate("", "DATA_ANALYSIS")); + dataAnalysisCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + getUi()->autoCheckForUpdatesCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + + dataProtectionBox->layout()->addWidget(updatesLabel); + dataProtectionBox->layout()->addWidget(getUi()->autoCheckForUpdatesCheckBox); + dataProtectionBox->layout()->addWidget(dataAnalysisCheckBox); + + connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool toggle){ + NMCConfigFile cfgFile; + cfgFile.setTransferUsageData(toggle, QString()); + }); + NMCConfigFile cfgFile; + dataAnalysisCheckBox->setChecked(cfgFile.transferUsageData()); + + dataProtectionBox->layout()->addItem(new QSpacerItem(1,8,QSizePolicy::Fixed,QSizePolicy::Fixed)); + + auto *dataAnalysisImpressum = new QLabel(this); + dataAnalysisImpressum->setText(QString("%1").arg(QCoreApplication::translate("", "IMPRESSUM"))); + dataAnalysisImpressum->setTextFormat(Qt::RichText); + dataAnalysisImpressum->setTextInteractionFlags(Qt::TextBrowserInteraction); + dataAnalysisImpressum->setOpenExternalLinks(true); + dataAnalysisImpressum->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dataAnalysisImpressum->setStyleSheet("font-size: 13px"); + dataProtectionBox->layout()->addWidget(dataAnalysisImpressum); + + auto *dataAnalysisData = new QLabel(this); + dataAnalysisData->setText(QString("%1").arg(QCoreApplication::translate("", "DATA_PROTECTION"))); + dataAnalysisData->setTextFormat(Qt::RichText); + dataAnalysisData->setTextInteractionFlags(Qt::TextBrowserInteraction); + dataAnalysisData->setOpenExternalLinks(true); + dataAnalysisData->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dataAnalysisData->setStyleSheet("font-size: 13px"); + dataProtectionBox->layout()->addWidget(dataAnalysisData); + + auto *dataAnalysisOpenSource = new QLabel(this); + dataAnalysisOpenSource->setText(QString("%1").arg(QCoreApplication::translate("", "LICENCE"))); + dataAnalysisOpenSource->setTextFormat(Qt::RichText); + dataAnalysisOpenSource->setTextInteractionFlags(Qt::TextBrowserInteraction); + dataAnalysisOpenSource->setOpenExternalLinks(true); + dataAnalysisOpenSource->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dataAnalysisOpenSource->setStyleSheet("font-size: 13px"); + dataProtectionBox->layout()->addWidget(dataAnalysisOpenSource); + + auto *dataAnalysisFurtherInfo = new QLabel(this); + dataAnalysisFurtherInfo->setText(QString("%1").arg(QCoreApplication::translate("", "FURTHER_INFO"))); + dataAnalysisFurtherInfo->setTextFormat(Qt::RichText); + dataAnalysisFurtherInfo->setTextInteractionFlags(Qt::TextBrowserInteraction); + dataAnalysisFurtherInfo->setOpenExternalLinks(true); + dataAnalysisFurtherInfo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dataAnalysisFurtherInfo->setStyleSheet("font-size: 13px"); + dataProtectionBox->layout()->addWidget(dataAnalysisFurtherInfo); + + dataProtectionBox->layout()->addItem(new QSpacerItem(1,8,QSizePolicy::Fixed,QSizePolicy::Fixed)); + + auto *currentVersion = new QLabel(this); + currentVersion->setText(Theme::instance()->about()); + currentVersion->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + //Todo, set current version + dataProtectionBox->layout()->addWidget(currentVersion); + + getUi()->gridLayout_3->addWidget(dataProtectionBox, 3, 0); + + auto *vExpandSpacer = new QSpacerItem(1,1,QSizePolicy::Fixed,QSizePolicy::Expanding); + getUi()->gridLayout_3->layout()->addItem(vExpandSpacer); +} + +} // namespace OCC \ No newline at end of file diff --git a/src/gui/nmcgui/nmcgeneralsettings.h b/src/gui/nmcgui/nmcgeneralsettings.h new file mode 100644 index 0000000000000..e3dcc7c755762 --- /dev/null +++ b/src/gui/nmcgui/nmcgeneralsettings.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) by Eugen Fischer + * + * 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. + */ + +#ifndef MIRALL_GENERALSETTINGSMAGENTA_H +#define MIRALL_GENERALSETTINGSMAGENTA_H + +#include "generalsettings.h" + +namespace OCC { + +/** + * @brief The NMCGeneralSettings class + * + * This class represents the Magenta-specific implementation of general settings + * for a graphical user interface. It inherits from the base class GeneralSettings. + * + * @ingroup gui + */ +class NMCGeneralSettings : public GeneralSettings +{ + Q_OBJECT + +public: + /** + * @brief Constructor for NMCGeneralSettings + * + * Creates an instance of NMCGeneralSettings with the specified parent widget. + * + * @param parent The parent widget (default is nullptr). + */ + explicit NMCGeneralSettings(QWidget *parent = nullptr); + + /** + * @brief Destructor for NMCGeneralSettings + */ + ~NMCGeneralSettings() = default; + +protected: + /** + * @brief Set default settings + * + * Sets the default values for Magenta-specific general settings. + */ + void setDefaultSettings(); + + /** + * @brief Set layout + * + * Sets the layout for the Magenta-specific general settings user interface. + */ + void setNMCLayout(); +}; + +} // namespace OCC +#endif // MIRALL_GENERALSETTINGSMAGENTA_H \ No newline at end of file diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index fb66182fab055..fb61a0dd58772 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -10,6 +10,7 @@ #include "folderman.h" #include "theme.h" #include "generalsettings.h" +#include "nmcgui/nmcgeneralsettings.h" #include "infosettings.h" #include "networksettings.h" #include "accountsettings.h" @@ -169,6 +170,15 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _actionGroup->setExclusive(true); connect(_actionGroup, &QActionGroup::triggered, this, &SettingsDialog::slotSwitchPage); + QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General")); + _actionGroup->addAction(generalAction); + _toolBar->addAction(generalAction); + auto *accountSpacer = new QWidget(this); + accountSpacer->setFixedHeight(16); + _toolBar->addWidget(accountSpacer); + _toolBar->addSeparator(); + auto *generalSettings = new NMCGeneralSettings; + _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); const auto accountsList = AccountManager::instance()->accounts(); diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index be060e8ce275e..49279f0cce004 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -168,6 +168,10 @@ set(libsync_SRCS caseclashconflictsolver.cpp ) +file(GLOB NMC_FILES "nmclibsync/*") +set(NMC_SRCS ${NMC_FILES}) +list(APPEND libsync_SRCS ${NMC_SRCS}) + if (WIN32) # to fix warnings from ntstatus.h add_definitions(-DUMDF_USING_NTSTATUS) diff --git a/src/libsync/configfile.h b/src/libsync/configfile.h index 14a5968970e11..b1509d4531585 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -321,10 +321,10 @@ class OWNCLOUDSYNC_EXPORT ConfigFile [[nodiscard]] QVariant retrieveData(const QString &group, const QString &key) const; void removeData(const QString &group, const QString &key); [[nodiscard]] bool dataExists(const QString &group, const QString &key) const; - -private: [[nodiscard]] QVariant getValue(const QString ¶m, const QString &group = QString(), const QVariant &defaultValue = QVariant()) const; + +private: void setValue(const QString &key, const QVariant &value); [[nodiscard]] QString keychainProxyPasswordKey() const; diff --git a/src/libsync/nmclibsync/nmcconfigfile.cpp b/src/libsync/nmclibsync/nmcconfigfile.cpp new file mode 100644 index 0000000000000..48eb0a77dd0be --- /dev/null +++ b/src/libsync/nmclibsync/nmcconfigfile.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) by Eugen Fischer + * + * 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 "nmcconfigfile.h" + +namespace OCC { + +bool NMCConfigFile::transferUsageData(const QString &connection) const +{ + QString con(connection); + if (connection.isEmpty()) + { + con = defaultConnection(); + } + QVariant fallback = getValue(m_transferUsageData, con, false); + fallback = getValue(m_transferUsageData, QString(), fallback); + + QVariant value = getPolicySetting(m_transferUsageData, fallback); + return value.toBool(); +} + +void NMCConfigFile::setTransferUsageData(bool usageData, const QString &connection) +{ + QString con(connection); + if (connection.isEmpty()) + { + con = defaultConnection(); + } + QSettings settings(configFile(), QSettings::IniFormat); + settings.beginGroup(con); + + settings.setValue(m_transferUsageData, QVariant(usageData)); + settings.sync(); +} + +} // namespace OCC \ No newline at end of file diff --git a/src/libsync/nmclibsync/nmcconfigfile.h b/src/libsync/nmclibsync/nmcconfigfile.h new file mode 100644 index 0000000000000..1c8f66f6d9921 --- /dev/null +++ b/src/libsync/nmclibsync/nmcconfigfile.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) by Eugen Fischer + * + * 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. + */ + +#ifndef MIRALL_NMCCONFIGFILE_H +#define MIRALL_NMCCONFIGFILE_H + +#include "configfile.h" + +namespace OCC { + +/** + * @brief The NMCConfigFile class. + * @ingroup lib + * + * Subclass of ConfigFile representing the configuration file for NMC (MagentaCustomization) in the OwnCloud Sync library. + */ +class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile +{ +public: + /** + * @brief Default constructor for NMCConfigFile. + */ + explicit NMCConfigFile() = default; + + /** + * @brief Default destructor for NMCConfigFile. + */ + ~NMCConfigFile() = default; + + /** + * @brief Check if transferring usage data is enabled. + * + * @param connection Optional parameter specifying the connection; default is an empty string. + * @return True if transferring usage data is enabled, false otherwise. + */ + [[nodiscard]] bool transferUsageData(const QString &connection = QString()) const; + + /** + * @brief Set the status of transferring usage data. + * + * @param usageData True to enable transferring usage data, false to disable. + * @param connection Optional parameter specifying the connection; default is an empty string. + */ + void setTransferUsageData(bool usageData, const QString &connection); + +private: + QString m_transferUsageData = "TransferUsageData"; ///< Configuration key for storing the status of transferring usage data. +}; + + + +} // namespace OCC +#endif // MIRALL_NMCCONFIGFILE_H \ No newline at end of file From 2f6a8bcce4c05a979699e21a8bfcade007f40f4a Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 14:50:25 +0100 Subject: [PATCH 02/18] updated gui cmake file --- src/gui/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 05b7d3143899d..20ed138bb6ed4 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,9 +6,6 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) -#NMC customization: needed to find the ui file in a different location than the header file -set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") - if(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -36,6 +33,9 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc) set(theme_dir ${CMAKE_SOURCE_DIR}/theme) +#NMC customization: needed to find the ui file in a different location than the header file +set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") + set(client_UI_SRCS advancedsettings.ui accountsettings.ui From 88ca109c516f536ae13595e0f388c9e52ea7a26c Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 28 Oct 2025 09:23:12 +0100 Subject: [PATCH 03/18] remove quota warning checkbox --- src/gui/nmcgui/nmcgeneralsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index f2335ff114f6e..3652f822704fe 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -59,6 +59,7 @@ void NMCGeneralSettings::setNMCLayout() getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->quotaWarningNotificationsCheckBox); getUi()->generalGroupBox->setTitle({}); static_cast(getUi()->generalGroupBox->layout())->addWidget(generalSettingsLabel, 0, 0); static_cast(getUi()->generalGroupBox->layout())->addWidget(getUi()->autostartCheckBox, 1, 0); From 9604f67ba0a229da1c6719677a165e0bf06acf2f Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 28 Oct 2025 09:25:52 +0100 Subject: [PATCH 04/18] set new default settings --- src/gui/nmcgui/nmcgeneralsettings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 3652f822704fe..9280a62677c4b 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -36,6 +36,7 @@ void NMCGeneralSettings::setDefaultSettings() getUi()->monoIconsCheckBox->setCheckState(Qt::Unchecked); getUi()->serverNotificationsCheckBox->setCheckState(Qt::Unchecked); getUi()->callNotificationsCheckBox->setCheckState(Qt::Unchecked); + getUi()->quotaWarningNotificationsCheckBox->setCheckState(Qt::Unchecked); //Advanced settings getUi()->newFolderLimitCheckBox->setCheckState(Qt::Unchecked); //Info settings @@ -44,6 +45,7 @@ void NMCGeneralSettings::setDefaultSettings() //General settings getUi()->monoIconsCheckBox->setVisible(false); getUi()->callNotificationsCheckBox->setVisible(false); + getUi()->quotaWarningNotificationsCheckBox->setVisible(false); //Advanced settings getUi()->groupBox->setVisible(false); //Info settings From 33deed4bc380b38db81c302d10c9b9380df881c6 Mon Sep 17 00:00:00 2001 From: memurats Date: Fri, 14 Nov 2025 12:41:27 +0100 Subject: [PATCH 05/18] ignore editor changes --- src/gui/ignorelisteditor.ui | 4 ++-- src/gui/nmcgui/nmcgeneralsettings.cpp | 2 +- translations/client_de.ts | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/ignorelisteditor.ui b/src/gui/ignorelisteditor.ui index f61e6119c4500..500af406fb463 100644 --- a/src/gui/ignorelisteditor.ui +++ b/src/gui/ignorelisteditor.ui @@ -37,7 +37,7 @@ - Global Ignore Settings + @@ -109,7 +109,7 @@ - Files Ignored by Patterns + diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 9280a62677c4b..7f41dd344683f 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -194,4 +194,4 @@ void NMCGeneralSettings::setNMCLayout() getUi()->gridLayout_3->layout()->addItem(vExpandSpacer); } -} // namespace OCC \ No newline at end of file +} // namespace OCC diff --git a/translations/client_de.ts b/translations/client_de.ts index 6d3b231dff68a..9b197e37cea43 100644 --- a/translations/client_de.ts +++ b/translations/client_de.ts @@ -3700,7 +3700,6 @@ Ein Downgrade von Versionen ist nicht sofort möglich: Der Wechsel von Beta auf Items where deletion is allowed will be deleted if they prevent a directory from being removed. This is useful for meta data. Dateien oder Ordner, die diesem Muster entsprechen, werden nicht synchronisiert. - Objekte, bei denen Löschen erlaubt ist, werden gelöscht, wenn diese das Entfernen eines Ordners verhindern würden. Dies ist für Metadaten nützlich. From 24f9f7dec6db873c5a83932287e3df2119aa11bc Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 26 Jan 2026 11:27:41 +0100 Subject: [PATCH 06/18] fix connection error --- src/libsync/nmclibsync/nmcconfigfile.cpp | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/libsync/nmclibsync/nmcconfigfile.cpp b/src/libsync/nmclibsync/nmcconfigfile.cpp index 48eb0a77dd0be..f482a165f38b0 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.cpp +++ b/src/libsync/nmclibsync/nmcconfigfile.cpp @@ -13,35 +13,36 @@ */ #include "nmcconfigfile.h" +#include "theme.h" namespace OCC { bool NMCConfigFile::transferUsageData(const QString &connection) const { - QString con(connection); - if (connection.isEmpty()) - { - con = defaultConnection(); - } - QVariant fallback = getValue(m_transferUsageData, con, false); + const QString group = + connection.isEmpty() + ? Theme::instance()->appName() + : connection; + + QVariant fallback = getValue(m_transferUsageData, group, false); fallback = getValue(m_transferUsageData, QString(), fallback); - QVariant value = getPolicySetting(m_transferUsageData, fallback); + const QVariant value = getPolicySetting(m_transferUsageData, fallback); return value.toBool(); } void NMCConfigFile::setTransferUsageData(bool usageData, const QString &connection) { - QString con(connection); - if (connection.isEmpty()) - { - con = defaultConnection(); - } + const QString group = + connection.isEmpty() + ? Theme::instance()->appName() + : connection; + QSettings settings(configFile(), QSettings::IniFormat); - settings.beginGroup(con); + settings.beginGroup(group); - settings.setValue(m_transferUsageData, QVariant(usageData)); + settings.setValue(m_transferUsageData, usageData); settings.sync(); } -} // namespace OCC \ No newline at end of file +} // namespace OCC From 7e1a0fd0d8643ede7d655934b9ed9139d2370ce5 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 29 Jan 2026 08:30:06 +0100 Subject: [PATCH 07/18] fix error --- src/libsync/nmclibsync/nmcconfigfile.cpp | 4 ++++ src/libsync/nmclibsync/nmcconfigfile.h | 28 ++++++++++-------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/libsync/nmclibsync/nmcconfigfile.cpp b/src/libsync/nmclibsync/nmcconfigfile.cpp index f482a165f38b0..067539828884d 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.cpp +++ b/src/libsync/nmclibsync/nmcconfigfile.cpp @@ -14,9 +14,13 @@ #include "nmcconfigfile.h" #include "theme.h" +#include namespace OCC { +const QString NMCConfigFile::m_transferUsageData = + QStringLiteral("TransferUsageData"); + bool NMCConfigFile::transferUsageData(const QString &connection) const { const QString group = diff --git a/src/libsync/nmclibsync/nmcconfigfile.h b/src/libsync/nmclibsync/nmcconfigfile.h index 1c8f66f6d9921..78faad9873ebe 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.h +++ b/src/libsync/nmclibsync/nmcconfigfile.h @@ -16,6 +16,7 @@ #define MIRALL_NMCCONFIGFILE_H #include "configfile.h" +#include namespace OCC { @@ -23,25 +24,19 @@ namespace OCC { * @brief The NMCConfigFile class. * @ingroup lib * - * Subclass of ConfigFile representing the configuration file for NMC (MagentaCustomization) in the OwnCloud Sync library. + * Subclass of ConfigFile representing the configuration file for + * NMC (MagentaCustomization) in the OwnCloud Sync library. */ class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile { public: - /** - * @brief Default constructor for NMCConfigFile. - */ explicit NMCConfigFile() = default; - - /** - * @brief Default destructor for NMCConfigFile. - */ - ~NMCConfigFile() = default; + ~NMCConfigFile() override = default; /** * @brief Check if transferring usage data is enabled. * - * @param connection Optional parameter specifying the connection; default is an empty string. + * @param connection Optional parameter specifying the connection. * @return True if transferring usage data is enabled, false otherwise. */ [[nodiscard]] bool transferUsageData(const QString &connection = QString()) const; @@ -49,16 +44,15 @@ class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile /** * @brief Set the status of transferring usage data. * - * @param usageData True to enable transferring usage data, false to disable. - * @param connection Optional parameter specifying the connection; default is an empty string. + * @param usageData True to enable transferring usage data, false otherwise. + * @param connection Optional parameter specifying the connection. */ - void setTransferUsageData(bool usageData, const QString &connection); + void setTransferUsageData(bool usageData, const QString &connection = QString()); private: - QString m_transferUsageData = "TransferUsageData"; ///< Configuration key for storing the status of transferring usage data. + static const QString m_transferUsageData; }; - - } // namespace OCC -#endif // MIRALL_NMCCONFIGFILE_H \ No newline at end of file + +#endif // MIRALL_NMCCONFIGFILE_H From 0c8b9723286c0d8c522b86e638d5bdb24eca7c43 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 29 Jan 2026 08:44:15 +0100 Subject: [PATCH 08/18] fix error --- src/libsync/nmclibsync/nmcconfigfile.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsync/nmclibsync/nmcconfigfile.h b/src/libsync/nmclibsync/nmcconfigfile.h index 78faad9873ebe..bd47e1418fca8 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.h +++ b/src/libsync/nmclibsync/nmcconfigfile.h @@ -30,8 +30,8 @@ namespace OCC { class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile { public: - explicit NMCConfigFile() = default; - ~NMCConfigFile() override = default; + NMCConfigFile() = default; + ~NMCConfigFile() = default; /** * @brief Check if transferring usage data is enabled. From 061f0e5136c491e67daed8e635d235c71a84ef9f Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 26 May 2026 11:59:38 +0200 Subject: [PATCH 09/18] fix error --- src/gui/nmcgui/nmcgeneralsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 7f41dd344683f..8c40afc17e7d6 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -47,7 +47,7 @@ void NMCGeneralSettings::setDefaultSettings() getUi()->callNotificationsCheckBox->setVisible(false); getUi()->quotaWarningNotificationsCheckBox->setVisible(false); //Advanced settings - getUi()->groupBox->setVisible(false); + getUi()->advancedGroupBox->setVisible(false); //Info settings getUi()->aboutAndUpdatesGroupBox->setVisible(false); } From 79f380fb8f32e4566b2900b76cf4936feb3b7a92 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 10:49:07 +0200 Subject: [PATCH 10/18] fix general settings dialog --- src/gui/nmcgui/nmcgeneralsettings.cpp | 181 ++++++++++++++--------- src/libsync/nmclibsync/nmcconfigfile.cpp | 11 +- 2 files changed, 116 insertions(+), 76 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 8c40afc17e7d6..ee55744ad4825 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -18,6 +18,19 @@ #include "ui_generalsettings.h" #include "theme.h" +#include +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_WIN +#define BACKGROUND_PALETTE "alternate-base" +#else +#define BACKGROUND_PALETTE "light" +#endif namespace OCC { @@ -30,59 +43,73 @@ NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) void NMCGeneralSettings::setDefaultSettings() { - //Set default settings - //General settings - getUi()->autostartCheckBox->setCheckState(Qt::Checked); - getUi()->monoIconsCheckBox->setCheckState(Qt::Unchecked); - getUi()->serverNotificationsCheckBox->setCheckState(Qt::Unchecked); - getUi()->callNotificationsCheckBox->setCheckState(Qt::Unchecked); - getUi()->quotaWarningNotificationsCheckBox->setCheckState(Qt::Unchecked); - //Advanced settings - getUi()->newFolderLimitCheckBox->setCheckState(Qt::Unchecked); - //Info settings - getUi()->aboutAndUpdatesGroupBox->setTitle(tr("Update")); - //Hide unsupported settings - //General settings + // Do not force autostart/server notification checkbox states here. + // GeneralSettings already loads them from ConfigFile and connects their save slots. + getUi()->monoIconsCheckBox->setVisible(false); getUi()->callNotificationsCheckBox->setVisible(false); getUi()->quotaWarningNotificationsCheckBox->setVisible(false); - //Advanced settings + getUi()->advancedGroupBox->setVisible(false); - //Info settings + + getUi()->aboutAndUpdatesGroupBox->setTitle(tr("Update")); getUi()->aboutAndUpdatesGroupBox->setVisible(false); + + getUi()->newFolderLimitCheckBox->setCheckState(Qt::Unchecked); } void NMCGeneralSettings::setNMCLayout() { // General settings - auto generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS")); - generalSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + auto *generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS"), this); + generalSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + getUi()->chatNotificationsCheckBox->hide(); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->quotaWarningNotificationsCheckBox); - getUi()->generalGroupBox->setTitle({}); - static_cast(getUi()->generalGroupBox->layout())->addWidget(generalSettingsLabel, 0, 0); - static_cast(getUi()->generalGroupBox->layout())->addWidget(getUi()->autostartCheckBox, 1, 0); - static_cast(getUi()->generalGroupBox->layout())->addWidget(getUi()->serverNotificationsCheckBox, 2, 0); - getUi()->generalGroupBox->layout()->setContentsMargins(16, 16, 16, 16); - getUi()->generalGroupBox->layout()->setSpacing(8); - getUi()->generalGroupBox->setStyleSheet("border-radius: 4px;"); - getUi()->generalGroupBox->setStyleSheet(getUi()->generalGroupBox->styleSheet()); - getUi()->autostartCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); - getUi()->serverNotificationsCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + getUi()->generalGroupBox->setTitle({}); + getUi()->generalGroupBox->setObjectName(QStringLiteral("nmcGeneralSettingsBox")); + getUi()->generalGroupBox->setAttribute(Qt::WA_StyledBackground, true); + getUi()->generalGroupBox->setStyleSheet(QStringLiteral( + "#nmcGeneralSettingsBox {" + " background: palette(" BACKGROUND_PALETTE ");" + " border-radius: 4px;" + " border: none;" + "}" + )); + + auto *generalLayout = static_cast(getUi()->generalGroupBox->layout()); + generalLayout->addWidget(generalSettingsLabel, 0, 0); + generalLayout->addWidget(getUi()->autostartCheckBox, 1, 0); + generalLayout->addWidget(getUi()->serverNotificationsCheckBox, 2, 0); + generalLayout->setContentsMargins(16, 16, 16, 16); + generalLayout->setSpacing(8); + + getUi()->autostartCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->serverNotificationsCheckBox->setFocusPolicy(Qt::NoFocus); // Advanced settings - auto advancedSettingsLabel = new QLabel(QCoreApplication::translate("", "ADVANCED_SETTINGS")); - advancedSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); - QGroupBox *advancedSettingsBox = new QGroupBox(this); - advancedSettingsBox->setTitle(""); + auto *advancedSettingsLabel = new QLabel(QCoreApplication::translate("", "ADVANCED_SETTINGS"), this); + advancedSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + + auto *advancedSettingsBox = new QGroupBox(this); + advancedSettingsBox->setObjectName(QStringLiteral("nmcAdvancedSettingsBox")); + advancedSettingsBox->setAttribute(Qt::WA_StyledBackground, true); + advancedSettingsBox->setTitle({}); advancedSettingsBox->setLayout(new QVBoxLayout); advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); advancedSettingsBox->layout()->setSpacing(8); - advancedSettingsBox->setStyleSheet("border-radius: 4px;"); + advancedSettingsBox->setStyleSheet(QStringLiteral( + "#nmcAdvancedSettingsBox {" + " background: palette(" BACKGROUND_PALETTE ");" + " border-radius: 4px;" + " border: none;" + "}" + )); getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); @@ -90,107 +117,121 @@ void NMCGeneralSettings::setNMCLayout() getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); - getUi()->ignoredFilesButton->setStyleSheet(R"( - QPushButton { - min-height: 32px; - min-width: 200px; - border: 1px solid black; - color: black; - background-color: #ededed; - font-size: 13px; - border-radius: 4px; - } - QPushButton:hover { - background-color: white; - } - )"); + getUi()->ignoredFilesButton->setStyleSheet(QStringLiteral( + "QPushButton {" + " min-height: 32px;" + " min-width: 200px;" + " border: 1px solid black;" + " color: black;" + " background-color: #ededed;" + " font-size: 13px;" + " border-radius: 4px;" + "}" + "QPushButton:hover {" + " background-color: white;" + "}" + )); advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); - getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); - getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + + getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::NoFocus); getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); - //Datenschutz - auto updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS")); - updatesLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); - QGroupBox *dataProtectionBox = new QGroupBox(this); - dataProtectionBox->setTitle(""); + // Updates & info / Datenschutz + auto *updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS"), this); + updatesLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + + auto *dataProtectionBox = new QGroupBox(this); + dataProtectionBox->setObjectName(QStringLiteral("nmcUpdatesInfoBox")); + dataProtectionBox->setAttribute(Qt::WA_StyledBackground, true); + dataProtectionBox->setTitle({}); dataProtectionBox->setLayout(new QVBoxLayout); dataProtectionBox->layout()->setContentsMargins(16, 16, 16, 16); dataProtectionBox->layout()->setSpacing(8); - dataProtectionBox->setStyleSheet("border-radius: 4px;"); - dataProtectionBox->setStyleSheet(dataProtectionBox->styleSheet()); + dataProtectionBox->setStyleSheet(QStringLiteral( + "#nmcUpdatesInfoBox {" + " background: palette(" BACKGROUND_PALETTE ");" + " border-radius: 4px;" + " border: none;" + "}" + )); auto *dataAnalysisCheckBox = new QCheckBox(this); dataAnalysisCheckBox->setText(QCoreApplication::translate("", "DATA_ANALYSIS")); - dataAnalysisCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); - getUi()->autoCheckForUpdatesCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + dataAnalysisCheckBox->setFocusPolicy(Qt::NoFocus); + + getUi()->autoCheckForUpdatesCheckBox->setFocusPolicy(Qt::NoFocus); dataProtectionBox->layout()->addWidget(updatesLabel); dataProtectionBox->layout()->addWidget(getUi()->autoCheckForUpdatesCheckBox); dataProtectionBox->layout()->addWidget(dataAnalysisCheckBox); - connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool toggle){ + connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool toggle) { NMCConfigFile cfgFile; cfgFile.setTransferUsageData(toggle, QString()); }); + NMCConfigFile cfgFile; dataAnalysisCheckBox->setChecked(cfgFile.transferUsageData()); - dataProtectionBox->layout()->addItem(new QSpacerItem(1,8,QSizePolicy::Fixed,QSizePolicy::Fixed)); + dataProtectionBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); auto *dataAnalysisImpressum = new QLabel(this); - dataAnalysisImpressum->setText(QString("%1").arg(QCoreApplication::translate("", "IMPRESSUM"))); + dataAnalysisImpressum->setText(QStringLiteral("%1") + .arg(QCoreApplication::translate("", "IMPRESSUM"))); dataAnalysisImpressum->setTextFormat(Qt::RichText); dataAnalysisImpressum->setTextInteractionFlags(Qt::TextBrowserInteraction); dataAnalysisImpressum->setOpenExternalLinks(true); dataAnalysisImpressum->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisImpressum->setStyleSheet("font-size: 13px"); + dataAnalysisImpressum->setStyleSheet(QStringLiteral("font-size: 13px")); dataProtectionBox->layout()->addWidget(dataAnalysisImpressum); auto *dataAnalysisData = new QLabel(this); - dataAnalysisData->setText(QString("%1").arg(QCoreApplication::translate("", "DATA_PROTECTION"))); + dataAnalysisData->setText(QStringLiteral("%1") + .arg(QCoreApplication::translate("", "DATA_PROTECTION"))); dataAnalysisData->setTextFormat(Qt::RichText); dataAnalysisData->setTextInteractionFlags(Qt::TextBrowserInteraction); dataAnalysisData->setOpenExternalLinks(true); dataAnalysisData->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisData->setStyleSheet("font-size: 13px"); + dataAnalysisData->setStyleSheet(QStringLiteral("font-size: 13px")); dataProtectionBox->layout()->addWidget(dataAnalysisData); auto *dataAnalysisOpenSource = new QLabel(this); - dataAnalysisOpenSource->setText(QString("%1").arg(QCoreApplication::translate("", "LICENCE"))); + dataAnalysisOpenSource->setText(QStringLiteral("%1") + .arg(QCoreApplication::translate("", "LICENCE"))); dataAnalysisOpenSource->setTextFormat(Qt::RichText); dataAnalysisOpenSource->setTextInteractionFlags(Qt::TextBrowserInteraction); dataAnalysisOpenSource->setOpenExternalLinks(true); dataAnalysisOpenSource->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisOpenSource->setStyleSheet("font-size: 13px"); + dataAnalysisOpenSource->setStyleSheet(QStringLiteral("font-size: 13px")); dataProtectionBox->layout()->addWidget(dataAnalysisOpenSource); auto *dataAnalysisFurtherInfo = new QLabel(this); - dataAnalysisFurtherInfo->setText(QString("%1").arg(QCoreApplication::translate("", "FURTHER_INFO"))); + dataAnalysisFurtherInfo->setText(QStringLiteral("%1") + .arg(QCoreApplication::translate("", "FURTHER_INFO"))); dataAnalysisFurtherInfo->setTextFormat(Qt::RichText); dataAnalysisFurtherInfo->setTextInteractionFlags(Qt::TextBrowserInteraction); dataAnalysisFurtherInfo->setOpenExternalLinks(true); dataAnalysisFurtherInfo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisFurtherInfo->setStyleSheet("font-size: 13px"); + dataAnalysisFurtherInfo->setStyleSheet(QStringLiteral("font-size: 13px")); dataProtectionBox->layout()->addWidget(dataAnalysisFurtherInfo); - dataProtectionBox->layout()->addItem(new QSpacerItem(1,8,QSizePolicy::Fixed,QSizePolicy::Fixed)); + dataProtectionBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); auto *currentVersion = new QLabel(this); currentVersion->setText(Theme::instance()->about()); currentVersion->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - //Todo, set current version dataProtectionBox->layout()->addWidget(currentVersion); getUi()->gridLayout_3->addWidget(dataProtectionBox, 3, 0); - auto *vExpandSpacer = new QSpacerItem(1,1,QSizePolicy::Fixed,QSizePolicy::Expanding); + auto *vExpandSpacer = new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); getUi()->gridLayout_3->layout()->addItem(vExpandSpacer); } diff --git a/src/libsync/nmclibsync/nmcconfigfile.cpp b/src/libsync/nmclibsync/nmcconfigfile.cpp index 067539828884d..f88f672fbbb28 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.cpp +++ b/src/libsync/nmclibsync/nmcconfigfile.cpp @@ -23,13 +23,12 @@ const QString NMCConfigFile::m_transferUsageData = bool NMCConfigFile::transferUsageData(const QString &connection) const { - const QString group = - connection.isEmpty() - ? Theme::instance()->appName() - : connection; + const QString group = connection.isEmpty() + ? Theme::instance()->appName() + : connection; - QVariant fallback = getValue(m_transferUsageData, group, false); - fallback = getValue(m_transferUsageData, QString(), fallback); + QVariant fallback = getValue(m_transferUsageData, QString(), false); + fallback = getValue(m_transferUsageData, group, fallback); const QVariant value = getPolicySetting(m_transferUsageData, fallback); return value.toBool(); From 23a7da697fbe35901f5de44874c83df4c96893dd Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 11:06:04 +0200 Subject: [PATCH 11/18] add limit option --- src/gui/nmcgui/nmcgeneralsettings.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index ee55744ad4825..9d019ddd236bc 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -18,11 +18,13 @@ #include "ui_generalsettings.h" #include "theme.h" +#include #include #include #include #include #include +#include #include #include @@ -43,19 +45,19 @@ NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) void NMCGeneralSettings::setDefaultSettings() { - // Do not force autostart/server notification checkbox states here. - // GeneralSettings already loads them from ConfigFile and connects their save slots. + // Nicht manuell setzen: + // autostartCheckBox, serverNotificationsCheckBox, newFolderLimitCheckBox usw. + // werden im GeneralSettings-Konstruktor über loadMiscSettings() korrekt geladen. getUi()->monoIconsCheckBox->setVisible(false); getUi()->callNotificationsCheckBox->setVisible(false); getUi()->quotaWarningNotificationsCheckBox->setVisible(false); + getUi()->chatNotificationsCheckBox->setVisible(false); getUi()->advancedGroupBox->setVisible(false); getUi()->aboutAndUpdatesGroupBox->setTitle(tr("Update")); getUi()->aboutAndUpdatesGroupBox->setVisible(false); - - getUi()->newFolderLimitCheckBox->setCheckState(Qt::Unchecked); } void NMCGeneralSettings::setNMCLayout() @@ -64,8 +66,6 @@ void NMCGeneralSettings::setNMCLayout() auto *generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS"), this); generalSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); - getUi()->chatNotificationsCheckBox->hide(); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); @@ -112,9 +112,12 @@ void NMCGeneralSettings::setNMCLayout() )); getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); - getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_trash->removeWidget(getUi()->moveFilesToTrashCheckBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); + // Checkbox + SpinBox + MB-Label gemeinsam aus dem Original-Advanced-Layout umziehen. + getUi()->verticalLayout_4->removeItem(getUi()->horizontalLayout_3); + getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); getUi()->ignoredFilesButton->setStyleSheet(QStringLiteral( @@ -135,11 +138,14 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); + advancedSettingsBox->layout()->addItem(getUi()->horizontalLayout_3); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::NoFocus); getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); From d59cde40c4fa7cd4816ebcdb79a546d70adbc34e Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 12:40:09 +0200 Subject: [PATCH 12/18] fix --- src/gui/nmcgui/nmcgeneralsettings.cpp | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 9d019ddd236bc..3d67a90ce1332 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -45,18 +45,12 @@ NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) void NMCGeneralSettings::setDefaultSettings() { - // Nicht manuell setzen: - // autostartCheckBox, serverNotificationsCheckBox, newFolderLimitCheckBox usw. - // werden im GeneralSettings-Konstruktor über loadMiscSettings() korrekt geladen. - getUi()->monoIconsCheckBox->setVisible(false); + getUi()->chatNotificationsCheckBox->setVisible(false); getUi()->callNotificationsCheckBox->setVisible(false); getUi()->quotaWarningNotificationsCheckBox->setVisible(false); - getUi()->chatNotificationsCheckBox->setVisible(false); getUi()->advancedGroupBox->setVisible(false); - - getUi()->aboutAndUpdatesGroupBox->setTitle(tr("Update")); getUi()->aboutAndUpdatesGroupBox->setVisible(false); } @@ -66,6 +60,8 @@ void NMCGeneralSettings::setNMCLayout() auto *generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS"), this); generalSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + getUi()->generalGroupBoxTitle->hide(); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->generalGroupBoxTitle); getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); @@ -115,8 +111,18 @@ void NMCGeneralSettings::setNMCLayout() getUi()->horizontalLayout_trash->removeWidget(getUi()->moveFilesToTrashCheckBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); - // Checkbox + SpinBox + MB-Label gemeinsam aus dem Original-Advanced-Layout umziehen. - getUi()->verticalLayout_4->removeItem(getUi()->horizontalLayout_3); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->label); + + auto *newFolderLimitLayout = new QHBoxLayout; + newFolderLimitLayout->setContentsMargins(0, 0, 0, 0); + newFolderLimitLayout->setSpacing(8); + + newFolderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); + newFolderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); + newFolderLimitLayout->addWidget(getUi()->label); + newFolderLimitLayout->addStretch(); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); @@ -136,9 +142,9 @@ void NMCGeneralSettings::setNMCLayout() )); advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); + advancedSettingsBox->layout()->addItem(newFolderLimitLayout); advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); - advancedSettingsBox->layout()->addItem(getUi()->horizontalLayout_3); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); @@ -149,7 +155,7 @@ void NMCGeneralSettings::setNMCLayout() getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); - // Updates & info / Datenschutz + // Updates & Info auto *updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS"), this); updatesLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); From 271c865ed1570b0fd11afba74705f1108c7c9b14 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 17:22:38 +0200 Subject: [PATCH 13/18] fix limit --- src/gui/nmcgui/nmcgeneralsettings.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 3d67a90ce1332..a082a18fc9908 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -8,8 +8,7 @@ * * 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. + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include "nmcgeneralsettings.h" @@ -23,10 +22,12 @@ #include #include #include +#include #include #include #include #include +#include #ifdef Q_OS_WIN #define BACKGROUND_PALETTE "alternate-base" @@ -115,7 +116,8 @@ void NMCGeneralSettings::setNMCLayout() getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_3->removeWidget(getUi()->label); - auto *newFolderLimitLayout = new QHBoxLayout; + auto *newFolderLimitWidget = new QWidget(advancedSettingsBox); + auto *newFolderLimitLayout = new QHBoxLayout(newFolderLimitWidget); newFolderLimitLayout->setContentsMargins(0, 0, 0, 0); newFolderLimitLayout->setSpacing(8); @@ -124,6 +126,16 @@ void NMCGeneralSettings::setNMCLayout() newFolderLimitLayout->addWidget(getUi()->label); newFolderLimitLayout->addStretch(); + getUi()->newFolderLimitCheckBox->setVisible(true); + getUi()->newFolderLimitSpinBox->setVisible(true); + getUi()->label->setVisible(true); + + getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitSpinBox->setEnabled(getUi()->newFolderLimitCheckBox->isChecked()); + + newFolderLimitWidget->setVisible(true); + getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); getUi()->ignoredFilesButton->setStyleSheet(QStringLiteral( @@ -142,7 +154,7 @@ void NMCGeneralSettings::setNMCLayout() )); advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); - advancedSettingsBox->layout()->addItem(newFolderLimitLayout); + advancedSettingsBox->layout()->addWidget(newFolderLimitWidget); advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); @@ -150,8 +162,6 @@ void NMCGeneralSettings::setNMCLayout() getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::NoFocus); getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); From 1d2dd8e4576b242c288762f7edfb4d9ad7c6bd26 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 17:27:46 +0200 Subject: [PATCH 14/18] standard optionalServerNotifications false --- src/libsync/configfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index fd31f0264e09b..1d087482171c9 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -172,7 +172,7 @@ bool ConfigFile::setConfDir(const QString &value) bool ConfigFile::optionalServerNotifications() const { QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(optionalServerNotificationsC, true).toBool(); + return settings.value(optionalServerNotificationsC, false).toBool(); } bool ConfigFile::showChatNotifications() const From 414c60337e1467bc785ea82f3f4d03f33e202aa4 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 3 Jun 2026 14:56:08 +0200 Subject: [PATCH 15/18] fix limit spinbox --- src/gui/nmcgui/nmcgeneralsettings.cpp | 9 +++++++-- src/gui/nmcgui/nmcgeneralsettings.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index a082a18fc9908..3a96e0b3c28d0 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) by Eugen Fischer + * Copyright (C) by Mauro Mura * * 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 @@ -117,6 +117,7 @@ void NMCGeneralSettings::setNMCLayout() getUi()->horizontalLayout_3->removeWidget(getUi()->label); auto *newFolderLimitWidget = new QWidget(advancedSettingsBox); + newFolderLimitWidget->setContentsMargins(0, 0, 0, 0); auto *newFolderLimitLayout = new QHBoxLayout(newFolderLimitWidget); newFolderLimitLayout->setContentsMargins(0, 0, 0, 0); newFolderLimitLayout->setSpacing(8); @@ -131,9 +132,13 @@ void NMCGeneralSettings::setNMCLayout() getUi()->label->setVisible(true); getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::ClickFocus); + getUi()->newFolderLimitSpinBox->setKeyboardTracking(true); getUi()->newFolderLimitSpinBox->setEnabled(getUi()->newFolderLimitCheckBox->isChecked()); + connect(getUi()->newFolderLimitCheckBox, &QAbstractButton::toggled, + getUi()->newFolderLimitSpinBox, &QWidget::setEnabled); + newFolderLimitWidget->setVisible(true); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); diff --git a/src/gui/nmcgui/nmcgeneralsettings.h b/src/gui/nmcgui/nmcgeneralsettings.h index e3dcc7c755762..4fa62f6bc570e 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.h +++ b/src/gui/nmcgui/nmcgeneralsettings.h @@ -1,5 +1,5 @@ /* - * Copyright (C) by Eugen Fischer + * Copyright (C) by Mauro Mura * * 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 From 77640ba1023df8f674cd9c85c393355a14bbf727 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 17 Jun 2026 10:27:56 +0200 Subject: [PATCH 16/18] changed general settings to new ui --- src/gui/nmcgui/nmcgeneralsettings.cpp | 388 ++++++++++++++++---------- src/gui/nmcgui/nmcgeneralsettings.h | 35 +-- 2 files changed, 242 insertions(+), 181 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 3a96e0b3c28d0..915e1ff304799 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -5,26 +5,29 @@ * 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 "nmcgeneralsettings.h" #include "generalsettings.h" +#include "configfile.h" +#include "ignorelisteditor.h" #include "nmclibsync/nmcconfigfile.h" -#include "ui_generalsettings.h" +#include "settingspanelstyle.h" #include "theme.h" +#include "ui_generalsettings.h" #include #include #include -#include +#include #include #include #include +#include #include +#include +#include +#include #include #include #include @@ -37,6 +40,51 @@ namespace OCC { +namespace { + +void applyNMCBoxStyle(QGroupBox *box, const QString &objectName) +{ + box->setObjectName(objectName); + box->setAttribute(Qt::WA_StyledBackground, true); + box->setTitle({}); + box->setStyleSheet(QStringLiteral( + "#%1 {" + " background: palette(" BACKGROUND_PALETTE ");" + " border-radius: 4px;" + " border: none;" + "}" + ).arg(objectName)); +} + +QLabel *createSectionLabel(const QString &text, QWidget *parent) +{ + auto *label = new QLabel(text, parent); + label->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + return label; +} + +QLabel *createLinkLabel(const QString &text, const QString &url, QWidget *parent) +{ + auto *label = new QLabel(parent); + label->setText(QStringLiteral("%2").arg(url, text)); + label->setTextFormat(Qt::RichText); + label->setTextInteractionFlags(Qt::TextBrowserInteraction); + label->setOpenExternalLinks(true); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + label->setStyleSheet(QStringLiteral("font-size: 13px")); + return label; +} + +QFrame *createSeparator(QWidget *parent) +{ + auto *separator = new QFrame(parent); + separator->setFrameShape(QFrame::HLine); + separator->setFrameShadow(QFrame::Plain); + return separator; +} + +} // namespace + NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) : GeneralSettings(parent) { @@ -46,27 +94,34 @@ NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) void NMCGeneralSettings::setDefaultSettings() { + // These options are still present in the new upstream UI, but should not be shown in NMC. getUi()->monoIconsCheckBox->setVisible(false); + getUi()->monoIconsLabel->setVisible(false); + getUi()->monoIconsRowWidget->setVisible(false); + getUi()->startupSeparator->setVisible(false); + getUi()->chatNotificationsCheckBox->setVisible(false); + getUi()->chatNotificationsLabel->setVisible(false); + getUi()->chatNotificationsSeparator->setVisible(false); + getUi()->callNotificationsCheckBox->setVisible(false); - getUi()->quotaWarningNotificationsCheckBox->setVisible(false); + getUi()->callNotificationsLabel->setVisible(false); + getUi()->callNotificationsSeparator->setVisible(false); - getUi()->advancedGroupBox->setVisible(false); - getUi()->aboutAndUpdatesGroupBox->setVisible(false); + getUi()->quotaWarningNotificationsCheckBox->setVisible(false); + getUi()->quotaWarningNotificationsLabel->setVisible(false); } void NMCGeneralSettings::setNMCLayout() { - // General settings - auto *generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS"), this); - generalSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + SettingsPanelStyle::apply(this); - getUi()->generalGroupBoxTitle->hide(); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->generalGroupBoxTitle); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->autostartCheckBox); - getUi()->generalGroupBox->layout()->removeWidget(getUi()->quotaWarningNotificationsCheckBox); + /* + * General settings + */ + auto *generalSettingsLabel = createSectionLabel( + QCoreApplication::translate("", "GENERAL_SETTINGS"), + this); getUi()->generalGroupBox->setTitle({}); getUi()->generalGroupBox->setObjectName(QStringLiteral("nmcGeneralSettingsBox")); @@ -79,71 +134,121 @@ void NMCGeneralSettings::setNMCLayout() "}" )); - auto *generalLayout = static_cast(getUi()->generalGroupBox->layout()); - generalLayout->addWidget(generalSettingsLabel, 0, 0); - generalLayout->addWidget(getUi()->autostartCheckBox, 1, 0); - generalLayout->addWidget(getUi()->serverNotificationsCheckBox, 2, 0); - generalLayout->setContentsMargins(16, 16, 16, 16); - generalLayout->setSpacing(8); + auto *generalLayout = qobject_cast(getUi()->generalGroupBox->layout()); + if (generalLayout) { + generalLayout->insertWidget(0, generalSettingsLabel); + generalLayout->setContentsMargins(16, 16, 16, 16); + generalLayout->setSpacing(8); + } getUi()->autostartCheckBox->setFocusPolicy(Qt::NoFocus); getUi()->serverNotificationsCheckBox->setFocusPolicy(Qt::NoFocus); - // Advanced settings - auto *advancedSettingsLabel = new QLabel(QCoreApplication::translate("", "ADVANCED_SETTINGS"), this); - advancedSettingsLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); - - auto *advancedSettingsBox = new QGroupBox(this); - advancedSettingsBox->setObjectName(QStringLiteral("nmcAdvancedSettingsBox")); - advancedSettingsBox->setAttribute(Qt::WA_StyledBackground, true); - advancedSettingsBox->setTitle({}); - advancedSettingsBox->setLayout(new QVBoxLayout); - advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); - advancedSettingsBox->layout()->setSpacing(8); - advancedSettingsBox->setStyleSheet(QStringLiteral( - "#nmcAdvancedSettingsBox {" + /* + * Hide notification group if only hidden options would remain. + * Server notifications are moved/kept in the new notification group. + */ + getUi()->notificationsGroupBox->setObjectName(QStringLiteral("nmcNotificationsSettingsBox")); + getUi()->notificationsGroupBox->setAttribute(Qt::WA_StyledBackground, true); + getUi()->notificationsGroupBox->setStyleSheet(QStringLiteral( + "#nmcNotificationsSettingsBox {" " background: palette(" BACKGROUND_PALETTE ");" " border-radius: 4px;" " border: none;" "}" )); - getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); - getUi()->horizontalLayout_trash->removeWidget(getUi()->moveFilesToTrashCheckBox); - getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); + if (auto *notificationsLayout = qobject_cast(getUi()->notificationsGroupBox->layout())) { + notificationsLayout->setContentsMargins(16, 16, 16, 16); + notificationsLayout->setSpacing(8); + } + + /* + * Advanced settings + * These widgets no longer exist in upstream generalsettings.ui, so we create them ourselves. + */ + auto *advancedSettingsBox = new QGroupBox(this); + applyNMCBoxStyle(advancedSettingsBox, QStringLiteral("nmcAdvancedSettingsBox")); + + auto *advancedLayout = new QVBoxLayout(advancedSettingsBox); + advancedLayout->setContentsMargins(16, 16, 16, 16); + advancedLayout->setSpacing(8); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->label); + auto *advancedSettingsLabel = createSectionLabel( + QCoreApplication::translate("", "ADVANCED_SETTINGS"), + advancedSettingsBox); + + ConfigFile cfgFile; + + auto *newFolderLimitCheckBox = new QCheckBox( + tr("Ask for confirmation before synchronizing new folders larger than"), + advancedSettingsBox); + newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); + + auto *newFolderLimitSpinBox = new QSpinBox(advancedSettingsBox); + newFolderLimitSpinBox->setMaximum(999999); + newFolderLimitSpinBox->setFocusPolicy(Qt::ClickFocus); + newFolderLimitSpinBox->setKeyboardTracking(true); + + auto *newFolderLimitLabel = new QLabel(tr("MB"), advancedSettingsBox); + + const auto newFolderLimit = cfgFile.newBigFolderSizeLimit(); + newFolderLimitCheckBox->setChecked(newFolderLimit.first); + newFolderLimitSpinBox->setValue(newFolderLimit.second); + newFolderLimitSpinBox->setEnabled(newFolderLimit.first); auto *newFolderLimitWidget = new QWidget(advancedSettingsBox); - newFolderLimitWidget->setContentsMargins(0, 0, 0, 0); auto *newFolderLimitLayout = new QHBoxLayout(newFolderLimitWidget); newFolderLimitLayout->setContentsMargins(0, 0, 0, 0); newFolderLimitLayout->setSpacing(8); - - newFolderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); - newFolderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); - newFolderLimitLayout->addWidget(getUi()->label); + newFolderLimitLayout->addWidget(newFolderLimitCheckBox); + newFolderLimitLayout->addWidget(newFolderLimitSpinBox); + newFolderLimitLayout->addWidget(newFolderLimitLabel); newFolderLimitLayout->addStretch(); - getUi()->newFolderLimitCheckBox->setVisible(true); - getUi()->newFolderLimitSpinBox->setVisible(true); - getUi()->label->setVisible(true); + connect(newFolderLimitCheckBox, &QAbstractButton::toggled, + newFolderLimitSpinBox, &QWidget::setEnabled); - getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::ClickFocus); - getUi()->newFolderLimitSpinBox->setKeyboardTracking(true); - getUi()->newFolderLimitSpinBox->setEnabled(getUi()->newFolderLimitCheckBox->isChecked()); + connect(newFolderLimitCheckBox, &QAbstractButton::toggled, this, + [newFolderLimitSpinBox](bool enabled) { + ConfigFile().setNewBigFolderSizeLimit(enabled, newFolderLimitSpinBox->value()); + }); - connect(getUi()->newFolderLimitCheckBox, &QAbstractButton::toggled, - getUi()->newFolderLimitSpinBox, &QWidget::setEnabled); + connect(newFolderLimitSpinBox, &QSpinBox::valueChanged, this, + [newFolderLimitCheckBox](int value) { + ConfigFile().setNewBigFolderSizeLimit(newFolderLimitCheckBox->isChecked(), value); + }); - newFolderLimitWidget->setVisible(true); + auto *moveFilesToTrashCheckBox = new QCheckBox( + tr("Move removed files to trash"), + advancedSettingsBox); + moveFilesToTrashCheckBox->setFocusPolicy(Qt::NoFocus); + moveFilesToTrashCheckBox->setChecked(cfgFile.moveToTrash()); - getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); - getUi()->ignoredFilesButton->setStyleSheet(QStringLiteral( + connect(moveFilesToTrashCheckBox, &QAbstractButton::toggled, this, + [](bool enabled) { + ConfigFile().setMoveToTrash(enabled); + }); + +#ifdef Q_OS_WIN + auto *showInExplorerNavigationPaneCheckBox = new QCheckBox( + tr("Show sync folders in &Explorer's navigation pane"), + advancedSettingsBox); + showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::NoFocus); + showInExplorerNavigationPaneCheckBox->setChecked(cfgFile.showInExplorerNavigationPane()); + + connect(showInExplorerNavigationPaneCheckBox, &QAbstractButton::toggled, this, + [](bool enabled) { + ConfigFile().setShowInExplorerNavigationPane(enabled); + }); +#endif + + auto *ignoredFilesButton = new QPushButton( + tr("Edit &Ignored Files"), + advancedSettingsBox); + ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + ignoredFilesButton->setFocusPolicy(Qt::NoFocus); + ignoredFilesButton->setStyleSheet(QStringLiteral( "QPushButton {" " min-height: 32px;" " min-width: 200px;" @@ -158,108 +263,93 @@ void NMCGeneralSettings::setNMCLayout() "}" )); - advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); - advancedSettingsBox->layout()->addWidget(newFolderLimitWidget); - advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); - advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); - advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); - advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); + connect(ignoredFilesButton, &QAbstractButton::clicked, this, [this]() { + auto *ignoreEditor = new IgnoreListEditor(this); + ignoreEditor->setAttribute(Qt::WA_DeleteOnClose, true); + ignoreEditor->open(); + }); - getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::NoFocus); + advancedLayout->addWidget(advancedSettingsLabel); + advancedLayout->addWidget(newFolderLimitWidget); +#ifdef Q_OS_WIN + advancedLayout->addWidget(showInExplorerNavigationPaneCheckBox); +#endif + advancedLayout->addWidget(moveFilesToTrashCheckBox); + advancedLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); + advancedLayout->addWidget(ignoredFilesButton); - getUi()->gridLayout_3->addWidget(advancedSettingsBox, 2, 0); + /* + * Updates, data protection and info + */ + auto *dataProtectionBox = new QGroupBox(this); + applyNMCBoxStyle(dataProtectionBox, QStringLiteral("nmcUpdatesInfoBox")); - // Updates & Info - auto *updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS"), this); - updatesLabel->setStyleSheet(QStringLiteral("font-size: 12px; font-weight: bold;")); + auto *dataProtectionLayout = new QVBoxLayout(dataProtectionBox); + dataProtectionLayout->setContentsMargins(16, 16, 16, 16); + dataProtectionLayout->setSpacing(8); - auto *dataProtectionBox = new QGroupBox(this); - dataProtectionBox->setObjectName(QStringLiteral("nmcUpdatesInfoBox")); - dataProtectionBox->setAttribute(Qt::WA_StyledBackground, true); - dataProtectionBox->setTitle({}); - dataProtectionBox->setLayout(new QVBoxLayout); - dataProtectionBox->layout()->setContentsMargins(16, 16, 16, 16); - dataProtectionBox->layout()->setSpacing(8); - dataProtectionBox->setStyleSheet(QStringLiteral( - "#nmcUpdatesInfoBox {" - " background: palette(" BACKGROUND_PALETTE ");" - " border-radius: 4px;" - " border: none;" - "}" - )); + auto *updatesLabel = createSectionLabel( + QCoreApplication::translate("", "UPDATES_SETTINGS"), + dataProtectionBox); - auto *dataAnalysisCheckBox = new QCheckBox(this); + auto *dataAnalysisCheckBox = new QCheckBox(dataProtectionBox); dataAnalysisCheckBox->setText(QCoreApplication::translate("", "DATA_ANALYSIS")); dataAnalysisCheckBox->setFocusPolicy(Qt::NoFocus); - getUi()->autoCheckForUpdatesCheckBox->setFocusPolicy(Qt::NoFocus); - - dataProtectionBox->layout()->addWidget(updatesLabel); - dataProtectionBox->layout()->addWidget(getUi()->autoCheckForUpdatesCheckBox); - dataProtectionBox->layout()->addWidget(dataAnalysisCheckBox); + NMCConfigFile nmcCfgFile; + dataAnalysisCheckBox->setChecked(nmcCfgFile.transferUsageData()); - connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool toggle) { + connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool enabled) { NMCConfigFile cfgFile; - cfgFile.setTransferUsageData(toggle, QString()); + cfgFile.setTransferUsageData(enabled, QString()); }); - NMCConfigFile cfgFile; - dataAnalysisCheckBox->setChecked(cfgFile.transferUsageData()); - - dataProtectionBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); - - auto *dataAnalysisImpressum = new QLabel(this); - dataAnalysisImpressum->setText(QStringLiteral("%1") - .arg(QCoreApplication::translate("", "IMPRESSUM"))); - dataAnalysisImpressum->setTextFormat(Qt::RichText); - dataAnalysisImpressum->setTextInteractionFlags(Qt::TextBrowserInteraction); - dataAnalysisImpressum->setOpenExternalLinks(true); - dataAnalysisImpressum->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisImpressum->setStyleSheet(QStringLiteral("font-size: 13px")); - dataProtectionBox->layout()->addWidget(dataAnalysisImpressum); - - auto *dataAnalysisData = new QLabel(this); - dataAnalysisData->setText(QStringLiteral("%1") - .arg(QCoreApplication::translate("", "DATA_PROTECTION"))); - dataAnalysisData->setTextFormat(Qt::RichText); - dataAnalysisData->setTextInteractionFlags(Qt::TextBrowserInteraction); - dataAnalysisData->setOpenExternalLinks(true); - dataAnalysisData->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisData->setStyleSheet(QStringLiteral("font-size: 13px")); - dataProtectionBox->layout()->addWidget(dataAnalysisData); - - auto *dataAnalysisOpenSource = new QLabel(this); - dataAnalysisOpenSource->setText(QStringLiteral("%1") - .arg(QCoreApplication::translate("", "LICENCE"))); - dataAnalysisOpenSource->setTextFormat(Qt::RichText); - dataAnalysisOpenSource->setTextInteractionFlags(Qt::TextBrowserInteraction); - dataAnalysisOpenSource->setOpenExternalLinks(true); - dataAnalysisOpenSource->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisOpenSource->setStyleSheet(QStringLiteral("font-size: 13px")); - dataProtectionBox->layout()->addWidget(dataAnalysisOpenSource); - - auto *dataAnalysisFurtherInfo = new QLabel(this); - dataAnalysisFurtherInfo->setText(QStringLiteral("%1") - .arg(QCoreApplication::translate("", "FURTHER_INFO"))); - dataAnalysisFurtherInfo->setTextFormat(Qt::RichText); - dataAnalysisFurtherInfo->setTextInteractionFlags(Qt::TextBrowserInteraction); - dataAnalysisFurtherInfo->setOpenExternalLinks(true); - dataAnalysisFurtherInfo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataAnalysisFurtherInfo->setStyleSheet(QStringLiteral("font-size: 13px")); - dataProtectionBox->layout()->addWidget(dataAnalysisFurtherInfo); - - dataProtectionBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); - - auto *currentVersion = new QLabel(this); - currentVersion->setText(Theme::instance()->about()); - currentVersion->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - dataProtectionBox->layout()->addWidget(currentVersion); + dataProtectionLayout->addWidget(updatesLabel); + dataProtectionLayout->addWidget(dataAnalysisCheckBox); + dataProtectionLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); + + dataProtectionLayout->addWidget(createLinkLabel( + QCoreApplication::translate("", "IMPRESSUM"), + QStringLiteral("https://www.telekom.de/impressum/"), + dataProtectionBox)); + + dataProtectionLayout->addWidget(createLinkLabel( + QCoreApplication::translate("", "DATA_PROTECTION"), + QStringLiteral("https://static.magentacloud.de/privacy/datenschutzhinweise_software.pdf"), + dataProtectionBox)); + + dataProtectionLayout->addWidget(createLinkLabel( + QCoreApplication::translate("", "LICENCE"), + QStringLiteral("https://static.magentacloud.de/licences/windowsdesktop.html"), + dataProtectionBox)); - getUi()->gridLayout_3->addWidget(dataProtectionBox, 3, 0); + dataProtectionLayout->addWidget(createLinkLabel( + QCoreApplication::translate("", "FURTHER_INFO"), + QStringLiteral("https://cloud.telekom-dienste.de/hilfe"), + dataProtectionBox)); - auto *vExpandSpacer = new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding); - getUi()->gridLayout_3->layout()->addItem(vExpandSpacer); + dataProtectionLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); + + auto *currentVersion = new QLabel(dataProtectionBox); + currentVersion->setText(Theme::instance()->about()); + currentVersion->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction); + currentVersion->setOpenExternalLinks(true); + currentVersion->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + dataProtectionLayout->addWidget(currentVersion); + + /* + * Insert custom boxes into the new upstream layout. + * New layout structure: + * pageLayout + * - generalGroupBox + * - notificationsGroupBox + * - verticalSpacer + */ + auto *pageLayout = getUi()->pageLayout; + const auto insertIndex = qMax(0, pageLayout->count() - 1); + + pageLayout->insertWidget(insertIndex, advancedSettingsBox); + pageLayout->insertWidget(insertIndex + 1, dataProtectionBox); } } // namespace OCC diff --git a/src/gui/nmcgui/nmcgeneralsettings.h b/src/gui/nmcgui/nmcgeneralsettings.h index 4fa62f6bc570e..a5df915984b54 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.h +++ b/src/gui/nmcgui/nmcgeneralsettings.h @@ -19,48 +19,19 @@ namespace OCC { -/** - * @brief The NMCGeneralSettings class - * - * This class represents the Magenta-specific implementation of general settings - * for a graphical user interface. It inherits from the base class GeneralSettings. - * - * @ingroup gui - */ class NMCGeneralSettings : public GeneralSettings { Q_OBJECT public: - /** - * @brief Constructor for NMCGeneralSettings - * - * Creates an instance of NMCGeneralSettings with the specified parent widget. - * - * @param parent The parent widget (default is nullptr). - */ explicit NMCGeneralSettings(QWidget *parent = nullptr); + ~NMCGeneralSettings() override = default; - /** - * @brief Destructor for NMCGeneralSettings - */ - ~NMCGeneralSettings() = default; - -protected: - /** - * @brief Set default settings - * - * Sets the default values for Magenta-specific general settings. - */ +private: void setDefaultSettings(); - - /** - * @brief Set layout - * - * Sets the layout for the Magenta-specific general settings user interface. - */ void setNMCLayout(); }; } // namespace OCC + #endif // MIRALL_GENERALSETTINGSMAGENTA_H \ No newline at end of file From 7f0d855d9245ee7b5c33ea6d915917aa35c91274 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Wed, 17 Jun 2026 10:53:43 +0200 Subject: [PATCH 17/18] Replace GeneralSettings with NMCGeneralSettings --- src/gui/settingsdialog.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index fb61a0dd58772..93d85283fa3ac 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -170,15 +170,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _actionGroup->setExclusive(true); connect(_actionGroup, &QActionGroup::triggered, this, &SettingsDialog::slotSwitchPage); - QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General")); - _actionGroup->addAction(generalAction); - _toolBar->addAction(generalAction); - auto *accountSpacer = new QWidget(this); - accountSpacer->setFixedHeight(16); - _toolBar->addWidget(accountSpacer); - _toolBar->addSeparator(); - auto *generalSettings = new NMCGeneralSettings; - _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); const auto accountsList = AccountManager::instance()->accounts(); @@ -190,7 +181,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) accountSpacer->setFixedHeight(16); _firstNonAccountAction = _toolBar->addWidget(accountSpacer); - addSettingsPage(QLatin1String(":/client/theme/settings.svg"), tr("General"), new GeneralSettings(this)); + addSettingsPage(QLatin1String(":/client/theme/settings.svg"), tr("General"), new NMCGeneralSettings(this)); addSettingsPage(QLatin1String(":/client/theme/advanced.svg"), tr("Advanced"), new AdvancedSettings(this)); addSettingsPage(QLatin1String(":/client/theme/info.svg"), tr("Info"), new InfoSettings(this), true); From 82d4efbf9e2ebf954ab1bc45a546f90894fd0d64 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Wed, 17 Jun 2026 11:10:37 +0200 Subject: [PATCH 18/18] Remove unused createSeparator function Removed unused createSeparator function from nmcgeneralsettings.cpp --- src/gui/nmcgui/nmcgeneralsettings.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 915e1ff304799..f12dded9aede3 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -75,14 +74,6 @@ QLabel *createLinkLabel(const QString &text, const QString &url, QWidget *parent return label; } -QFrame *createSeparator(QWidget *parent) -{ - auto *separator = new QFrame(parent); - separator->setFrameShape(QFrame::HLine); - separator->setFrameShadow(QFrame::Plain); - return separator; -} - } // namespace NMCGeneralSettings::NMCGeneralSettings(QWidget *parent)