Skip to content

Commit

Permalink
Renamed and moved the files to NMCGui folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Nov 20, 2023
1 parent 178c33e commit 45493f6
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 51 deletions.
21 changes: 12 additions & 9 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ project(gui)
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 Xml Network)
find_package(KF5Archive REQUIRED)

#MNC change, its needed to fins the ui file in different location as the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

if(QUICK_COMPILER)
find_package(Qt5QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES
Expand Down Expand Up @@ -65,8 +68,6 @@ set(client_SRCS
accountmanager.cpp
accountsettings.h
accountsettings.cpp
accountsettingsmagenta.h
accountsettingsmagenta.cpp
accountsetupfromcommandlinejob.h
accountsetupfromcommandlinejob.cpp
accountsetupcommandlinemanager.h
Expand Down Expand Up @@ -109,8 +110,6 @@ set(client_SRCS
folderwizard.cpp
generalsettings.h
generalsettings.cpp
generalsettingsmagenta.h
generalsettingsmagenta.cpp
legalnotice.h
legalnotice.cpp
ignorelisteditor.h
Expand All @@ -125,9 +124,6 @@ set(client_SRCS
navigationpanehelper.cpp
networksettings.h
networksettings.cpp
networksettingsmagenta.h
networksettingsmagenta.cpp
nmcguiinterface.h
ocsnavigationappsjob.h
ocsnavigationappsjob.cpp
ocsjob.h
Expand All @@ -148,8 +144,6 @@ set(client_SRCS
selectivesyncdialog.cpp
settingsdialog.h
settingsdialog.cpp
settingsdialogmagenta.h
settingsdialogmagenta.cpp
sharemanager.h
sharemanager.cpp
profilepagewidget.h
Expand Down Expand Up @@ -200,6 +194,15 @@ set(client_SRCS
syncconflictsmodel.cpp
fileactivitylistmodel.h
fileactivitylistmodel.cpp
nmcgui/nmcaccountsettings.h
nmcgui/nmcaccountsettings.cpp
nmcgui/nmcgeneralsettings.h
nmcgui/nmcgeneralsettings.cpp
nmcgui/nmcguiinterface.h
nmcgui/nmcnetworksettings.h
nmcgui/nmcnetworksettings.cpp
nmcgui/nmcsettingsdialog.h
nmcgui/nmcsettingsdialog.cpp
filedetails/datefieldbackend.h
filedetails/datefieldbackend.cpp
filedetails/filedetails.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
* for more details.
*/

#include "accountsettingsmagenta.h"
#include "nmcaccountsettings.h"
#include "accountsettings.h"
#include "ui_accountsettings.h"
#include "qdesktopservices.h"


namespace OCC {

AccountSettingsMagenta::AccountSettingsMagenta(AccountState *accountState, QWidget *parent)
NMCAccountSettings::NMCAccountSettings(AccountState *accountState, QWidget *parent)
: AccountSettings(accountState, parent)
{
setDefaultSettings();
setLayout();
setLogic();
}

void AccountSettingsMagenta::setDefaultSettings()
void NMCAccountSettings::setDefaultSettings()
{
//Set default settings
_ui->encryptionMessage->setCloseButtonVisible(true);
Expand All @@ -38,7 +38,7 @@ void AccountSettingsMagenta::setDefaultSettings()
_ui->bigFolderUi->setVisible(false);
}

void AccountSettingsMagenta::setLayout()
void NMCAccountSettings::setLayout()
{
//Fix layout
_ui->storageGroupBox->removeWidget(_ui->quotaInfoLabel);
Expand Down Expand Up @@ -66,7 +66,7 @@ void AccountSettingsMagenta::setLayout()
_ui->gridLayout->addLayout(magentaHLayout, 0, 0);
}

void AccountSettingsMagenta::setLogic()
void NMCAccountSettings::setLogic()
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace OCC {
* @brief The AccountSettingsMagenta class
* @ingroup gui
*/
class AccountSettingsMagenta : public AccountSettings, public NMCGuiInterface
class NMCAccountSettings : public AccountSettings, public NMCGuiInterface
{
Q_OBJECT

public:
explicit AccountSettingsMagenta(AccountState *accountState, QWidget *parent = nullptr);
~AccountSettingsMagenta() = default;
explicit NMCAccountSettings(AccountState *accountState, QWidget *parent = nullptr);
~NMCAccountSettings() = default;

// NMCGuiInterface interface
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
* for more details.
*/

#include "generalsettingsmagenta.h"
#include "generalsettings.h"
#include "nmcgeneralsettings.h"
#include "GeneralSettings.h"
#include "ui_generalsettings.h"


namespace OCC {

GeneralSettingsMagenta::GeneralSettingsMagenta(QWidget *parent)
NMCGeneralSettings::NMCGeneralSettings(QWidget *parent)
: GeneralSettings(parent)
{
setDefaultSettings();
setLayout();
setLogic();
}

void GeneralSettingsMagenta::setDefaultSettings()
void NMCGeneralSettings::setDefaultSettings()
{
//Set default settings
//General settings
Expand All @@ -49,7 +49,7 @@ void GeneralSettingsMagenta::setDefaultSettings()
_ui->aboutAndUpdatesGroupBox->setVisible(false);
}

void GeneralSettingsMagenta::setLayout()
void NMCGeneralSettings::setLayout()
{
//Fix layout
//General settings
Expand Down Expand Up @@ -149,7 +149,7 @@ void GeneralSettingsMagenta::setLayout()
_ui->gridLayout_3->layout()->addItem(vExpandSpacer);
}

void GeneralSettingsMagenta::setLogic()
void NMCGeneralSettings::setLogic()
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace OCC {
* @brief The GeneralSettingsMagenta class
* @ingroup gui
*/
class GeneralSettingsMagenta : public GeneralSettings, public NMCGuiInterface
class NMCGeneralSettings : public GeneralSettings, public NMCGuiInterface
{
Q_OBJECT

public:
explicit GeneralSettingsMagenta(QWidget *parent = nullptr);
~GeneralSettingsMagenta() = default;
explicit NMCGeneralSettings(QWidget *parent = nullptr);
~NMCGeneralSettings() = default;

// NMCGuiInterface interface
protected:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
* for more details.
*/

#include "networksettingsmagenta.h"
#include "nmcnetworksettings.h"
#include "NetworkSettings.h"
#include "ui_networksettings.h"


namespace OCC {

NetworkSettingsMagenta::NetworkSettingsMagenta(QWidget *parent)
NMCNetworkSettings::NMCNetworkSettings(QWidget *parent)
: NetworkSettings(parent)
{
setDefaultSettings();
setLayout();
setLogic();
}

void NetworkSettingsMagenta::setDefaultSettings()
void NMCNetworkSettings::setDefaultSettings()
{
//Set default settings
_ui->manualSettings->setVisible(true);
Expand All @@ -52,7 +52,7 @@ void NetworkSettingsMagenta::setDefaultSettings()
_ui->uploadSpinBoxLabel->setVisible(true);
}

void NetworkSettingsMagenta::setLayout()
void NMCNetworkSettings::setLayout()
{
//Fix Layouts
//Proxy settings
Expand Down Expand Up @@ -129,7 +129,7 @@ void NetworkSettingsMagenta::setLayout()
_ui->hostLineEdit->setStyleSheet(QString());
}

void NetworkSettingsMagenta::setLogic()
void NMCNetworkSettings::setLogic()
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace OCC {
* @brief The NetworkSettingsMagenta class
* @ingroup gui
*/
class NetworkSettingsMagenta : public NetworkSettings, public NMCGuiInterface
class NMCNetworkSettings : public NetworkSettings, public NMCGuiInterface
{
Q_OBJECT

public:
explicit NetworkSettingsMagenta(QWidget *parent = nullptr);
~NetworkSettingsMagenta() = default;
explicit NMCNetworkSettings(QWidget *parent = nullptr);
~NMCNetworkSettings() = default;

// NMCGuiInterface interface
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
* for more details.
*/

#include "settingsdialogmagenta.h"
#include "nmcsettingsdialog.h"
#include "QtWidgets/qtoolbar.h"
#include "settingsdialog.h"
#include "ui_settingsdialog.h"


namespace OCC {

SettingsDialogMagenta::SettingsDialogMagenta(ownCloudGui *gui, QWidget *parent)
NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent)
: SettingsDialog(gui, parent)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ namespace OCC {
* @brief The SettingsDialogMagenta class
* @ingroup gui
*/
class SettingsDialogMagenta : public SettingsDialog
class NMCSettingsDialog : public SettingsDialog
{
Q_OBJECT

public:
explicit SettingsDialogMagenta(ownCloudGui *gui, QWidget *parent = nullptr);
~SettingsDialogMagenta() = default;
explicit NMCSettingsDialog(ownCloudGui *gui, QWidget *parent = nullptr);
~NMCSettingsDialog() = default;

private:

Expand Down
4 changes: 2 additions & 2 deletions src/gui/owncloudgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "openfilemanager.h"
#include "owncloudsetupwizard.h"
#include "progressdispatcher.h"
#include "settingsdialogmagenta.h"
#include "nmcgui/nmcsettingsdialog.h"
#include "theme.h"
#include "wheelhandler.h"
#include "syncconflictsmodel.h"
Expand Down Expand Up @@ -569,7 +569,7 @@ void ownCloudGui::slotShowGuiMessage(const QString &title, const QString &messag
void ownCloudGui::slotShowSettings()
{
if (_settingsDialog.isNull()) {
_settingsDialog = new SettingsDialogMagenta(this);
_settingsDialog = new NMCSettingsDialog(this);
_settingsDialog->setAttribute(Qt::WA_DeleteOnClose, true);
_settingsDialog->show();
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/owncloudgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace OCC {

class Folder;

class SettingsDialogMagenta;
class NMCSettingsDialog;
class ShareDialog;
class Application;
class LogBrowser;
Expand Down Expand Up @@ -112,7 +112,7 @@ private slots:

private:
QPointer<Systray> _tray;
QPointer<SettingsDialogMagenta> _settingsDialog;
QPointer<NMCSettingsDialog> _settingsDialog;
QPointer<LogBrowser> _logBrowser;

#ifdef WITH_LIBCLOUDPROVIDERS
Expand Down
16 changes: 8 additions & 8 deletions src/gui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include "folderman.h"
#include "theme.h"
#include "generalsettingsmagenta.h"
#include "networksettingsmagenta.h"
#include "accountsettingsmagenta.h"
#include "nmcgui/nmcgeneralsettings.h"
#include "nmcgui/nmcnetworksettings.h"
#include "nmcgui/nmcaccountsettings.h"
#include "configfile.h"
#include "progressdispatcher.h"
#include "owncloudgui.h"
Expand Down Expand Up @@ -120,16 +120,16 @@ 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 GeneralSettingsMagenta;
auto *generalSettings = new NMCGeneralSettings;
_ui->stack->addWidget(generalSettings);

// Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
connect(this, &SettingsDialog::styleChanged, generalSettings, &GeneralSettingsMagenta::slotStyleChanged);
connect(this, &SettingsDialog::styleChanged, generalSettings, &NMCGeneralSettings::slotStyleChanged);

QAction *networkAction = createColorAwareAction(QLatin1String(":/client/theme/network.svg"), tr("Network"));
_actionGroup->addAction(networkAction);
_toolBar->addAction(networkAction);
auto *networkSettings = new NetworkSettingsMagenta;
auto *networkSettings = new NMCNetworkSettings;
_ui->stack->addWidget(networkSettings);

connect(_ui->stack, &QStackedWidget::currentChanged, this, &SettingsDialog::currentPageChanged);
Expand Down Expand Up @@ -243,7 +243,7 @@ void SettingsDialog::accountAdded(AccountState *s)
}

_toolBar->insertAction(_toolBar->actions().at(0), accountAction);
auto accountSettings = new AccountSettingsMagenta(s, this);
auto accountSettings = new NMCAccountSettings(s, this);
QString objectName = QLatin1String("accountSettings_");
objectName += s->account()->displayName();
accountSettings->setObjectName(objectName);
Expand Down Expand Up @@ -305,7 +305,7 @@ void SettingsDialog::slotAccountDisplayNameChanged()
void SettingsDialog::accountRemoved(AccountState *s)
{
for (auto it = _actionGroupWidgets.begin(); it != _actionGroupWidgets.end(); ++it) {
auto as = qobject_cast<AccountSettingsMagenta *>(*it);
auto as = qobject_cast<NMCAccountSettings *>(*it);
if (!as) {
continue;
}
Expand Down

0 comments on commit 45493f6

Please sign in to comment.