Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-03-21 15:33:44 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-03-21 15:33:44 (GMT)
commit31cfcc25505d917c0e23b4f9b328b4970343a989 (patch)
tree90e4290a0956288eab87ec4dea2481e4eaf65d04
parent472060ead77910ac873fc349d9b2cf5f04e088a2 (diff)
Show the instruments description in the iconview
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--activity.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/activity.py b/activity.py
index 8e2da31..9416d77 100644
--- a/activity.py
+++ b/activity.py
@@ -163,10 +163,10 @@ class SimplePianoActivity(activity.Activity):
-1, Gdk.Screen.height() - piano_height - style.GRID_CELL_SIZE)
def load_instruments(self):
- self._instruments_store = Gtk.ListStore(str, GdkPixbuf.Pixbuf)
+ self._instruments_store = Gtk.ListStore(str, GdkPixbuf.Pixbuf, str)
self._instruments_store.set_sort_column_id(0, Gtk.SortType.ASCENDING)
self.instruments_iconview = Gtk.IconView(self._instruments_store)
- self.instruments_iconview.set_text_column(0)
+ self.instruments_iconview.set_text_column(2)
self.instruments_iconview.set_pixbuf_column(1)
# load the images
@@ -176,12 +176,15 @@ class SimplePianoActivity(activity.Activity):
for file_name in os.listdir(images_path):
image_file_name = os.path.join(images_path, file_name)
logging.error('Adding %s', image_file_name)
- instrument_name = image_file_name[image_file_name.rfind('/'):]
pxb = GdkPixbuf.Pixbuf.new_from_file_at_size(
image_file_name, 75, 75)
+ #instrument_name = image_file_name[image_file_name.rfind('/'):]
instrument_name = image_file_name[image_file_name.rfind('/') + 1:]
instrument_name = instrument_name[:instrument_name.find('.')]
- self._instruments_store.append([instrument_name, pxb])
+ instrument_desc = \
+ self.instrumentDB.instNamed[instrument_name].nameTooltip
+ self._instruments_store.append([instrument_name, pxb,
+ instrument_desc])
self.instruments_iconview.connect(
'selection-changed', self.__instrument_iconview_activated_cb)