From 37ebaef463a8394647ae8451cf28a4e41ce7ac9c Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 11:32:53 +0100 Subject: [PATCH 01/29] 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 | 3 +- 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, 392 insertions(+), 3 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 54d32c3580e86..06f095611462a 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() @@ -260,6 +263,10 @@ set(client_SRCS wizard/wizardproxysettingsdialog.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 b62a7b3c07476..96761f25c0559 100644 --- a/src/gui/generalsettings.h +++ b/src/gui/generalsettings.h @@ -34,6 +34,12 @@ class GeneralSettings : public QWidget ~GeneralSettings() override; [[nodiscard]] QSize sizeHint() const override; +protected: + Ui::GeneralSettings *getUi() const + { + return _ui; + } + public slots: void slotStyleChanged(); #if defined(BUILD_UPDATER) 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 dc6ab9cb802ca..033c555f7309d 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 "networksettings.h" #include "accountsettings.h" #include "configfile.h" @@ -114,7 +115,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General")); _actionGroup->addAction(generalAction); _toolBar->addAction(generalAction); - auto *generalSettings = new GeneralSettings; + auto *generalSettings = new NMCGeneralSettings; _ui->stack->addWidget(generalSettings); // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching) diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index 5820fc0c8aa02..c80d58364e350 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -164,6 +164,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 dd865020272b1..1507ab5bb6fc5 100644 --- a/src/libsync/configfile.h +++ b/src/libsync/configfile.h @@ -276,10 +276,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 fadd35c370630ac9895263ed6acfd67167e9666a Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 14:50:25 +0100 Subject: [PATCH 02/29] 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 06f095611462a..96fb9c4f5ac4a 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() @@ -26,6 +23,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 accountsettings.ui conflictdialog.ui From 99689730db068612bec8d42ebb7ed74fd7192865 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 28 Oct 2025 09:23:53 +0100 Subject: [PATCH 03/29] 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 389752d2ae8686735e57cb8c060660e74e2dc0ef Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 28 Oct 2025 09:25:30 +0100 Subject: [PATCH 04/29] 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 da0a1b7987b91907b34258c0fec4ca7d6381c849 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 13:37:54 +0100 Subject: [PATCH 05/29] fix reset default button --- src/gui/ignorelisteditor.cpp | 35 ++++++++++++++++++++++++++++- src/gui/ignorelisteditor.h | 8 ++++++- src/gui/ignorelisteditor.ui | 4 ++-- src/gui/ignorelisttablewidget.cpp | 37 ++++++++++++++++++------------- src/gui/ignorelisttablewidget.h | 27 +++++++++++----------- translations/client_de.ts | 1 - 6 files changed, 79 insertions(+), 33 deletions(-) diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index f17252168419b..4f8411ff4f437 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -34,9 +34,14 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) .arg(QDir::toNativeSeparators(cfgFile.excludeFile(ConfigFile::SystemScope))); setupTableReadOnlyItems(); + const auto userConfig = cfgFile.excludeFile(ConfigFile::Scope::UserScope); ui->ignoreTableWidget->readIgnoreFile(userConfig); + _defaultPatterns = ui->ignoreTableWidget->patterns(); + _defaultIgnoreHidden = !FolderMan::instance()->ignoreHiddenFiles(); + ui->syncHiddenFilesCheckBox->setChecked(_defaultIgnoreHidden); + connect(this, &QDialog::accepted, [=, this]() { ui->ignoreTableWidget->slotWriteIgnoreFile(userConfig); /* handle the hidden file checkbox */ @@ -48,10 +53,15 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) */ FolderMan::instance()->setIgnoreHiddenFiles(ignoreHiddenFiles()); }); + connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &IgnoreListEditor::slotRestoreDefaults); + connect(ui->ignoreTableWidget, &IgnoreListTableWidget::changed, + this, &IgnoreListEditor::updateRestoreDefaultsButtonState); + connect(ui->syncHiddenFilesCheckBox, &QCheckBox::toggled, + this, &IgnoreListEditor::updateRestoreDefaultsButtonState); - ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles()); + updateRestoreDefaultsButtonState(); } IgnoreListEditor::~IgnoreListEditor() @@ -81,6 +91,29 @@ void IgnoreListEditor::slotRestoreDefaults(QAbstractButton *button) ConfigFile cfgFile; setupTableReadOnlyItems(); ui->ignoreTableWidget->readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), false); + + ui->syncHiddenFilesCheckBox->setChecked(true); + + _defaultPatterns = ui->ignoreTableWidget->patterns(); + _defaultIgnoreHidden = ui->syncHiddenFilesCheckBox->isChecked(); + + updateRestoreDefaultsButtonState(); +} + +void IgnoreListEditor::updateRestoreDefaultsButtonState() +{ + bool changed = false; + + const auto currentPatterns = ui->ignoreTableWidget->patterns(); + if (currentPatterns != _defaultPatterns) + changed = true; + + if (ui->syncHiddenFilesCheckBox->isChecked() != _defaultIgnoreHidden) + changed = true; + + auto restoreButton = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults); + if (restoreButton) + restoreButton->setEnabled(changed); } } // namespace OCC diff --git a/src/gui/ignorelisteditor.h b/src/gui/ignorelisteditor.h index dbda14e28a3aa..ab65cc44bdfc5 100644 --- a/src/gui/ignorelisteditor.h +++ b/src/gui/ignorelisteditor.h @@ -8,6 +8,7 @@ #define IGNORELISTEDITOR_H #include +#include class QListWidgetItem; class QAbstractButton; @@ -27,16 +28,21 @@ class IgnoreListEditor : public QDialog Q_OBJECT public: - IgnoreListEditor(QWidget *parent = nullptr); + explicit IgnoreListEditor(QWidget *parent = nullptr); ~IgnoreListEditor() override; bool ignoreHiddenFiles(); private slots: void slotRestoreDefaults(QAbstractButton *button); + void updateRestoreDefaultsButtonState(); // 🔹 neu: Zustand des Buttons aktualisieren private: void setupTableReadOnlyItems(); + + QStringList _defaultPatterns; + bool _defaultIgnoreHidden = false; + QString readOnlyTooltip; Ui::IgnoreListEditor *ui; }; diff --git a/src/gui/ignorelisteditor.ui b/src/gui/ignorelisteditor.ui index 3ebdf524938c0..7c4a50f04c02a 100644 --- a/src/gui/ignorelisteditor.ui +++ b/src/gui/ignorelisteditor.ui @@ -17,7 +17,7 @@ - Global Ignore Settings + @@ -33,7 +33,7 @@ - Files Ignored by Patterns + diff --git a/src/gui/ignorelisttablewidget.cpp b/src/gui/ignorelisttablewidget.cpp index 047d8251f6e12..6f552bfd2dadc 100644 --- a/src/gui/ignorelisttablewidget.cpp +++ b/src/gui/ignorelisttablewidget.cpp @@ -5,7 +5,6 @@ #include "ignorelisttablewidget.h" #include "ui_ignorelisttablewidget.h" - #include "folderman.h" #include @@ -33,8 +32,7 @@ IgnoreListTableWidget::IgnoreListTableWidget(QWidget *parent) ui->descriptionLabel->setText(tr("Files or folders matching a pattern will not be synchronized.\n\n" "Items where deletion is allowed will be deleted if they prevent a " - "directory from being removed. " - "This is useful for meta data.")); + "directory from being removed. This is useful for meta data.")); ui->removePushButton->setEnabled(false); connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, @@ -73,11 +71,14 @@ void IgnoreListTableWidget::slotRemoveCurrentItem() ui->tableWidget->removeRow(ui->tableWidget->currentRow()); if(ui->tableWidget->rowCount() == readOnlyRows) ui->removeAllPushButton->setEnabled(false); + + emit changed(); } void IgnoreListTableWidget::slotRemoveAllItems() { ui->tableWidget->setRowCount(0); + emit changed(); } void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) @@ -85,9 +86,7 @@ void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) QFile ignores(file); if (ignores.open(QIODevice::WriteOnly)) { - // rewrites the whole file since now the user can also remove system patterns QFile::resize(file, 0); - for (auto row = 0; row < ui->tableWidget->rowCount(); ++row) { const auto patternItem = ui->tableWidget->item(row, patternCol); const auto deletableItem = ui->tableWidget->item(row, deletableCol); @@ -107,21 +106,13 @@ void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) tr("Could not open file"), tr("Cannot write changes to \"%1\".").arg(file)); } - ignores.close(); //close the file before reloading stuff. + ignores.close(); const auto folderMan = FolderMan::instance(); - - // We need to force a remote discovery after a change of the ignore list. - // Otherwise we would not download the files/directories that are no longer - // ignored (because the remote etag did not change) (issue #3172) for (const auto folder : std::as_const(folderMan->map())) { folder->journalDb()->forceRemoteDiscoveryNextSync(); folderMan->scheduleFolder(folder); } - -#ifdef BUILD_FILE_PROVIDER_MODULE - Mac::FileProvider::instance()->xpc()->setIgnoreList(); -#endif } void IgnoreListTableWidget::slotAddPattern() @@ -139,6 +130,7 @@ void IgnoreListTableWidget::slotAddPattern() addPattern(pattern, false, false); ui->tableWidget->scrollToBottom(); + emit changed(); } void IgnoreListTableWidget::readIgnoreFile(const QString &file, const bool readOnly) @@ -163,6 +155,9 @@ void IgnoreListTableWidget::readIgnoreFile(const QString &file, const bool readO } } } + ignores.close(); + if (!readOnly) + emit changed(); } int IgnoreListTableWidget::addPattern(const QString &pattern, const bool deletable, const bool readOnly) @@ -181,13 +176,25 @@ int IgnoreListTableWidget::addPattern(const QString &pattern, const bool deletab if (readOnly) { patternItem->setFlags(patternItem->flags() ^ Qt::ItemIsEnabled); - patternItem->setToolTip(readOnlyTooltip); + patternItem->setToolTip(tr("This entry is provided by the system and cannot be modified.")); deletableItem->setFlags(deletableItem->flags() ^ Qt::ItemIsEnabled); } ui->removeAllPushButton->setEnabled(true); + emit changed(); return newRow; } +QStringList IgnoreListTableWidget::patterns() const +{ + QStringList list; + for (int r = 0; r < ui->tableWidget->rowCount(); ++r) { + const auto item = ui->tableWidget->item(r, patternCol); + if (item && (item->flags() & Qt::ItemIsEnabled)) + list << item->text(); + } + return list; +} + } // namespace OCC diff --git a/src/gui/ignorelisttablewidget.h b/src/gui/ignorelisttablewidget.h index e0b1e0314ead1..0bf600441a9fd 100644 --- a/src/gui/ignorelisttablewidget.h +++ b/src/gui/ignorelisttablewidget.h @@ -6,38 +6,39 @@ #pragma once #include - -class QAbstractButton; - -namespace OCC { +#include namespace Ui { - class IgnoreListTableWidget; +class IgnoreListTableWidget; } +namespace OCC { + class IgnoreListTableWidget : public QWidget { Q_OBJECT public: - IgnoreListTableWidget(QWidget *parent = nullptr); + explicit IgnoreListTableWidget(QWidget *parent = nullptr); ~IgnoreListTableWidget() override; - void readIgnoreFile(const QString &file, bool readOnly = false); - int addPattern(const QString &pattern, bool deletable, bool readOnly); - -public slots: + int addPattern(const QString &pattern, const bool deletable = false, const bool readOnly = false); + void slotRemoveCurrentItem(); void slotRemoveAllItems(); + void readIgnoreFile(const QString &file, const bool readOnly = true); void slotWriteIgnoreFile(const QString &file); + QStringList patterns() const; + +signals: + void changed(); + private slots: void slotItemSelectionChanged(); - void slotRemoveCurrentItem(); void slotAddPattern(); private: - void setupTableReadOnlyItems(); - QString readOnlyTooltip; Ui::IgnoreListTableWidget *ui; }; + } // namespace OCC diff --git a/translations/client_de.ts b/translations/client_de.ts index 0b4417654c6b4..162896a20bb9a 100644 --- a/translations/client_de.ts +++ b/translations/client_de.ts @@ -3114,7 +3114,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 2ad7c2d5f3cb8f938db63ea434cb01976c8909a5 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 13:46:12 +0100 Subject: [PATCH 06/29] fix error --- src/gui/ignorelisttablewidget.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/ignorelisttablewidget.h b/src/gui/ignorelisttablewidget.h index 0bf600441a9fd..0eb50c7de3e0d 100644 --- a/src/gui/ignorelisttablewidget.h +++ b/src/gui/ignorelisttablewidget.h @@ -8,12 +8,14 @@ #include #include -namespace Ui { -class IgnoreListTableWidget; -} +class QAbstractButton; namespace OCC { +namespace Ui { + class IgnoreListTableWidget; +} + class IgnoreListTableWidget : public QWidget { Q_OBJECT From 724128f2df79eef3924b2c4eeedd18dd106843d0 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 13:54:08 +0100 Subject: [PATCH 07/29] fixed error --- src/gui/ignorelisteditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index 4f8411ff4f437..4329903b3c515 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace OCC { From 85c47981f3b56684199751035508925a7ffaee0f Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 15:08:53 +0100 Subject: [PATCH 08/29] revert ignore table widget changes --- src/gui/ignorelisttablewidget.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/ignorelisttablewidget.h b/src/gui/ignorelisttablewidget.h index 0eb50c7de3e0d..a3b85a57e360b 100644 --- a/src/gui/ignorelisttablewidget.h +++ b/src/gui/ignorelisttablewidget.h @@ -6,7 +6,6 @@ #pragma once #include -#include class QAbstractButton; @@ -21,25 +20,26 @@ class IgnoreListTableWidget : public QWidget Q_OBJECT public: - explicit IgnoreListTableWidget(QWidget *parent = nullptr); + IgnoreListTableWidget(QWidget *parent = nullptr); ~IgnoreListTableWidget() override; - int addPattern(const QString &pattern, const bool deletable = false, const bool readOnly = false); - void slotRemoveCurrentItem(); + void readIgnoreFile(const QString &file, bool readOnly = false); + int addPattern(const QString &pattern, bool deletable, bool readOnly); + +public slots: void slotRemoveAllItems(); - void readIgnoreFile(const QString &file, const bool readOnly = true); void slotWriteIgnoreFile(const QString &file); QStringList patterns() const; -signals: - void changed(); - private slots: void slotItemSelectionChanged(); + void slotRemoveCurrentItem(); void slotAddPattern(); private: + void setupTableReadOnlyItems(); + QString readOnlyTooltip; Ui::IgnoreListTableWidget *ui; }; From b6bc4c66d73fc6f43f1ee94a4efad7c16b9498bf Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 15:09:31 +0100 Subject: [PATCH 09/29] revert change --- src/gui/ignorelisttablewidget.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/ignorelisttablewidget.h b/src/gui/ignorelisttablewidget.h index a3b85a57e360b..e0b1e0314ead1 100644 --- a/src/gui/ignorelisttablewidget.h +++ b/src/gui/ignorelisttablewidget.h @@ -30,8 +30,6 @@ public slots: void slotRemoveAllItems(); void slotWriteIgnoreFile(const QString &file); - QStringList patterns() const; - private slots: void slotItemSelectionChanged(); void slotRemoveCurrentItem(); @@ -42,5 +40,4 @@ private slots: QString readOnlyTooltip; Ui::IgnoreListTableWidget *ui; }; - } // namespace OCC From c2fc1f231bea6cbc31e43c58f4207826e8326b88 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 15:14:37 +0100 Subject: [PATCH 10/29] revert changes --- src/gui/ignorelisttablewidget.cpp | 37 +++++++++++++------------------ 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/gui/ignorelisttablewidget.cpp b/src/gui/ignorelisttablewidget.cpp index 6f552bfd2dadc..047d8251f6e12 100644 --- a/src/gui/ignorelisttablewidget.cpp +++ b/src/gui/ignorelisttablewidget.cpp @@ -5,6 +5,7 @@ #include "ignorelisttablewidget.h" #include "ui_ignorelisttablewidget.h" + #include "folderman.h" #include @@ -32,7 +33,8 @@ IgnoreListTableWidget::IgnoreListTableWidget(QWidget *parent) ui->descriptionLabel->setText(tr("Files or folders matching a pattern will not be synchronized.\n\n" "Items where deletion is allowed will be deleted if they prevent a " - "directory from being removed. This is useful for meta data.")); + "directory from being removed. " + "This is useful for meta data.")); ui->removePushButton->setEnabled(false); connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, @@ -71,14 +73,11 @@ void IgnoreListTableWidget::slotRemoveCurrentItem() ui->tableWidget->removeRow(ui->tableWidget->currentRow()); if(ui->tableWidget->rowCount() == readOnlyRows) ui->removeAllPushButton->setEnabled(false); - - emit changed(); } void IgnoreListTableWidget::slotRemoveAllItems() { ui->tableWidget->setRowCount(0); - emit changed(); } void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) @@ -86,7 +85,9 @@ void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) QFile ignores(file); if (ignores.open(QIODevice::WriteOnly)) { + // rewrites the whole file since now the user can also remove system patterns QFile::resize(file, 0); + for (auto row = 0; row < ui->tableWidget->rowCount(); ++row) { const auto patternItem = ui->tableWidget->item(row, patternCol); const auto deletableItem = ui->tableWidget->item(row, deletableCol); @@ -106,13 +107,21 @@ void IgnoreListTableWidget::slotWriteIgnoreFile(const QString &file) tr("Could not open file"), tr("Cannot write changes to \"%1\".").arg(file)); } - ignores.close(); + ignores.close(); //close the file before reloading stuff. const auto folderMan = FolderMan::instance(); + + // We need to force a remote discovery after a change of the ignore list. + // Otherwise we would not download the files/directories that are no longer + // ignored (because the remote etag did not change) (issue #3172) for (const auto folder : std::as_const(folderMan->map())) { folder->journalDb()->forceRemoteDiscoveryNextSync(); folderMan->scheduleFolder(folder); } + +#ifdef BUILD_FILE_PROVIDER_MODULE + Mac::FileProvider::instance()->xpc()->setIgnoreList(); +#endif } void IgnoreListTableWidget::slotAddPattern() @@ -130,7 +139,6 @@ void IgnoreListTableWidget::slotAddPattern() addPattern(pattern, false, false); ui->tableWidget->scrollToBottom(); - emit changed(); } void IgnoreListTableWidget::readIgnoreFile(const QString &file, const bool readOnly) @@ -155,9 +163,6 @@ void IgnoreListTableWidget::readIgnoreFile(const QString &file, const bool readO } } } - ignores.close(); - if (!readOnly) - emit changed(); } int IgnoreListTableWidget::addPattern(const QString &pattern, const bool deletable, const bool readOnly) @@ -176,25 +181,13 @@ int IgnoreListTableWidget::addPattern(const QString &pattern, const bool deletab if (readOnly) { patternItem->setFlags(patternItem->flags() ^ Qt::ItemIsEnabled); - patternItem->setToolTip(tr("This entry is provided by the system and cannot be modified.")); + patternItem->setToolTip(readOnlyTooltip); deletableItem->setFlags(deletableItem->flags() ^ Qt::ItemIsEnabled); } ui->removeAllPushButton->setEnabled(true); - emit changed(); return newRow; } -QStringList IgnoreListTableWidget::patterns() const -{ - QStringList list; - for (int r = 0; r < ui->tableWidget->rowCount(); ++r) { - const auto item = ui->tableWidget->item(r, patternCol); - if (item && (item->flags() & Qt::ItemIsEnabled)) - list << item->text(); - } - return list; -} - } // namespace OCC From 774d170a8bd119c9be04bbcd66f6cfa9d19c609e Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 15:17:25 +0100 Subject: [PATCH 11/29] revert changes --- src/gui/ignorelisteditor.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gui/ignorelisteditor.h b/src/gui/ignorelisteditor.h index ab65cc44bdfc5..83348d506a1c9 100644 --- a/src/gui/ignorelisteditor.h +++ b/src/gui/ignorelisteditor.h @@ -8,7 +8,6 @@ #define IGNORELISTEDITOR_H #include -#include class QListWidgetItem; class QAbstractButton; @@ -28,21 +27,17 @@ class IgnoreListEditor : public QDialog Q_OBJECT public: - explicit IgnoreListEditor(QWidget *parent = nullptr); + IgnoreListEditor(QWidget *parent = nullptr); ~IgnoreListEditor() override; bool ignoreHiddenFiles(); private slots: void slotRestoreDefaults(QAbstractButton *button); - void updateRestoreDefaultsButtonState(); // 🔹 neu: Zustand des Buttons aktualisieren private: void setupTableReadOnlyItems(); - QStringList _defaultPatterns; - bool _defaultIgnoreHidden = false; - QString readOnlyTooltip; Ui::IgnoreListEditor *ui; }; From ba9b42754b6779ff0436005b986dc2ff0cfe182e Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 13 Nov 2025 15:20:17 +0100 Subject: [PATCH 12/29] revert changes --- src/gui/ignorelisteditor.cpp | 34 +--------------------------------- src/gui/ignorelisteditor.h | 1 - 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index 4329903b3c515..d669c0fc7091e 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -17,7 +17,6 @@ #include #include #include -#include namespace OCC { @@ -35,14 +34,9 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) .arg(QDir::toNativeSeparators(cfgFile.excludeFile(ConfigFile::SystemScope))); setupTableReadOnlyItems(); - const auto userConfig = cfgFile.excludeFile(ConfigFile::Scope::UserScope); ui->ignoreTableWidget->readIgnoreFile(userConfig); - _defaultPatterns = ui->ignoreTableWidget->patterns(); - _defaultIgnoreHidden = !FolderMan::instance()->ignoreHiddenFiles(); - ui->syncHiddenFilesCheckBox->setChecked(_defaultIgnoreHidden); - connect(this, &QDialog::accepted, [=, this]() { ui->ignoreTableWidget->slotWriteIgnoreFile(userConfig); /* handle the hidden file checkbox */ @@ -54,15 +48,10 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) */ FolderMan::instance()->setIgnoreHiddenFiles(ignoreHiddenFiles()); }); - connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &IgnoreListEditor::slotRestoreDefaults); - connect(ui->ignoreTableWidget, &IgnoreListTableWidget::changed, - this, &IgnoreListEditor::updateRestoreDefaultsButtonState); - connect(ui->syncHiddenFilesCheckBox, &QCheckBox::toggled, - this, &IgnoreListEditor::updateRestoreDefaultsButtonState); - updateRestoreDefaultsButtonState(); + ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles()); } IgnoreListEditor::~IgnoreListEditor() @@ -93,28 +82,7 @@ void IgnoreListEditor::slotRestoreDefaults(QAbstractButton *button) setupTableReadOnlyItems(); ui->ignoreTableWidget->readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), false); - ui->syncHiddenFilesCheckBox->setChecked(true); - - _defaultPatterns = ui->ignoreTableWidget->patterns(); - _defaultIgnoreHidden = ui->syncHiddenFilesCheckBox->isChecked(); - updateRestoreDefaultsButtonState(); } -void IgnoreListEditor::updateRestoreDefaultsButtonState() -{ - bool changed = false; - - const auto currentPatterns = ui->ignoreTableWidget->patterns(); - if (currentPatterns != _defaultPatterns) - changed = true; - - if (ui->syncHiddenFilesCheckBox->isChecked() != _defaultIgnoreHidden) - changed = true; - - auto restoreButton = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults); - if (restoreButton) - restoreButton->setEnabled(changed); -} - } // namespace OCC diff --git a/src/gui/ignorelisteditor.h b/src/gui/ignorelisteditor.h index 83348d506a1c9..dbda14e28a3aa 100644 --- a/src/gui/ignorelisteditor.h +++ b/src/gui/ignorelisteditor.h @@ -37,7 +37,6 @@ private slots: private: void setupTableReadOnlyItems(); - QString readOnlyTooltip; Ui::IgnoreListEditor *ui; }; From 117cf5e8b54d4a11c5ebc47ab50ea2dc1ee512c9 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Thu, 13 Nov 2025 15:53:31 +0100 Subject: [PATCH 13/29] Update ignorelisteditor.cpp --- src/gui/ignorelisteditor.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index d669c0fc7091e..f17252168419b 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -81,8 +81,6 @@ void IgnoreListEditor::slotRestoreDefaults(QAbstractButton *button) ConfigFile cfgFile; setupTableReadOnlyItems(); ui->ignoreTableWidget->readIgnoreFile(cfgFile.excludeFile(ConfigFile::SystemScope), false); - - updateRestoreDefaultsButtonState(); } } // namespace OCC From be6de9a0f04f2c98b8e71fb38b4f375e585fd1da Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 17 Nov 2025 09:49:33 +0100 Subject: [PATCH 14/29] added new folder size settings --- src/gui/nmcgui/nmcgeneralsettings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 9280a62677c4b..0756c422948a8 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -86,8 +86,12 @@ void NMCGeneralSettings::setNMCLayout() getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); + + getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); getUi()->ignoredFilesButton->setStyleSheet(R"( @@ -108,6 +112,10 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); + auto *folderLimitLayout = new QHBoxLayout; + folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); + folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); + advancedSettingsBox->layout()->addLayout(folderLimitLayout); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); From ca337d63c4252d98580c53107902e7bf63ab5f30 Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 17 Nov 2025 11:59:38 +0100 Subject: [PATCH 15/29] settings text --- src/gui/nmcgui/nmcgeneralsettings.cpp | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 0756c422948a8..79c2b0ff72862 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -79,19 +79,16 @@ void NMCGeneralSettings::setNMCLayout() 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); + auto *advLayout = new QVBoxLayout(advancedSettingsBox); + advLayout->setContentsMargins(16, 16, 16, 16); + advLayout->setSpacing(8); advancedSettingsBox->setStyleSheet("border-radius: 4px;"); + // Entferne Widgets aus alten Layouts, falls notwendig getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); - - getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); getUi()->ignoredFilesButton->setStyleSheet(R"( @@ -109,15 +106,18 @@ void NMCGeneralSettings::setNMCLayout() } )"); - advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); - advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); - advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); - auto *folderLimitLayout = new QHBoxLayout; - folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); - folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); - advancedSettingsBox->layout()->addLayout(folderLimitLayout); - advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); - advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); + advLayout->addWidget(advancedSettingsLabel); + + advLayout->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); + advLayout->addWidget(getUi()->moveFilesToTrashCheckBox); + + if (getUi()->horizontalLayout_3) { + advLayout->addLayout(getUi()->horizontalLayout_3); + } + + advLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); + advLayout->addWidget(getUi()->ignoredFilesButton); + getUi()->showInExplorerNavigationPaneCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); getUi()->moveFilesToTrashCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); From 41735a1ac60e0f7b8aa74eddc9afb4d62d37d6a5 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 09:22:47 +0100 Subject: [PATCH 16/29] fixed error --- src/gui/nmcgui/nmcgeneralsettings.cpp | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 79c2b0ff72862..a4bbc3c5e09be 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -79,14 +79,16 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); QGroupBox *advancedSettingsBox = new QGroupBox(this); advancedSettingsBox->setTitle(""); - auto *advLayout = new QVBoxLayout(advancedSettingsBox); - advLayout->setContentsMargins(16, 16, 16, 16); - advLayout->setSpacing(8); + advancedSettingsBox->setLayout(new QVBoxLayout); + advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); + advancedSettingsBox->layout()->setSpacing(8); advancedSettingsBox->setStyleSheet("border-radius: 4px;"); // Entferne Widgets aus alten Layouts, falls notwendig getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -106,17 +108,19 @@ void NMCGeneralSettings::setNMCLayout() } )"); - advLayout->addWidget(advancedSettingsLabel); + advancedSettingsBox->layout()->addWidget(advancedSettingsLabel); + advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); + advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); - advLayout->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); - advLayout->addWidget(getUi()->moveFilesToTrashCheckBox); + QGroupBox *folderLimitBox = new QGroupBox(this); + folderLimitBox->setTitle(""); + folderLimitBox->setLayout(new QHBoxLayout); + folderLimitBox->addWidget(getUi()->newFolderLimitCheckBox); + folderLimitBox->addWidget(getUi()->newFolderLimitSpinBox); - if (getUi()->horizontalLayout_3) { - advLayout->addLayout(getUi()->horizontalLayout_3); - } - - advLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); - advLayout->addWidget(getUi()->ignoredFilesButton); + advancedSettingsBox->layout()->addWidget(folderLimitBox); + 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); @@ -199,7 +203,7 @@ void NMCGeneralSettings::setNMCLayout() getUi()->gridLayout_3->addWidget(dataProtectionBox, 3, 0); auto *vExpandSpacer = new QSpacerItem(1,1,QSizePolicy::Fixed,QSizePolicy::Expanding); - getUi()->gridLayout_3->layout()->addItem(vExpandSpacer); + getUi()->gridLayout_3->addItem(vExpandSpacer, 99, 0); } } // namespace OCC \ No newline at end of file From eed05c49a1ffa5aea06c332c956c8fe3a9f5446e Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 09:33:30 +0100 Subject: [PATCH 17/29] fixed error --- src/gui/nmcgui/nmcgeneralsettings.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index a4bbc3c5e09be..8d45762987dda 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -87,8 +87,6 @@ void NMCGeneralSettings::setNMCLayout() // Entferne Widgets aus alten Layouts, falls notwendig getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); - getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -112,13 +110,10 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); - QGroupBox *folderLimitBox = new QGroupBox(this); - folderLimitBox->setTitle(""); - folderLimitBox->setLayout(new QHBoxLayout); - folderLimitBox->addWidget(getUi()->newFolderLimitCheckBox); - folderLimitBox->addWidget(getUi()->newFolderLimitSpinBox); - + QWidget *folderLimitBox = new QWidget(this); + folderLimitBox->setLayout(getUi()->horizontalLayout_3); advancedSettingsBox->layout()->addWidget(folderLimitBox); + advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); From 04cb83165e3ba10658dd8e06074c4c80244628b1 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 11:12:58 +0100 Subject: [PATCH 18/29] show folder limit option --- src/gui/nmcgui/nmcgeneralsettings.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 8d45762987dda..9340d48ddf30a 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -56,7 +56,7 @@ void NMCGeneralSettings::setNMCLayout() { // General settings auto generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS")); - generalSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + generalSettingsLabel->setStyleSheet("font-size: 13px; font-weight: bold;"); getUi()->chatNotificationsCheckBox->hide(); getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->serverNotificationsCheckBox); @@ -76,17 +76,20 @@ void NMCGeneralSettings::setNMCLayout() // Advanced settings auto advancedSettingsLabel = new QLabel(QCoreApplication::translate("", "ADVANCED_SETTINGS")); - advancedSettingsLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + advancedSettingsLabel->setStyleSheet("font-size: 13px; 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;"); + advancedSettingsBox->setStyleSheet(advancedSettingsBox->styleSheet()); // Entferne Widgets aus alten Layouts, falls notwendig getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -110,8 +113,11 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->addWidget(getUi()->showInExplorerNavigationPaneCheckBox); advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); + QHBoxLayout *folderLimitLayout = new QHBoxLayout; + folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); + folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); QWidget *folderLimitBox = new QWidget(this); - folderLimitBox->setLayout(getUi()->horizontalLayout_3); + folderLimitBox->setLayout(folderLimitLayout); advancedSettingsBox->layout()->addWidget(folderLimitBox); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); @@ -124,7 +130,7 @@ void NMCGeneralSettings::setNMCLayout() //Datenschutz auto updatesLabel = new QLabel(QCoreApplication::translate("", "UPDATES_SETTINGS")); - updatesLabel->setStyleSheet("font-size: 12px; font-weight: bold;"); + updatesLabel->setStyleSheet("font-size: 13px; font-weight: bold;"); QGroupBox *dataProtectionBox = new QGroupBox(this); dataProtectionBox->setTitle(""); dataProtectionBox->setLayout(new QVBoxLayout); From 532773de31ba77638ccc3ba1d45eae60ed375440 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 13:36:44 +0100 Subject: [PATCH 19/29] fixed general settings visuals --- src/gui/nmcgui/nmcgeneralsettings.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 9340d48ddf30a..22e206b51ba8f 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -68,8 +68,6 @@ void NMCGeneralSettings::setNMCLayout() 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); @@ -82,8 +80,6 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->setLayout(new QVBoxLayout); advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); advancedSettingsBox->layout()->setSpacing(8); - advancedSettingsBox->setStyleSheet("border-radius: 4px;"); - advancedSettingsBox->setStyleSheet(advancedSettingsBox->styleSheet()); // Entferne Widgets aus alten Layouts, falls notwendig getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); @@ -114,12 +110,18 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->addWidget(getUi()->moveFilesToTrashCheckBox); QHBoxLayout *folderLimitLayout = new QHBoxLayout; + folderLimitLayout->setContentsMargins(0,0,0,0); + folderLimitLayout->setSpacing(8); folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); + getUi()->newFolderLimitSpinBox->setFixedWidth(80); + folderLimitLayout->addStretch(); + QWidget *folderLimitBox = new QWidget(this); folderLimitBox->setLayout(folderLimitLayout); - advancedSettingsBox->layout()->addWidget(folderLimitBox); + folderLimitBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + advancedSettingsBox->layout()->addWidget(folderLimitBox); advancedSettingsBox->layout()->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed)); advancedSettingsBox->layout()->addWidget(getUi()->ignoredFilesButton); @@ -136,8 +138,6 @@ void NMCGeneralSettings::setNMCLayout() 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")); From 17a8a2d89879a105337a49bff81f65cb775f8290 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 16:10:12 +0100 Subject: [PATCH 20/29] fixed alignment --- src/gui/nmcgui/nmcgeneralsettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 22e206b51ba8f..bff19cb273719 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -86,6 +86,7 @@ void NMCGeneralSettings::setNMCLayout() getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); + getUi()->horizontalLayout_3->removeWidget(getUi()->label); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -115,10 +116,14 @@ void NMCGeneralSettings::setNMCLayout() folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); getUi()->newFolderLimitSpinBox->setFixedWidth(80); + getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); + folderLimitLayout->addWidget(getUi()->label); + getUi()->label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); folderLimitLayout->addStretch(); QWidget *folderLimitBox = new QWidget(this); folderLimitBox->setLayout(folderLimitLayout); + folderLimitBox->setContentsMargins(2, 0, 0, 0); folderLimitBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); advancedSettingsBox->layout()->addWidget(folderLimitBox); From 7b3a289e32745dfc59c7c60e78de331c5f33f1ef Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 17:29:03 +0100 Subject: [PATCH 21/29] fix error --- src/libsync/nmclibsync/nmcconfigfile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsync/nmclibsync/nmcconfigfile.h b/src/libsync/nmclibsync/nmcconfigfile.h index 1c8f66f6d9921..079d1dd39757f 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.h +++ b/src/libsync/nmclibsync/nmcconfigfile.h @@ -56,6 +56,7 @@ class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile private: QString m_transferUsageData = "TransferUsageData"; ///< Configuration key for storing the status of transferring usage data. + QString defaultConnection() const override { return QString(); } }; From 48b1270bca3aa15bc3d02ba92e6074b6d6ab7188 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 18 Nov 2025 17:42:33 +0100 Subject: [PATCH 22/29] fix error --- src/libsync/nmclibsync/nmcconfigfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/nmclibsync/nmcconfigfile.h b/src/libsync/nmclibsync/nmcconfigfile.h index 079d1dd39757f..ac79815e542a4 100644 --- a/src/libsync/nmclibsync/nmcconfigfile.h +++ b/src/libsync/nmclibsync/nmcconfigfile.h @@ -56,7 +56,7 @@ class OWNCLOUDSYNC_EXPORT NMCConfigFile : public ConfigFile private: QString m_transferUsageData = "TransferUsageData"; ///< Configuration key for storing the status of transferring usage data. - QString defaultConnection() const override { return QString(); } + QString defaultConnection() const { return QString(); } }; From 92c51dd0a0e46fe5b9a874f0cd0b859e7856c53f Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 19 Nov 2025 08:18:17 +0100 Subject: [PATCH 23/29] fixed alignment --- 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 bff19cb273719..40bc9e0fef628 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -123,7 +123,7 @@ void NMCGeneralSettings::setNMCLayout() QWidget *folderLimitBox = new QWidget(this); folderLimitBox->setLayout(folderLimitLayout); - folderLimitBox->setContentsMargins(2, 0, 0, 0); + folderLimitBox->setContentsMargins(0, 0, 0, 0); folderLimitBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); advancedSettingsBox->layout()->addWidget(folderLimitBox); From 7ca0db238f993746b731881cb6cab074041e31c6 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 26 Nov 2025 18:15:17 +0100 Subject: [PATCH 24/29] fixed settings --- src/gui/nmcgui/nmcgeneralsettings.cpp | 34 ++++++++++++--------------- src/libsync/configfile.cpp | 12 +++++----- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 40bc9e0fef628..70b8d4a43f5b0 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -30,24 +30,16 @@ NMCGeneralSettings::NMCGeneralSettings(QWidget *parent) void NMCGeneralSettings::setDefaultSettings() { - //Set default settings + //Hide and disable unsupported 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 - getUi()->monoIconsCheckBox->setVisible(false); getUi()->callNotificationsCheckBox->setVisible(false); + getUi()->monoIconsCheckBox->setVisible(false); + getUi()->chatNotificationsCheckBox->setVisible(false); getUi()->quotaWarningNotificationsCheckBox->setVisible(false); + //Advanced settings getUi()->groupBox->setVisible(false); + //Info settings getUi()->aboutAndUpdatesGroupBox->setVisible(false); } @@ -58,9 +50,11 @@ void NMCGeneralSettings::setNMCLayout() auto generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS")); generalSettingsLabel->setStyleSheet("font-size: 13px; 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()->serverNotificationsCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->callNotificationsCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->monoIconsCheckBox); + getUi()->generalGroupBox->layout()->removeWidget(getUi()->chatNotificationsCheckBox); getUi()->generalGroupBox->layout()->removeWidget(getUi()->quotaWarningNotificationsCheckBox); getUi()->generalGroupBox->setTitle({}); static_cast(getUi()->generalGroupBox->layout())->addWidget(generalSettingsLabel, 0, 0); @@ -81,13 +75,12 @@ void NMCGeneralSettings::setNMCLayout() advancedSettingsBox->layout()->setContentsMargins(16, 16, 16, 16); advancedSettingsBox->layout()->setSpacing(8); - // Entferne Widgets aus alten Layouts, falls notwendig - getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); - getUi()->horizontalLayout->removeWidget(getUi()->moveFilesToTrashCheckBox); + getUi()->horizontalLayout_trash->removeWidget(getUi()->moveFilesToTrashCheckBox); getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitCheckBox); getUi()->horizontalLayout_3->removeWidget(getUi()->newFolderLimitSpinBox); getUi()->horizontalLayout_3->removeWidget(getUi()->label); getUi()->horizontalLayout_4->removeWidget(getUi()->ignoredFilesButton); + getUi()->horizontalLayout_10->removeWidget(getUi()->showInExplorerNavigationPaneCheckBox); getUi()->ignoredFilesButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); getUi()->ignoredFilesButton->setFocusPolicy(Qt::NoFocus); @@ -144,15 +137,18 @@ void NMCGeneralSettings::setNMCLayout() dataProtectionBox->layout()->setContentsMargins(16, 16, 16, 16); dataProtectionBox->layout()->setSpacing(8); + getUi()->updatesLayout_2->removeWidget(getUi()->autoCheckForUpdatesCheckBox); + 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); + getUi()->autoCheckForUpdatesCheckBox->setFocusPolicy(Qt::FocusPolicy::NoFocus); + connect(dataAnalysisCheckBox, &QAbstractButton::toggled, this, [](bool toggle){ NMCConfigFile cfgFile; cfgFile.setTransferUsageData(toggle, QString()); diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 9f9ad7df61270..52dd5d3dc4a46 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -187,13 +187,13 @@ 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 { const QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(showChatNotificationsC, true).toBool() && optionalServerNotifications(); + return settings.value(showChatNotificationsC, false).toBool() && optionalServerNotifications(); } void ConfigFile::setShowChatNotifications(const bool show) @@ -206,7 +206,7 @@ void ConfigFile::setShowChatNotifications(const bool show) bool ConfigFile::showCallNotifications() const { const QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(showCallNotificationsC, true).toBool() && optionalServerNotifications(); + return settings.value(showCallNotificationsC, false).toBool() && optionalServerNotifications(); } void ConfigFile::setShowCallNotifications(bool show) @@ -219,7 +219,7 @@ void ConfigFile::setShowCallNotifications(bool show) bool ConfigFile::showQuotaWarningNotifications() const { const QSettings settings(configFile(), QSettings::IniFormat); - return settings.value(showQuotaWarningNotificationsC, true).toBool() && optionalServerNotifications(); + return settings.value(showQuotaWarningNotificationsC, false).toBool() && optionalServerNotifications(); } void ConfigFile::setShowQuotaWarningNotifications(bool show) @@ -1001,13 +1001,13 @@ void ConfigFile::setNewBigFolderSizeLimit(bool isChecked, qint64 mbytes) bool ConfigFile::confirmExternalStorage() const { - const auto fallback = getValue(confirmExternalStorageC, QString(), true); + const auto fallback = getValue(confirmExternalStorageC, QString(), false); return getPolicySetting(QLatin1String(confirmExternalStorageC), fallback).toBool(); } bool ConfigFile::useNewBigFolderSizeLimit() const { - const auto fallback = getValue(useNewBigFolderSizeLimitC, QString(), true); + const auto fallback = getValue(useNewBigFolderSizeLimitC, QString(), false); return getPolicySetting(QLatin1String(useNewBigFolderSizeLimitC), fallback).toBool(); } From 00284d511a5d7f179b40f19d423dbd4309fbf964 Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 26 Nov 2025 18:21:51 +0100 Subject: [PATCH 25/29] iconicon --- .gitignore | 1 + theme/colored/magentacloud-icon.svg | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 theme/colored/magentacloud-icon.svg diff --git a/.gitignore b/.gitignore index e64d58766d85e..17d49259d6cdf 100644 --- a/.gitignore +++ b/.gitignore @@ -191,6 +191,7 @@ convert.exe *-icon.png *-icon-win-folder.png *-sidebar.png +*-icon.svg *-w10startmenu.png *state-*.png theme.qrc diff --git a/theme/colored/magentacloud-icon.svg b/theme/colored/magentacloud-icon.svg new file mode 100644 index 0000000000000..d2b5a35f0c949 --- /dev/null +++ b/theme/colored/magentacloud-icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + From fe7e9981dc7f4d8b1b0225c81710cab349d849df Mon Sep 17 00:00:00 2001 From: memurats Date: Wed, 26 Nov 2025 18:24:21 +0100 Subject: [PATCH 26/29] removed change --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 17d49259d6cdf..e64d58766d85e 100644 --- a/.gitignore +++ b/.gitignore @@ -191,7 +191,6 @@ convert.exe *-icon.png *-icon-win-folder.png *-sidebar.png -*-icon.svg *-w10startmenu.png *state-*.png theme.qrc From 380b85dc836c8a7960075ec794bc0c02d4eda3d5 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Thu, 27 Nov 2025 08:37:32 +0100 Subject: [PATCH 27/29] Delete theme/colored/magentacloud-icon.svg --- theme/colored/magentacloud-icon.svg | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 theme/colored/magentacloud-icon.svg diff --git a/theme/colored/magentacloud-icon.svg b/theme/colored/magentacloud-icon.svg deleted file mode 100644 index d2b5a35f0c949..0000000000000 --- a/theme/colored/magentacloud-icon.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - From 78a72a3cb07da2a819f4df9bf1f96b057fcb0de1 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 27 Nov 2025 11:15:44 +0100 Subject: [PATCH 28/29] no focus on limit box --- 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 70b8d4a43f5b0..95e07904d4abc 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -110,6 +110,7 @@ void NMCGeneralSettings::setNMCLayout() folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); getUi()->newFolderLimitSpinBox->setFixedWidth(80); getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); folderLimitLayout->addWidget(getUi()->label); getUi()->label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); folderLimitLayout->addStretch(); From ac098ef763c2dd40fb115a674b827c7975711fc1 Mon Sep 17 00:00:00 2001 From: memurats Date: Thu, 27 Nov 2025 16:20:06 +0100 Subject: [PATCH 29/29] fixed input spinbox --- src/gui/nmcgui/nmcgeneralsettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/nmcgui/nmcgeneralsettings.cpp b/src/gui/nmcgui/nmcgeneralsettings.cpp index 95e07904d4abc..ff6f6b6f650f0 100644 --- a/src/gui/nmcgui/nmcgeneralsettings.cpp +++ b/src/gui/nmcgui/nmcgeneralsettings.cpp @@ -108,9 +108,9 @@ void NMCGeneralSettings::setNMCLayout() folderLimitLayout->setSpacing(8); folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox); folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox); - getUi()->newFolderLimitSpinBox->setFixedWidth(80); - getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::NoFocus); getUi()->newFolderLimitCheckBox->setFocusPolicy(Qt::NoFocus); + getUi()->newFolderLimitSpinBox->setFixedWidth(80); + getUi()->newFolderLimitSpinBox->setFocusPolicy(Qt::StrongFocus); folderLimitLayout->addWidget(getUi()->label); getUi()->label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); folderLimitLayout->addStretch();