settings: rename new settings dialog

This commit is contained in:
tobtoht 2023-02-11 18:24:18 +01:00
parent 6437d064c4
commit 6a7da01033
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
8 changed files with 41 additions and 44 deletions

View file

@ -154,7 +154,7 @@ void MainWindow::initStatusBar() {
m_statusBtnConnectionStatusIndicator = new StatusBarButton(icons()->icon("status_disconnected.svg"), "Connection status", this); m_statusBtnConnectionStatusIndicator = new StatusBarButton(icons()->icon("status_disconnected.svg"), "Connection status", this);
connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, [this](){ connect(m_statusBtnConnectionStatusIndicator, &StatusBarButton::clicked, [this](){
this->onShowSettingsPage(SettingsNew::Pages::NETWORK); this->onShowSettingsPage(Settings::Pages::NETWORK);
}); });
this->statusBar()->addPermanentWidget(m_statusBtnConnectionStatusIndicator); this->statusBar()->addPermanentWidget(m_statusBtnConnectionStatusIndicator);
this->onConnectionStatusChanged(Wallet::ConnectionStatus_Disconnected); this->onConnectionStatusChanged(Wallet::ConnectionStatus_Disconnected);

View file

@ -11,7 +11,7 @@
#include "appcontext.h" #include "appcontext.h"
#include "components.h" #include "components.h"
#include "CalcWindow.h" #include "CalcWindow.h"
#include "SettingsNewDialog.h" #include "SettingsDialog.h"
#include "dialog/AboutDialog.h" #include "dialog/AboutDialog.h"
#include "dialog/AccountSwitcherDialog.h" #include "dialog/AccountSwitcherDialog.h"

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2020-2023 The Monero Project // SPDX-FileCopyrightText: 2020-2023 The Monero Project
#include "SettingsNewDialog.h" #include "SettingsDialog.h"
#include "ui_SettingsNewDialog.h" #include "ui_SettingsDialog.h"
#include <QCloseEvent> #include <QCloseEvent>
#include <QDesktopServices> #include <QDesktopServices>
@ -13,9 +13,9 @@
#include "utils/WebsocketNotifier.h" #include "utils/WebsocketNotifier.h"
#include "widgets/NetworkProxyWidget.h" #include "widgets/NetworkProxyWidget.h"
SettingsNew::SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent) Settings::Settings(QSharedPointer<AppContext> ctx, QWidget *parent)
: QDialog(parent) : QDialog(parent)
, ui(new Ui::SettingsNew) , ui(new Ui::Settings)
, m_ctx(std::move(ctx)) , m_ctx(std::move(ctx))
{ {
ui->setupUi(this); ui->setupUi(this);
@ -68,7 +68,7 @@ SettingsNew::SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent)
this->adjustSize(); this->adjustSize();
} }
void SettingsNew::setupAppearanceTab() { void Settings::setupAppearanceTab() {
// [Theme] // [Theme]
this->setupThemeComboBox(); this->setupThemeComboBox();
auto settingsTheme = config()->get(Config::skin).toString(); auto settingsTheme = config()->get(Config::skin).toString();
@ -148,7 +148,7 @@ void SettingsNew::setupAppearanceTab() {
}); });
} }
void SettingsNew::setupNetworkTab() { void Settings::setupNetworkTab() {
// Node // Node
if (m_ctx) { if (m_ctx) {
ui->nodeWidget->setupUI(m_ctx->nodes); ui->nodeWidget->setupUI(m_ctx->nodes);
@ -161,7 +161,7 @@ void SettingsNew::setupNetworkTab() {
} }
// Proxy // Proxy
connect(ui->proxyWidget, &NetworkProxyWidget::proxySettingsChanged, this, &SettingsNew::onProxySettingsChanged); connect(ui->proxyWidget, &NetworkProxyWidget::proxySettingsChanged, this, &Settings::onProxySettingsChanged);
// Websocket // Websocket
// [Obtain third-party data] // [Obtain third-party data]
@ -180,7 +180,7 @@ void SettingsNew::setupNetworkTab() {
}); });
} }
void SettingsNew::setupStorageTab() { void Settings::setupStorageTab() {
// Paths // Paths
ui->lineEdit_defaultWalletDir->setText(config()->get(Config::walletDirectory).toString()); ui->lineEdit_defaultWalletDir->setText(config()->get(Config::walletDirectory).toString());
ui->lineEdit_configDir->setText(Config::defaultConfigDir().path()); ui->lineEdit_configDir->setText(Config::defaultConfigDir().path());
@ -250,7 +250,7 @@ void SettingsNew::setupStorageTab() {
}); });
} }
void SettingsNew::setupDisplayTab() { void Settings::setupDisplayTab() {
// [Hide balance] // [Hide balance]
ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool()); ui->checkBox_hideBalance->setChecked(config()->get(Config::hideBalance).toBool());
connect(ui->checkBox_hideBalance, &QCheckBox::toggled, [this](bool toggled){ 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 // Nothing here, yet
} }
void SettingsNew::setupTransactionsTab() { void Settings::setupTransactionsTab() {
// [Multibroadcast outgoing transactions] // [Multibroadcast outgoing transactions]
ui->checkBox_multibroadcast->setChecked(config()->get(Config::multiBroadcast).toBool()); ui->checkBox_multibroadcast->setChecked(config()->get(Config::multiBroadcast).toBool());
connect(ui->checkBox_multibroadcast, &QCheckBox::toggled, [](bool toggled){ connect(ui->checkBox_multibroadcast, &QCheckBox::toggled, [](bool toggled){
@ -314,7 +314,7 @@ void SettingsNew::setupTransactionsTab() {
ui->checkBox_requirePasswordToSpend->hide(); ui->checkBox_requirePasswordToSpend->hide();
} }
void SettingsNew::setupMiscTab() { void Settings::setupMiscTab() {
// [Block explorer] // [Block explorer]
ui->comboBox_blockExplorer->setCurrentIndex(ui->comboBox_blockExplorer->findText(config()->get(Config::blockExplorer).toString())); ui->comboBox_blockExplorer->setCurrentIndex(ui->comboBox_blockExplorer->findText(config()->get(Config::blockExplorer).toString()));
connect(ui->comboBox_blockExplorer, QOverload<int>::of(&QComboBox::currentIndexChanged), [this]{ 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); ui->closeButton->addButton(QDialogButtonBox::Apply);
connect(ui->closeButton->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, [this](){ connect(ui->closeButton->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, [this](){
ui->proxyWidget->setProxySettings(); ui->proxyWidget->setProxySettings();
@ -353,12 +353,12 @@ void SettingsNew::onProxySettingsChanged() {
}); });
} }
void SettingsNew::showNetworkProxyTab() { void Settings::showNetworkProxyTab() {
this->setSelection(SettingsNew::Pages::NETWORK); this->setSelection(Settings::Pages::NETWORK);
ui->tabWidget_network->setCurrentIndex(1); ui->tabWidget_network->setCurrentIndex(1);
} }
void SettingsNew::setupThemeComboBox() { void Settings::setupThemeComboBox() {
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
m_themes.removeOne("Breeze/Dark"); m_themes.removeOne("Breeze/Dark");
m_themes.removeOne("Breeze/Light"); m_themes.removeOne("Breeze/Light");
@ -369,7 +369,7 @@ void SettingsNew::setupThemeComboBox() {
ui->comboBox_theme->insertItems(0, m_themes); 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 // You'd really think there is a better way
QListWidgetItem *item = ui->selector->item(index); QListWidgetItem *item = ui->selector->item(index);
QModelIndex idx = ui->selector->indexFromItem(item); QModelIndex idx = ui->selector->indexFromItem(item);
@ -377,7 +377,7 @@ void SettingsNew::setSelection(int index) {
ui->selector->selectionModel()->select(idx, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); 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()) { if (enabled && !config()->get(Config::offlineMode).toBool() && !config()->get(Config::disableWebsocket).toBool()) {
websocketNotifier()->websocketClient.restart(); websocketNotifier()->websocketClient.restart();
} else { } else {
@ -387,4 +387,4 @@ void SettingsNew::enableWebsocket(bool enabled) {
emit websocketStatusChanged(enabled); emit websocketStatusChanged(enabled);
} }
SettingsNew::~SettingsNew() = default; Settings::~Settings() = default;

View file

@ -1,8 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2020-2023 The Monero Project // SPDX-FileCopyrightText: 2020-2023 The Monero Project
#ifndef FEATHER_SETTINGSNEWDIALOG_H #ifndef FEATHER_SettingsDIALOG_H
#define FEATHER_SETTINGSNEWDIALOG_H #define FEATHER_SettingsDIALOG_H
#include <QAbstractButton> #include <QAbstractButton>
@ -13,16 +13,16 @@
#include "widgets/NodeWidget.h" #include "widgets/NodeWidget.h"
namespace Ui { namespace Ui {
class SettingsNew; class Settings;
} }
class SettingsNew : public QDialog class Settings : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr); explicit Settings(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
~SettingsNew() override; ~Settings() override;
void showNetworkProxyTab(); void showNetworkProxyTab();
@ -66,7 +66,7 @@ private:
void setSelection(int index); void setSelection(int index);
void enableWebsocket(bool enabled); void enableWebsocket(bool enabled);
QScopedPointer<Ui::SettingsNew> ui; QScopedPointer<Ui::Settings> ui;
QSharedPointer<AppContext> m_ctx; QSharedPointer<AppContext> m_ctx;
Nodes *m_nodes = nullptr; Nodes *m_nodes = nullptr;
@ -75,4 +75,4 @@ private:
QStringList m_timeFormats{"hh:mm", "hh:mm ap"}; QStringList m_timeFormats{"hh:mm", "hh:mm ap"};
}; };
#endif //FEATHER_SETTINGSNEWDIALOG_H #endif //FEATHER_SettingsDIALOG_H

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SettingsNew</class> <class>Settings</class>
<widget class="QDialog" name="SettingsNew"> <widget class="QDialog" name="Settings">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -1087,7 +1087,7 @@
<connection> <connection>
<sender>closeButton</sender> <sender>closeButton</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>SettingsNew</receiver> <receiver>Settings</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -1103,7 +1103,7 @@
<connection> <connection>
<sender>closeButton</sender> <sender>closeButton</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>SettingsNew</receiver> <receiver>Settings</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View file

@ -139,19 +139,19 @@ void WindowManager::raise() {
// ######################## SETTINGS ######################## // ######################## SETTINGS ########################
void WindowManager::showSettings(QSharedPointer<AppContext> ctx, QWidget *parent, bool showProxyTab) { 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) { for (const auto &window : m_windows) {
window->onPreferredFiatCurrencyChanged(); window->onPreferredFiatCurrencyChanged();
} }
}); });
connect(&settings, &SettingsNew::skinChanged, this, &WindowManager::onChangeTheme); connect(&settings, &Settings::skinChanged, this, &WindowManager::onChangeTheme);
connect(&settings, &SettingsNew::updateBalance, this, &WindowManager::updateBalance); connect(&settings, &Settings::updateBalance, this, &WindowManager::updateBalance);
connect(&settings, &SettingsNew::proxySettingsChanged, this, &WindowManager::onProxySettingsChanged); connect(&settings, &Settings::proxySettingsChanged, this, &WindowManager::onProxySettingsChanged);
connect(&settings, &SettingsNew::websocketStatusChanged, this, &WindowManager::onWebsocketStatusChanged); connect(&settings, &Settings::websocketStatusChanged, this, &WindowManager::onWebsocketStatusChanged);
connect(&settings, &SettingsNew::offlineMode, this, &WindowManager::offlineMode); connect(&settings, &Settings::offlineMode, this, &WindowManager::offlineMode);
connect(&settings, &SettingsNew::hideUpdateNotifications, [this](bool hidden){ connect(&settings, &Settings::hideUpdateNotifications, [this](bool hidden){
for (const auto &window : m_windows) { for (const auto &window : m_windows) {
window->onHideUpdateNotifications(hidden); window->onHideUpdateNotifications(hidden);
} }

View file

@ -7,8 +7,6 @@
#include <QFileDialog> #include <QFileDialog>
#include "SettingsNewDialog.h"
PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent) PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent)
: QWizardPage(parent) : QWizardPage(parent)
, ui(new Ui::PageMenu) , ui(new Ui::PageMenu)

View file

@ -19,7 +19,6 @@
#include "PageNetworkProxy.h" #include "PageNetworkProxy.h"
#include "PageNetworkWebsocket.h" #include "PageNetworkWebsocket.h"
#include "constants.h" #include "constants.h"
#include "SettingsNewDialog.h"
#include <QLineEdit> #include <QLineEdit>
#include <QVBoxLayout> #include <QVBoxLayout>