mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-03 17:39:49 +00:00
settings: rename new settings dialog
This commit is contained in:
parent
6437d064c4
commit
6a7da01033
8 changed files with 41 additions and 44 deletions
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
Settings::~Settings() = default;
|
|
@ -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>
|
||||
|
@ -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<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
|
|
@ -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>
|
||||
|
@ -1087,7 +1087,7 @@
|
|||
<connection>
|
||||
<sender>closeButton</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SettingsNew</receiver>
|
||||
<receiver>Settings</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
|
@ -1103,7 +1103,7 @@
|
|||
<connection>
|
||||
<sender>closeButton</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SettingsNew</receiver>
|
||||
<receiver>Settings</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "SettingsNewDialog.h"
|
||||
|
||||
PageMenu::PageMenu(WizardFields *fields, WalletKeysFilesModel *wallets, QWidget *parent)
|
||||
: QWizardPage(parent)
|
||||
, ui(new Ui::PageMenu)
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "PageNetworkProxy.h"
|
||||
#include "PageNetworkWebsocket.h"
|
||||
#include "constants.h"
|
||||
#include "SettingsNewDialog.h"
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
|
|
Loading…
Reference in a new issue