[PATCH] Let Gtk pick the size for the isoChooserDialog (#973376)

David Shea dshea at redhat.com
Thu Feb 27 21:07:41 UTC 2014


If it's not big enough now, it's not our problem.

Also converted the dialog from a GtkDialog containing a
GtkFileChooserWidget into just a GtkFileChooserDialog, which is
basically the same thing but one less layer of objects that we have to
define for ourselves.

Unrelated things that glade changed but that seem ok enough to keep: a
<style> element was moved from the middle of an <object> element to the
end of it, and two instances of "icon-size" were changed to "icon_size".
---
 pyanaconda/ui/gui/spokes/source.glade | 32 +++++++++++---------------------
 pyanaconda/ui/gui/spokes/source.py    |  2 +-
 2 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index 25b8ff3..033f06c 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Thu Jan 16 14:59:10 2014 -->
+<!-- Generated with glade 3.16.1 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <!-- interface-requires AnacondaWidgets 1.0 -->
   <object class="GtkFileFilter" id="isoFilter">
     <patterns>
       <pattern>*.iso</pattern>
     </patterns>
   </object>
-  <object class="GtkDialog" id="isoChooserDialog">
-    <property name="width_request">550</property>
-    <property name="height_request">320</property>
+  <object class="GtkFileChooserDialog" id="isoChooserDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="type_hint">dialog</property>
     <property name="decorated">False</property>
+    <property name="create_folders">False</property>
+    <property name="filter">isoFilter</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox2">
         <property name="can_focus">False</property>
@@ -61,17 +61,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkFileChooserWidget" id="isoChooser">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="create_folders">False</property>
-            <property name="filter">isoFilter</property>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
+          <placeholder/>
         </child>
       </object>
     </child>
@@ -1040,9 +1030,6 @@
                         <property name="can_focus">False</property>
                         <property name="toolbar_style">icons</property>
                         <property name="show_arrow">False</property>
-                        <style>
-                          <class name="inline-toolbar"/>
-                        </style>
                         <property name="icon_size">1</property>
                         <child>
                           <object class="GtkToolButton" id="addButton">
@@ -1101,6 +1088,9 @@
                             <property name="homogeneous">True</property>
                           </packing>
                         </child>
+                        <style>
+                          <class name="inline-toolbar"/>
+                        </style>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -1306,7 +1296,7 @@
                                 <property name="can_focus">False</property>
                                 <property name="ypad">3</property>
                                 <property name="stock">gtk-dialog-warning</property>
-                                <property name="icon-size">2</property>
+                                <property name="icon_size">2</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -1381,7 +1371,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="stock">gtk-dialog-warning</property>
-                            <property name="icon-size">2</property>
+                            <property name="icon_size">2</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 3b724dd..a3445d6 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -233,7 +233,7 @@ class IsoChooser(GUIObject):
 
     def __init__(self, data):
         GUIObject.__init__(self, data)
-        self._chooser = self.builder.get_object("isoChooser")
+        self._chooser = self.builder.get_object("isoChooserDialog")
 
     # pylint: disable-msg=W0221
     def refresh(self, currentFile=""):
-- 
1.8.5.3



More information about the anaconda-patches mailing list