]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
settings: rename new settings dialog
authortobtoht <tob@featherwallet.org>
Sat, 11 Feb 2023 17:24:18 +0000 (18:24 +0100)
committertobtoht <tob@featherwallet.org>
Sat, 11 Feb 2023 17:24:18 +0000 (18:24 +0100)
src/MainWindow.cpp
src/MainWindow.h
src/SettingsDialog.cpp [moved from src/SettingsNewDialog.cpp with 95% similarity]
src/SettingsDialog.h [moved from src/SettingsNewDialog.h with 82% similarity]
src/SettingsDialog.ui [moved from src/SettingsNewDialog.ui with 99% similarity]
src/WindowManager.cpp
src/wizard/PageMenu.cpp
src/wizard/WalletWizard.cpp

index 84babb175f6f602fa9f404423b02fe08fe7c8d1a..77d708a2d8d980a7c8452e8b92235d7c98b9ac75 100644 (file)
@@ -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);
index 5c43d9d43b98a2fb83d930aff3e468bf4b94d82b..64c0ae22a91eb767bb0c32dc2af472264f26ec93 100644 (file)
@@ -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"
similarity index 95%
rename from src/SettingsNewDialog.cpp
rename to src/SettingsDialog.cpp
index 6f28c282e18b0cd0adf070528de78fa455425f07..e15a142f963989c58975f18dcd1e1a6bb388ee73 100644 (file)
@@ -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 <QCloseEvent>
 #include <QDesktopServices>
@@ -13,9 +13,9 @@
 #include "utils/WebsocketNotifier.h"
 #include "widgets/NetworkProxyWidget.h"
 
-SettingsNew::SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent)
+Settings::Settings(QSharedPointer<AppContext> 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<AppContext> 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<int>::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
similarity index 82%
rename from src/SettingsNewDialog.h
rename to src/SettingsDialog.h
index f6dc487011fd96aae2a5065ca94adef2e300f640..b8b1f91e6afebbfc8f576565933fff9fe6cf1b40 100644 (file)
@@ -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 <QAbstractButton>
 #include "widgets/NodeWidget.h"
 
 namespace Ui {
-    class SettingsNew;
+    class Settings;
 }
 
-class SettingsNew : public QDialog
+class Settings : public QDialog
 {
 Q_OBJECT
 
 public:
-    explicit SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
-    ~SettingsNew() override;
+    explicit Settings(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
+    ~Settings() override;
 
     void showNetworkProxyTab();
 
@@ -66,7 +66,7 @@ private:
     void setSelection(int index);
     void enableWebsocket(bool enabled);
 
-    QScopedPointer<Ui::SettingsNew> ui;
+    QScopedPointer<Ui::Settings> ui;
     QSharedPointer<AppContext> 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
similarity index 99%
rename from src/SettingsNewDialog.ui
rename to src/SettingsDialog.ui
index 94002e5d931ddf062b1a78f8958a34fa1a0bc553..873f4c9a7d31933f2ef5d7119f0b83a346e5e141 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>SettingsNew</class>
- <widget class="QDialog" name="SettingsNew">
+ <class>Settings</class>
+ <widget class="QDialog" name="Settings">
   <property name="geometry">
    <rect>
     <x>0</x>
   <connection>
    <sender>closeButton</sender>
    <signal>accepted()</signal>
-   <receiver>SettingsNew</receiver>
+   <receiver>Settings</receiver>
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
   <connection>
    <sender>closeButton</sender>
    <signal>rejected()</signal>
-   <receiver>SettingsNew</receiver>
+   <receiver>Settings</receiver>
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
index 7bc0e2857d3e9a5f430b81c8439cb73a5fdfeb90..bce0f5cdc03e2b6e18974499395fe1e129eed8cd 100644 (file)
@@ -139,19 +139,19 @@ void WindowManager::raise() {
 // ######################## SETTINGS ########################
 
 void WindowManager::showSettings(QSharedPointer<AppContext> 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);
         }
index 7dd137f2ed1045e3fc4979d91753fcbd05a1fb8b..8f4e2bd1479e3583c71724f7effd5cf726a60325 100644 (file)
@@ -7,8 +7,6 @@
 
 #include <QFileDialog>
 
-#include "SettingsNewDialog.h"
-
 PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent)
         : QWizardPage(parent)
         , ui(new Ui::PageMenu)
index 7d39777bb6514e1f9301cc63c883509fc2bd871c..8d62dbe5bf373e9f525876345d958a18de2568e4 100644 (file)
@@ -19,7 +19,6 @@
 #include "PageNetworkProxy.h"
 #include "PageNetworkWebsocket.h"
 #include "constants.h"
-#include "SettingsNewDialog.h"
 
 #include <QLineEdit>
 #include <QVBoxLayout>