mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-08 20:09:43 +00:00
Settings: make dialog modal
This commit is contained in:
parent
a958a54927
commit
6d00d444e1
3 changed files with 11 additions and 14 deletions
|
@ -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() {
|
||||
|
|
|
@ -223,7 +223,6 @@ private:
|
|||
WindowManager *m_windowManager;
|
||||
QSharedPointer<AppContext> m_ctx;
|
||||
|
||||
Settings *m_windowSettings = nullptr;
|
||||
CalcWindow *m_windowCalc = nullptr;
|
||||
SplashDialog *m_splashDialog = nullptr;
|
||||
|
||||
|
|
|
@ -465,11 +465,12 @@
|
|||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
<addaction name="actionOfficialWebsite"/>
|
||||
<addaction name="actionDonate_to_Feather"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDocumentation"/>
|
||||
<addaction name="actionReport_bug"/>
|
||||
<addaction name="actionShow_debug_info"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDonate_to_Feather"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
|
|
Loading…
Reference in a new issue