Commit b656de92 authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

Added 3 new background musics (classical music).

	Implemented the management of the default profile.
parent 20ff98d3
2005-07-21 Bruno coudoin <bruno.coudoin@free.fr>
Added 3 new background musics (classical music).
Implemented the management of the default profile.
* boards/music/background/COPYRIGHT: Added public domain released classical musics
from T. Willhoite found on http://www.archive.org
* boards/music/background/Mozart__WA_-_String_Quartet_No.2_in_D_Mvmt_3.ogg
* boards/music/background/Brahms__Johannes_-_String_Quartet_C_minor__Op_51_mvmt_4.ogg
* boards/music/background/Bach_JS__Brandenburg_Concert_No_2_in_F_Major_BWV_1047_mvmt1.ogg
* src/boards/python/admin/board_list.py:
* src/boards/python/admin/class_edit.py:
* src/boards/python/admin/class_list.py:
* src/boards/python/admin/group_edit.py:
* src/boards/python/admin/group_list.py:
* src/boards/python/admin/profile_edit.py:
* src/boards/python/admin/profile_list.py:
* src/boards/python/admin/user_list.py:
2005-07-21 Bruno coudoin <bruno.coudoin@free.fr>
Completed profile_edit. It is now possible to select groups in profiles
......
The musics BarDasImagens.ogg bontemp1.ogg glockenschmoutz.ogg vaudeville.ogg
Are from Rico Da Halvarez http://info.vnatrc.net/
This tune was made from a public domain music score found at Project Gutenberg,
Music site: http://gutenberg.net/music/ and http://www.archive.org.
The "performance" is by my computer and is released into the public domain. T. Willhoite
- Mozart__WA_-_String_Quartet_No.2_in_D_Mvmt_3.ogg
- Brahms__Johannes_-_String_Quartet_C_minor__Op_51_mvmt_4.ogg
- Bach_JS__Brandenburg_Concert_No_2_in_F_Major_BWV_1047_mvmt1.ogg
......@@ -177,9 +177,18 @@ class Board_list:
for board_cell in menu_list:
self.board_dict['%s/%s' % (board_cell[1].section,board_cell[1].name)] = board_cell[1]
if board_cell[0] == None:
row_dict[''] = model.append(None, [self.pixbuf_at_height('gcompris/misc/tuxplane.png', height), _('Main menu') + '\n' + _('/'), not board_cell[1].board_id in self.out_dict[self.active_profile.profile_id], '%s/%s' % (board_cell[1].section,board_cell[1].name)])
row_dict[''] = \
model.append(None,
[self.pixbuf_at_height('gcompris/misc/tuxplane.png', height),
_('Main menu') + '\n' + _('/'),
not board_cell[1].board_id in self.out_dict[self.active_profile.profile_id],
'%s/%s' % (board_cell[1].section,board_cell[1].name)])
else:
row_dict['%s/%s' % (board_cell[1].section,board_cell[1].name)] = model.append(row_dict[board_cell[1].section], [self.pixbuf_at_height(board_cell[1].icon_name, height), _(board_cell[1].title) + '\n' + '%s/%s' % (board_cell[1].section,board_cell[1].name), not board_cell[1].board_id in self.out_dict[self.active_profile.profile_id], '%s/%s' % (board_cell[1].section,board_cell[1].name)])
row_dict['%s/%s' % (board_cell[1].section,board_cell[1].name)] = \
model.append(row_dict[board_cell[1].section],
[self.pixbuf_at_height(board_cell[1].icon_name, height),
_(board_cell[1].title) + '\n' + '%s/%s' % (board_cell[1].section,board_cell[1].name),
not board_cell[1].board_id in self.out_dict[self.active_profile.profile_id], '%s/%s' % (board_cell[1].section,board_cell[1].name)])
def pixbuf_at_height(self,file, height):
pixbuf = gcompris.utils.load_pixmap(file)
......
......@@ -110,7 +110,7 @@ class ClassEdit(gtk.Window):
button_add.connect("clicked", self.add_user, treeview)
vbox2.pack_start(button_add, False, False, 0)
button_delete = gtk.Button(stock='gtk-delete')
button_delete = gtk.Button(stock='gtk-remove')
vbox2.pack_start(button_delete, False, False, 0)
# Right List
......
......@@ -111,16 +111,16 @@ class Class_list:
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-delete')
button.connect("clicked", self.on_remove_class_clicked, treeview_class)
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-edit')
button.connect("clicked", self.on_edit_class_clicked, treeview_class)
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-remove')
button.connect("clicked", self.on_remove_class_clicked, treeview_class)
right_box.pack_start(button, False, False, 0)
button.show()
# User list for the group
user_hbox = gtk.HBox(False, 8)
user_hbox.show()
......
......@@ -114,7 +114,7 @@ class GroupEdit(gtk.Window):
vbox2.pack_start(button, False, False, 0)
button.show()
button_delete = gtk.Button(stock='gtk-delete')
button_delete = gtk.Button(stock='gtk-remove')
vbox2.pack_start(button_delete, False, False, 0)
button_delete.show()
......
......@@ -146,13 +146,13 @@ class Group_list:
vbox_button.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-delete')
button.connect("clicked", self.on_remove_group_clicked, treeview_group)
button = gtk.Button(stock='gtk-edit')
button.connect("clicked", self.on_edit_group_clicked, treeview_group)
vbox_button.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-edit')
button.connect("clicked", self.on_edit_group_clicked, treeview_group)
button = gtk.Button(stock='gtk-remove')
button.connect("clicked", self.on_remove_group_clicked, treeview_group)
vbox_button.pack_start(button, False, False, 0)
button.show()
......
......@@ -112,7 +112,7 @@ class ProfileEdit(gtk.Window):
vbox2.pack_start(button, False, False, 0)
button.show()
button_delete = gtk.Button(stock='gtk-delete')
button_delete = gtk.Button(stock='gtk-remove')
vbox2.pack_start(button_delete, False, False, 0)
button_delete.show()
......
......@@ -57,6 +57,12 @@ class Profile_list:
# The profile_id to work on
self.current_profile_id = 0
# Get the default profile
self.cur.execute('select * from informations')
self.default_profile_id = self.cur.fetchall()[0][2]
self.default_profile_id_iter = None
self.default_profile_id_description = None
# ---------------
# Profile Management
# ---------------
......@@ -112,13 +118,18 @@ class Profile_list:
vbox_button.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-delete')
button = gtk.Button(stock='gtk-edit')
button.connect("clicked", self.on_edit_profile_clicked, treeview_profile)
vbox_button.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-remove')
button.connect("clicked", self.on_remove_profile_clicked, treeview_profile)
vbox_button.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-edit')
button.connect("clicked", self.on_edit_profile_clicked, treeview_profile)
button = gtk.Button(_("Default"))
button.connect("clicked", self.on_default_profile_clicked, treeview_profile)
vbox_button.pack_start(button, False, False, 0)
button.show()
......@@ -228,7 +239,9 @@ class Profile_list:
COLUMN_DESCRIPTION, aprofile[COLUMN_DESCRIPTION],
COLUMN_PROFILE_EDITABLE, True
)
if self.default_profile_id == aprofile[COLUMN_PROFILEID]:
self.set_default_in_description(iter)
#
def on_add_profile_clicked(self, button, model):
......@@ -310,8 +323,50 @@ class Profile_list:
dialog.destroy()
# Set the default profile in the 'informations' table
def on_default_profile_clicked(self, button, treeview):
selection = treeview.get_selection()
model, iter = selection.get_selected()
if iter:
path = model.get_path(iter)[0]
profile_id = model.get_value(iter, COLUMN_PROFILEID)
# Get the old data (informations is a one line table)
self.cur.execute('select * from informations')
info_data = self.cur.fetchall()[0]
# Save the changes in the base
self.cur.execute('insert or replace into informations (gcompris_version, init_date, profile_id) values (?, ?, ?)',
(info_data[0], info_data[1], profile_id))
self.con.commit()
self.set_default_in_description(iter)
# Write an additional [Default] in the profile description
def set_default_in_description(self, iter):
# set default in description
description = self.profile_model.get_value(iter, COLUMN_DESCRIPTION)
self.profile_model.set (iter,
COLUMN_DESCRIPTION, description + " " + _("[Default]"),
)
# There was a previous default TAG, erase it
if self.default_profile_id_iter:
self.profile_model.set (self.default_profile_id_iter,
COLUMN_DESCRIPTION, self.default_profile_id_description,
)
# Save the default profile iter to erase it's "default" tag if needed
self.default_profile_id_iter = iter
self.default_profile_id_description = description
#
# Called on profile change
#
def profile_changed_cb(self, selection, profile_group):
print "profile_changed_cb"
model, iter = selection.get_selected()
if iter:
......
......@@ -105,16 +105,16 @@ class User_list:
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-delete')
button.connect("clicked", self.on_remove_item_clicked, treeview)
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-open')
button.connect("clicked", self.on_import_cvs_clicked, treeview)
right_box.pack_start(button, False, False, 0)
button.show()
button = gtk.Button(stock='gtk-remove')
button.connect("clicked", self.on_remove_item_clicked, treeview)
right_box.pack_start(button, False, False, 0)
button.show()
# -------------------
# User Management
......
Supports Markdown
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