1
0

fix email_requests plugin

This commit is contained in:
SomberNight
2018-03-01 02:39:48 +01:00
parent df9935e6af
commit 2f4ee16fd4
2 changed files with 42 additions and 14 deletions

View File

@@ -738,6 +738,19 @@ def export_meta_gui(electrum_window, title, exporter):
.format(title, str(filename)))
def get_parent_main_window(widget):
"""Returns a reference to the ElectrumWindow this widget belongs to."""
from .main_window import ElectrumWindow
for _ in range(100):
if widget is None:
return None
if not isinstance(widget, ElectrumWindow):
widget = widget.parentWidget()
else:
return widget
return None
if __name__ == "__main__":
app = QApplication([])
t = WaitingDialog(None, 'testing ...', lambda: [time.sleep(1)], lambda x: QMessageBox.information(None, 'done', "done"))