[Goodies-commits] r7245 - in xfce4-clipman-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Mon Apr 20 00:57:19 CEST 2009


Author: mmassonnet
Date: 2009-04-19 22:57:19 +0000 (Sun, 19 Apr 2009)
New Revision: 7245

Modified:
   xfce4-clipman-plugin/trunk/ChangeLog
   xfce4-clipman-plugin/trunk/panel-plugin/Makefile.am
   xfce4-clipman-plugin/trunk/panel-plugin/main.c
   xfce4-clipman-plugin/trunk/panel-plugin/settings-dialog.glade
Log:
Set Help button sensitive in dialog and add code to show the help

Modified: xfce4-clipman-plugin/trunk/ChangeLog
===================================================================
--- xfce4-clipman-plugin/trunk/ChangeLog	2009-04-19 22:27:57 UTC (rev 7244)
+++ xfce4-clipman-plugin/trunk/ChangeLog	2009-04-19 22:57:19 UTC (rev 7245)
@@ -1,4 +1,13 @@
 2009-04-19	Mike Massonnet
+Set Help button sensitive in dialog and add code to show the help
+
+	- panel-plugin/Makefile.am:
+		Define DATAROOTDIR to be able to point into xfce4/doc.
+	- panel-plugin/main.c:
+		New callback cb_show_help to run a command that opens the html
+		manual file.
+
+2009-04-19	Mike Massonnet
 Add documentation
 
 2009-04-18	Mike Massonnet

Modified: xfce4-clipman-plugin/trunk/panel-plugin/Makefile.am
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/Makefile.am	2009-04-19 22:27:57 UTC (rev 7244)
+++ xfce4-clipman-plugin/trunk/panel-plugin/Makefile.am	2009-04-19 22:57:19 UTC (rev 7245)
@@ -3,6 +3,7 @@
 INCLUDES =								\
 	-I${top_srcdir}							\
 	-DSYSCONFDIR=\"$(sysconfdir)\"					\
+	-DDATAROOTDIR=\"$(datarootdir)\"				\
 	-DDATADIR=\"$(datadir)\"					\
 	-DSRCDIR=\"$(top_srcdir)\"					\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\

Modified: xfce4-clipman-plugin/trunk/panel-plugin/main.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/main.c	2009-04-19 22:27:57 UTC (rev 7244)
+++ xfce4-clipman-plugin/trunk/panel-plugin/main.c	2009-04-19 22:57:19 UTC (rev 7245)
@@ -135,6 +135,8 @@
  * Settings Dialog
  */
 
+static void             cb_show_help                    (GtkButton *button,
+                                                         MyPlugin *plugin);
 static void             setup_actions_treeview          (GtkTreeView *treeview,
                                                          MyPlugin *plugin);
 static void             refresh_actions_treeview        (GtkTreeView *treeview,
@@ -731,6 +733,7 @@
   glade_xml_signal_connect_data (plugin->gxml, "cb_add_command", G_CALLBACK (cb_add_command), plugin);
   glade_xml_signal_connect_data (plugin->gxml, "cb_refresh_command", G_CALLBACK (cb_refresh_command), plugin);
   glade_xml_signal_connect_data (plugin->gxml, "cb_delete_command", G_CALLBACK (cb_delete_command), plugin);
+  glade_xml_signal_connect_data (plugin->gxml, "cb_show_help", G_CALLBACK (cb_show_help), plugin);
 
   setup_actions_treeview (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "actions")), plugin);
   setup_commands_treeview (GTK_TREE_VIEW (glade_xml_get_widget (plugin->gxml, "commands")), plugin);
@@ -748,7 +751,7 @@
   /* Run the dialog */
   if (plugin->panel_plugin != NULL)
     xfce_panel_plugin_block_menu (plugin->panel_plugin);
-  gtk_dialog_run (GTK_DIALOG (dialog));
+  while (gtk_dialog_run (GTK_DIALOG (dialog)) != 0);
   if (plugin->panel_plugin != NULL)
     xfce_panel_plugin_unblock_menu (plugin->panel_plugin);
 
@@ -930,6 +933,31 @@
  * Settings Dialog
  */
 
+static void
+cb_show_help (GtkButton *button,
+              MyPlugin *plugin)
+{
+  GdkScreen *screen;
+  gchar *filename = NULL;
+  gchar *command = NULL;
+  
+  screen = gtk_widget_get_screen (GTK_WIDGET (button));
+  filename = "file://"DATAROOTDIR"/xfce4/doc/C/"PACKAGE".html";
+  command = g_strdup_printf ("exo-open %s", filename);
+  if (gdk_spawn_command_line_on_screen (screen, command, NULL))
+    goto out;
+
+  g_free (command);
+  command = g_strdup_printf ("firefox %s", filename);
+  if (gdk_spawn_command_line_on_screen (screen, command, NULL))
+    goto out;
+
+  xfce_err ("Unable to open documentation \"%s\"", filename);
+
+out:
+  g_free (command);
+}
+
 /* Actions */
 static void
 setup_actions_treeview (GtkTreeView *treeview,

Modified: xfce4-clipman-plugin/trunk/panel-plugin/settings-dialog.glade
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/settings-dialog.glade	2009-04-19 22:27:57 UTC (rev 7244)
+++ xfce4-clipman-plugin/trunk/panel-plugin/settings-dialog.glade	2009-04-19 22:57:19 UTC (rev 7245)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <glade-interface>
-  <!-- interface-requires gtk+ 2.16 -->
+  <!-- interface-requires gtk+ 2.14 -->
   <requires lib="xfce4"/>
   <!-- interface-requires xfce4 2335.53032 -->
   <!-- interface-naming-policy toplevel-contextual -->
@@ -304,11 +304,12 @@
             <child>
               <widget class="GtkButton" id="button2">
                 <property name="label">gtk-help</property>
+                <property name="response_id">2</property>
                 <property name="visible">True</property>
-                <property name="sensitive">False</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
+                <signal name="clicked" handler="cb_show_help"/>
               </widget>
               <packing>
                 <property name="expand">False</property>




More information about the Goodies-commits mailing list