Commit 182dd911 authored by lode_leroy's avatar lode_leroy
parent df07a55a
...@@ -13,7 +13,7 @@ if __name__ == "__main__": ...@@ -13,7 +13,7 @@ if __name__ == "__main__":
parser = OptionParser(usage="usage: %prog [--gui] [inputfile [outputfile]]") parser = OptionParser(usage="usage: %prog [--gui] [inputfile [outputfile]]")
parser.add_option("", "--gui", dest="display", parser.add_option("", "--gui", dest="display",
action="store_true", default=False, action="store_true", default=False,
help="ignore 'outputfile' and show the GUI window") help="don't create the outputfile on the fly - just preset the output filename and show the GUI")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if len(args) > 0: if len(args) > 0:
...@@ -27,13 +27,16 @@ if __name__ == "__main__": ...@@ -27,13 +27,16 @@ if __name__ == "__main__":
if not inputfile: if not inputfile:
gui.model = TestModel() gui.model = TestModel()
gui.mainloop()
else: else:
gui.open(inputfile) gui.open(inputfile)
if options.display: if outputfile and not options.display:
gui.mainloop() # an output filename is given and no gui is explicitly requested
else:
gui.generateToolpath() gui.generateToolpath()
if outputfile: if outputfile:
gui.save(outputfile) gui.save(outputfile)
else:
# the gui should be shown
if outputfile:
gui.setOutputFilename(outputfile)
gui.mainloop()
...@@ -320,6 +320,10 @@ class SimpleGui(Frame): ...@@ -320,6 +320,10 @@ class SimpleGui(Frame):
if filename: if filename:
self.save(filename) self.save(filename)
def setOutputFilename(self, filename):
if filename:
self.OutputFileName.set(filename)
def save(self, filename): def save(self, filename):
self.OutputFileName.set(filename) self.OutputFileName.set(filename)
if self.toolpath: if self.toolpath:
......
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