1
0

fix: bring dialog to front after reloading

When reloading the windows, e.g. after enabling or disabling a plugin,
the plugins dialog vanished behind the main window. By using a
Timer its possible to bring the Dialog back in front after the windows
have reloaded.
This commit is contained in:
f321x
2025-04-29 11:21:38 +02:00
parent eed944368c
commit 84632f53d2

View File

@@ -4,7 +4,7 @@ import shutil
import os import os
from PyQt6.QtWidgets import QLabel, QVBoxLayout, QGridLayout, QPushButton, QWidget, QScrollArea, QFormLayout, QFileDialog, QMenu, QApplication from PyQt6.QtWidgets import QLabel, QVBoxLayout, QGridLayout, QPushButton, QWidget, QScrollArea, QFormLayout, QFileDialog, QMenu, QApplication
from PyQt6.QtCore import Qt from PyQt6.QtCore import QTimer
from electrum.i18n import _ from electrum.i18n import _
from electrum.logging import get_logger from electrum.logging import get_logger
@@ -365,8 +365,7 @@ class PluginsDialog(WindowModalDialog, MessageBoxMixin):
status_button.update() status_button.update()
if self.gui_object: if self.gui_object:
self.gui_object.reload_windows() self.gui_object.reload_windows()
self.setFocus() self.bring_to_front()
self.activateWindow()
def uninstall_plugin(self, name): def uninstall_plugin(self, name):
if not self.question(_('Remove plugin \'{}\'?').format(name)): if not self.question(_('Remove plugin \'{}\'?').format(name)):
@@ -375,3 +374,10 @@ class PluginsDialog(WindowModalDialog, MessageBoxMixin):
if self.gui_object: if self.gui_object:
self.gui_object.reload_windows() self.gui_object.reload_windows()
self.show_list() self.show_list()
self.bring_to_front()
def bring_to_front(self):
def _bring_self_to_front():
self.activateWindow()
self.setFocus()
QTimer.singleShot(100, _bring_self_to_front)