[f-spot] Converted viewer_preferences from LibGlade to GtkBuilder.



commit 88716123a67153e79c47cdd64dc560fbfe231b50
Author: Trevor Buchanan <buchananta charter net>
Date:   Tue Jun 22 13:39:34 2010 -0500

    Converted viewer_preferences from LibGlade to GtkBuilder.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620845

 src/Makefile.am              |    1 +
 src/SingleView.cs            |   22 ++--
 src/f-spot.glade             |  234 ---------------------------------------
 src/ui/viewer_preferences.ui |  248 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 260 insertions(+), 245 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 94e5eac..c2a909b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -219,6 +219,7 @@ RESOURCES = \
 	f-spot.glade \
 	ui/main_window.ui \
 	ui/version_name_dialog.ui \
+	ui/viewer_preferences.ui \
 	ui/import.ui \
 	ui/mail_dialog.ui \
 	UI.Dialog/ui/AdjustTimeDialog.ui \
diff --git a/src/SingleView.cs b/src/SingleView.cs
index 5af506b..9a6aa9d 100644
--- a/src/SingleView.cs
+++ b/src/SingleView.cs
@@ -572,20 +572,20 @@ namespace FSpot {
 			}
 		}
 
-		public class PreferenceDialog : GladeDialog {
-			[Glade.Widget] private CheckButton interpolation_check;
-			[Glade.Widget] private ColorButton color_button;
-			[Glade.Widget] private RadioButton as_background_radio;
-			[Glade.Widget] private RadioButton as_check_radio;
-			[Glade.Widget] private RadioButton as_color_radio;
-
-			public PreferenceDialog () : base ("viewer_preferences")
+		public class PreferenceDialog : BuilderDialog {
+			[GtkBeans.Builder.Object] private CheckButton interpolation_check;
+			[GtkBeans.Builder.Object] private ColorButton color_button;
+			[GtkBeans.Builder.Object] private RadioButton as_background_radio;
+			[GtkBeans.Builder.Object] private RadioButton as_check_radio;
+			[GtkBeans.Builder.Object] private RadioButton as_color_radio;
+
+			public PreferenceDialog () : base ("viewer_preferences.ui", "viewer_preferences")
 			{
 				this.LoadPreference (Preferences.VIEWER_INTERPOLATION);
 				this.LoadPreference (Preferences.VIEWER_TRANSPARENCY);
 				this.LoadPreference (Preferences.VIEWER_TRANS_COLOR);
 				Preferences.SettingChanged += OnPreferencesChanged;
-				this.Dialog.Destroyed += HandleDestroyed;
+				this.Destroyed += HandleDestroyed;
 			}
 
 			void InterpolationToggled (object sender, System.EventArgs args)
@@ -618,7 +618,7 @@ namespace FSpot {
 				if (prefs == null)
 					prefs = new PreferenceDialog ();
 				
-				prefs.Dialog.Present ();
+				prefs.Present ();
 			}
 
 			void OnPreferencesChanged (object sender, NotifyEventArgs args)
@@ -628,7 +628,7 @@ namespace FSpot {
 
 			void HandleClose (object sender, EventArgs args)
 			{
-				this.Dialog.Destroy ();
+				this.Destroy ();
 			}
 
 			private void HandleDestroyed (object sender, EventArgs args)
diff --git a/src/f-spot.glade b/src/f-spot.glade
index bfead47..3c50251 100644
--- a/src/f-spot.glade
+++ b/src/f-spot.glade
@@ -1395,240 +1395,6 @@ between</property>
       </widget>
     </child>
   </widget>
-  <widget class="GtkDialog" id="viewer_preferences">
-    <property name="visible">True</property>
-    <property name="title" translatable="yes">Preferences</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="vbox85">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkVBox" id="vbox86">
-            <property name="visible">True</property>
-            <child>
-              <widget class="GtkFrame" id="frame49">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment66">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkVBox" id="vbox87">
-                        <property name="visible">True</property>
-                        <child>
-                          <widget class="GtkCheckButton" id="interpolation_check">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">_Interpolate image on zoom</property>
-                            <property name="use_underline">True</property>
-                            <property name="response_id">0</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="InterpolationToggled"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label218">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;Enable this to allow interpolation on zoomed images. You shouldn't disable this for viewing photos, but disabling the interpolation could be usefull in icon design.&lt;/i&gt;&lt;/small&gt;</property>
-                            <property name="use_markup">True</property>
-                            <property name="wrap">True</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="padding">12</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label219">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Image Interpolation&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <widget class="GtkFrame" id="frame50">
-                <property name="visible">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">GTK_SHADOW_NONE</property>
-                <child>
-                  <widget class="GtkAlignment" id="alignment67">
-                    <property name="visible">True</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <widget class="GtkVBox" id="vbox88">
-                        <property name="visible">True</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="as_background_radio">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">As _background</property>
-                            <property name="use_underline">True</property>
-                            <property name="response_id">0</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="HandleTransparencyToggled"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkRadioButton" id="as_check_radio">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">As check _pattern</property>
-                            <property name="use_underline">True</property>
-                            <property name="response_id">0</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">as_background_radio</property>
-                            <signal name="toggled" handler="HandleTransparencyToggled"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkHBox" id="hbox91">
-                            <property name="visible">True</property>
-                            <child>
-                              <widget class="GtkRadioButton" id="as_color_radio">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="label" translatable="yes">As _custom color: </property>
-                                <property name="use_underline">True</property>
-                                <property name="response_id">0</property>
-                                <property name="draw_indicator">True</property>
-                                <property name="group">as_background_radio</property>
-                                <signal name="toggled" handler="HandleTransparencyToggled"/>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkColorButton" id="color_button">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="response_id">0</property>
-                                <signal name="color_set" handler="HandleTransparentColorSet"/>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label220">
-                            <property name="visible">True</property>
-                            <property name="xalign">0</property>
-                            <property name="xpad">12</property>
-                            <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;You can choose how to display transparent parts in images. This option has no effect on photos, but setting this as check pattern or custom color could be usefull when viewing icons or other artworks with transparent parts.&lt;/i&gt;&lt;/small&gt;</property>
-                            <property name="use_markup">True</property>
-                            <property name="wrap">True</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="padding">12</property>
-                            <property name="position">3</property>
-                          </packing>
-                        </child>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label221">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Transparent Parts&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="position">3</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="hbuttonbox13">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="button28">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-close</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-7</property>
-                <signal name="clicked" handler="HandleClose"/>
-              </widget>
-            </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>
diff --git a/src/ui/viewer_preferences.ui b/src/ui/viewer_preferences.ui
new file mode 100644
index 0000000..3f21d3c
--- /dev/null
+++ b/src/ui/viewer_preferences.ui
@@ -0,0 +1,248 @@
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="viewer_preferences">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Preferences</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="vbox85">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkVBox" id="vbox86">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkFrame" id="frame49">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment66">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox87">
+                        <property name="visible">True</property>
+                        <child>
+                          <object class="GtkCheckButton" id="interpolation_check">
+                            <property name="label" translatable="yes">_Interpolate image on zoom</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <signal name="toggled" handler="InterpolationToggled"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label218">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">12</property>
+                            <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;Enable this to allow interpolation on zoomed images. You shouldn't disable this for viewing photos, but disabling the interpolation could be usefull in icon design.&lt;/i&gt;&lt;/small&gt;</property>
+                            <property name="use_markup">True</property>
+                            <property name="wrap">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">12</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label219">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Image Interpolation&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame50">
+                <property name="visible">True</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment67">
+                    <property name="visible">True</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox88">
+                        <property name="visible">True</property>
+                        <child>
+                          <object class="GtkRadioButton" id="as_background_radio">
+                            <property name="label" translatable="yes">As _background</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <signal name="toggled" handler="HandleTransparencyToggled"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="as_check_radio">
+                            <property name="label" translatable="yes">As check _pattern</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">as_background_radio</property>
+                            <signal name="toggled" handler="HandleTransparencyToggled"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkHBox" id="hbox91">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkRadioButton" id="as_color_radio">
+                                <property name="label" translatable="yes">As _custom color: </property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">as_background_radio</property>
+                                <signal name="toggled" handler="HandleTransparencyToggled"/>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkColorButton" id="color_button">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <signal name="color_set" handler="HandleTransparentColorSet"/>
+                              </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="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label220">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="xpad">12</property>
+                            <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;You can choose how to display transparent parts in images. This option has no effect on photos, but setting this as check pattern or custom color could be usefull when viewing icons or other artworks with transparent parts.&lt;/i&gt;&lt;/small&gt;</property>
+                            <property name="use_markup">True</property>
+                            <property name="wrap">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">12</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label221">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Transparent Parts&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="hbuttonbox13">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button28">
+                <property name="label">gtk-close</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>
+                <signal name="clicked" handler="HandleClose"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</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="-7">button28</action-widget>
+    </action-widgets>
+  </object>
+</interface>



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