Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cf2489f
network settings changes
memurats Oct 24, 2025
b6b1a17
updated gui cmake file
memurats Oct 27, 2025
192c4b9
added network settings button
memurats Oct 29, 2025
97b2999
fixed crash
memurats Oct 29, 2025
d43d060
use standard network settings
memurats Oct 29, 2025
691ae41
fix bug
memurats Oct 29, 2025
e5283f9
remove network tab
memurats Oct 30, 2025
5731f74
added constructor overload
memurats Oct 30, 2025
d4b484c
fixed header
memurats Oct 30, 2025
9e0ad54
removed widget
memurats Oct 30, 2025
c471c73
removed changes
memurats Oct 30, 2025
a42a29e
removed customisation
memurats Oct 30, 2025
995e42b
modified init
memurats Oct 30, 2025
8cbe905
standard init
memurats Oct 30, 2025
489d9f7
removed include
memurats Oct 30, 2025
60dc4c9
add background color
memurats Oct 30, 2025
2b7b781
disabled network action
memurats Oct 30, 2025
9088840
fix network visuals
memurats Nov 12, 2025
1a1e100
style background
memurats Nov 12, 2025
a116bd0
added padding to connection tab
memurats Nov 13, 2025
e4ad774
add spacing
memurats Nov 13, 2025
ab9994a
network settings styling
memurats Nov 18, 2025
6b79f0a
fixed network fonts
memurats Nov 18, 2025
a1b1900
fixed layout
memurats Nov 18, 2025
b05f7a2
fixed network margin
memurats Nov 19, 2025
26fd790
changed background color
memurats Nov 19, 2025
252ab8d
fix layout
memurats Nov 20, 2025
1d3d7f9
fixed layout
memurats Nov 20, 2025
7ef34f2
changed bg color
memurats Nov 21, 2025
085877b
chabged bg
memurats Nov 21, 2025
e534013
fixed bg
memurats Nov 21, 2025
10b9653
btn color
memurats Nov 21, 2025
961a894
fix error
memurats Nov 21, 2025
016d53f
revert
memurats Nov 21, 2025
10a6a5c
change settings box
memurats Nov 25, 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 @@ -258,6 +261,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
23 changes: 23 additions & 0 deletions src/gui/networksettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <QNetworkProxy>
#include <QString>
#include <QList>
#include <QPainter>
#include <QPainterPath>
#include <type_traits>

namespace OCC {
Expand All @@ -28,6 +30,9 @@ NetworkSettings::NetworkSettings(const AccountPtr &account, QWidget *parent)
{
_ui->setupUi(this);

setAttribute(Qt::WA_OpaquePaintEvent, false);
setAutoFillBackground(false);

_ui->manualSettings->setVisible(_ui->manualProxyRadioButton->isChecked());

_ui->proxyGroupBox->setVisible(!Theme::instance()->doNotUseProxy());
Expand Down Expand Up @@ -276,5 +281,23 @@ void NetworkSettings::checkAccountLocalhost()
_ui->labelLocalhost->setVisible(visible);
}

void NetworkSettings::paintEvent(QPaintEvent *event)
{
const int radius = 4;

QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);

QRect rect(0, 0, width(), height());

QPainterPath path;
path.addRoundedRect(rect, radius, radius);

QPalette palette = this->palette();

painter.fillPath(path, palette.color(QPalette::Base));

QWidget::paintEvent(event);
}

} // namespace OCC
6 changes: 6 additions & 0 deletions src/gui/networksettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class NetworkSettings : public QWidget
~NetworkSettings() override;
[[nodiscard]] QSize sizeHint() const override;

Ui::NetworkSettings *getUi() const
{
return _ui;
}

private slots:
void saveProxySettings();
void saveBWLimitSettings();
Expand All @@ -42,6 +47,7 @@ private slots:

protected:
void showEvent(QShowEvent *event) override;
void paintEvent(QPaintEvent *event) override;

