mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 23:42:33 +02:00
qt: Disable tray icon menu when a modal dialog is active
This commit is contained in:
parent
92427354dd
commit
8c0eb80f41
@ -818,16 +818,26 @@ void BitcoinGUI::createTrayIconMenu()
|
|||||||
// Using QSystemTrayIcon::Context is not reliable.
|
// Using QSystemTrayIcon::Context is not reliable.
|
||||||
// See https://bugreports.qt.io/browse/QTBUG-91697
|
// See https://bugreports.qt.io/browse/QTBUG-91697
|
||||||
trayIconMenu.get(), &QMenu::aboutToShow,
|
trayIconMenu.get(), &QMenu::aboutToShow,
|
||||||
[this, show_hide_action, send_action, receive_action, sign_action, verify_action] {
|
[this, show_hide_action, send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action] {
|
||||||
if (show_hide_action) show_hide_action->setText(
|
if (show_hide_action) show_hide_action->setText(
|
||||||
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
|
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
|
||||||
tr("&Hide") :
|
tr("&Hide") :
|
||||||
tr("S&how"));
|
tr("S&how"));
|
||||||
if (enableWallet) {
|
if (QApplication::activeModalWidget()) {
|
||||||
send_action->setEnabled(sendCoinsAction->isEnabled());
|
for (QAction* a : trayIconMenu.get()->actions()) {
|
||||||
receive_action->setEnabled(receiveCoinsAction->isEnabled());
|
a->setEnabled(false);
|
||||||
sign_action->setEnabled(signMessageAction->isEnabled());
|
}
|
||||||
verify_action->setEnabled(verifyMessageAction->isEnabled());
|
} else {
|
||||||
|
if (show_hide_action) show_hide_action->setEnabled(true);
|
||||||
|
if (enableWallet) {
|
||||||
|
send_action->setEnabled(sendCoinsAction->isEnabled());
|
||||||
|
receive_action->setEnabled(receiveCoinsAction->isEnabled());
|
||||||
|
sign_action->setEnabled(signMessageAction->isEnabled());
|
||||||
|
verify_action->setEnabled(verifyMessageAction->isEnabled());
|
||||||
|
}
|
||||||
|
options_action->setEnabled(optionsAction->isEnabled());
|
||||||
|
node_window_action->setEnabled(openRPCConsoleAction->isEnabled());
|
||||||
|
if (quit_action) quit_action->setEnabled(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user