Commit d1e48930 authored by Guillaume Seguin's avatar Guillaume Seguin

Don't load CLI-provided filenames immediately in Pronterface

We were still parsing the files twice for this case as the command line parser
was loading them, and the PronterWindow constructor was reloading them before
updating the UI controls.
parent 0e4ada2e
...@@ -1431,7 +1431,10 @@ class pronsole(cmd.Cmd): ...@@ -1431,7 +1431,10 @@ class pronsole(cmd.Cmd):
self.processing_args = False self.processing_args = False
if args.filename: if args.filename:
filename = args.filename.decode(locale.getpreferredencoding()) filename = args.filename.decode(locale.getpreferredencoding())
self.do_load(filename) self.cmdline_filename_callback(filename)
def cmdline_filename_callback(self, filename):
self.do_load(filename)
def parse_cmdline(self, args): def parse_cmdline(self, args):
parser = argparse.ArgumentParser(description = 'Printrun 3D printer interface') parser = argparse.ArgumentParser(description = 'Printrun 3D printer interface')
......
...@@ -1486,6 +1486,11 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -1486,6 +1486,11 @@ class PronterWindow(MainWindow, pronsole.pronsole):
threading.Thread(target = self.skein_func).start() threading.Thread(target = self.skein_func).start()
threading.Thread(target = self.skein_monitor).start() threading.Thread(target = self.skein_monitor).start()
def cmdline_filename_callback(self, filename):
# Do nothing when processing a filename from command line, as we'll
# handle it when everything has been prepared
self.filename = filename
def do_load(self,l): def do_load(self,l):
if hasattr(self, 'skeining'): if hasattr(self, 'skeining'):
self.loadfile(None, l) self.loadfile(None, l)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment