From 985473d277bddfa942d4c3cffa97137b0484482b Mon Sep 17 00:00:00 2001 From: Lawrence Hudson Date: Mon, 16 May 2016 11:30:17 +0100 Subject: [PATCH] Process events before opening file --- inselect/app.py | 2 ++ inselect/gui/main_window.py | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/inselect/app.py b/inselect/app.py index 635005e..53588f7 100644 --- a/inselect/app.py +++ b/inselect/app.py @@ -63,6 +63,8 @@ def main(args): window.show_from_geometry_settings() if parsed.file: + # Process messages before loading document + app.processEvents() window.open_file(parsed.file) if parsed.quit: diff --git a/inselect/gui/main_window.py b/inselect/gui/main_window.py index 11c1300..1a37e84 100644 --- a/inselect/gui/main_window.py +++ b/inselect/gui/main_window.py @@ -61,7 +61,7 @@ class MainWindow(QtGui.QMainWindow): IMAGE_FILE_FILTER = u'Images ({0})'.format(u' '.join(IMAGE_PATTERNS)) - def __init__(self, app, filename=None): + def __init__(self, app): super(MainWindow, self).__init__() self.app = app @@ -132,11 +132,6 @@ def __init__(self, app, filename=None): self.empty_document() - if filename: - # Process messages before loading document - QtGui.qApp.processEvents() - self.open_file(filename) - def _create_views(self): "Creates view objects" # Boxes view