diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index bdbdbb2..4f08352 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -47,7 +47,6 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa // Ensure the destructor is called after closeEvent() setAttribute(Qt::WA_DeleteOnClose); - m_windowSettings = new Settings(m_ctx, this); m_windowCalc = new CalcWindow(this); m_splashDialog = new SplashDialog(this); @@ -68,19 +67,12 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa #endif websocketNotifier()->emitCache(); // Get cached data - // Settings - for (const auto &widget: m_priceTickerWidgets) - connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, widget, &PriceTickerWidget::updateDisplay); - connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_balanceTickerWidget, &BalanceTickerWidget::updateDisplay); - connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged)); - connect(m_windowSettings, &Settings::skinChanged, this, &MainWindow::skinChanged); - QTimer::singleShot(1, [this]{this->updateWidgetIcons();}); - connect(m_windowManager, &WindowManager::torSettingsChanged, m_ctx.get(), &AppContext::onTorSettingsChanged); connect(torManager(), &TorManager::connectionStateChanged, this, &MainWindow::onTorConnectionStateChanged); this->onTorConnectionStateChanged(torManager()->torConnected); ColorScheme::updateFromWidget(this); + QTimer::singleShot(1, [this]{this->updateWidgetIcons();}); // Timers connect(&m_updateBytes, &QTimer::timeout, this, &MainWindow::updateNetStats); @@ -833,9 +825,14 @@ void MainWindow::menuAboutClicked() { } void MainWindow::menuSettingsClicked() { - m_windowSettings->raise(); - m_windowSettings->show(); - m_windowSettings->activateWindow(); + Settings settings{m_ctx, this}; + for (const auto &widget: m_priceTickerWidgets) { + connect(&settings, &Settings::preferredFiatCurrencyChanged, widget, &PriceTickerWidget::updateDisplay); + } + connect(&settings, &Settings::preferredFiatCurrencyChanged, m_balanceTickerWidget, &BalanceTickerWidget::updateDisplay); + connect(&settings, &Settings::preferredFiatCurrencyChanged, m_sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged)); + connect(&settings, &Settings::skinChanged, this, &MainWindow::skinChanged); + settings.exec(); } void MainWindow::menuSignVerifyClicked() { diff --git a/src/MainWindow.h b/src/MainWindow.h index a007aa4..fc863e1 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -223,7 +223,6 @@ private: WindowManager *m_windowManager; QSharedPointer m_ctx; - Settings *m_windowSettings = nullptr; CalcWindow *m_windowCalc = nullptr; SplashDialog *m_splashDialog = nullptr; diff --git a/src/MainWindow.ui b/src/MainWindow.ui index a80c460..3d82bf1 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -465,11 +465,12 @@ - + +