[f-spot] Port Zip export to GtkBuilder



commit 00e3ae9cbddb087d9006213dc39cd30a704496b0
Author: Paul Lange <palango gmx de>
Date:   Sun Aug 15 14:05:22 2010 +0200

    Port Zip export to GtkBuilder
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626997

 po/POTFILES.in                                     |    2 +-
 .../FSpot.Exporters.Zip/FSpot.Exporters.Zip.csproj |   14 ++-
 .../FSpot.Exporters.Zip/ZipExport.cs               |   16 ++--
 .../Exporters/FSpot.Exporters.Zip/Makefile.am      |    4 +-
 .../Resources/{ZipExport.glade => zip_export.ui}   |  125 +++++++++++--------
 5 files changed, 94 insertions(+), 67 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 12c7da8..1a2f476 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -118,7 +118,7 @@ src/Extensions/Exporters/FSpot.Exporters.Tabblo/FSpot.Exporters.Tabblo/TabbloExp
 [type: gettext/glade]src/Extensions/Exporters/FSpot.Exporters.Tabblo/Resources/ui/TabbloExport.ui
 [type: gettext/glade]src/Extensions/Exporters/FSpot.Exporters.Tabblo/Resources/ui/TrustError.ui
 src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip/ZipExport.cs
-[type: gettext/glade]src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/ZipExport.glade
+[type: gettext/glade]src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/zip_export.ui
 [type: gettext/glade]src/Extensions/Tools/FSpot.Tools.ChangePhotoPath/Resources/ChangePhotoPath.glade
 src/Extensions/Tools/FSpot.Tools.DevelopInUFraw/FSpot.Tools.DevelopInUFraw/DevelopInUFRawBatch.cs
 src/Extensions/Tools/FSpot.Tools.HashJob/FSpot.Tools.HashJob/HashJob.cs
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip.csproj b/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip.csproj
index e5f1c9d..2f7867a 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip.csproj
+++ b/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip.csproj
@@ -38,8 +38,8 @@
     <EmbeddedResource Include="Resources\ZipExport.addin.xml">
       <LogicalName>ZipExport.addin.xml</LogicalName>
     </EmbeddedResource>
-    <EmbeddedResource Include="Resources\ZipExport.glade">
-      <LogicalName>ZipExport.glade</LogicalName>
+    <EmbeddedResource Include="Resources\zip_export.ui">
+      <LogicalName>zip_export.ui</LogicalName>
     </EmbeddedResource>
   </ItemGroup>
   <ProjectExtensions>
@@ -81,9 +81,17 @@
     <Reference Include="ICSharpCode.SharpZipLib" />
     <Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
     <Reference Include="System" />
+    <Reference Include="gtk-sharp-beans, Version=2.14.0.0, Culture=neutral, PublicKeyToken=97a95fb57b03c03a">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\lib\gtk-sharp-beans\gtk-sharp-beans.dll</HintPath>
+    </Reference>
+    <Reference Include="gio-sharp, Version=2.14.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\lib\gio-sharp\gio\gio-sharp.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Resources\" />
     <Folder Include="FSpot.Exporters.Zip\" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip/ZipExport.cs b/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip/ZipExport.cs
