diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 84babb1..77d708a 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -154,7 +154,7 @@ void MainWindow::initStatusBar() { m_statusBtnConnectionStatusIndicator = new StatusBarButton(icons()->icon("status_disconnected.svg"), "Connection status", this); connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, [this](){ - this->onShowSettingsPage(SettingsNew::Pages::NETWORK); + this->onShowSettingsPage(Settings::Pages::NETWORK); }); this->statusBar()->addPermanentWidget(m_statusBtnConnectionStatusIndicator); this->onConnectionStatusChanged(Wallet::ConnectionStatus_Disconnected); diff --git a/src/MainWindow.h b/src/MainWindow.h index 5c43d9d..64c0ae2 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -11,7 +11,7 @@ #include "appcontext.h" #include "components.h" #include "CalcWindow.h" -#include "SettingsNewDialog.h" +#include "SettingsDialog.h" #include "dialog/AboutDialog.h" #include "dialog/AccountSwitcherDialog.h" diff --git a/src/SettingsNewDialog.cpp b/src/SettingsDialog.cpp similarity index 95% rename from src/SettingsNewDialog.cpp rename to src/SettingsDialog.cpp index 6f28c28..e15a142 100644 --- a/src/SettingsNewDialog.cpp +++ b/src/SettingsDialog.cpp @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2023 The Monero Project -#include "SettingsNewDialog.h" -#include "ui_SettingsNewDialog.h" +#include "SettingsDialog.h" +#include "ui_SettingsDialog.h" #include #include @@ -13,9 +13,9 @@ #include "utils/WebsocketNotifier.h" #include "widgets/NetworkProxyWidget.h" -SettingsNew::SettingsNew(QSharedPointer ctx, QWidget *parent) +Settings::Settings(QSharedPointer ctx, QWidget *parent) : QDialog(parent) - , ui(new Ui::SettingsNew) + , ui(new Ui::Settings) , m_ctx(std::move(ctx)) { ui->setupUi(this); @@ -68,7 +68,7 @@ SettingsNew::SettingsNew(QSharedPointer ctx, QWidget *parent) this->adjustSize(); } -void SettingsNew::setupAppearanceTab() { +void Settings::setupAppearanceTab() { // [Theme] this->setupThemeComboBox(); auto settingsTheme = config()->get(Config::skin).toString(); @@ -148,7 +148,7 @@ void SettingsNew::setupAppearanceTab() { }); } -void SettingsNew::setupNetworkTab() { +void Settings::setupNetworkTab() { // Node if (m_ctx) { ui->nodeWidget->setupUI(m_ctx->nodes); @@ -161,7 +161,7 @@ void SettingsNew::setupNetworkTab() { } // Proxy - connect(ui->proxyWidget, &NetworkProxyWidget::proxySettingsChanged, this, &SettingsNew::onProxySettingsChanged); + connect(ui->proxyWidget, &NetworkProxyWidget::proxySettingsChanged, this, &Settings::onProxySettingsChanged); // Websocket // [Obtain third-party data] @@ -180,7 +180,7 @@ void SettingsNew::setupNetworkTab() { }); } -void SettingsNew::setupStorageTab() { +void Settings::setupStorageTab() { // Paths ui->lineEdit_defaultWalletDir->setText(config()->get(Config::walletDirectory).toString()); ui->lineEdit_configDir->setText(Config::defaultConfigDir().path()); @@ -250,7 +250,7 @@ void SettingsNew::setupStorageTab() { }); } -void SettingsNew::setupDisplayTab() { +void Settings::setupDisplayTab() { // [Hide balance] ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool()); connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){ @@ -295,11 +295,11 @@ void SettingsNew::setupDisplayTab() { }); } -void SettingsNew::setupMemoryTab() { +void Settings::setupMemoryTab() { // Nothing here, yet } -void SettingsNew::setupTransactionsTab() { +void Settings::setupTransactionsTab() { // [Multibroadcast outgoing transactions] ui->checkBox_multibroadcast->setChecked(config()->get(Config::multiBroadcast).toBool()); connect(ui->checkBox_multibroadcast, &QCheckBox::toggled, [](bool toggled){ @@ -314,7 +314,7 @@ void SettingsNew::setupTransactionsTab() { ui->checkBox_requirePasswordToSpend->hide(); } -void SettingsNew::setupMiscTab() { +void Settings::setupMiscTab() { // [Block explorer] ui->comboBox_blockExplorer->setCurrentIndex(ui->comboBox_blockExplorer->findText(config()->get(Config::blockExplorer).toString())); connect(ui->comboBox_blockExplorer, QOverload::of(&QComboBox::currentIndexChanged), [this]{ @@ -344,7 +344,7 @@ void SettingsNew::setupMiscTab() { }); } -void SettingsNew::onProxySettingsChanged() { +void Settings::onProxySettingsChanged() { ui->closeButton->addButton(QDialogButtonBox::Apply); connect(ui->closeButton->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, [this](){ ui->proxyWidget->setProxySettings(); @@ -353,12 +353,12 @@ void SettingsNew::onProxySettingsChanged() { }); } -void SettingsNew::showNetworkProxyTab() { - this->setSelection(SettingsNew::Pages::NETWORK); +void Settings::showNetworkProxyTab() { + this->setSelection(Settings::Pages::NETWORK); ui->tabWidget_network->setCurrentIndex(1); } -void SettingsNew::setupThemeComboBox() { +void Settings::setupThemeComboBox() { #if defined(Q_OS_WIN) m_themes.removeOne("Breeze/Dark"); m_themes.removeOne("Breeze/Light"); @@ -369,7 +369,7 @@ void SettingsNew::setupThemeComboBox() { ui->comboBox_theme->insertItems(0, m_themes); } -void SettingsNew::setSelection(int index) { +void Settings::setSelection(int index) { // You'd really think there is a better way QListWidgetItem *item = ui->selector->item(index); QModelIndex idx = ui->selector->indexFromItem(item); @@ -377,7 +377,7 @@ void SettingsNew::setSelection(int index) { ui->selector->selectionModel()->select(idx, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } -void SettingsNew::enableWebsocket(bool enabled) { +void Settings::enableWebsocket(bool enabled) { if (enabled && !config()->get(Config::offlineMode).toBool() && !config()->get(Config::disableWebsocket).toBool()) { websocketNotifier()->websocketClient.restart(); } else { @@ -387,4 +387,4 @@ void SettingsNew::enableWebsocket(bool enabled) { emit websocketStatusChanged(enabled); } -SettingsNew::~SettingsNew() = default; \ No newline at end of file +Settings::~Settings() = default; \ No newline at end of file diff --git a/src/SettingsNewDialog.h b/src/SettingsDialog.h similarity index 82% rename from src/SettingsNewDialog.h rename to src/SettingsDialog.h index f6dc487..b8b1f91 100644 --- a/src/SettingsNewDialog.h +++ b/src/SettingsDialog.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: BSD-3-Clause // SPDX-FileCopyrightText: 2020-2023 The Monero Project -#ifndef FEATHER_SETTINGSNEWDIALOG_H -#define FEATHER_SETTINGSNEWDIALOG_H +#ifndef FEATHER_SettingsDIALOG_H +#define FEATHER_SettingsDIALOG_H #include @@ -13,16 +13,16 @@ #include "widgets/NodeWidget.h" namespace Ui { - class SettingsNew; + class Settings; } -class SettingsNew : public QDialog +class Settings : public QDialog { Q_OBJECT public: - explicit SettingsNew(QSharedPointer ctx, QWidget *parent = nullptr); - ~SettingsNew() override; + explicit Settings(QSharedPointer ctx, QWidget *parent = nullptr); + ~Settings() override; void showNetworkProxyTab(); @@ -66,7 +66,7 @@ private: void setSelection(int index); void enableWebsocket(bool enabled); - QScopedPointer ui; + QScopedPointer ui; QSharedPointer m_ctx; Nodes *m_nodes = nullptr; @@ -75,4 +75,4 @@ private: QStringList m_timeFormats{"hh:mm", "hh:mm ap"}; }; -#endif //FEATHER_SETTINGSNEWDIALOG_H +#endif //FEATHER_SettingsDIALOG_H diff --git a/src/SettingsNewDialog.ui b/src/SettingsDialog.ui similarity index 99% rename from src/SettingsNewDialog.ui rename to src/SettingsDialog.ui index 94002e5..873f4c9 100644 --- a/src/SettingsNewDialog.ui +++ b/src/SettingsDialog.ui @@ -1,7 +1,7 @@ - SettingsNew - + Settings + 0 @@ -1087,7 +1087,7 @@ closeButton accepted() - SettingsNew + Settings accept() @@ -1103,7 +1103,7 @@ closeButton rejected() - SettingsNew + Settings reject() diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 7bc0e28..bce0f5c 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -139,19 +139,19 @@ void WindowManager::raise() { // ######################## SETTINGS ######################## void WindowManager::showSettings(QSharedPointer ctx, QWidget *parent, bool showProxyTab) { - SettingsNew settings{ctx, parent}; + Settings settings{ctx, parent}; - connect(&settings, &SettingsNew::preferredFiatCurrencyChanged, [this]{ + connect(&settings, &Settings::preferredFiatCurrencyChanged, [this]{ for (const auto &window : m_windows) { window->onPreferredFiatCurrencyChanged(); } }); - connect(&settings, &SettingsNew::skinChanged, this, &WindowManager::onChangeTheme); - connect(&settings, &SettingsNew::updateBalance, this, &WindowManager::updateBalance); - connect(&settings, &SettingsNew::proxySettingsChanged, this, &WindowManager::onProxySettingsChanged); - connect(&settings, &SettingsNew::websocketStatusChanged, this, &WindowManager::onWebsocketStatusChanged); - connect(&settings, &SettingsNew::offlineMode, this, &WindowManager::offlineMode); - connect(&settings, &SettingsNew::hideUpdateNotifications, [this](bool hidden){ + connect(&settings, &Settings::skinChanged, this, &WindowManager::onChangeTheme); + connect(&settings, &Settings::updateBalance, this, &WindowManager::updateBalance); + connect(&settings, &Settings::proxySettingsChanged, this, &WindowManager::onProxySettingsChanged); + connect(&settings, &Settings::websocketStatusChanged, this, &WindowManager::onWebsocketStatusChanged); + connect(&settings, &Settings::offlineMode, this, &WindowManager::offlineMode); + connect(&settings, &Settings::hideUpdateNotifications, [this](bool hidden){ for (const auto &window : m_windows) { window->onHideUpdateNotifications(hidden); } diff --git a/src/wizard/PageMenu.cpp b/src/wizard/PageMenu.cpp index 7dd137f..8f4e2bd 100644 --- a/src/wizard/PageMenu.cpp +++ b/src/wizard/PageMenu.cpp @@ -7,8 +7,6 @@ #include -#include "SettingsNewDialog.h" - PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent) : QWizardPage(parent) , ui(new Ui::PageMenu) diff --git a/src/wizard/WalletWizard.cpp b/src/wizard/WalletWizard.cpp index 7d39777..8d62dbe 100644 --- a/src/wizard/WalletWizard.cpp +++ b/src/wizard/WalletWizard.cpp @@ -19,7 +19,6 @@ #include "PageNetworkProxy.h" #include "PageNetworkWebsocket.h" #include "constants.h" -#include "SettingsNewDialog.h" #include #include