[vinagre] Reording of preferences item that toggles menu accelerators.



commit 6af9e3e82cc9bfc066eebcd737ca55b0aa55d9c5
Author: Jonh Wendell <jwendell gnome org>
Date:   Wed Jan 27 10:47:34 2010 -0300

    Reording of preferences item that toggles menu accelerators.
    
    Also, put a help button in that dialog.

 data/vinagre.ui         |   22 +++++++++++++++++++---
 vinagre/vinagre-prefs.c |   20 ++++++++++++++------
 2 files changed, 33 insertions(+), 9 deletions(-)
---
diff --git a/data/vinagre.ui b/data/vinagre.ui
index ce7135f..ecc99ab 100644
--- a/data/vinagre.ui
+++ b/data/vinagre.ui
@@ -879,10 +879,11 @@
                     </child>
                     <child>
                       <object class="GtkCheckButton" id="show_accels_check">
-                        <property name="label" translatable="yes">_Show menu shortcuts</property>
+                        <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="tooltip_text" translatable="yes" comments="This is a tooltip in preferences dialog">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="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -914,7 +915,21 @@
         <child internal-child="action_area">
           <object class="GtkHButtonBox" id="dialog-action_area5">
             <property name="visible">True</property>
-            <property name="layout_style">end</property>
+            <property name="layout_style">edge</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_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>
@@ -926,7 +941,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>
@@ -939,6 +954,7 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="1">preferences_help_button</action-widget>
       <action-widget response="0">button9</action-widget>
     </action-widgets>
   </object>
diff --git a/vinagre/vinagre-prefs.c b/vinagre/vinagre-prefs.c
index 11a874a..05b75e4 100644
--- a/vinagre/vinagre-prefs.c
+++ b/vinagre/vinagre-prefs.c
@@ -497,6 +497,7 @@ typedef struct {
   GtkWidget   *dialog;
   GtkWidget   *show_tabs;
   GtkWidget   *show_accels;
+  GtkWindow   *parent;
 } VinagrePrefsDialog;
 
 static void
@@ -514,8 +515,14 @@ vinagre_prefs_dialog_setup (VinagrePrefsDialog *dialog)
 }
 
 static void
-vinagre_prefs_dialog_quit (VinagrePrefsDialog *dialog)
+vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialog *dialog)
 {
+  if (response_id > 0)
+    {
+      vinagre_utils_help_contents (dialog->parent, "preferences");
+      return;
+    }
+
   gtk_widget_destroy (dialog->dialog);
   g_object_unref (dialog->xml);
   g_free (dialog);
@@ -547,17 +554,18 @@ vinagre_prefs_dialog_show (VinagreWindow *window)
 
   dialog->xml = vinagre_utils_get_builder (NULL, NULL);
   dialog->dialog = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "preferences_dialog"));
-  gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), GTK_WINDOW (window));
+  dialog->parent = GTK_WINDOW (window);
+  gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), dialog->parent);
 
   dialog->show_tabs = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "always_show_tabs_check"));
   dialog->show_accels = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "show_accels_check"));
 
   vinagre_prefs_dialog_setup (dialog);
 
-  g_signal_connect_swapped (dialog->dialog,
-			    "response", 
-                            G_CALLBACK (vinagre_prefs_dialog_quit),
-                            dialog);
+  g_signal_connect (dialog->dialog,
+		    "response",
+		    G_CALLBACK (vinagre_prefs_dialog_response),
+		    dialog);
 
   g_signal_connect_swapped (dialog->show_tabs,
 			    "toggled",



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