Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Coudoin <bcoudoin@src.gnome.org>2009-03-10 20:55:31 (GMT)
committer Bruno Coudoin <bcoudoin@src.gnome.org>2009-03-10 20:55:31 (GMT)
commit276cb2603343d46746486a93b282081c6672440d (patch)
treefe56c6140351929947319a77d6a3072cf5ca4489
parent72756d1ded049e895504a65faced88867880719b (diff)
Patch from Miguel that fixes the configuration
of python activities (tuxpaint and login was crashing). Merge from trunk 3765 and 3766 svn path=/branches/GCOMPRIS_8_3/; revision=3767
-rw-r--r--ChangeLog20
-rw-r--r--src/boards/Makefile.am1
-rw-r--r--src/boards/Makefile.mingw1
-rw-r--r--src/boards/py-gcompris-boardconfig.c78
-rw-r--r--src/boards/py-gcompris-boardconfig.h14
-rw-r--r--src/boards/py-mod-gcompris.c79
-rw-r--r--src/boards/python/login.py8
-rw-r--r--src/boards/python/pythontest.py24
-rw-r--r--src/boards/python/tuxpaint.py29
-rw-r--r--src/gcompris/board_config_radio.c3
10 files changed, 202 insertions, 55 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d27c00..a99f990 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2009-03-10 Bruno coudoin <bruno.coudoin@free.fr>
+ Patch from Miguel that fixes the configuration
+ of python activities (tuxpaint and login was crashing).
+ Merge from trunk 3765 and 3766
+
+ * src/boards/Makefile.am:
+ * src/boards/py-mod-gcompris.c:
+ (py_gc_board_config_window_display),
+ (py_gc_board_config_boolean_box), (py_gc_board_config_combo_box),
+ (py_gc_board_config_radio_buttons), (py_gc_board_config_spin_int),
+ (py_gc_board_conf_separator), (py_gc_board_config_combo_locales),
+ (py_gc_board_config_combo_locales_asset),
+ (py_gc_board_config_textview):
+ * src/boards/python/login.py:
+ * src/boards/python/pythontest.py:
+ * src/boards/python/tuxpaint.py:
+ * src/gcompris/board_config_radio.c:
+ (gc_board_config_radio_buttons):
+
+2009-03-10 Bruno coudoin <bruno.coudoin@free.fr>
+
Fixes to compile again on windows.
* Makefile.am:
diff --git a/src/boards/Makefile.am b/src/boards/Makefile.am
index 7e714ef..9dabb27 100644
--- a/src/boards/Makefile.am
+++ b/src/boards/Makefile.am
@@ -283,6 +283,7 @@ libpython_la_SOURCES = python.c \
py-gcompris-properties.c py-gcompris-properties.h \
py-gcompris-profile.c py-gcompris-profile.h \
py-gcompris-wordlist.c py-gcompris-wordlist.h \
+ py-gcompris-boardconfig.c py-gcompris-boardconfig.h \
py-gcompris-user.c \
py-gcompris-class.c \
py-gcompris-group.c \
diff --git a/src/boards/Makefile.mingw b/src/boards/Makefile.mingw
index 37eaec0..61febb5 100644
--- a/src/boards/Makefile.mingw
+++ b/src/boards/Makefile.mingw
@@ -120,6 +120,7 @@ PYTHON_C_SRC = \
canvas.c \
canvasmodule.c \
py-gcompris-board.c \
+ py-gcompris-boardconfig.c \
py-gcompris-properties.c \
py-gcompris-profile.c \
py-gcompris-wordlist.c \
diff --git a/src/boards/py-gcompris-boardconfig.c b/src/boards/py-gcompris-boardconfig.c
new file mode 100644
index 0000000..03c926a
--- /dev/null
+++ b/src/boards/py-gcompris-boardconfig.c
@@ -0,0 +1,78 @@
+#include "py-gcompris-boardconfig.h"
+#define NO_IMPORT_PYGOBJECT 1
+#include <pygobject.h>
+#include "py-gcompris-profile.h"
+#include "py-gcompris-board.h"
+
+staticforward PyTypeObject pyGcomprisBoardConfigType;
+
+/* Special function created for the python plugin to be able to create
+ * a pyGcomprisBoardObject form the existing GcomprisBoard structure
+ */
+PyObject*
+gcompris_new_pyGcomprisBoardConfigObject(GcomprisBoardConf* boardconfig)
+{
+ pyGcomprisBoardConfigObject* theboardconf = NULL;
+
+ theboardconf = PyObject_New(pyGcomprisBoardConfigObject, &pyGcomprisBoardConfigType);
+ if (theboardconf!=NULL)
+ theboardconf->cdata = boardconfig ;
+
+ return (PyObject*)theboardconf;
+}
+
+
+/* Free the python gcompris board config */
+static void
+pyGcomprisBoardConfigType_dealloc(pyGcomprisBoardConfigObject *self)
+{
+ self->cdata = NULL;
+ PyObject_DEL(self);
+}
+
+
+/* Methods defined in the pyGcomprisBoardConfig class */
+static PyMethodDef pyGcomprisBoardConfigType_methods[] = {
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Return the value of the members contained in the GcomprisBoardConfig structure */
+static PyObject *
+pyGcomprisBoardConfigType_getattr(pyGcomprisBoardConfigObject *self, char *name)
+{
+ return Py_FindMethod(pyGcomprisBoardConfigType_methods, (PyObject *)self, name);
+
+}
+
+/* Set the value of a GcomprisBoardConfig structure member */
+static int
+pyGcomprisBoardConfigType_setattr(pyGcomprisBoardConfigObject *self, char *name, PyObject *v)
+{
+ /* members are supposed to be read only */
+
+ return -1;
+}
+
+static PyTypeObject pyGcomprisBoardConfigType = {
+#if defined(WIN32)
+ PyObject_HEAD_INIT(NULL)
+#else /* ! WIN32 */
+ PyObject_HEAD_INIT(&PyType_Type)
+#endif
+ 0, /*ob_size*/
+ "pyGcomprisBoardConfig", /*tp_name*/
+ sizeof(pyGcomprisBoardConfigObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)pyGcomprisBoardConfigType_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ (getattrfunc)pyGcomprisBoardConfigType_getattr, /*tp_getattr*/
+ (setattrfunc)pyGcomprisBoardConfigType_setattr, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+};
diff --git a/src/boards/py-gcompris-boardconfig.h b/src/boards/py-gcompris-boardconfig.h
new file mode 100644
index 0000000..3d7cbbb
--- /dev/null
+++ b/src/boards/py-gcompris-boardconfig.h
@@ -0,0 +1,14 @@
+#ifndef _PY_GCOMPRIS_BOARDCONFIG_H_
+#define _PY_GCOMPRIS_BOARDCONFIG_H_
+
+#include <Python.h>
+#include "gcompris/gcompris.h"
+
+PyObject* gcompris_new_pyGcomprisBoardConfigObject(GcomprisBoardConf * boardconfig);
+
+typedef struct{
+ PyObject_HEAD
+ GcomprisBoardConf* cdata;
+} pyGcomprisBoardConfigObject;
+
+#endif
diff --git a/src/boards/py-mod-gcompris.c b/src/boards/py-mod-gcompris.c
index 51b1fc5..20d2b17 100644
--- a/src/boards/py-mod-gcompris.c
+++ b/src/boards/py-mod-gcompris.c
@@ -33,6 +33,7 @@ typedef int Py_ssize_t;
#include "py-gcompris-properties.h"
#include "py-gcompris-profile.h"
#include "py-gcompris-wordlist.h"
+#include "py-gcompris-boardconfig.h"
/* submodules includes */
#include "py-mod-bonus.h"
@@ -1055,10 +1056,9 @@ py_gc_board_config_window_display(PyObject* self, PyObject* args){
Py_INCREF(pyGcomprisConfCallbackFunc);
- return (PyObject *) \
- pygobject_new((GObject*) \
- gc_board_config_window_display( label,
- (GcomprisConfCallback )pyGcomprisConfCallback));
+ return gcompris_new_pyGcomprisBoardConfigObject(
+ gc_board_config_window_display( label,
+ (GcomprisConfCallback )pyGcomprisConfCallback));
}
@@ -1067,17 +1067,20 @@ py_gc_board_config_window_display(PyObject* self, PyObject* args){
static PyObject*
py_gc_board_config_boolean_box(PyObject* self, PyObject* args)
{
- PyObject *py_bool;
+ PyObject *py_bool, *py_bconf;
+ pyGcomprisBoardConfigObject * bconf;
gchar *label;
gchar *key;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "ssO:gc_board_config_boolean_box", &label, &key, &py_bool))
+ if(!PyArg_ParseTuple(args, "OssO:gc_board_config_boolean_box", &py_bconf, &label, &key, &py_bool))
return NULL;
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
+
/* Call the corresponding C function */
return (PyObject *)pygobject_new((GObject*) \
- gc_board_config_boolean_box(NULL,(const gchar *)label, key, PyObject_IsTrue(py_bool)));
+ gc_board_config_boolean_box(bconf->cdata,(const gchar *)label, key, PyObject_IsTrue(py_bool)));
}
@@ -1085,7 +1088,8 @@ py_gc_board_config_boolean_box(PyObject* self, PyObject* args)
static PyObject*
py_gc_board_config_combo_box(PyObject* self, PyObject* args)
{
- PyObject *py_list;
+ pyGcomprisBoardConfigObject * bconf;
+ PyObject *py_list, *py_bconf;
gchar *label;
gchar *key;
gchar *init;
@@ -1095,7 +1099,7 @@ py_gc_board_config_combo_box(PyObject* self, PyObject* args)
int i, size;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "sOss:gc_board_config_combo_box", &label, &py_list, &key, &init))
+ if(!PyArg_ParseTuple(args, "OsOss:gc_board_config_combo_box", &py_bconf, &label, &py_list, &key, &init))
return NULL;
if (!PyList_Check(py_list)){
@@ -1110,9 +1114,11 @@ py_gc_board_config_combo_box(PyObject* self, PyObject* args)
list = g_list_append( list,
PyString_AsString( PyList_GetItem( py_list, i)));
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
+
/* Call the corresponding C function */
return (PyObject *)pygobject_new((GObject*) \
- gc_board_config_combo_box(NULL, (const gchar *)label,
+ gc_board_config_combo_box(bconf->cdata, (const gchar *)label,
list,
key,
init));
@@ -1167,14 +1173,15 @@ PyObject* hash_object_to_dict(GHashTable *table)
static PyObject*
py_gc_board_config_radio_buttons(PyObject* self, PyObject* args)
{
- PyObject *py_dict;
+ PyObject *py_dict, *py_bconf;
+ pyGcomprisBoardConfigObject *bconf;
GHashTable *buttons_label, *result;
gchar *label;
gchar *key;
gchar *init;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "ssOs:gc_board_config_radio_buttons", &label, &key, &py_dict, &init))
+ if(!PyArg_ParseTuple(args, "OssOs:gc_board_config_radio_buttons", &py_bconf, &label, &key, &py_dict, &init))
return NULL;
if (!PyDict_Check(py_dict)){
@@ -1182,6 +1189,7 @@ py_gc_board_config_radio_buttons(PyObject* self, PyObject* args)
"gc_board_config_radio_buttons second argument must be a dict");
return NULL;
}
+ bconf = (pyGcomprisBoardConfigObject*) py_bconf;
PyObject *pykey, *pyvalue;
Py_ssize_t pos = 0;
@@ -1197,7 +1205,7 @@ py_gc_board_config_radio_buttons(PyObject* self, PyObject* args)
g_strdup(PyString_AsString(pyvalue)));
}
- result = gc_board_config_radio_buttons(NULL,label,
+ result = gc_board_config_radio_buttons(bconf->cdata,label,
key,
buttons_label,
init);
@@ -1210,16 +1218,20 @@ py_gc_board_config_radio_buttons(PyObject* self, PyObject* args)
static PyObject*
py_gc_board_config_spin_int(PyObject* self, PyObject* args)
{
+ pyGcomprisBoardConfigObject *bconf;
+ PyObject *py_bconf;
gchar *label;
gchar *key;
gint min, max, step, init;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "ssiiii:gc_board_config_radio_buttons", &label, &key, &min, &max, &step, &init))
+ if(!PyArg_ParseTuple(args, "Ossiiii:gc_board_config_radio_buttons", &py_bconf, &label, &key, &min, &max, &step, &init))
return NULL;
-
+
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
+
return (PyObject *)pygobject_new((GObject*) \
- gc_board_config_spin_int(NULL, (const gchar *)label,
+ gc_board_config_spin_int(bconf->cdata, (const gchar *)label,
key,
min,
max,
@@ -1233,12 +1245,17 @@ py_gc_board_config_spin_int(PyObject* self, PyObject* args)
static PyObject*
py_gc_board_conf_separator(PyObject* self, PyObject* args)
{
+ PyObject *py_bconf;
+ pyGcomprisBoardConfigObject * bconf;
+
/* Parse arguments */
- if(!PyArg_ParseTuple(args, ":gc_board_conf_separator"))
+ if(!PyArg_ParseTuple(args, "O:gc_board_conf_separator", &py_bconf))
return NULL;
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
+
/* Create and return the result */
- return (PyObject *)pygobject_new((GObject*) gc_board_conf_separator(NULL));
+ return (PyObject *)pygobject_new((GObject*) gc_board_conf_separator(bconf->cdata));
}
@@ -1246,14 +1263,17 @@ py_gc_board_conf_separator(PyObject* self, PyObject* args)
static PyObject*
py_gc_board_config_combo_locales(PyObject* self, PyObject* args)
{
+ pyGcomprisBoardConfigObject *bconf;
+ PyObject *py_bconf;
gchar *init;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "s:gc_board_config_combo_locales", &init))
+ if(!PyArg_ParseTuple(args, "Os:gc_board_config_combo_locales", &py_bconf, &init))
return NULL;
-
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
+
return (PyObject *)pygobject_new((GObject*) \
- gc_board_config_combo_locales(NULL, init));
+ gc_board_config_combo_locales(bconf->cdata, init));
}
@@ -1284,19 +1304,21 @@ py_gc_locale_gets_list(PyObject* self, PyObject* args)
static PyObject*
py_gc_board_config_combo_locales_asset(PyObject* self, PyObject* args)
{
+ pyGcomprisBoardConfigObject *bconf;
+ PyObject *py_bconf;
gchar *init;
gchar *label;
gchar *file;
/* Parse arguments */
- if(!PyArg_ParseTuple(args, "ssz:gc_board_config_combo_locales",
+ if(!PyArg_ParseTuple(args, "Ossz:gc_board_config_combo_locales", &py_bconf,
&label,
&init,
&file))
return NULL;
-
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
return (PyObject *)pygobject_new((GObject*) \
- gc_board_config_combo_locales_asset(NULL, label, init, file ));
+ gc_board_config_combo_locales_asset(bconf->cdata, label, init, file ));
}
@@ -1416,7 +1438,8 @@ static gboolean pyGcomprisTextCallback(gchar *key, gchar *text, GtkLabel *label)
static PyObject*
py_gc_board_config_textview(PyObject* self, PyObject* args){
- PyObject* pyCallback;
+ pyGcomprisBoardConfigObject *bconf;
+ PyObject* pyCallback, *py_bconf;
gchar *label;
gchar *key;
gchar *desc = NULL;
@@ -1424,7 +1447,8 @@ py_gc_board_config_textview(PyObject* self, PyObject* args){
/* Parse arguments */
if(!PyArg_ParseTuple(args,
- "sszzO:gc_board_config_window_display",
+ "OsszzO:gc_board_config_window_display",
+ &py_bconf,
&label,
&key,
&desc,
@@ -1444,10 +1468,11 @@ py_gc_board_config_textview(PyObject* self, PyObject* args){
g_hash_table_replace (text_callbacks, key, pyCallback);
Py_INCREF(pyCallback);
+ bconf = (pyGcomprisBoardConfigObject*)py_bconf;
return (PyObject *) \
pygobject_new((GObject*) \
- gc_board_config_textview(NULL, label,
+ gc_board_config_textview(bconf->cdata, label,
key,
desc,
init_text,
diff --git a/src/boards/python/login.py b/src/boards/python/login.py
index 0961a01..d02d458 100644
--- a/src/boards/python/login.py
+++ b/src/boards/python/login.py
@@ -533,23 +533,23 @@ class Gcompris_login:
# the returned value is the main GtkVBox of the window,
#we can add what you want in it.
- self.main_vbox = gcompris.configuration_window ( \
+ bconf = gcompris.configuration_window ( \
_('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Login', profile.name ),
self.ok_callback
)
# toggle box
- uppercase = gcompris.boolean_box(_('Uppercase only text'),
+ uppercase = gcompris.boolean_box(bconf, _('Uppercase only text'),
'uppercase_only',
eval(self.config_dict['uppercase_only'])
)
#uppercase.set_sensitive(False)
- gcompris.separator()
+ gcompris.separator(bconf)
# toggle box
- entry_text = gcompris.boolean_box(_('Enter login to log in'),
+ entry_text = gcompris.boolean_box(bconf, _('Enter login to log in'),
'entry_text',
eval(self.config_dict['entry_text'])
)
diff --git a/src/boards/python/pythontest.py b/src/boards/python/pythontest.py
index 12f91d4..8640688 100644
--- a/src/boards/python/pythontest.py
+++ b/src/boards/python/pythontest.py
@@ -405,13 +405,13 @@ class Gcompris_pythontest:
# the returned value is the main GtkVBox of the window,
#we can add what you want in it.
- self.main_vbox = gcompris.configuration_window ( \
+ bconf = gcompris.configuration_window ( \
_('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Pythontest', profile.name ),
self.ok_callback
)
# toggle box
- control_line = gcompris.boolean_box(_('Disable line drawing in circle'),
+ control_line = gcompris.boolean_box(bconf, _('Disable line drawing in circle'),
'disable_line',
eval(self.config_dict['disable_line'])
)
@@ -420,18 +420,18 @@ class Gcompris_pythontest:
# combo box
self.color_choice = \
- gcompris.combo_box(_('Color of the line'),
+ gcompris.combo_box(bconf, _('Color of the line'),
self.config_colors_list,
'color_line',
self.config_dict['color_line']
)
self.color_choice.set_sensitive(not eval(self.config_dict['disable_line']))
- gcompris.separator()
+ gcompris.separator(bconf)
#spin button for int
self.distance_box = \
- gcompris.spin_int(_('Distance between circles'),
+ gcompris.spin_int(bconf, _('Distance between circles'),
'distance_circle',
20,
200,
@@ -439,14 +439,14 @@ class Gcompris_pythontest:
eval(self.config_dict['distance_circle'])
)
- gcompris.separator()
+ gcompris.separator(bconf)
#radio buttons for circle or rectangle
patterns = { 'circle': _('Use circles'),
'rectangle': _('Use rectangles')
}
- gcompris.radio_buttons(_('Choice of pattern'),
+ gcompris.radio_buttons(bconf, _('Choice of pattern'),
'pattern',
patterns,
self.config_dict['pattern']
@@ -455,11 +455,11 @@ class Gcompris_pythontest:
print "List of locales shown in gcompris.combo_locale :"
print gcompris.get_locales_list()
- gcompris.separator()
+ gcompris.separator(bconf)
- gcompris.combo_locales( self.config_dict['locale'])
+ gcompris.combo_locales(bconf, self.config_dict['locale'])
- gcompris.separator()
+ gcompris.separator(bconf)
print "List of locales shown in gcompris.combo_locales_asset :"
locales_purple = gcompris.get_locales_asset_list( "gcompris colors", None, "audio/x-ogg", "purple.ogg")
@@ -468,9 +468,9 @@ class Gcompris_pythontest:
label = gtk.Label()
label.set_markup('<i>-- unused, but here for test --</i>')
label.show()
- self.main_vbox.pack_start (label, False, False, 8)
+# self.main_vbox.pack_start (label, False, False, 8)
- gcompris.combo_locales_asset( _("Select sound locale"), self.config_dict['locale_sound'], "gcompris colors", None, "audio/x-ogg", "purple.ogg" )
+ gcompris.combo_locales_asset( bconf, _("Select sound locale"), self.config_dict['locale_sound'], "gcompris colors", None, "audio/x-ogg", "purple.ogg" )
print gcompris.utils.get_asset_file ("gcompris colors", None, "audio/x-ogg", "purple.ogg")
print gcompris.utils.get_asset_file_locale ("gcompris colors", None, "audio/x-ogg", "purple.ogg", None)
diff --git a/src/boards/python/tuxpaint.py b/src/boards/python/tuxpaint.py
index 5c73a1c..e5564ff 100644
--- a/src/boards/python/tuxpaint.py
+++ b/src/boards/python/tuxpaint.py
@@ -203,30 +203,37 @@ class Gcompris_tuxpaint:
#set already configured values
self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))
- self.main_vbox = gcompris.configuration_window(_('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Tuxpaint', profile.name ),
+ bconfig = gcompris.configuration_window(_('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Tuxpaint', profile.name ),
self.apply_callback)
- gcompris.boolean_box(_('Inherit fullscreen setting from GCompris'), 'fullscreen', eval(self.config_dict['fullscreen']))
+ gcompris.boolean_box(bconfig, _('Inherit fullscreen setting from GCompris'), 'fullscreen',
+ eval(self.config_dict['fullscreen']))
- gcompris.separator()
+ gcompris.separator(bconfig)
- gcompris.boolean_box(_('Inherit size setting from GCompris (800x600, 640x480)'), 'size', eval(self.config_dict['size']))
+ gcompris.boolean_box(bconfig, _('Inherit size setting from GCompris (800x600, 640x480)'),
+ 'size', eval(self.config_dict['size']))
- gcompris.separator()
+ gcompris.separator(bconfig)
- gcompris.boolean_box(_('Disable shape rotation'), 'disable_shape_rotation', eval(self.config_dict['disable_shape_rotation']))
+ gcompris.boolean_box(bconfig, _('Disable shape rotation'), 'disable_shape_rotation',
+ eval(self.config_dict['disable_shape_rotation']))
- gcompris.separator()
+ gcompris.separator(bconfig)
- gcompris.boolean_box(_('Show Uppercase text only'), 'uppercase_text', eval(self.config_dict['uppercase_text']))
+ gcompris.boolean_box(bconfig, _('Show Uppercase text only'), 'uppercase_text',
+ eval(self.config_dict['uppercase_text']))
- gcompris.separator()
+ gcompris.separator(bconfig)
- stamps = gcompris.boolean_box(_('Disable stamps'), 'disable_stamps', eval(self.config_dict['disable_stamps']))
+ stamps = gcompris.boolean_box(bconfig, _('Disable stamps'), 'disable_stamps',
+ eval(self.config_dict['disable_stamps']))
stamps.connect("toggled", self.stamps_changed)
- self.stamps_control = gcompris.boolean_box('Disable stamps control', 'disable_stamps_control', eval(self.config_dict['disable_stamps_control']))
+ self.stamps_control = gcompris.boolean_box(bconfig, 'Disable stamps control',
+ 'disable_stamps_control',
+ eval(self.config_dict['disable_stamps_control']))
self.stamps_control.set_sensitive(not eval(self.config_dict['disable_stamps']))
def stamps_changed(self, button):
diff --git a/src/gcompris/board_config_radio.c b/src/gcompris/board_config_radio.c
index 555bdd3..47f45e3 100644
--- a/src/gcompris/board_config_radio.c
+++ b/src/gcompris/board_config_radio.c
@@ -120,6 +120,7 @@ gc_board_config_radio_buttons(GcomprisBoardConf *conf, const gchar *label,
NULL);
Gconfig_radio *u = g_malloc0(sizeof(Gconfig_radio));
u->hash_radio = buttons;
+ u->config = conf;
u->radio_box = gtk_vbox_new (TRUE, 2);
gtk_widget_show (GTK_WIDGET (u->radio_box));
@@ -152,7 +153,7 @@ gc_board_config_radio_buttons(GcomprisBoardConf *conf, const gchar *label,
g_hash_table_foreach( buttons_label,
(GHFunc) create_radio_buttons,
- (gpointer) buttons);
+ (gpointer) u);
g_signal_connect (G_OBJECT(u->radio_box), "destroy", G_CALLBACK(radio_box_destroy), (gpointer) u);