[transmageddon] Make file selection code work when there is no DVD in	the system, Code can probably be trimmed down
- From: Christian Fredrik Kalager Schaller <uraeus src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [transmageddon] Make file selection code work when there is no DVD in	the system, Code can probably be trimmed down
 
- Date: Wed, 23 Oct 2013 08:52:03 +0000 (UTC)
 
commit 3926420b39e4c60186deff5dcfa0f8d46aafcf6c
Author: Christian Fredrik Kalager Schaller <uraeus linuxrising org>
Date:   Wed Oct 23 10:51:14 2013 +0200
    Make file selection code work when there is no DVD in the system,
    Code can probably be trimmed down a lot.
 src/transmageddon.py |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/src/transmageddon.py b/src/transmageddon.py
index cc87ef7..92826a9 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -1354,7 +1354,32 @@ class TransmageddonUI(Gtk.ApplicationWindow):
            self.combo.set_active(0)
            self.combo.connect("changed", self.on_source_changed)
        else:
-           self.combo = Gtk.FileChooserButton(_("(None)"))
+           theme = Gtk.IconTheme.get_default()
+           size= Gtk.icon_size_lookup(Gtk.IconSize.MENU)[1]
+           cdrom=theme.load_icon(Gtk.STOCK_CDROM, size, 0)
+           fileopen=theme.load_icon(Gtk.STOCK_OPEN, size, 0)
+
+
+           liststore = Gtk.ListStore(GdkPixbuf.Pixbuf, GObject.TYPE_STRING, GObject.TYPE_STRING, 
GObject.TYPE_INT)
+           liststore.append([None, "", "", 0])
+           liststore.append([fileopen, "Choose File...", "", 1])
+           # liststore.append([cdrom, self.dvdname, self.dvddevice,  2])
+
+           self.combo = Gtk.ComboBox(model=liststore)
+
+           renderer_text = Gtk.CellRendererText()
+           renderer_pixbuf = Gtk.CellRendererPixbuf()
+
+           self.combo.pack_start(renderer_pixbuf, False)
+           self.combo.pack_start(renderer_text, True)
+           self.combo.add_attribute(renderer_pixbuf, 'pixbuf', 0)
+           self.combo.add_attribute(renderer_text, 'text', 1)
+                
+           self.combo.set_active(0)
+           self.combo.connect("changed", self.on_source_changed)
+
+           #self.combo = Gtk.FileChooserButton(_("(None)"))
+
           
        #if not self.source_hbox:
        self.source_hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]