[glade] Added clear properties and read documentation actions



commit 88d2ee166c7abb911bdf129abd1b572f6a110ef0
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sun Mar 10 22:28:27 2013 -0300

    Added clear properties and read documentation actions

 plugins/gtk+/glade-gtk.c |   13 +++++++++++++
 plugins/gtk+/gtk+.xml.in |    2 ++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index c1f787d..11354a1 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -800,6 +800,9 @@ glade_gtk_widget_deep_post_create (GladeWidgetAdaptor * adaptor,
   if (!glade_widget_get_internal (gwidget))
     g_signal_connect (G_OBJECT (widget), "notify::parent",
                       G_CALLBACK (widget_parent_changed), adaptor);
+
+  if (!glade_widget_adaptor_get_book (adaptor) || !glade_util_have_devhelp ())
+    glade_widget_remove_action (gwidget, "read_documentation");
 }
 
 void
@@ -1023,6 +1026,16 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor * adaptor,
     {
       /* Ignore dummy */
     }
+  else if (strcmp (action_path, "clear_properties") == 0)
+    {
+      glade_editor_reset_dialog_run (gtk_widget_get_toplevel (parent), gwidget);
+    }
+  else if (strcmp (action_path, "read_documentation") == 0)
+    {
+      glade_app_search_docs (glade_widget_adaptor_get_book (adaptor),
+                             glade_widget_adaptor_get_name (adaptor),
+                             NULL);
+    }
   else
     GWA_GET_CLASS (G_TYPE_OBJECT)->action_activate (adaptor,
                                                     object, action_path);
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index df4af2a..75e865f 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -46,6 +46,8 @@
           <action id="paned" _name="Paned"/>
         </action>
        <action id="sizegroup_add" _name="Add to Size Group"/>
+        <action id="clear_properties" _name="Clear properties" stock="gtk-clear"/>
+        <action id="read_documentation" _name="Read documentation" stock="glade-devhelp" important="True"/>
       </actions>
 
       <properties>


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