Commit 55510618 authored by sumpfralle's avatar sumpfralle

fixed some options handling for the GTK interface

load the default settings (tool radus, ...) during startup (for GTK)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@260 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 9009aefb
......@@ -639,6 +639,7 @@ class ProjectGui:
window_box.pack_start(self.menubar, False)
window_box.reorder_child(self.menubar, 0)
# some more initialization
self.processing_settings.enable_config()
self.update_toolpath_table()
self.update_tool_editor()
self.update_tool_selector()
......@@ -1084,7 +1085,7 @@ class ProjectGui:
def open_processing_settings_file(self, filename):
""" This function is used by the commandline handler """
self.last_toolpath_file = filename
self.last_config_file = filename
self.load_processing_file(filename=filename)
self.update_save_actions()
......@@ -1477,6 +1478,9 @@ class ProjectGui:
dialog.destroy()
return filename
def setOutputFilename(self, filename):
self.last_toolpath_file = filename
@gui_activity_guard
def save_toolpath(self, widget=None, data=None):
if not self.toolpath:
......@@ -1486,6 +1490,9 @@ class ProjectGui:
if isinstance(widget, basestring):
filename = widget
no_dialog = True
elif self.no_dialog:
filename = self.last_toolpath_file
no_dialog = True
else:
# we open a dialog
filename = self.get_filename_via_dialog("Save toolpath to ...",
......@@ -1522,7 +1529,9 @@ class ProjectGui:
show_error_dialog(self.window, "Failed to save toolpath file")
def mainloop(self):
gtk.main()
# run the mainloop only if a GUI was requested
if not self.no_dialog:
gtk.main()
if __name__ == "__main__":
gui = ProjectGui()
......
......@@ -71,7 +71,7 @@ if __name__ == "__main__":
if options.ode_disabled:
override_ode_availability(False)
if outputfile:
if outputfile and not options.display:
gui = gui_class(no_dialog=True)
else:
gui = gui_class()
......
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