[f-spot] GtkBuilder transition for tag_selection_dialog



commit bda178d3836854a6316d78d9d8e08cf683c46a3a
Author: Eric Faehnrich <misterfright gmail com>
Date:   Fri Jul 30 20:56:38 2010 -0400

    GtkBuilder transition for tag_selection_dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620838

 src/Makefile.am                     |    1 +
 src/UI.Dialog/TagSelectionDialog.cs |   10 ++--
 src/f-spot.glade                    |   61 +---------------------------
 src/ui/tag_selection_dialog.ui      |   78 +++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 65 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 8540aa1..13c286a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -204,6 +204,7 @@ RESOURCES = \
 	ui/single_view.ui \
 	ui/version_name_dialog.ui \
 	ui/viewer_preferences.ui \
+	ui/tag_selection_dialog.ui \
 	UI.Dialog/ui/AdjustTimeDialog.ui \
 	UI.Dialog/ui/DateRangeDialog.ui \
 	UI.Dialog/ui/EditTagDialog.ui \
diff --git a/src/UI.Dialog/TagSelectionDialog.cs b/src/UI.Dialog/TagSelectionDialog.cs
index 77fb097..28969bc 100644
--- a/src/UI.Dialog/TagSelectionDialog.cs
+++ b/src/UI.Dialog/TagSelectionDialog.cs
@@ -4,13 +4,13 @@ using Gtk;
 using Glade;
 
 namespace FSpot.UI.Dialog {
-	public class TagSelectionDialog : GladeDialog 
+	public class TagSelectionDialog : BuilderDialog
 	{
-		[Widget] Gtk.ScrolledWindow tag_selection_scrolled;
+		[GtkBeans.Builder.Object] Gtk.ScrolledWindow tag_selection_scrolled;
 		
 		TagSelectionWidget tag_selection_widget;
 		
-		public TagSelectionDialog (TagStore tags) : base ("tag_selection_dialog")
+		public TagSelectionDialog (TagStore tags) : base ("tag_selection_dialog.ui", "tag_selection_dialog")
 		{
 			tag_selection_widget = new TagSelectionWidget (tags);
 			tag_selection_scrolled.Add (tag_selection_widget);
@@ -19,7 +19,7 @@ namespace FSpot.UI.Dialog {
 		
 		public Tag[] Run ()
 		{
-			int response = this.Dialog.Run ();
+			int response = base.Run ();
 			if ((ResponseType) response == ResponseType.Ok)
 				return tag_selection_widget.TagHighlight;
 			
@@ -28,7 +28,7 @@ namespace FSpot.UI.Dialog {
 		
 		public void Hide ()
 		{
-			this.Dialog.Hide ();
+			base.Hide ();
 		}
 	}
 }
diff --git a/src/f-spot.glade b/src/f-spot.glade
index f954d21..4cddb77 100644
--- a/src/f-spot.glade
+++ b/src/f-spot.glade
@@ -124,66 +124,7 @@
       </widget>
     </child>
   </widget>
-  <widget class="GtkDialog" id="tag_selection_dialog">
-    <property name="width_request">300</property>
-    <property name="height_request">300</property>
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Select a Tag...</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="selection_vbox">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkScrolledWindow" id="tag_selection_scrolled">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-            <property name="shadow_type">GTK_SHADOW_IN</property>
-            <child>
-              <placeholder/>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area9">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="cancel_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</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="ok_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</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="GtkWindow" id="color_editor_prefs_window">
   <property name="title" translatable="yes"></property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
diff --git a/src/ui/tag_selection_dialog.ui b/src/ui/tag_selection_dialog.ui
new file mode 100644
index 0000000..2332f3c
--- /dev/null
+++ b/src/ui/tag_selection_dialog.ui
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="tag_selection_dialog">
+    <property name="width_request">300</property>
+    <property name="height_request">300</property>
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Select a Tag...</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="selection_vbox">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkScrolledWindow" id="tag_selection_scrolled">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">automatic</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area9">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <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="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="ok_button">
+                <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="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">cancel_button</action-widget>
+      <action-widget response="-5">ok_button</action-widget>
+    </action-widgets>
+  </object>
+</interface>



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