[vinagre] Move about dialog text to GtkBuilder XML



commit 1bd43cc178aeada704bd9aeb793ce115a2217644
Author: David King <amigadave amigadave com>
Date:   Fri Jul 8 23:33:20 2011 +0200

    Move about dialog text to GtkBuilder XML

 data/vinagre.ui            |  300 +++++++++++++++++++++++++-------------------
 vinagre/vinagre-utils.vala |   34 ++----
 2 files changed, 176 insertions(+), 158 deletions(-)
---
diff --git a/data/vinagre.ui b/data/vinagre.ui
index eefe4ef..7c2f54c 100644
--- a/data/vinagre.ui
+++ b/data/vinagre.ui
@@ -1,6 +1,42 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAboutDialog" id="about_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="type_hint">dialog</property>
+    <property name="copyright">Copyright  2007â2011 Jonh Wendell
+Copyright  2011 David King</property>
+    <property name="comments" translatable="yes">Vinagre is a remote desktop viewer for the GNOME desktop</property>
+    <property name="authors">David King &lt;amigadave amigadave com&gt;
+Jonh Wendell &lt;jwendell gnome org&gt;</property>
+    <property name="documenters">Ekaterina Gerasimova &lt;kittykat3756 googlemail com&gt;</property>
+    <property name="translator_credits" translatable="yes" comments="Add your name here to appear as a translator in the about dialog">translator-credits</property>
+    <property name="artists">Vinicius Depizzol &lt;vdepizzol gmail com&gt;</property>
+    <property name="license_type">gpl-3-0</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="aboutdialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="aboutdialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+  </object>
   <object class="GtkDialog" id="auth_required_dialog">
     <property name="can_focus">False</property>
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -1037,138 +1073,6 @@
       <action-widget response="-5">connect_button</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkDialog" id="preferences_dialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">12</property>
-    <property name="title" translatable="yes">Preferences</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="window_position">center-on-parent</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox5">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkVBox" id="vbox3">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="label17">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Interface</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkCheckButton" id="always_show_tabs_check">
-                <property name="label" translatable="yes">_Always show tabs</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="tooltip_text" translatable="yes">Always show tabs in the remote desktop display area</property>
-                <property name="margin_left">12</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_underline">True</property>
-                <property name="xalign">0</property>
-                <property name="draw_indicator">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkCheckButton" id="show_accels_check">
-                <property name="label" translatable="yes">Allow _keyboard shortcuts</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="has_tooltip">True</property>
-                <property name="tooltip_markup" translatable="yes">This option enables menu accelerators and keyboard shortcuts. For more info on why you may want to disable them, check the documentation.</property>
-                <property name="tooltip_text" translatable="yes" comments="This is a tooltip in preferences dialog">Enables menu accelerators and keyboard shortcuts. For more info on why you may want to disable them, check the documentation</property>
-                <property name="margin_left">12</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_underline">True</property>
-                <property name="xalign">0</property>
-                <property name="draw_indicator">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area5">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkButton" id="preferences_help_button">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">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="button9">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">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="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="1">preferences_help_button</action-widget>
-      <action-widget response="0">button9</action-widget>
-    </action-widgets>
-  </object>
   <object class="GtkTextBuffer" id="ip_textbuffer"/>
   <object class="GtkDialog" id="listener_dialog">
     <property name="can_focus">False</property>
@@ -1461,4 +1365,136 @@
       <action-widget response="0">button4</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkDialog" id="preferences_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">12</property>
+    <property name="title" translatable="yes">Preferences</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox5">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkVBox" id="vbox3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Interface</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="always_show_tabs_check">
+                <property name="label" translatable="yes">_Always show tabs</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="tooltip_text" translatable="yes">Always show tabs in the remote desktop display area</property>
+                <property name="margin_left">12</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="show_accels_check">
+                <property name="label" translatable="yes">Allow _keyboard shortcuts</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="has_tooltip">True</property>
+                <property name="tooltip_markup" translatable="yes">This option enables menu accelerators and keyboard shortcuts. For more info on why you may want to disable them, check the documentation.</property>
+                <property name="tooltip_text" translatable="yes" comments="This is a tooltip in preferences dialog">Enables menu accelerators and keyboard shortcuts. For more info on why you may want to disable them, check the documentation</property>
+                <property name="margin_left">12</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="padding">6</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkButton" id="preferences_help_button">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">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="button9">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">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="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="1">preferences_help_button</action-widget>
+      <action-widget response="0">button9</action-widget>
+    </action-widgets>
+  </object>
 </interface>
diff --git a/vinagre/vinagre-utils.vala b/vinagre/vinagre-utils.vala
index f1e0eee..e19797c 100644
--- a/vinagre/vinagre-utils.vala
+++ b/vinagre/vinagre-utils.vala
@@ -198,33 +198,15 @@ namespace Vinagre.Utils {
 
     // TODO: Move this into the uilder file.
     public void show_help_about (Window parent) {
-        string[] authors = { "David King <amigadave amigadave com>",
-                             "Jonh Wendell <jwendell gnome org>" };
+        var builder = get_builder ();
+        var dialog = builder.get_object ("about_dialog") as Gtk.AboutDialog;
 
-        string[] artists = { "Vinicius Depizzol <vdepizzol gmail com>" };
+        dialog.logo_icon_name = Vinagre.Config.PACKAGE_TARNAME;
+        dialog.version = Vinagre.Config.PACKAGE_VERSION;
+        dialog.website = Vinagre.Config.PACKAGE_URL;
+        dialog.set_transient_for (parent);
 
-        const string copyright = "Copyright \xc2\xa9 2007-2011 Jonh Wendell\n" +
-                                 "Copyright \xc2\xa9 2011 David King";
-
-        const string comments = N_("Vinagre is a remote desktop viewer for the GNOME Desktop");
-
-        const string license = """Vinagre is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-
-            Vinagre is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-
-            You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.""";
-
-        show_about_dialog (parent,
-                           "authors", authors,
-                           "artists", artists,
-                           "comments", _(comments),
-                           "copyright", copyright,
-                           "license", license,
-                           "wrap-license", true,
-                           "logo-icon-name", Vinagre.Config.PACKAGE_TARNAME,
-                           "translator-credits", _("translator-credits"),
-                           "version", Vinagre.Config.PACKAGE_VERSION,
-                           "website", Vinagre.Config.PACKAGE_URL,
-                           "website-label", _("Vinagre Website"));
+        dialog.run ();
+        dialog.hide ();
     }
 } // namespace Vinagre.Utils



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