gedit r6353 - in trunk: . bindings/python gedit gedit/dialogs plugins/externaltools/tools plugins/snippets/snippets plugins/sort plugins/spell plugins/time



Author: jessevdk
Date: Wed Aug  6 19:45:23 2008
New Revision: 6353
URL: http://svn.gnome.org/viewvc/gedit?rev=6353&view=rev

Log:
	* gedit/gedit-help.[ch]:
	* bindings/python/gedit.defs:
	
	Changed the gedit help helper function to use gtk_show_uri with
	the ghelp scheme instead of gnome_show_help. Using "gedit.xml" as
	the name generates a deprecation warning but will translate to "gedit"
	which will properly show the help to prevent regression for third party
	plugins.
	
	* plugins/snippets/snippets/Manager.py:
	* plugins/externaltools/tools/manager.py:
	* plugins/spell/gedit-spell-language-dialog.c:
	* plugins/sort/gedit-sort-plugin.c:
	* plugins/time/gedit-time-plugin.c:
	* plugins/spell/gedit-spell-language-dialog.c:
	* gedit/dialogs/gedit-preferences-dialog.c:
	* gedit/dialogs/gedit-style-scheme-dialog.c:
	
	Adapted plugins and gedit core to not use "gedit.xml" as the help name.
	Changed to use NULL since they all want the default.


Modified:
   trunk/ChangeLog
   trunk/bindings/python/gedit.defs
   trunk/gedit/dialogs/gedit-preferences-dialog.c
   trunk/gedit/dialogs/gedit-style-scheme-dialog.c
   trunk/gedit/gedit-help.c
   trunk/gedit/gedit-help.h
   trunk/plugins/externaltools/tools/manager.py
   trunk/plugins/snippets/snippets/Manager.py
   trunk/plugins/sort/gedit-sort-plugin.c
   trunk/plugins/spell/gedit-spell-language-dialog.c
   trunk/plugins/time/gedit-time-plugin.c

Modified: trunk/bindings/python/gedit.defs
==============================================================================
--- trunk/bindings/python/gedit.defs	(original)
+++ trunk/bindings/python/gedit.defs	Wed Aug  6 19:45:23 2008
@@ -527,7 +527,7 @@
   (return-type "gboolean")
   (parameters
     '("GtkWindow*" "parent")
-    '("const-gchar*" "file_name")
+    '("const-gchar*" "name")
     '("const-gchar*" "link_id")
   )
 )

