[f-spot] Migrated LastImportRollFilterDialog to GtkBuilder



commit 8e5dbb945eb07a95f78526d56547c63f6f21ee40
Author: Peter Goetz <peter gtz gmail com>
Date:   Tue Jun 22 00:15:59 2010 +0200

    Migrated LastImportRollFilterDialog to GtkBuilder
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620842

 src/Makefile.am                                |    1 +
 src/UI.Dialog/LastRollDialog.cs                |   22 ++--
 src/UI.Dialog/ui/LastImportRollFilterDialog.ui |  217 ++++++++++++++++++++++++
 src/f-spot.glade                               |  153 -----------------
 4 files changed, 229 insertions(+), 164 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b66e1c1..b51e931 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -230,6 +230,7 @@ RESOURCES = \
 	UI.Dialog/ui/PreferenceDialog.ui \
 	UI.Dialog/ui/RatingFilterDialog.ui \
 	UI.Dialog/ui/CreateTagDialog.ui \
+	UI.Dialog/ui/LastImportRollFilterDialog.ui \
 	UI.Dialog/ui/RepairDialog.ui \
 	FSpot.addin.xml
 
diff --git a/src/UI.Dialog/LastRollDialog.cs b/src/UI.Dialog/LastRollDialog.cs
index 1e83c6c..a187c30 100644
--- a/src/UI.Dialog/LastRollDialog.cs
+++ b/src/UI.Dialog/LastRollDialog.cs
@@ -15,20 +15,20 @@ using FSpot.Query;
 using FSpot.UI.Dialog;
 
 namespace FSpot.UI.Dialog {
-	public class LastRolls : GladeDialog {
+	public class LastRolls : BuilderDialog {
 		FSpot.PhotoQuery query;
 		RollStore rollstore;
 		Gtk.Window parent_window;
 		
 		Roll [] rolls;
 
-		[Glade.Widget] private ComboBox combo_filter; // at, after, or between
-		[Glade.Widget] private ComboBox combo_roll_1;
-		[Glade.Widget] private ComboBox combo_roll_2;
-		[Glade.Widget] private Label    and_label; // and label between two comboboxes.
-		[Glade.Widget] private Label    photos_in_selected_rolls; 
+		[GtkBeans.Builder.Object] private ComboBox combo_filter; // at, after, or between
+		[GtkBeans.Builder.Object] private ComboBox combo_roll_1;
+		[GtkBeans.Builder.Object] private ComboBox combo_roll_2;
+		[GtkBeans.Builder.Object] private Label    and_label; // and label between two comboboxes.
+		[GtkBeans.Builder.Object] private Label    photos_in_selected_rolls;
 		
-		public LastRolls (FSpot.PhotoQuery query, RollStore rollstore, Gtk.Window parent_window) : base ("last_import_rolls_filter") 
+		public LastRolls (FSpot.PhotoQuery query, RollStore rollstore, Gtk.Window parent_window) : base ("LastImportRollFilterDialog.ui", "last_import_rolls_filter")
 		{
 			this.query = query;
 			this.rollstore = rollstore;
@@ -41,9 +41,9 @@ namespace FSpot.UI.Dialog {
 			combo_roll_1.Active = 0;
 			combo_roll_2.Active = 0;
 			
-			Dialog.DefaultResponse = ResponseType.Ok;
-			Dialog.Response += HandleResponse;
-			Dialog.Show ();
+			DefaultResponse = ResponseType.Ok;
+			Response += HandleResponse;
+			Show ();
 		}
 
 		[GLib.ConnectBefore]
@@ -55,7 +55,7 @@ namespace FSpot.UI.Dialog {
 				if (selected_rolls != null && selected_rolls.Length > 0 )
 					query.RollSet = new RollSet (selected_rolls);
 			}
-			Dialog.Destroy ();
+			Destroy ();
 		}
 		
 		void HandleComboFilterChanged (object o, EventArgs args)
diff --git a/src/UI.Dialog/ui/LastImportRollFilterDialog.ui b/src/UI.Dialog/ui/LastImportRollFilterDialog.ui
new file mode 100644
index 0000000..c7d49ea
--- /dev/null
+++ b/src/UI.Dialog/ui/LastImportRollFilterDialog.ui
@@ -0,0 +1,217 @@
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="last_import_rolls_filter">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Filter on selected rolls</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkVBox" id="vbox1">
+            <property name="width_request">450</property>
+            <property name="visible">True</property>
+            <property name="spacing">5</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;View all pictures imported&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="spacing">4</property>
+                <child>
+                  <object class="GtkComboBox" id="combo_filter">
+                    <property name="visible">True</property>
+                    <property name="model">liststore3</property>
+                    <signal name="changed" handler="HandleComboFilterChanged"/>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="combo_roll_1">
+                    <property name="visible">True</property>
+                    <property name="model">liststore2</property>
+                    <signal name="changed" handler="HandleComboRollChanged"/>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="and_label">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">and</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="combo_roll_2">
+                    <property name="visible">True</property>
+                    <property name="model">liststore1</property>
+                    <signal name="changed" handler="HandleComboRollChanged"/>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox85">
+                <property name="visible">True</property>
+                <child>
+                  <object class="GtkLabel" id="label210">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Number of photos in selected rolls:</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="photos_in_selected_rolls">
+                    <property name="visible">True</property>
+                    <property name="xpad">3</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="padding">5</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="padding">3</property>
+            <property name="position">2</property>
+          </packing>
+        </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>
+              <object class="GtkButton" id="cancelbutton1">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="tooltip_text" translatable="yes">Show all photos.</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="okbutton1">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="tooltip_text" translatable="yes">Display only those photos that were imported in specified Rolls.</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">cancelbutton1</action-widget>
+      <action-widget response="-5">okbutton1</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkListStore" id="liststore1">
+    <columns>
+      <!-- column-name item text -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore2">
+    <columns>
+      <!-- column-name item text -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore3">
+    <columns>
+      <!-- column-name item text -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">at</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">after</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">between</col>
+      </row>
+    </data>
+  </object>
+</interface>
diff --git a/src/f-spot.glade b/src/f-spot.glade
index b8b9154..f954d21 100644
--- a/src/f-spot.glade
+++ b/src/f-spot.glade
@@ -820,159 +820,6 @@
     </widget>
   </child>
 </widget>
-
-  <widget class="GtkDialog" id="last_import_rolls_filter">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Filter on selected rolls</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkVBox" id="vbox1">
-            <property name="width_request">450</property>
-            <property name="visible">True</property>
-            <property name="spacing">5</property>
-            <child>
-              <widget class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">&lt;b&gt;View all pictures imported&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="hbox1">
-                <property name="visible">True</property>
-                <property name="spacing">4</property>
-                <child>
-                  <widget class="GtkComboBox" id="combo_filter">
-                    <property name="visible">True</property>
-                    <property name="items" translatable="yes" comments="at, or after a date, or between dates">at
-after
-between</property>
-                    <signal name="changed" handler="HandleComboFilterChanged"/>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkComboBox" id="combo_roll_1">
-                    <property name="visible">True</property>
-                    <property name="items" translatable="yes"></property>
-                    <signal name="changed" handler="HandleComboRollChanged"/>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="and_label">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">and</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkComboBox" id="combo_roll_2">
-                    <property name="visible">True</property>
-                    <property name="items" translatable="yes"></property>
-                    <signal name="changed" handler="HandleComboRollChanged"/>
-                  </widget>
-                  <packing>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="hbox85">
-                <property name="visible">True</property>
-                <child>
-                  <widget class="GtkLabel" id="label210">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Number of photos in selected rolls:</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="photos_in_selected_rolls">
-                    <property name="visible">True</property>
-                    <property name="xpad">3</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="padding">5</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="padding">3</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="cancelbutton1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="tooltip" translatable="yes">Show all photos.</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-6</property>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkButton" id="okbutton1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="tooltip" translatable="yes">Display only those photos that were imported in specified Rolls.</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-5</property>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
   <widget class="GtkDialog" id="customratio_dialog">
     <property name="border_width">5</property>
     <property name="has_separator">False</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]