11// SPDX-License-Identifier: BSD-3-Clause
22// SPDX-FileCopyrightText: 2020-2023 The Monero Project
33
4- #include " SettingsNewDialog .h"
5- #include " ui_SettingsNewDialog .h"
4+ #include " SettingsDialog .h"
5+ #include " ui_SettingsDialog .h"
66
77#include < QCloseEvent>
88#include < QDesktopServices>
1313#include " utils/WebsocketNotifier.h"
1414#include " widgets/NetworkProxyWidget.h"
1515
16- SettingsNew::SettingsNew (QSharedPointer<AppContext> ctx, QWidget *parent)
16+ Settings::Settings (QSharedPointer<AppContext> ctx, QWidget *parent)
1717 : QDialog(parent)
18- , ui(new Ui::SettingsNew )
18+ , ui(new Ui::Settings )
1919 , m_ctx(std::move(ctx))
2020{
2121 ui->setupUi (this );
@@ -68,7 +68,7 @@ SettingsNew::SettingsNew(QSharedPointer<AppContext> ctx, QWidget *parent)
6868 this ->adjustSize ();
6969}
7070
71- void SettingsNew ::setupAppearanceTab () {
71+ void Settings ::setupAppearanceTab () {
7272 // [Theme]
7373 this ->setupThemeComboBox ();
7474 auto settingsTheme = config ()->get (Config::skin).toString ();
@@ -148,7 +148,7 @@ void SettingsNew::setupAppearanceTab() {
148148 });
149149}
150150
151- void SettingsNew ::setupNetworkTab () {
151+ void Settings ::setupNetworkTab () {
152152 // Node
153153 if (m_ctx) {
154154 ui->nodeWidget ->setupUI (m_ctx->nodes );
@@ -161,7 +161,7 @@ void SettingsNew::setupNetworkTab() {
161161 }
162162
163163 // Proxy
164- connect (ui->proxyWidget , &NetworkProxyWidget::proxySettingsChanged, this , &SettingsNew ::onProxySettingsChanged);
164+ connect (ui->proxyWidget , &NetworkProxyWidget::proxySettingsChanged, this , &Settings ::onProxySettingsChanged);
165165
166166 // Websocket
167167 // [Obtain third-party data]
@@ -180,7 +180,7 @@ void SettingsNew::setupNetworkTab() {
180180 });
181181}
182182
183- void SettingsNew ::setupStorageTab () {
183+ void Settings ::setupStorageTab () {
184184 // Paths
185185 ui->lineEdit_defaultWalletDir ->setText (config ()->get (Config::walletDirectory).toString ());
186186 ui->lineEdit_configDir ->setText (Config::defaultConfigDir ().path ());
@@ -250,7 +250,7 @@ void SettingsNew::setupStorageTab() {
250250 });
251251}
252252
253- void SettingsNew ::setupDisplayTab () {
253+ void Settings ::setupDisplayTab () {
254254 // [Hide balance]
255255 ui->checkBox_hideBalance ->setChecked (config ()->get (Config::hideBalance).toBool ());
256256 connect (ui->checkBox_hideBalance , &QCheckBox::toggled, [this ](bool toggled){
@@ -295,11 +295,11 @@ void SettingsNew::setupDisplayTab() {
295295 });
296296}
297297
298- void SettingsNew ::setupMemoryTab () {
298+ void Settings ::setupMemoryTab () {
299299 // Nothing here, yet
300300}
301301
302- void SettingsNew ::setupTransactionsTab () {
302+ void Settings ::setupTransactionsTab () {
303303 // [Multibroadcast outgoing transactions]
304304 ui->checkBox_multibroadcast ->setChecked (config ()->get (Config::multiBroadcast).toBool ());
305305 connect (ui->checkBox_multibroadcast , &QCheckBox::toggled, [](bool toggled){
@@ -314,7 +314,7 @@ void SettingsNew::setupTransactionsTab() {
314314 ui->checkBox_requirePasswordToSpend ->hide ();
315315}
316316
317- void SettingsNew ::setupMiscTab () {
317+ void Settings ::setupMiscTab () {
318318 // [Block explorer]
319319 ui->comboBox_blockExplorer ->setCurrentIndex (ui->comboBox_blockExplorer ->findText (config ()->get (Config::blockExplorer).toString ()));
320320 connect (ui->comboBox_blockExplorer , QOverload<int >::of (&QComboBox::currentIndexChanged), [this ]{
@@ -344,7 +344,7 @@ void SettingsNew::setupMiscTab() {
344344 });
345345}
346346
347- void SettingsNew ::onProxySettingsChanged () {
347+ void Settings ::onProxySettingsChanged () {
348348 ui->closeButton ->addButton (QDialogButtonBox::Apply);
349349 connect (ui->closeButton ->button (QDialogButtonBox::Apply), &QAbstractButton::clicked, [this ](){
350350 ui->proxyWidget ->setProxySettings ();
@@ -353,12 +353,12 @@ void SettingsNew::onProxySettingsChanged() {
353353 });
354354}
355355
356- void SettingsNew ::showNetworkProxyTab () {
357- this ->setSelection (SettingsNew ::Pages::NETWORK );
356+ void Settings ::showNetworkProxyTab () {
357+ this ->setSelection (Settings ::Pages::NETWORK );
358358 ui->tabWidget_network ->setCurrentIndex (1 );
359359}
360360
361- void SettingsNew ::setupThemeComboBox () {
361+ void Settings ::setupThemeComboBox () {
362362#if defined(Q_OS_WIN)
363363 m_themes.removeOne (" Breeze/Dark" );
364364 m_themes.removeOne (" Breeze/Light" );
@@ -369,15 +369,15 @@ void SettingsNew::setupThemeComboBox() {
369369 ui->comboBox_theme ->insertItems (0 , m_themes);
370370}
371371
372- void SettingsNew ::setSelection (int index) {
372+ void Settings ::setSelection (int index) {
373373 // You'd really think there is a better way
374374 QListWidgetItem *item = ui->selector ->item (index);
375375 QModelIndex idx = ui->selector ->indexFromItem (item);
376376 ui->selector ->setCurrentRow (index);
377377 ui->selector ->selectionModel ()->select (idx, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
378378}
379379
380- void SettingsNew ::enableWebsocket (bool enabled) {
380+ void Settings ::enableWebsocket (bool enabled) {
381381 if (enabled && !config ()->get (Config::offlineMode).toBool () && !config ()->get (Config::disableWebsocket).toBool ()) {
382382 websocketNotifier ()->websocketClient .restart ();
383383 } else {
@@ -387,4 +387,4 @@ void SettingsNew::enableWebsocket(bool enabled) {
387387 emit websocketStatusChanged (enabled);
388388}
389389
390- SettingsNew ::~SettingsNew () = default ;
390+ Settings ::~Settings () = default ;
0 commit comments