From 54c944c17104c4b2cbdb8c530b3bddebe7dcd540 Mon Sep 17 00:00:00 2001 From: somas95 Date: Sun, 25 Mar 2018 00:16:50 +0100 Subject: [PATCH] Fix uberwriter not opening files from terminal or from file managers Signed-off-by: somas95 --- uberwriter/__init__.py | 21 ++++++++++++--------- uberwriter_lib/AppWindow.py | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/uberwriter/__init__.py b/uberwriter/__init__.py index 1f118d4..e65efd3 100644 --- a/uberwriter/__init__.py +++ b/uberwriter/__init__.py @@ -49,17 +49,20 @@ def parse_options(): def main(): 'constructor for your class instances' (options, args) = parse_options() + + # TODO: all the parsing is unused. + # We want to allow multiple windows # Run the application. - # ~ if args: - # ~ for arg in args: - # ~ window = UberwriterWindow.UberwriterWindow() - # ~ window.load_file(arg) - # ~ else: - # ~ window = UberwriterWindow.UberwriterWindow() - # ~ if options.experimental_features: - # ~ window.use_experimental_features(True) app = AppWindow.Application() + + if args: + for arg in args: + pass + else: + pass + if options.experimental_features: + window.use_experimental_features(True) + app.run(sys.argv) - #Gtk.main() diff --git a/uberwriter_lib/AppWindow.py b/uberwriter_lib/AppWindow.py index 9803c64..d055c6a 100644 --- a/uberwriter_lib/AppWindow.py +++ b/uberwriter_lib/AppWindow.py @@ -136,6 +136,7 @@ class Application(Gtk.Application): # when the last one is closed the application shuts down # self.window = Window(application=self, title="UberWriter") self.window = UberwriterWindow.UberwriterWindow(application=self, title="UberWriter") + self.window.load_file(sys.argv[1]) self.window.present()