gcompris r3767 - in branches/GCOMPRIS_8_3: . src/boards src/boards/python src/gcompris
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3767 - in branches/GCOMPRIS_8_3: . src/boards src/boards/python src/gcompris
- Date: Tue, 10 Mar 2009 20:55:32 +0000 (UTC)
Author: bcoudoin
Date: Tue Mar 10 20:55:31 2009
New Revision: 3767
URL: http://svn.gnome.org/viewvc/gcompris?rev=3767&view=rev
Log:
Patch from Miguel that fixes the configuration
of python activities (tuxpaint and login was crashing).
Merge from trunk 3765 and 3766
Added:
branches/GCOMPRIS_8_3/src/boards/py-gcompris-boardconfig.c
- copied unchanged from r3766, /trunk/src/boards/py-gcompris-boardconfig.c
branches/GCOMPRIS_8_3/src/boards/py-gcompris-boardconfig.h
- copied unchanged from r3766, /trunk/src/boards/py-gcompris-boardconfig.h
Modified:
branches/GCOMPRIS_8_3/ (props changed)
branches/GCOMPRIS_8_3/ChangeLog
branches/GCOMPRIS_8_3/src/boards/Makefile.am
branches/GCOMPRIS_8_3/src/boards/Makefile.mingw
branches/GCOMPRIS_8_3/src/boards/py-mod-gcompris.c
branches/GCOMPRIS_8_3/src/boards/python/login.py
branches/GCOMPRIS_8_3/src/boards/python/pythontest.py
branches/GCOMPRIS_8_3/src/boards/python/tuxpaint.py
branches/GCOMPRIS_8_3/src/gcompris/board_config_radio.c
Modified: branches/GCOMPRIS_8_3/src/boards/Makefile.am
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/Makefile.am (original)
+++ branches/GCOMPRIS_8_3/src/boards/Makefile.am Tue Mar 10 20:55:31 2009
@@ -283,6 +283,7 @@
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 \
Modified: branches/GCOMPRIS_8_3/src/boards/Makefile.mingw
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/Makefile.mingw (original)
+++ branches/GCOMPRIS_8_3/src/boards/Makefile.mingw Tue Mar 10 20:55:31 2009
@@ -120,6 +120,7 @@
canvas.c \
canvasmodule.c \
py-gcompris-board.c \
+ py-gcompris-boardconfig.c \
py-gcompris-properties.c \
py-gcompris-profile.c \
py-gcompris-wordlist.c \
Modified: branches/GCOMPRIS_8_3/src/boards/py-mod-gcompris.c
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/py-mod-gcompris.c (original)
+++ branches/GCOMPRIS_8_3/src/boards/py-mod-gcompris.c Tue Mar 10 20:55:31 2009
@@ -33,6 +33,7 @@
#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_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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
"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 @@
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 @@
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 @@
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 @@
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 @@
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 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 @@
/* 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 @@
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,
Modified: branches/GCOMPRIS_8_3/src/boards/python/login.py
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/python/login.py (original)
+++ branches/GCOMPRIS_8_3/src/boards/python/login.py Tue Mar 10 20:55:31 2009
@@ -533,23 +533,23 @@
# 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'])
)
Modified: branches/GCOMPRIS_8_3/src/boards/python/pythontest.py
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/python/pythontest.py (original)
+++ branches/GCOMPRIS_8_3/src/boards/python/pythontest.py Tue Mar 10 20:55:31 2009
@@ -405,13 +405,13 @@
# 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 @@
# 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 @@
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 @@
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 @@
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)
Modified: branches/GCOMPRIS_8_3/src/boards/python/tuxpaint.py
==============================================================================
--- branches/GCOMPRIS_8_3/src/boards/python/tuxpaint.py (original)
+++ branches/GCOMPRIS_8_3/src/boards/python/tuxpaint.py Tue Mar 10 20:55:31 2009
@@ -203,30 +203,37 @@
#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):
Modified: branches/GCOMPRIS_8_3/src/gcompris/board_config_radio.c
==============================================================================
--- branches/GCOMPRIS_8_3/src/gcompris/board_config_radio.c (original)
+++ branches/GCOMPRIS_8_3/src/gcompris/board_config_radio.c Tue Mar 10 20:55:31 2009
@@ -120,6 +120,7 @@
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 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]