[SCM] Installer for game data files branch, gui, updated. 9092133f0b2589fd66ef16e6348f2c3989f9aa4c

Jon Dowland jmtd at debian.org
Fri Sep 25 17:28:42 UTC 2009


The following commit has been merged in the gui branch:
commit ec5c16238369b145921b4c726fc4691a862fdba1
Author: Jon Dowland <jmtd at debian.org>
Date:   Thu Sep 24 17:35:03 2009 +0100

    don't embed a filechooser dialogue

diff --git a/gdp.glade b/gdp.glade
index 51382cb..155d8a1 100644
--- a/gdp.glade
+++ b/gdp.glade
@@ -14,6 +14,9 @@
       <placeholder/>
     </child>
     <child>
+      <placeholder/>
+    </child>
+    <child>
       <object class="GtkVBox" id="vbox1">
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
@@ -52,38 +55,6 @@
       </packing>
     </child>
   </object>
-  <object class="GtkFileChooserDialog" id="filechooserdialog1">
-    <property name="border_width">5</property>
-    <property name="type_hint">normal</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <placeholder/>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
   <object class="GtkWindow" id="placeholder_filechooser_window">
     <child>
       <object class="GtkVBox" id="vbox2">
@@ -102,7 +73,7 @@
           <object class="GtkHBox" id="hbox1">
             <property name="visible">True</property>
             <child>
-              <object class="GtkEntry" id="entry1">
+              <object class="GtkEntry" id="choose_file_entry">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">&#x25CF;</property>
@@ -112,7 +83,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button1">
+              <object class="GtkButton" id="choose_file_button">
                 <property name="label" translatable="yes">Choose file...</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
diff --git a/gdp.py b/gdp.py
index b6324ba..52a635b 100755
--- a/gdp.py
+++ b/gdp.py
@@ -60,7 +60,17 @@ class View:
 		print "there are %d children" % len(children)
 		w.remove(children[0])
 		self.window.append_page(children[0])
-		print "zomg"
+		self.builder.get_object("choose_file_button").connect("clicked", 
+			self.handle_file_button)
+
+	def handle_file_button(self,button):
+		chooser = gtk.FileChooserDialog(title="Select doom2.wad", 
+			action=gtk.FILE_CHOOSER_ACTION_OPEN,
+			buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,
+				gtk.RESPONSE_OK))
+		chooser.run()
+		filename = chooser.get_filename()
+		chooser.destroy()
 
 	def supported_game_added(self,game):
 		liststor = self.builder.get_object("liststore1")

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list