private:
void loadProxySettings();
Expand Down
23 changes: 13 additions & 10 deletions src/gui/networksettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>16</number>
</property>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
Expand Down Expand Up @@ -45,6 +48,9 @@
<string>Proxy Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>8</number>
</property>
<item row="0" column="0">
<widget class="QRadioButton" name="noProxyRadioButton">
<property name="text">
Expand Down Expand Up @@ -306,13 +312,13 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="topMargin">
<number>9</number>
<number>8</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
<number>8</number>
</property>
<item row="3" column="0">
<widget class="QRadioButton" name="downloadLimitRadioButton">
Expand All @@ -337,7 +343,7 @@
<string>Limit to 3/4 of estimated bandwidth</string>
</property>
<property name="text">
<string>Limit automatically</string>
<string>Limit to 3/4 of estimated bandwidth</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -401,18 +407,15 @@
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="topMargin">
<number>9</number>
<number>12</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>6</number>
<number>8</number>
</property>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0">
Expand Down Expand Up @@ -460,7 +463,7 @@
<string>Limit to 3/4 of estimated bandwidth</string>
</property>
<property name="text">
<string>Limit automatically</string>
<string>Limit to 3/4 of estimated bandwidth</string>
</property>
</widget>
</item>
Expand Down
125 changes: 125 additions & 0 deletions src/gui/nmcgui/nmcnetworksettings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/*
* 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 "nmcgui/nmcnetworksettings.h"
#include "networksettings.h"
#include "ui_networksettings.h"

#include <QLabel>
#include <QSpacerItem>
#include <QGridLayout>
#include <QSizePolicy>
#include <QCoreApplication>

namespace OCC {

NMCNetworkSettings::NMCNetworkSettings(const AccountPtr &account, QWidget *parent)
: NetworkSettings(account, parent)
{
setLayout();
}

void NMCNetworkSettings::setLayout()
{
auto *ui = getUi();

//
// Proxy Settings
//
ui->proxyGroupBox->setTitle({});
ui->proxyGroupBox->layout()->removeWidget(ui->manualProxyRadioButton);
ui->proxyGroupBox->layout()->removeWidget(ui->noProxyRadioButton);
ui->proxyGroupBox->layout()->removeWidget(ui->systemProxyRadioButton);

delete ui->horizontalLayout_7;

Check failure on line 45 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rewrite the code so that you no longer need this "delete".

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYV&open=AZ4gmWWPR3i4cpnENxYV&pullRequest=407
delete ui->horizontalSpacer_2;

Check failure on line 46 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rewrite the code so that you no longer need this "delete".

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYW&open=AZ4gmWWPR3i4cpnENxYW&pullRequest=407

ui->proxyGroupBox->layout()->setContentsMargins(16, 16, 16, 16);
ui->proxyGroupBox->setStyleSheet("border-radius: 4px;");

auto *proxyLayout = qobject_cast<QGridLayout *>(ui->proxyGroupBox->layout());
auto *proxyLabel = new QLabel(QCoreApplication::translate("", "PROXY_SETTINGS"));

Check failure on line 52 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the use of "new" with an operation that automatically manages the memory.

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYZ&open=AZ4gmWWPR3i4cpnENxYZ&pullRequest=407
proxyLabel->setStyleSheet("font-size: 12px; font-weight: bold;");

proxyLayout->addWidget(proxyLabel, 0, 0);
proxyLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
proxyLayout->addWidget(ui->noProxyRadioButton, 2, 0);
proxyLayout->addWidget(ui->systemProxyRadioButton, 3, 0);
proxyLayout->addWidget(ui->manualProxyRadioButton, 4, 0);

ui->horizontalSpacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
ui->proxyGroupBox->setStyleSheet(ui->proxyGroupBox->styleSheet());

//
// Download Bandwidth
//
ui->verticalSpacer_2->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
ui->downloadBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
ui->horizontalLayout_3->setSpacing(8);
ui->downloadBox->setTitle({});

ui->downloadBox->layout()->removeWidget(ui->noDownloadLimitRadioButton);
ui->downloadBox->layout()->removeWidget(ui->autoDownloadLimitRadioButton);
ui->downloadBox->layout()->removeWidget(ui->downloadLimitRadioButton);

delete ui->horizontalLayout_3;

Check failure on line 76 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rewrite the code so that you no longer need this "delete".

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYX&open=AZ4gmWWPR3i4cpnENxYX&pullRequest=407

ui->downloadBox->layout()->setContentsMargins(16, 16, 16, 16);
ui->downloadBox->setStyleSheet("border-radius: 4px;");

auto *downLayout = qobject_cast<QGridLayout *>(ui->downloadBox->layout());
auto *downLabel = new QLabel(QCoreApplication::translate("", "DOWNLOAD_BANDWIDTH"));

Check failure on line 82 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the use of "new" with an operation that automatically manages the memory.

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYa&open=AZ4gmWWPR3i4cpnENxYa&pullRequest=407
downLabel->setStyleSheet("font-size: 12px; font-weight: bold;");

downLayout->addWidget(downLabel, 0, 0);
downLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
downLayout->addWidget(ui->noDownloadLimitRadioButton, 2, 0);
downLayout->addWidget(ui->autoDownloadLimitRadioButton, 3, 0);
downLayout->addWidget(ui->downloadLimitRadioButton, 4, 0);

ui->downloadLimitRadioButton->setFixedHeight(ui->downloadSpinBox->height());
ui->downloadBox->setStyleSheet(ui->downloadBox->styleSheet());

//
// Upload Bandwidth
//
ui->verticalSpacer_3->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
ui->uploadBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
ui->horizontalLayout_4->setSpacing(8);
ui->uploadBox->setTitle({});

ui->uploadBox->layout()->removeWidget(ui->noUploadLimitRadioButton);
ui->uploadBox->layout()->removeWidget(ui->autoUploadLimitRadioButton);
ui->uploadBox->layout()->removeWidget(ui->uploadLimitRadioButton);

delete ui->horizontalLayout_4;

Check failure on line 106 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rewrite the code so that you no longer need this "delete".

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYY&open=AZ4gmWWPR3i4cpnENxYY&pullRequest=407

ui->uploadBox->layout()->setContentsMargins(16, 16, 16, 16);
ui->uploadBox->setStyleSheet("border-radius: 4px;");

auto *upLayout = qobject_cast<QGridLayout *>(ui->uploadBox->layout());
auto *upLabel = new QLabel(QCoreApplication::translate("", "UPLOAD_BANDWIDTH"));

Check failure on line 112 in src/gui/nmcgui/nmcnetworksettings.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace the use of "new" with an operation that automatically manages the memory.

See more on https://sonarcloud.io/project/issues?id=nextmcloud_desktop&issues=AZ4gmWWPR3i4cpnENxYb&open=AZ4gmWWPR3i4cpnENxYb&pullRequest=407
upLabel->setStyleSheet("font-size: 12px; font-weight: bold;");

upLayout->addWidget(upLabel, 0, 0);
upLayout->addItem(new QSpacerItem(1, 8, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
upLayout->addWidget(ui->noUploadLimitRadioButton, 2, 0);
upLayout->addWidget(ui->autoUploadLimitRadioButton, 3, 0);
upLayout->addWidget(ui->uploadLimitRadioButton, 4, 0);

ui->uploadLimitRadioButton->setFixedHeight(ui->uploadSpinBox->height());
ui->uploadBox->setStyleSheet(ui->uploadBox->styleSheet());
}

} // namespace OCC
57 changes: 57 additions & 0 deletions src/gui/nmcgui/nmcnetworksettings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
*
* 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_NETWORKSETTINGSMAGENTA_H
#define MIRALL_NETWORKSETTINGSMAGENTA_H

#include "networksettings.h"

QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE

namespace OCC {

/**
* @class NMCNetworkSettings
* @ingroup gui
* @brief Derived class for network settings specific to NMC (Magenta) in the ownCloud client.
*/
class NMCNetworkSettings : public NetworkSettings
{
Q_OBJECT

public:
/**
* @brief Constructor
* @param account Account pointer used to configure settings
* @param parent Parent widget
*/
explicit NMCNetworkSettings(const AccountPtr &account = {}, QWidget *parent = nullptr);

/**
* @brief Destructor
*/
~NMCNetworkSettings() override = default;

private:
/**
* @brief Initializes and sets the custom layout
*/
void setLayout();
};

} // namespace OCC

#endif // MIRALL_NETWORKSETTINGSMAGENTA_H