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