Skip to content

Commit

Permalink
Process messages after closing file
Browse files Browse the repository at this point in the history
  • Loading branch information
quicklizard99 committed Jun 2, 2016
1 parent eb15601 commit a9ac746
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions inselect/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,20 @@ def open_file(self, path=None):
if not self.close_document(document_path):
# User does not want to close the existing document
pass
elif document_path:
# Open the .inselect document
debug_print('Opening inselect document [{0}]'.format(document_path))
self.open_document(path=document_path)
elif image_path:
msg = u'Creating new inselect document for image [{0}]'
debug_print(msg.format(image_path))
self.new_document(image_path)
else:
raise InselectError('Unknown file type [{0}]'.format(path))
# Process messages after closing to redraw the UI.
self.app.processEvents()

if document_path:
# Open the .inselect document
debug_print('Opening inselect document [{0}]'.format(document_path))
self.open_document(path=document_path)
elif image_path:
msg = u'Creating new inselect document for image [{0}]'
debug_print(msg.format(image_path))
self.new_document(image_path)
else:
raise InselectError('Unknown file type [{0}]'.format(path))

def new_document(self, path, default_metadata_items=None):
"""Creates and opens a new inselect document for the scanned image
Expand Down

0 comments on commit a9ac746

Please sign in to comment.