From b9bc61e2ddd3ec81c244bb2a428934c4822e62c9 Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Wed, 24 Jun 2009 23:35:17 +0300 Subject: [PATCH] Add button and image to choose album art --- src/edit_panel.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/edit_panel.py b/src/edit_panel.py index d6735a2..6117bc3 100755 --- a/src/edit_panel.py +++ b/src/edit_panel.py @@ -123,7 +123,7 @@ class MussorgskyEditPanel (hildon.StackableWindow): filename_row.pack_start (play_button, expand=False, fill=False, padding=12) view_vbox.pack_start (filename_row, expand=True); - central_panel = gtk.VBox () + central_panel = gtk.HBox () table = gtk.Table (3, 2, False) table.set_col_spacings (12) @@ -156,6 +156,14 @@ class MussorgskyEditPanel (hildon.StackableWindow): self.album_entry = gtk.Entry() table.attach (self.album_entry, 1, 2, 2, 3) + # Album art space + album_button = gtk.Button () + self.album_art = gtk.Image () + self.album_art.set_size_request (124, 124) + album_button.add (self.album_art) + album_button.connect ("clicked", self.clicked_album_art) + central_panel.pack_start (album_button, expand=False, fill=False, padding=24) + # Buttons row button_box = gtk.HButtonBox () button_box.set_layout (gtk.BUTTONBOX_END) @@ -184,6 +192,8 @@ class MussorgskyEditPanel (hildon.StackableWindow): self.title_entry.set_text (song[TITLE_KEY]) self.album_entry.set_text (song[ALBUM_KEY]) + self.album_art.set_from_file ("/home/ivan/cover-sample.jpeg") + if (not song[MIME_KEY] in self.writer.get_supported_mimes ()): print "show notification" self.banner = hildon.Banner () @@ -197,6 +207,9 @@ class MussorgskyEditPanel (hildon.StackableWindow): song = self.songs_list [self.song_counter] self.player.play ("file://" + song[FILE_URI]) + def clicked_album_art (self, widget): + print "implement me, please" + def album_selection_cb (self, widget): if (not self.albums_selector): self.albums_selector = hildon.hildon_touch_selector_new_text () -- 1.7.9.5