index 7d444e5..3ee1a4d 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip/ZipExport.cs
+++ b/src/Extensions/Exporters/FSpot.Exporters.Zip/FSpot.Exporters.Zip/ZipExport.cs
@@ -31,12 +31,12 @@ using ICSharpCode.SharpZipLib.GZip;
 namespace FSpot.Exporters.Zip {
 	public class Zip : IExporter {
 
-		[Glade.Widget] Gtk.Dialog zipdiag;
-		[Glade.Widget] Gtk.HBox dirchooser_hbox;
-		[Glade.Widget] Gtk.CheckButton scale_check;
-		[Glade.Widget] Gtk.Entry filename;
-		[Glade.Widget] Gtk.SpinButton scale_size;
-		[Glade.Widget] Gtk.Button create_button;
+		[GtkBeans.Builder.Object] Gtk.Dialog zipdiag;
+		[GtkBeans.Builder.Object] Gtk.HBox dirchooser_hbox;
+		[GtkBeans.Builder.Object] Gtk.CheckButton scale_check;
+		[GtkBeans.Builder.Object] Gtk.Entry filename;
+		[GtkBeans.Builder.Object] Gtk.SpinButton scale_size;
+		[GtkBeans.Builder.Object] Gtk.Button create_button;
 
 		IPhoto [] photos;
 		Gtk.FileChooserButton uri_chooser;
@@ -58,8 +58,8 @@ namespace FSpot.Exporters.Zip {
 		}
 
 		public void ShowDialog () {
-			Glade.XML xml = new Glade.XML (null, "ZipExport.glade", "zipdiag", "f-spot");
-			xml.Autoconnect (this);
+			var builder = new GtkBeans.Builder (null, "zip_export.ui", null);
+			builder.Autoconnect (this);
 			zipdiag.Modal = false;
 			zipdiag.TransientFor = null;
 
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Zip/Makefile.am b/src/Extensions/Exporters/FSpot.Exporters.Zip/Makefile.am
index 7773b66..f67571f 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Zip/Makefile.am
+++ b/src/Extensions/Exporters/FSpot.Exporters.Zip/Makefile.am
@@ -6,7 +6,7 @@ INSTALL_DIR = $(EXTENSIONS_INSTALL_DIR)
 SOURCES = FSpot.Exporters.Zip/ZipExport.cs
 
 RESOURCES =  \
-	Resources/ZipExport.addin.xml \
-	Resources/ZipExport.glade
+	Resources/zip_export.ui \
+	Resources/ZipExport.addin.xml
 
 include $(top_srcdir)/build/build.mk
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/ZipExport.glade b/src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/zip_export.ui
similarity index 73%
rename from src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/ZipExport.glade
rename to src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/zip_export.ui
index 98f5b56..110d5c8 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/ZipExport.glade
+++ b/src/Extensions/Exporters/FSpot.Exporters.Zip/Resources/zip_export.ui
@@ -1,20 +1,21 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.0 on Tue Dec 11 00:09:08 2007 -->
-<glade-interface>
-  <widget class="GtkDialog" id="zipdiag">
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="zipdiag">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
     <property name="border_width">5</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
     <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
+      <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+        <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child>
-          <widget class="GtkTable" id="table1">
+          <object class="GtkTable" id="table1">
             <property name="visible">True</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <property name="border_width">12</property>
@@ -23,35 +24,29 @@
             <property name="column_spacing">7</property>
             <property name="row_spacing">6</property>
             <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label1">
+              <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="xalign">1</property>
                 <property name="label" translatable="yes">_Location:</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
             </child>
             <child>
-              <widget class="GtkLabel" id="label2">
+              <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="xalign">1</property>
                 <property name="label" translatable="yes">_File name:</property>
                 <property name="use_underline">True</property>
-              </widget>
+              </object>
               <packing>
                 <property name="top_attach">1</property>
                 <property name="bottom_attach">2</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkHBox" id="dirchooser_hbox">
+              <object class="GtkHBox" id="dirchooser_hbox">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
@@ -60,19 +55,18 @@
                 <child>
                   <placeholder/>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkEntry" id="filename">
+              <object class="GtkEntry" id="filename">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="tooltip_text">File will be overwritten, if exists</property>
-              </widget>
+              </object>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
@@ -81,24 +75,25 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkHBox" id="hbox1">
+              <object class="GtkHBox" id="hbox1">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
-                  <widget class="GtkSpinButton" id="scale_size">
+                  <object class="GtkSpinButton" id="scale_size">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="adjustment">1024 1 10000 1 10 10</property>
-                  </widget>
+                    <property name="adjustment">adjustment1</property>
+                  </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <placeholder/>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
@@ -107,78 +102,102 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkHBox" id="hbox2">
+              <object class="GtkHBox" id="hbox2">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <child>
                   <placeholder/>
                 </child>
                 <child>
-                  <widget class="GtkCheckButton" id="scale_check">
+                  <object class="GtkCheckButton" id="scale_check">
+                    <property name="label" translatable="yes">_Scale:</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Scale:</property>
                     <property name="use_underline">True</property>
                     <property name="xalign">0</property>
-                    <property name="response_id">0</property>
                     <property name="draw_indicator">True</property>
-                  </widget>
+                  </object>
                   <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
                     <property name="position">1</property>
-		    <property name="expand">False</property>
-		    <property name="fill">False</property>
                   </packing>
                 </child>
-              </widget>
+              </object>
               <packing>
                 <property name="top_attach">2</property>
                 <property name="bottom_attach">3</property>
               </packing>
             </child>
-          </widget>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
           <packing>
             <property name="expand">False</property>
             <property name="position">1</property>
           </packing>
         </child>
         <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
             <property name="visible">True</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <property name="layout_style">end</property>
             <child>
-              <widget class="GtkButton" id="button1">
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">gtk-cancel</property>
                 <property name="use_stock">True</property>
-                <property name="response_id">0</property>
-              </widget>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
             </child>
             <child>
-              <widget class="GtkButton" id="create_button">
+              <object class="GtkButton" id="create_button">
+                <property name="label" translatable="yes">_Create</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label" translatable="yes">_Create</property>
                 <property name="use_underline">True</property>
-                <property name="response_id">-5</property>
-              </widget>
+              </object>
               <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">1</property>
               </packing>
             </child>
-          </widget>
+          </object>
           <packing>
             <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
-      </widget>
+      </object>
     </child>
-  </widget>
-</glade-interface>
+    <action-widgets>
+      <action-widget response="0">button1</action-widget>
+      <action-widget response="-5">create_button</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="value">1024</property>
+    <property name="lower">1</property>
+    <property name="upper">10000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+    <property name="page_size">10</property>
+  </object>
+</interface>



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