Commit 2f528dff authored by sumpfralle's avatar sumpfralle

fixed selection tracking after removing parameter sets from a combobox

fixed model list update after unregistering/registering model plugin
fixed "copy" for triangles
minor GUI improvements for processes and tools


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1147 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 2aaf5424
...@@ -177,15 +177,6 @@ ...@@ -177,15 +177,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">4</property> <property name="spacing">4</property>
<child>
<object class="GtkHSeparator" id="hseparator7">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkAlignment" id="ProcessSelectorBox"> <object class="GtkAlignment" id="ProcessSelectorBox">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -228,7 +219,7 @@ ...@@ -228,7 +219,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">1</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -240,7 +231,7 @@ ...@@ -240,7 +231,7 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
......
...@@ -212,15 +212,6 @@ ...@@ -212,15 +212,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">4</property> <property name="spacing">4</property>
<child>
<object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkAlignment" id="ToolSelectorBox"> <object class="GtkAlignment" id="ToolSelectorBox">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -261,7 +252,7 @@ ...@@ -261,7 +252,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">1</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -274,7 +265,7 @@ ...@@ -274,7 +265,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
......
...@@ -93,7 +93,7 @@ class Triangle(TransformableContainer): ...@@ -93,7 +93,7 @@ class Triangle(TransformableContainer):
def copy(self): def copy(self):
return self.__class__(self.p1.copy(), self.p2.copy(), self.p3.copy(), return self.__class__(self.p1.copy(), self.p2.copy(), self.p3.copy(),
self.n.copy()) self.normal.copy())
def next(self): def next(self):
yield self.p1 yield self.p1
......
...@@ -97,6 +97,8 @@ class Models(pycam.Plugins.ListPluginBase): ...@@ -97,6 +97,8 @@ class Models(pycam.Plugins.ListPluginBase):
"model-selection-changed") "model-selection-changed")
self._get_colors_of_selected_models() self._get_colors_of_selected_models()
self.register_model_update(update_model) self.register_model_update(update_model)
# update the model list
self.core.emit_event("model-list-changed")
self.core.set("models", self) self.core.set("models", self)
return True return True
......
...@@ -148,7 +148,7 @@ class Processes(pycam.Plugins.ListPluginBase): ...@@ -148,7 +148,7 @@ class Processes(pycam.Plugins.ListPluginBase):
cell.set_cell_data_func(renderer, self._render_process_description) cell.set_cell_data_func(renderer, self._render_process_description)
def _update_widgets(self): def _update_widgets(self):
# TODO: keep the current selection selected = self._get_strategy()
model = self.gui.get_object("StrategyModel") model = self.gui.get_object("StrategyModel")
model.clear() model.clear()
strategies = list(self.core.get("get_parameter_sets")("process").values()) strategies = list(self.core.get("get_parameter_sets")("process").values())
...@@ -171,6 +171,8 @@ class Processes(pycam.Plugins.ListPluginBase): ...@@ -171,6 +171,8 @@ class Processes(pycam.Plugins.ListPluginBase):
selector_box.hide() selector_box.hide()
else: else:
selector_box.show() selector_box.show()
if selected:
self.select_strategy(selected["name"])
def _get_strategy(self, name=None): def _get_strategy(self, name=None):
strategies = self.core.get("get_parameter_sets")("process") strategies = self.core.get("get_parameter_sets")("process")
......
...@@ -28,6 +28,7 @@ from pycam.Cutters.ToroidalCutter import ToroidalCutter ...@@ -28,6 +28,7 @@ from pycam.Cutters.ToroidalCutter import ToroidalCutter
class Tools(pycam.Plugins.ListPluginBase): class Tools(pycam.Plugins.ListPluginBase):
DEPENDS = ["ParameterGroupManager"]
UI_FILE = "tools.ui" UI_FILE = "tools.ui"
COLUMN_REF, COLUMN_TOOL_ID, COLUMN_NAME = range(3) COLUMN_REF, COLUMN_TOOL_ID, COLUMN_NAME = range(3)
LIST_ATTRIBUTE_MAP = {"id": COLUMN_TOOL_ID, "name": COLUMN_NAME} LIST_ATTRIBUTE_MAP = {"id": COLUMN_TOOL_ID, "name": COLUMN_NAME}
...@@ -199,6 +200,7 @@ class Tools(pycam.Plugins.ListPluginBase): ...@@ -199,6 +200,7 @@ class Tools(pycam.Plugins.ListPluginBase):
cell.set_cell_data_func(renderer, self._render_tool_shape) cell.set_cell_data_func(renderer, self._render_tool_shape)
def _update_widgets(self): def _update_widgets(self):
selected = self._get_shape()
model = self.gui.get_object("ToolShapeList") model = self.gui.get_object("ToolShapeList")
model.clear() model.clear()
shapes = self.core.get("get_parameter_sets")("tool").values() shapes = self.core.get("get_parameter_sets")("tool").values()
...@@ -221,6 +223,8 @@ class Tools(pycam.Plugins.ListPluginBase): ...@@ -221,6 +223,8 @@ class Tools(pycam.Plugins.ListPluginBase):
selector_box.hide() selector_box.hide()
else: else:
selector_box.show() selector_box.show()
if selected:
self.select_shape(selected["name"])
def _store_tool_settings(self): def _store_tool_settings(self):
tool = self.get_selected() tool = self.get_selected()
......
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