Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
37ebaef
general settings dialog changes
memurats Oct 27, 2025
fadd35c
updated gui cmake file
memurats Oct 27, 2025
9968973
remove quota warning checkbox
memurats Oct 28, 2025
389752d
set new default settings
memurats Oct 28, 2025
da0a1b7
fix reset default button
memurats Nov 13, 2025
2ad7c2d
fix error
memurats Nov 13, 2025
724128f
fixed error
memurats Nov 13, 2025
85c4798
revert ignore table widget changes
memurats Nov 13, 2025
b6bc4c6
revert change
memurats Nov 13, 2025
c2fc1f2
revert changes
memurats Nov 13, 2025
774d170
revert changes
memurats Nov 13, 2025
ba9b427
revert changes
memurats Nov 13, 2025
117cf5e
Update ignorelisteditor.cpp
memurats Nov 13, 2025
be6de9a
added new folder size settings
memurats Nov 17, 2025
ca337d6
settings text
memurats Nov 17, 2025
41735a1
fixed error
memurats Nov 18, 2025
eed05c4
fixed error
memurats Nov 18, 2025
04cb831
show folder limit option
memurats Nov 18, 2025
532773d
fixed general settings visuals
memurats Nov 18, 2025
17a8a2d
fixed alignment
memurats Nov 18, 2025
7b3a289
fix error
memurats Nov 18, 2025
48b1270
fix error
memurats Nov 18, 2025
92c51dd
fixed alignment
memurats Nov 19, 2025
7ca0db2
fixed settings
memurats Nov 26, 2025
00284d5
iconicon
memurats Nov 26, 2025
fe7e998
removed change
memurats Nov 26, 2025
5f54483
Merge branch 'stable-4.0' into backport/nmc/384/stable-4.0
memurats Nov 26, 2025
380b85d
Delete theme/colored/magentacloud-icon.svg
memurats Nov 27, 2025
78a72a3
no focus on limit box
memurats Nov 27, 2025
ac098ef
fixed input spinbox
memurats Nov 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/gui/generalsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/gui/ignorelisteditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Global Ignore Settings</string>
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
Expand All @@ -33,7 +33,7 @@
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Files Ignored by Patterns</string>
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
Expand Down
212 changes: 212 additions & 0 deletions src/gui/nmcgui/nmcgeneralsettings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
/*
* 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()
{
//Hide and disable unsupported settings
//General settings
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);
}

void NMCGeneralSettings::setNMCLayout()
{
// General settings
auto generalSettingsLabel = new QLabel(QCoreApplication::translate("", "GENERAL_SETTINGS"));
generalSettingsLabel->setStyleSheet("font-size: 13px; font-weight: bold;");
getUi()->chatNotificationsCheckBox->hide();
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<QGridLayout *>(getUi()->generalGroupBox->layout())->addWidget(generalSettingsLabel, 0, 0);
static_cast<QGridLayout *>(getUi()->generalGroupBox->layout())->addWidget(getUi()->autostartCheckBox, 1, 0);
static_cast<QGridLayout *>(getUi()->generalGroupBox->layout())->addWidget(getUi()->serverNotificationsCheckBox, 2, 0);
getUi()->generalGroupBox->layout()->setContentsMargins(16, 16, 16, 16);
getUi()->generalGroupBox->layout()->setSpacing(8);

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: 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);

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);
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);

QHBoxLayout *folderLimitLayout = new QHBoxLayout;
folderLimitLayout->setContentsMargins(0,0,0,0);
folderLimitLayout->setSpacing(8);
folderLimitLayout->addWidget(getUi()->newFolderLimitCheckBox);
folderLimitLayout->addWidget(getUi()->newFolderLimitSpinBox);
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();

QWidget *folderLimitBox = new QWidget(this);
folderLimitBox->setLayout(folderLimitLayout);
folderLimitBox->setContentsMargins(0, 0, 0, 0);
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);

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: 13px; 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);

getUi()->updatesLayout_2->removeWidget(getUi()->autoCheckForUpdatesCheckBox);

auto *dataAnalysisCheckBox = new QCheckBox(this);
dataAnalysisCheckBox->setText(QCoreApplication::translate("", "DATA_ANALYSIS"));
dataAnalysisCheckBox->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());
});
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("<a href=\"https://www.telekom.de/impressum/\"><span style=\"color:#2238df\">%1</span></a>").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("<a href=\"https://static.magentacloud.de/privacy/datenschutzhinweise_software.pdf\"><span style=\"color:#2238df\">%1</span></a>").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("<a href=\"https://static.magentacloud.de/licences/windowsdesktop.html\"><span style=\"color:#2238df\">%1</span></a>").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("<a href=\"https://cloud.telekom-dienste.de/hilfe\"><span style=\"color:#2238df\">%1</span></a>").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->addItem(vExpandSpacer, 99, 0);
}

} // namespace OCC
66 changes: 66 additions & 0 deletions src/gui/nmcgui/nmcgeneralsettings.h
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion src/gui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/libsync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading