[Goodies-commits] r6832 - in gigolo/trunk: . src

Enrico Troeger enrico at xfce.org
Mon Mar 2 12:22:10 CET 2009


Author: enrico
Date: 2009-03-02 11:22:10 +0000 (Mon, 02 Mar 2009)
New Revision: 6832

Modified:
   gigolo/trunk/ChangeLog
   gigolo/trunk/src/window.c
Log:
Add Online Help and Supported Protocols help menu items.

Modified: gigolo/trunk/ChangeLog
===================================================================
--- gigolo/trunk/ChangeLog	2009-03-02 10:55:37 UTC (rev 6831)
+++ gigolo/trunk/ChangeLog	2009-03-02 11:22:10 UTC (rev 6832)
@@ -3,6 +3,8 @@
  * src/common.c, src/bookmarkeditdialog.c:
    Add a separate service type for Obex connections in the
    Connect/Bookmark Edit dialogs.
+ * src/window.c:
+   Add Online Help and Supported Protocols help menu items.
 
 
 2009-03-01  Enrico Tröger  <enrico(at)xfce(dot)org>

Modified: gigolo/trunk/src/window.c
===================================================================
--- gigolo/trunk/src/window.c	2009-03-02 10:55:37 UTC (rev 6831)
+++ gigolo/trunk/src/window.c	2009-03-02 11:22:10 UTC (rev 6832)
@@ -445,6 +445,45 @@
 }
 
 
+static void action_help_cb(G_GNUC_UNUSED GtkAction *action, G_GNUC_UNUSED GigoloWindow *window)
+{
+	gigolo_show_uri("http://www.uvena.de/gigolo/help.html");
+}
+
+
+static void action_supported_schemes_cb(G_GNUC_UNUSED GtkAction *action, GigoloWindow *window)
+{
+	const gchar* const *supported;
+	const gchar *description;
+	GString *str;
+	GtkWidget *dialog;
+	guint j;
+
+	str = g_string_new(_("Gigolo can use the following protocols provided by GVfs:"));
+	g_string_append(str, "\n\n");
+
+	supported = gigolo_backend_gvfs_get_supported_uri_schemes();
+	for (j = 0; supported[j] != NULL; j++)
+	{
+		description = gigolo_describe_scheme(supported[j]);
+		if (description != NULL)
+		{
+			g_string_append_printf(str, "%s (%s)", description, supported[j]);
+			g_string_append_c(str, '\n');
+		}
+	}
+
+	dialog = gtk_message_dialog_new(GTK_WINDOW(window),
+		GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,
+		GTK_BUTTONS_OK, "%s", str->str);
+
+	gtk_dialog_run(GTK_DIALOG(dialog));
+
+	gtk_widget_destroy(dialog);
+	g_string_free(str, TRUE);
+}
+
+
 static void action_copy_uri_cb(G_GNUC_UNUSED GtkAction *action, GigoloWindow *window)
 {
 	GigoloWindowPrivate *priv = GIGOLO_WINDOW_GET_PRIVATE(window);
@@ -991,6 +1030,9 @@
 				"<menuitem action='CopyURI'/>"
 			"</menu>"
 			"<menu action='Help'>"
+				"<menuitem action='OnlineHelp'/>"
+				"<menuitem action='SupportedSchemes'/>"
+				"<separator/>"
 				"<menuitem action='About'/>"
 			"</menu>"
 		"</menubar>"
@@ -1045,6 +1087,8 @@
 			N_("Open the selected resource with a file manager"), G_CALLBACK(action_open_cb) },
 		{ "CopyURI", GTK_STOCK_COPY, N_("Copy _URI"), "<Ctrl>c", NULL, G_CALLBACK(action_copy_uri_cb) },
 		{ "Quit", GTK_STOCK_QUIT, NULL, "<Ctrl>q", N_("Quit Gigolo"), G_CALLBACK(action_quit_cb) },
+		{ "OnlineHelp", GTK_STOCK_HELP, _("Online Help"), NULL, NULL, G_CALLBACK(action_help_cb) },
+		{ "SupportedSchemes", NULL, _("Supported Protocols"), NULL, NULL, G_CALLBACK(action_supported_schemes_cb) },
 		{ "About", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK(action_about_cb) }
 	};
 	const guint entries_n = G_N_ELEMENTS(entries);




More information about the Goodies-commits mailing list