Modified: trunk/gedit/dialogs/gedit-preferences-dialog.c
==============================================================================
--- trunk/gedit/dialogs/gedit-preferences-dialog.c	(original)
+++ trunk/gedit/dialogs/gedit-preferences-dialog.c	Wed Aug  6 19:45:23 2008
@@ -152,7 +152,7 @@
 	{
 		case GTK_RESPONSE_HELP:
 			gedit_help_display (GTK_WINDOW (dlg),
-					    "gedit.xml",
+					    NULL,
 					    "gedit-prefs");
 
 			g_signal_stop_emission_by_name (dlg, "response");

Modified: trunk/gedit/dialogs/gedit-style-scheme-dialog.c
==============================================================================
--- trunk/gedit/dialogs/gedit-style-scheme-dialog.c	(original)
+++ trunk/gedit/dialogs/gedit-style-scheme-dialog.c	Wed Aug  6 19:45:23 2008
@@ -103,7 +103,7 @@
 	{
 		case GTK_RESPONSE_HELP:
 			gedit_help_display (GTK_WINDOW (dlg),
-					    "gedit.xml",
+					    NULL,
 					    "gedit-prefs"); // FIXME
 
 			g_signal_stop_emission_by_name (dlg, "response");

Modified: trunk/gedit/gedit-help.c
==============================================================================
--- trunk/gedit/gedit-help.c	(original)
+++ trunk/gedit/gedit-help.c	Wed Aug  6 19:45:23 2008
@@ -36,24 +36,40 @@
 
 #include <glib/gi18n.h>
 #include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-help.h>
+#include <string.h>
+#include <gtk/gtk.h>
 
 gboolean    
 gedit_help_display (GtkWindow   *parent,
-		    const gchar *file_name, /* "gedit.xml" if NULL */
+		    const gchar *name, /* "gedit" if NULL */
 		    const gchar *link_id)
 {
 	GError *error = NULL;
 	gboolean ret;
-
+	gchar *link;
+	
 	g_return_val_if_fail ((parent == NULL) || GTK_IS_WINDOW (parent), FALSE);
 
-	if (file_name == NULL)
-		file_name = "gedit.xml";
+	if (name == NULL)
+		name = "gedit";
+	else if (strcmp (name, "gedit.xml") == 0)
+	{
+		g_warning ("%s: Using \"gedit.xml\" for the help name is deprecated, use \"gedit\" or simply NULL instead", G_STRFUNC);
+		
+		name = "gedit";
+	}
+
+	if (link_id)
+		link = g_strdup_printf ("ghelp:%s?%s", name, link_id);
+	else
+		link = g_strdup_printf ("ghelp:%s", name);
+
+	ret = gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (parent)),
+	                    link, 
+			    GDK_CURRENT_TIME, 
+			    &error);
 
-	ret = gnome_help_display (file_name,
-				  link_id,
-				  &error);
+	g_free (link);
 
 	if (error != NULL)
 	{

Modified: trunk/gedit/gedit-help.h
==============================================================================
--- trunk/gedit/gedit-help.h	(original)
+++ trunk/gedit/gedit-help.h	Wed Aug  6 19:45:23 2008
@@ -36,7 +36,7 @@
 G_BEGIN_DECLS
 
 gboolean	gedit_help_display (GtkWindow   *parent,
-				    const gchar *file_name, /* "gedit.xml" if NULL */
+				    const gchar *name, /* "gedit" if NULL */
 				    const gchar *link_id);
 				    
 G_END_DECLS

Modified: trunk/plugins/externaltools/tools/manager.py
==============================================================================
--- trunk/plugins/externaltools/tools/manager.py	(original)
+++ trunk/plugins/externaltools/tools/manager.py	Wed Aug  6 19:45:23 2008
@@ -367,7 +367,7 @@
 
     def on_tool_manager_dialog_response(self, dialog, response):
         if response == gtk.RESPONSE_HELP:
-            gedit.help_display(self.dialog, 'gedit.xml', 'gedit-external-tools-plugin')
+            gedit.help_display(self.dialog, 'gedit', 'gedit-external-tools-plugin')
             return
 
         self.on_tool_manager_dialog_focus_out(dialog, None)

Modified: trunk/plugins/snippets/snippets/Manager.py
==============================================================================
--- trunk/plugins/snippets/snippets/Manager.py	(original)
+++ trunk/plugins/snippets/snippets/Manager.py	Wed Aug  6 19:45:23 2008
@@ -632,7 +632,7 @@
         
         def on_dialog_snippets_response(self, dlg, resp):                                
                 if resp == gtk.RESPONSE_HELP:
-                        gedit.help_display(self.dlg, 'gedit.xml', 'gedit-snippets-plugin')
+                        gedit.help_display(self.dlg, 'gedit', 'gedit-snippets-plugin')
                         return
 
                 self.dlg.destroy()

Modified: trunk/plugins/sort/gedit-sort-plugin.c
==============================================================================
--- trunk/plugins/sort/gedit-sort-plugin.c	(original)
+++ trunk/plugins/sort/gedit-sort-plugin.c	Wed Aug  6 19:45:23 2008
@@ -108,7 +108,7 @@
 
 		case GTK_RESPONSE_HELP:
 			gedit_help_display (GTK_WINDOW (widget),
-					    "gedit.xml",
+					    NULL,
 					    "gedit-sort-plugin");
 			break;
 

Modified: trunk/plugins/spell/gedit-spell-language-dialog.c
==============================================================================
--- trunk/plugins/spell/gedit-spell-language-dialog.c	(original)
+++ trunk/plugins/spell/gedit-spell-language-dialog.c	Wed Aug  6 19:45:23 2008
@@ -71,7 +71,7 @@
 	if (res_id == GTK_RESPONSE_HELP)
 	{
 		gedit_help_display (GTK_WINDOW (dlg),
-				    "gedit.xml",
+				    NULL,
 				    "gedit-spell-checker-plugin");
 
 		g_signal_stop_emission_by_name (dlg, "response");

Modified: trunk/plugins/time/gedit-time-plugin.c
==============================================================================
--- trunk/plugins/time/gedit-time-plugin.c	(original)
+++ trunk/plugins/time/gedit-time-plugin.c	Wed Aug  6 19:45:23 2008
@@ -1015,7 +1015,7 @@
 		{
 			gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
 			gedit_help_display (GTK_WINDOW (widget),
-					    "gedit.xml",
+					    NULL,
 					    "gedit-insert-date-time-plugin");
 			break;
 		}
@@ -1170,7 +1170,7 @@
 			gedit_debug_message (DEBUG_PLUGINS, "GTK_RESPONSE_HELP");
 
 			gedit_help_display (GTK_WINDOW (dialog),
-					    "gedit.xml",
+					    NULL,
 					    "gedit-date-time-configure");
 			break;
 		}



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