Commit 6945857c authored by Bruno Coudoin's avatar Bruno Coudoin

- Start of support of python plugin on window.

	- Fixed several issues in the admin.
	- Fixed the login mode.
	- Removed empty config code in some python plugin because it causes the admin
	  to display a conbfiguration icon for them.
parent 5d2b63c4
2006-09-23 Bruno coudoin <bruno.coudoin@free.fr>
- Start of support of python plugin on window.
- Fixed several issues in the admin.
- Fixed the login mode.
- Removed empty config code in some python plugin because it causes the admin
to display a conbfiguration icon for them.
* Makefile.mingw:
* docs/website/footer.php3:
* docs/website/header.php3:
* docs/website/menu.php3:
* docs/website/meta.php3:
* src/boards/Makefile.mingw:
* src/boards/py-gcompris-board.c:
* src/boards/py-gcompris-class.c:
* src/boards/py-gcompris-group.c:
* src/boards/py-gcompris-profile.c:
* src/boards/py-gcompris-properties.c:
(pyGcomprisPropertiesType_getattr):
* src/boards/py-gcompris-user.c:
* src/boards/py-gcompris-wordlist.c:
(pyGcomprisWordlistType_getattr):
* src/boards/py-mod-admin.c: (py_gc_board_config_start):
* src/boards/py-mod-anim.c: (AnimCanvas_getattr),
(py_gcompris_animcanvas_swapanim),
(python_gcompris_anim_module_init):
* src/boards/python.c: (pythonboard_init), (pythonboard_start),
(pythonboard_is_our_board), (pythongc_board_config_start):
* src/boards/python/admin/board_list.py:
* src/boards/python/electric.py:
* src/boards/python/guessnumber.py:
* src/boards/python/login.py:
* src/boards/python/mosaic.py:
* src/gcompris/Makefile.mingw:
* src/gcompris/anim.c: (gc_anim_load):
* src/gcompris/binreloc.c: (_br_find_exe),
(_br_find_exe_for_symbol):
* src/gcompris/board.c: (init_plugins), (gc_board_check_file):
* src/gcompris/log.c: (gc_log_end):
* src/gcompris/profile.c: (gc_profile_set_current_user),
(gc_profile_destroy), (gc_user_destroy):
* src/gcompris/properties.c: (gc_prop_save):
2006-09-20 Bruno coudoin <bruno.coudoin@free.fr>
reviewed by: <delete if not using a buddy>
- Memory leak review by miguel2i (on free.fr)
- Fixed chess movelearn level 3, white could take
the king immediately. reported by woof
* Makefile.mingw:
* src/boards/Makefile.mingw:
......
......@@ -55,9 +55,10 @@ NEEDED_DLLS = $(GNUCHESS_TOP)/bin/pthreadGC.dll \
$(GTK_TOP)/expat/bin/xmlparse.dll \
$(GTK_TOP)/expat/bin/xmltok.dll \
$(GTK_TOP)/bin/iconv.dll \
$(GTK_TOP)/bin/intl.dll \
$(GTK_TOP)/bin/libpng12.dll \
$(GTK_TOP)/bin/libpng13.dll \
$(GTK_TOP)/bin/jpeg62.dll \
$(GTK_TOP)/bin/libcairo-2.dll \
$(GTK_TOP)/bin/libpangocairo-1.0-0.dll \
/c/WINDOWS/system32/python24.dll
NEEDED_FILES = README \
......
<?php
$fond = "footer";
$delais = 2 * 3600;
include ("inc-public.php3");
?>
<?php
$fond = "header";
$delais = 2 * 3600;
include ("inc-public.php3");
?>
<?php
$fond = "menu";
$delais = 2 * 3600;
include ("inc-public.php3");
?>
<?php
$fond = "meta";
$delais = 24 * 3600;
include ("inc-public.php3");
?>
......@@ -67,7 +67,7 @@ LIB_PATHS = -L$(GTK_TOP)/lib \
-L$(GNUWIN32_TOP)/lib \
-L$(SDL_TOP)/lib \
-L$(GCOMPRIS_TOP)/src/gcompris \
-I$(PYTHON_TOP)/lib
-L$(PYTHON_TOP)/libs
##
......@@ -89,7 +89,6 @@ LIBS = -lgtk-win32-2.0 \
-lgdi32 -lgthread-2.0 \
-lintl \
-lws2_32 \
-lpython \
-lpython24 \
libgcompris-1.la
......
......@@ -171,7 +171,11 @@ pyGcomprisBoardType_setattr(pyGcomprisBoardObject *self, char *name, PyObject *v
}
static PyTypeObject pyGcomprisBoardType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisBoard", /*tp_name*/
sizeof(pyGcomprisBoardObject), /*tp_basicsize*/
......
......@@ -9,7 +9,7 @@ staticforward PyTypeObject pyGcomprisClassType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisClassObject(GcomprisClass* class)
{
pyGcomprisClassObject* theclass = NULL;
......@@ -23,19 +23,19 @@ gcompris_new_pyGcomprisClassObject(GcomprisClass* class)
/* Free the python gcompris class */
static void
static void
pyGcomprisClassType_dealloc(pyGcomprisClassObject *self)
{
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisClass class */
static PyMethodDef pyGcomprisClassType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisClass structure */
static PyObject *
......@@ -93,9 +93,13 @@ pyGcomprisClassType_setattr(pyGcomprisClassObject *self, char *name, PyObject *v
return -1;
}
static PyTypeObject pyGcomprisClassType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisClass", /*tp_name*/
sizeof(pyGcomprisClassObject), /*tp_basicsize*/
......
......@@ -9,7 +9,7 @@ staticforward PyTypeObject pyGcomprisGroupType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisGroupObject(GcomprisGroup* group)
{
pyGcomprisGroupObject* thegroup = NULL;
......@@ -23,19 +23,19 @@ gcompris_new_pyGcomprisGroupObject(GcomprisGroup* group)
/* Free the python gcompris group */
static void
static void
pyGcomprisGroupType_dealloc(pyGcomprisGroupObject *self)
{
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisGroup class */
static PyMethodDef pyGcomprisGroupType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisGroup structure */
static PyObject *
......@@ -82,9 +82,13 @@ pyGcomprisGroupType_setattr(pyGcomprisGroupObject *self, char *name, PyObject *v
return -1;
}
static PyTypeObject pyGcomprisGroupType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisGroup", /*tp_name*/
sizeof(pyGcomprisGroupObject), /*tp_basicsize*/
......
......@@ -9,7 +9,7 @@ staticforward PyTypeObject pyGcomprisProfileType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisProfileObject(GcomprisProfile* profile)
{
if (!profile)
......@@ -26,19 +26,19 @@ gcompris_new_pyGcomprisProfileObject(GcomprisProfile* profile)
/* Free the python gcompris profile */
static void
static void
pyGcomprisProfileType_dealloc(pyGcomprisProfileObject *self)
{
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisProfile class */
static PyMethodDef pyGcomprisProfileType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisProfile structure */
static PyObject *
......@@ -97,9 +97,13 @@ pyGcomprisProfileType_setattr(pyGcomprisProfileObject *self, char *name, PyObjec
return -1;
}
static PyTypeObject pyGcomprisProfileType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisProfile", /*tp_name*/
sizeof(pyGcomprisProfileObject), /*tp_basicsize*/
......
......@@ -11,7 +11,7 @@ staticforward PyTypeObject pyGcomprisPropertiesType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisPropertiesObject(GcomprisProperties* properties)
{
pyGcomprisPropertiesObject* theproperties = NULL;
......@@ -25,19 +25,19 @@ gcompris_new_pyGcomprisPropertiesObject(GcomprisProperties* properties)
/* Free the python gcompris properties */
static void
static void
pyGcomprisPropertiesType_dealloc(pyGcomprisPropertiesObject *self)
{
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisProperties class */
static PyMethodDef pyGcomprisPropertiesType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisProperties structure */
static PyObject *
......@@ -101,7 +101,7 @@ pyGcomprisPropertiesType_getattr(pyGcomprisPropertiesObject *self, char *name)
if(strcmp(name,"skin")==0) return Py_BuildValue("s", self->cdata->skin);
if(strcmp(name,"shared_dir")==0) return Py_BuildValue("s", self->cdata->shared_dir);
if(strcmp(name,"users_dir")==0) return Py_BuildValue("s", self->cdata->users_dir);
if(strcmp(name,"profile")==0){
if (self->cdata->profile)
return gcompris_new_pyGcomprisProfileObject(self->cdata->profile);
......@@ -181,9 +181,13 @@ pyGcomprisPropertiesType_setattr(pyGcomprisPropertiesObject *self, char *name, P
return -1;
}
static PyTypeObject pyGcomprisPropertiesType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisProperties", /*tp_name*/
sizeof(pyGcomprisPropertiesObject), /*tp_basicsize*/
......
......@@ -9,7 +9,7 @@ staticforward PyTypeObject pyGcomprisUserType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisUserObject(GcomprisUser* user)
{
pyGcomprisUserObject* theuser = NULL;
......@@ -23,19 +23,19 @@ gcompris_new_pyGcomprisUserObject(GcomprisUser* user)
/* Free the python gcompris user */
static void
static void
pyGcomprisUserType_dealloc(pyGcomprisUserObject *self)
{
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisUser class */
static PyMethodDef pyGcomprisUserType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisUser structure */
static PyObject *
......@@ -76,9 +76,13 @@ pyGcomprisUserType_setattr(pyGcomprisUserObject *self, char *name, PyObject *v)
return -1;
}
static PyTypeObject pyGcomprisUserType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisUser", /*tp_name*/
sizeof(pyGcomprisUserObject), /*tp_basicsize*/
......
......@@ -11,7 +11,7 @@ staticforward PyTypeObject pyGcomprisWordlistType;
/* Special function created for the python plugin to be able to create
* a pyGcomprisBoardObject form the existing GcomprisBoard structure
*/
PyObject*
PyObject*
gcompris_new_pyGcomprisWordlistObject(GcomprisWordlist* wordlist)
{
pyGcomprisWordlistObject* thewordlist = NULL;
......@@ -25,20 +25,20 @@ gcompris_new_pyGcomprisWordlistObject(GcomprisWordlist* wordlist)
/* Free the python gcompris wordlist */
static void
static void
pyGcomprisWordlistType_dealloc(pyGcomprisWordlistObject *self)
{
gc_wordlist_free((GcomprisWordlist *)self->cdata);
self->cdata = NULL;
PyObject_DEL(self);
}
/* Methods defined in the pyGcomprisWordlist class */
static PyMethodDef pyGcomprisWordlistType_methods[] = {
{NULL, NULL} /* sentinel */
};
/* Return the value of the members contained in the GcomprisWordlist structure */
static PyObject *
......@@ -59,18 +59,18 @@ pyGcomprisWordlistType_getattr(pyGcomprisWordlistObject *self, char *name)
GSList *list, *list_words;
pydict = PyDict_New();
for (list = self->cdata->levels_words; list !=NULL; list = list->next){
level = ((LevelWordlist *) list)->level;
words = ((LevelWordlist *) list)->words;
pylist = PyList_New(0);
for (list_words = words; list_words !=NULL; list_words = list_words->next){
PyList_Append(pylist, Py_BuildValue("s", (gchar *)list->data));
}
PyDict_SetItem( pydict, PyInt_FromLong( (long) level), pylist);
return pydict;
}
}
......@@ -88,9 +88,13 @@ pyGcomprisWordlistType_setattr(pyGcomprisWordlistObject *self, char *name, PyObj
return -1;
}
static PyTypeObject pyGcomprisWordlistType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /*ob_size*/
"pyGcomprisWordlist", /*tp_name*/
sizeof(pyGcomprisWordlistObject), /*tp_basicsize*/
......
......@@ -43,9 +43,9 @@ py_gc_board_config_start (PyObject* self, PyObject* args)
GcomprisProfile* cGcomprisProfile;
/* Parse arguments */
if(!PyArg_ParseTuple(args,
"OO:gc_board_config_start",
&pyBoard,
if(!PyArg_ParseTuple(args,
"OO:gc_board_config_start",
&pyBoard,
&pyProfile))
return NULL;
......@@ -344,8 +344,8 @@ py_gc_profile_get_current_user (PyObject* self, PyObject* args)
static PyMethodDef PythonGcomprisAdminModule[] = {
{ "board_run_next", py_board_run_next, METH_VARARGS, "board_run_next" },
{ "gc_board_config_start", py_gc_board_config_start, METH_VARARGS, "gc_board_config_start" },
{ "gc_board_config_stop", py_gc_board_config_stop, METH_VARARGS, "gc_board_config_stop" },
{ "board_config_start", py_gc_board_config_start, METH_VARARGS, "gc_board_config_start" },
{ "board_config_stop", py_gc_board_config_stop, METH_VARARGS, "gc_board_config_stop" },
{ "get_profile_from_id", py_gc_db_get_profile_from_id, METH_VARARGS, "gc_db_get_profile_from_id" },
{ "get_profiles_list", py_gc_db_profiles_list_get, METH_VARARGS, "gc_db_profiles_list_get" },
{ "get_user_from_id", py_gc_db_get_user_from_id, METH_VARARGS, "gc_db_get_user_from_id" },
......
......@@ -38,7 +38,11 @@ static PyMethodDef AnimationMethods[] = {
};
static PyTypeObject py_GcomprisAnimationType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /* ob_size */
"pyGcomprisAnimation", /* tp_name */
sizeof(py_GcomprisAnimation), /* tp_basicsize */
......@@ -80,7 +84,11 @@ static PyTypeObject py_GcomprisAnimationType = {
};
static PyTypeObject py_GcomprisAnimCanvasType = {
#if defined(WIN32)
PyObject_HEAD_INIT(NULL)
#else /* ! WIN32 */
PyObject_HEAD_INIT(&PyType_Type)
#endif
0, /* ob_size */
"pyGcomprisAnimCanvas", /* tp_name */
sizeof(py_GcomprisAnimCanvas), /* tp_basicsize */
......@@ -220,7 +228,7 @@ static PyObject *AnimCanvas_getattr(py_GcomprisAnimCanvas *self, char *name)
else if(!strcmp(name, "num_states"))
return Py_BuildValue("i", self->item->anim->numstates);
return Py_FindMethod(AnimCanvasMethods, (PyObject *)self, name);
return Py_FindMethod(AnimCanvasMethods, (PyObject *)self, name);
}
static PyObject*
......@@ -248,7 +256,7 @@ py_gcompris_animcanvas_swapanim(PyObject *self, PyObject *args)
py_GcomprisAnimation *old_anim = (py_GcomprisAnimation*)s->anim;
GcomprisAnimCanvasItem *item = s->item;
if(!item) THROW_INACTIVE_ANIMATION;
if(!item) THROW_INACTIVE_ANIMATION;
if(!PyArg_ParseTuple(args, "O:AnimCanvas_swapAnim", (PyObject**)&new_anim))
return NULL;
......@@ -282,7 +290,7 @@ py_gcompris_animcanvas_destroy(PyObject *self, PyObject *args)
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC
python_gcompris_anim_module_init(void)
python_gcompris_anim_module_init(void)
{
PyObject* m;
......
......@@ -208,13 +208,13 @@ pythonboard_init (GcomprisBoard *agcomprisBoard){
board->board_dir,
properties->package_python_plugin_dir);
if (strcmp(board->board_dir, properties->package_python_plugin_dir)!=0){
if (strcmp(board->board_dir, properties->package_python_plugin_dir)!=0){
boarddir = g_strdup_printf("sys.path.append('%s/')", board->board_dir);
PyRun_SimpleString(boarddir);
g_free(boarddir);
}
/* Insert the board module into the python's interpreter */
python_board_module = PyImport_ImportModuleEx(board_file_name,
globals,
......@@ -224,13 +224,13 @@ pythonboard_init (GcomprisBoard *agcomprisBoard){
if(python_board_module!=NULL){
/* Get the module dictionnary */
module_dict = PyModule_GetDict(python_board_module);
/* Get the python board class */
py_boardclass = PyDict_GetItemString(module_dict, boardclass);
if (PyObject_HasAttrString( py_boardclass, "config_start")) {
config_boards = g_list_append(config_boards, board);
g_warning("The board '%s' has a configuration entry",
g_warning("The board '%s' has a configuration entry",
board_file_name);
}
}
......@@ -312,9 +312,9 @@ pythonboard_start (GcomprisBoard *agcomprisBoard){
/* Test if board come with -L option */
if (strcmp(gcomprisBoard->board_dir, properties->package_data_dir)!=0){
if (strcmp(gcomprisBoard->board_dir, properties->package_data_dir)!=0){
boarddir = g_strdup_printf("sys.path.append('%s/../python/')", gcomprisBoard->board_dir);
PyRun_SimpleString(boarddir);
g_free(boarddir);
}
......@@ -418,9 +418,9 @@ static gboolean pythonboard_is_our_board (GcomprisBoard *agcomprisBoard){
if (agcomprisBoard!=NULL) {
if (g_ascii_strncasecmp(agcomprisBoard->type, "python", 6)==0) {
bp_board = g_malloc0(sizeof(BoardPlugin));
bp_board->handle = menu_bp.handle;
bp_board->filename = menu_bp.filename;
bp_board->name = menu_bp.name;
......@@ -439,7 +439,7 @@ static gboolean pythonboard_is_our_board (GcomprisBoard *agcomprisBoard){
bp_board->set_level = menu_bp.set_level;
bp_board->config = menu_bp.config;
bp_board->repeat = menu_bp.repeat;
if (g_list_find (config_boards, agcomprisBoard)){
bp_board->config_start = menu_bp.config_start;
bp_board->config_stop = menu_bp.config_stop;
......@@ -451,11 +451,11 @@ static gboolean pythonboard_is_our_board (GcomprisBoard *agcomprisBoard){
/* Set the plugin entry */
agcomprisBoard->plugin = bp_board;
bp_board = NULL;
//g_print("pythonboard: is our board = TRUE\n");
return TRUE;
}
}
......@@ -572,19 +572,19 @@ pythongc_board_config_start (GcomprisBoard *agcomprisBoard,
gchar *userplugindir;
g_assert (agcomprisBoard != NULL);
if(!Py_IsInitialized()){
/* Initialize the python interpreter */
Py_SetProgramName(python_prog_name);
Py_Initialize();
PySys_SetArgv(1, python_args);
init_pygobject();
main_module = PyImport_AddModule("__main__");
globals = PyModule_GetDict(main_module);
if(globals==NULL){
g_print("Cannot get info from the python interpreter. Seems there is a problem with this one.\n");
return;
......@@ -614,7 +614,7 @@ pythongc_board_config_start (GcomprisBoard *agcomprisBoard,
python_gcompris_module_init();
python_run_by_config = TRUE;
}
else {
main_module = PyImport_AddModule("__main__"); /* Borrowed reference */
......@@ -624,7 +624,7 @@ pythongc_board_config_start (GcomprisBoard *agcomprisBoard,
/* Python is now initialized we create some usefull variables */
board_file_name = strchr(agcomprisBoard->type, ':')+1;
boardclass = g_strdup_printf("Gcompris_%s", board_file_name);
/* Insert the board module into the python's interpreter */
python_board_config_module = PyImport_ImportModuleEx(board_file_name,
globals,
......@@ -647,9 +647,9 @@ pythongc_board_config_start (GcomprisBoard *agcomprisBoard,
python_board_config_instance = PyInstance_New(py_boardclass, py_boardclass_args, NULL);
Py_DECREF(py_boardclass_args);
py_function_result = PyObject_CallMethod(python_board_config_instance,
"config_start",
"O",
py_function_result = PyObject_CallMethod(python_board_config_instance,
"config_start",
"O",
gcompris_new_pyGcomprisProfileObject(aProfile));
if( py_function_result != NULL){
......@@ -660,7 +660,7 @@ pythongc_board_config_start (GcomprisBoard *agcomprisBoard,
} else {
PyErr_Print();
}
g_free(boardclass);
}
......
# gcompris - board_list.py
#
#
# Copyright (C) 2005 Yves Combe
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
import gnome
import gnome.canvas
......@@ -47,12 +47,12 @@ class Board_list:
self.frame = frame
self.cur = db_cursor
self.con = db_connect
# ---------------
# Boards Management
# ---------------
# Create the profiles Combo
self.profiles_list = gcompris.admin.get_profiles_list()
......@@ -61,7 +61,7 @@ class Board_list:
self.con.commit()
self.default_profile_id = self.cur.fetchall()[0][0]
self.out_dict = self.get_boards_out_by_profile()
self.difficulty = [1, 6]
......@@ -81,7 +81,7 @@ class Board_list:
box3 = gtk.VBox(False, 8)
box3.show()
top_box.pack_start(box1, False, False, 0)
top_box.pack_start(box2, True, True, 0)
......@@ -100,10 +100,10 @@ class Board_list:
combobox.append_text(profile.name)
if profile.profile_id == self.default_profile_id:
combobox.set_active(self.profiles_list.index(profile))
self.active_profile = self.profiles_list[combobox.get_active()]
print 'Active profile is now', self.active_profile.name
# Create the table
sw = gtk.ScrolledWindow()
sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
......@@ -191,7 +191,7 @@ class Board_list:
if (board.section + '/' + board.name) == name:
return board
return None
def get_board_from_menu(self, menu, list):
if menu.name =='':
section = ''
......@@ -201,9 +201,9 @@ class Board_list:
for board in list:
if board.section == section:
return_list.append([section, board])
return return_list
def add_boards_in_model(self, model, boards_list):
root_menu = '/'
root = self.get_board_by_name(root_menu, boards_list)
......@@ -215,7 +215,7 @@ class Board_list:
menu = list.pop(0)[1]
list_board = self.get_board_from_menu(menu, boards_list)
menu_list = menu_list + list_board
for board_cell in list_board:
if board_cell[<