Commit d69eb1a1 authored by sumpfralle's avatar sumpfralle

fixed "empty processing template list" problem with gtk 2.12

documented version problems with Debian "Lenny" and Ubunut (before "Karmic")
clear previous configuration before loading a processing settings file


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@210 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent f939866a
Version 0.2.1 - UNRELEASED Version 0.2.1 - UNRELEASED
* fixed code that depended on GTK 2.16 (instead of 2.12) * fixed code that depended on GTK 2.16 (instead of 2.12)
* view settings "light", "shadow" and "polygon fill" are now configurable * view settings "light", "shadow" and "polygon fill" are now configurable
* documented version problems with Debian "Lenny" and Ubuntu (before "Karmic")
Version 0.2 - 2010-03-04 Version 0.2 - 2010-03-04
* added an alternative GTK interface with additional features: * added an alternative GTK interface with additional features:
......
...@@ -57,10 +57,14 @@ Install the following packages with your package manager: ...@@ -57,10 +57,14 @@ Install the following packages with your package manager:
On a debian or ubuntu system you would just type the following in a root console: On a debian or ubuntu system you would just type the following in a root console:
apt-get install python-gtkglext1 python-pyode python-opengl python-gtk2 apt-get install python-gtkglext1 python-pyode python-opengl python-gtk2
BEWARE: Debian Lenny sadly contains a broken "python-opengl" package. You need to BEWARE: Debian "Lenny" and Ubuntu "Dapper/Hardy/Intrepid/Jaunty" contain older
switch to "squeeze" and run "apt-get install python-opengl" to fix this. Afterwards "python-opengl" and "python-pyode" packages, that expose problems with PyCAM.
you should go back to "Lenny". This may also be relevant for certain versions of You need to add "Squeeze" (for Debian) or "Karmic/Lucid" (for Ubuntu) to your
Ubuntu. package repository list and run the following:
apt-get update
apt-get install python-pyode python-opengl
Afterwards you can remove the new package repository again.
Dependencies of the Tk interface: Dependencies of the Tk interface:
......
...@@ -541,11 +541,11 @@ class ProjectGui: ...@@ -541,11 +541,11 @@ class ProjectGui:
self.processing_settings = pycam.Gui.Settings.ProcessingSettings(self.settings) self.processing_settings = pycam.Gui.Settings.ProcessingSettings(self.settings)
self.processing_config_selection = self.gui.get_object("ProcessingTemplatesList") self.processing_config_selection = self.gui.get_object("ProcessingTemplatesList")
self.processing_config_selection.connect("changed", self.processing_config_selection.connect("changed",
self.switch_processing_config, self.processing_config_selection.get_active_text) self.switch_processing_config, self.processing_config_selection.get_active)
self.gui.get_object("ProcessingTemplateDelete").connect("clicked", self.gui.get_object("ProcessingTemplateDelete").connect("clicked",
self.delete_processing_config, self.processing_config_selection.get_active_text) self.delete_processing_config, lambda: self.processing_config_selection.get_child().get_text())
self.gui.get_object("ProcessingTemplateSave").connect("clicked", self.gui.get_object("ProcessingTemplateSave").connect("clicked",
self.save_processing_config, self.processing_config_selection.get_active_text) self.save_processing_config, lambda: self.processing_config_selection.get_child().get_text())
# progress bar and task pane # progress bar and task pane
self.progress_bar = self.gui.get_object("ProgressBar") self.progress_bar = self.gui.get_object("ProgressBar")
self.progress_widget = self.gui.get_object("ProgressWidget") self.progress_widget = self.gui.get_object("ProgressWidget")
...@@ -891,39 +891,39 @@ class ProjectGui: ...@@ -891,39 +891,39 @@ class ProjectGui:
def load_processing_settings(self, filename=None): def load_processing_settings(self, filename=None):
if not filename is None: if not filename is None:
self.processing_settings.reset("")
self.processing_settings.load_file(filename) self.processing_settings.load_file(filename)
# load the default config # load the default config
self.processing_settings.enable_config() self.processing_settings.enable_config()
# reset the combobox # reset the combobox
self.processing_config_selection.set_active(0) self.processing_config_selection.get_model().clear()
while self.processing_config_selection.get_active() >= 0:
self.processing_config_selection.remove_text(0)
self.processing_config_selection.set_active(0)
for config_name in self.processing_settings.get_config_list(): for config_name in self.processing_settings.get_config_list():
self.processing_config_selection.append_text(config_name) self.processing_config_selection.append_text(config_name)
def switch_processing_config(self, widget=None, section=None): def switch_processing_config(self, widget=None, index=None):
if callable(section): if callable(index):
section = section() index = index()
if not section: if index is None:
return return
if section in self.processing_settings.get_config_list(): if index >= 0:
section = self.processing_settings.get_config_list()[index]
self.processing_settings.enable_config(section) self.processing_settings.enable_config(section)
self._visually_enable_specific_processing_config(section) self._visually_enable_specific_processing_config(section)
def delete_processing_config(self, widget=None, section=None): def delete_processing_config(self, widget=None, section=None):
if callable(section): if callable(section):
section = section() section = section()
if not section: if section is None:
return return
if section in self.processing_settings.get_config_list(): if section in self.processing_settings.get_config_list():
self.processing_settings.delete_config(section) self.processing_settings.delete_config(section)
self.load_processing_settings() self.load_processing_settings()
self._visually_enable_specific_processing_config("")
def save_processing_config(self, widget=None, section=None): def save_processing_config(self, widget=None, section=None):
if callable(section): if callable(section):
section = section() section = section()
if not section: if section is None:
return return
self.processing_settings.store_config(section) self.processing_settings.store_config(section)
self.load_processing_settings() self.load_processing_settings()
...@@ -932,10 +932,9 @@ class ProjectGui: ...@@ -932,10 +932,9 @@ class ProjectGui:
def _visually_enable_specific_processing_config(self, section): def _visually_enable_specific_processing_config(self, section):
# select the requested section in the drop-down list # select the requested section in the drop-down list
# don't change the setting if not required - otherwise we will loop # don't change the setting if not required - otherwise we will loop
if section != self.processing_config_selection.get_active_text(): current_text = self.processing_config_selection.get_child().get_text()
config_list = self.processing_settings.get_config_list() if section != current_text:
if section in config_list: self.processing_config_selection.get_child().set_text(section)
self.processing_config_selection.set_active(config_list.index(section))
def _toolpath_table_get_active_index(self): def _toolpath_table_get_active_index(self):
if len(self.toolpath) == 0: if len(self.toolpath) == 0:
......
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="ProcessingConfigs">
<columns>
<!-- column-name Name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="ToolPathListModel"> <object class="GtkListStore" id="ToolPathListModel">
<columns> <columns>
<!-- column-name index --> <!-- column-name index -->
...@@ -64,6 +58,12 @@ ...@@ -64,6 +58,12 @@
</row> </row>
</data> </data>
</object> </object>
<object class="GtkListStore" id="ProcessingConfigs">
<columns>
<!-- column-name Name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="ProjectWindow"> <object class="GtkWindow" id="ProjectWindow">
<property name="title" translatable="yes">PyCAM</property> <property name="title" translatable="yes">PyCAM</property>
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
...@@ -955,6 +955,12 @@ ...@@ -955,6 +955,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">ProcessingConfigs</property> <property name="model">ProcessingConfigs</property>
<property name="text_column">0</property> <property name="text_column">0</property>
<child>
<object class="GtkCellRendererText" id="name1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
......
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