Commit 40a89f9e authored by sumpfralle's avatar sumpfralle

fixed focus problem of the task name control


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@486 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 10f6ceea
...@@ -476,15 +476,14 @@ class ProjectGui: ...@@ -476,15 +476,14 @@ class ProjectGui:
self.gui.get_object("GenerateToolPathButton").connect("clicked", self._handle_tasklist_button_event, "generate_one_toolpath") self.gui.get_object("GenerateToolPathButton").connect("clicked", self._handle_tasklist_button_event, "generate_one_toolpath")
self.gui.get_object("GenerateAllToolPathsButton").connect("clicked", self._handle_tasklist_button_event, "generate_all_toolpaths") self.gui.get_object("GenerateAllToolPathsButton").connect("clicked", self._handle_tasklist_button_event, "generate_all_toolpaths")
# We need to collect the signal handles to block them during # We need to collect the signal handles to block them during
# programmatical changes. # programmatical changes. The "self._task_property_signals" list allows
# us to track all handlers that need to be blocked.
self._task_property_signals = [] self._task_property_signals = []
for objname, signal in (("TaskNameControl", "focus-out-event"), for objname in ("TaskNameControl", "TaskToolSelector",
("TaskToolSelector", "changed"), "TaskProcessSelector", "TaskBoundsSelector"):
("TaskProcessSelector", "changed"),
("TaskBoundsSelector", "changed")):
obj = self.gui.get_object(objname) obj = self.gui.get_object(objname)
self._task_property_signals.append((obj, self._task_property_signals.append((obj,
obj.connect(signal, self._handle_task_setting_change))) obj.connect("changed", self._handle_task_setting_change)))
# menu bar # menu bar
uimanager = gtk.UIManager() uimanager = gtk.UIManager()
self._accel_group = uimanager.get_accel_group() self._accel_group = uimanager.get_accel_group()
...@@ -776,7 +775,11 @@ class ProjectGui: ...@@ -776,7 +775,11 @@ class ProjectGui:
task = self.settings.get("current_task") task = self.settings.get("current_task")
if task is None: if task is None:
return return
task["name"] = self.gui.get_object("TaskNameControl").get_text() task_name_obj = self.gui.get_object("TaskNameControl")
old_name = task["name"]
new_name = task_name_obj.get_text()
if old_name != new_name:
task["name"] = new_name
tool_id = self.gui.get_object("TaskToolSelector").get_active() tool_id = self.gui.get_object("TaskToolSelector").get_active()
task["tool"] = self.tool_list[tool_id] task["tool"] = self.tool_list[tool_id]
process_id = self.gui.get_object("TaskProcessSelector").get_active() process_id = self.gui.get_object("TaskProcessSelector").get_active()
...@@ -789,6 +792,9 @@ class ProjectGui: ...@@ -789,6 +792,9 @@ class ProjectGui:
self.append_to_queue(self.update_boundary_limits) self.append_to_queue(self.update_boundary_limits)
# update the tasklist table (especially for name changes) # update the tasklist table (especially for name changes)
self.update_tasklist_table() self.update_tasklist_table()
# the task_name input control seems to loose focus somehow
if old_name != new_name:
task_name_obj.grab_focus()
@gui_activity_guard @gui_activity_guard
def _handle_tasklist_button_event(self, widget, data, action=None): def _handle_tasklist_button_event(self, widget, data, action=None):
......
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