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
* fixed code that depended on GTK 2.16 (instead of 2.12)
* 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
* added an alternative GTK interface with additional features:
......
......@@ -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:
apt-get install python-gtkglext1 python-pyode python-opengl python-gtk2
BEWARE: Debian Lenny sadly contains a broken "python-opengl" package. You need to
switch to "squeeze" and run "apt-get install python-opengl" to fix this. Afterwards
you should go back to "Lenny". This may also be relevant for certain versions of
Ubuntu.
BEWARE: Debian "Lenny" and Ubuntu "Dapper/Hardy/Intrepid/Jaunty" contain older
"python-opengl" and "python-pyode" packages, that expose problems with PyCAM.
You need to add "Squeeze" (for Debian) or "Karmic/Lucid" (for Ubuntu) to your
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:
......
......@@ -541,11 +541,11 @@ class ProjectGui:
self.processing_settings = pycam.Gui.Settings.ProcessingSettings(self.settings)
self.processing_config_selection = self.gui.get_object("ProcessingTemplatesList")
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.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.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
self.progress_bar = self.gui.get_object("ProgressBar")
self.progress_widget = self.gui.get_object("ProgressWidget")
......@@ -891,39 +891,39 @@ class ProjectGui:
def load_processing_settings(self, filename=None):
if not filename is None:
self.processing_settings.reset("")
self.processing_settings.load_file(filename)
# load the default config
self.processing_settings.enable_config()
# reset the combobox
self.processing_config_selection.set_active(0)
while self.processing_config_selection.get_active() >= 0:
self.processing_config_selection.remove_text(0)
self.processing_config_selection.set_active(0)
self.processing_config_selection.get_model().clear()
for config_name in self.processing_settings.get_config_list():
self.processing_config_selection.append_text(config_name)
def switch_processing_config(self, widget=None, section=None):
if callable(section):
section = section()
if not section:
def switch_processing_config(self, widget=None, index=None):
if callable(index):
index = index()
if index is None:
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._visually_enable_specific_processing_config(section)
def delete_processing_config(self, widget=None, section=None):
if callable(section):
section = section()
if not section:
if section is None:
return
if section in self.processing_settings.get_config_list():
self.processing_settings.delete_config(section)
self.load_processing_settings()
self._visually_enable_specific_processing_config("")
def save_processing_config(self, widget=None, section=None):
if callable(section):
section = section()
if not section:
if section is None:
return
self.processing_settings.store_config(section)
self.load_processing_settings()
......@@ -932,10 +932,9 @@ class ProjectGui:
def _visually_enable_specific_processing_config(self, section):
# select the requested section in the drop-down list
# don't change the setting if not required - otherwise we will loop
if section != self.processing_config_selection.get_active_text():
config_list = self.processing_settings.get_config_list()
if section in config_list:
self.processing_config_selection.set_active(config_list.index(section))
current_text = self.processing_config_selection.get_child().get_text()
if section != current_text:
self.processing_config_selection.get_child().set_text(section)
def _toolpath_table_get_active_index(self):
if len(self.toolpath) == 0:
......
......@@ -2,12 +2,6 @@
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="ProcessingConfigs">
<columns>
<!-- column-name Name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="ToolPathListModel">
<columns>
<!-- column-name index -->
......@@ -64,6 +58,12 @@
</row>
</data>
</object>
<object class="GtkListStore" id="ProcessingConfigs">
<columns>
<!-- column-name Name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="ProjectWindow">
<property name="title" translatable="yes">PyCAM</property>
<property name="destroy_with_parent">True</property>
......@@ -955,6 +955,12 @@
<property name="visible">True</property>
<property name="model">ProcessingConfigs</property>
<property name="text_column">0</property>
<child>
<object class="GtkCellRendererText" id="name1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<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