1
0

Merge pull request #3989 from SomberNight/fix_email_requests_plugin

fix email_requests plugin
This commit is contained in:
ThomasV
2018-03-01 16:58:54 +01:00
committed by GitHub
2 changed files with 42 additions and 14 deletions

View File

@@ -750,6 +750,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"))