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
ede9813
network settings changes
memurats Oct 24, 2025
f3cf7cc
updated gui cmake file
memurats Oct 27, 2025
96900f9
added network settings button
memurats Oct 29, 2025
c15de48
fixed crash
memurats Oct 29, 2025
b68cbe6
use standard network settings
memurats Oct 29, 2025
d5fe281
fix bug
memurats Oct 29, 2025
2f1d823
remove network tab
memurats Oct 30, 2025
d047c66
added constructor overload
memurats Oct 30, 2025
c6c9ef9
fixed header
memurats Oct 30, 2025
8ef97ed
removed widget
memurats Oct 30, 2025
e0a0097
removed changes
memurats Oct 30, 2025
5cde5aa
removed customisation
memurats Oct 30, 2025
d1f2f00
modified init
memurats Oct 30, 2025
6b74677
standard init
memurats Oct 30, 2025
5c02db1
removed include
memurats Oct 30, 2025
6820200
add background color
memurats Oct 30, 2025
0914fc4
disabled network action
memurats Oct 30, 2025
ced5996
fix network visuals
memurats Nov 12, 2025
5524926
style background
memurats Nov 12, 2025
35b4ec4
added padding to connection tab
memurats Nov 13, 2025
c36e80f
add spacing
memurats Nov 13, 2025
53bd248
network settings styling
memurats Nov 18, 2025
075840b
fixed network fonts
memurats Nov 18, 2025
5d41a75
fixed layout
memurats Nov 18, 2025
d3a02f2
fixed network margin
memurats Nov 19, 2025
92d9f36
changed background color
memurats Nov 19, 2025
74917eb
fix layout
memurats Nov 20, 2025
4a13281
fixed layout
memurats Nov 20, 2025
5fadc0d
changed bg color
memurats Nov 21, 2025
f0843ba
chabged bg
memurats Nov 21, 2025
16bb77f
fixed bg
memurats Nov 21, 2025
d90654f
btn color
memurats Nov 21, 2025
fb48125
fix error
memurats Nov 21, 2025
95f163e
revert
memurats Nov 21, 2025
968a658
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 @@ -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
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;
delete ui->horizontalSpacer_2;

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

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

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