[cheese] Add help button to the preferences dialog



commit 529b9398257e4fad5268f7a10a74c00f15df1cc3
Author: Ekaterina Gerasimova <kittykat3756 googlemail com>
Date:   Sun Oct 30 17:55:32 2011 +0100

    Add help button to the preferences dialog

 data/cheese-prefs.ui        |   20 +++++++++++++++++++-
 src/cheese-preferences.vala |   14 ++++++++++++++
 2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/data/cheese-prefs.ui b/data/cheese-prefs.ui
index ba4617d..a3971c0 100644
--- a/data/cheese-prefs.ui
+++ b/data/cheese-prefs.ui
@@ -37,6 +37,23 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
+              <object class="GtkButton" id="help">
+                <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>
+                <signal name="clicked" handler="cheese_preferences_dialog_on_dialog_help" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkButton" id="close">
                 <property name="label">gtk-close</property>
                 <property name="visible">True</property>
@@ -50,7 +67,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>
@@ -517,6 +534,7 @@
       </object>
     </child>
     <action-widgets>
+      <action-widget response="-11">help</action-widget>
       <action-widget response="-7">close</action-widget>
     </action-widgets>
   </object>
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 2a8e873..9f87d32 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -268,6 +268,20 @@ public class Cheese.PreferencesDialog : GLib.Object
   }
 
   [CCode (instance_pos = -1)]
+  public void on_dialog_help (Gtk.Button button)
+  {
+    try
+    {
+      Gtk.show_uri (this.dialog.get_screen (), "ghelp:cheese?index#preferences",
+        Gdk.CURRENT_TIME);
+    }
+    catch
+    {
+      warning ("%s", "Error showing help");
+    }
+  }
+
+  [CCode (instance_pos = -1)]
   public void on_countdown_toggle (Gtk.CheckButton checkbutton)
   {
     settings.set_boolean ("countdown", checkbutton.active);



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