[nautilus] Update help targets and add more useful entries to help menu



commit 4060b9ee98bb080383e4d973c7ae5be1a515f785
Author: Shaun McCance <shaunm gnome org>
Date:   Fri Sep 2 11:39:52 2011 -0400

    Update help targets and add more useful entries to help menu

 src/nautilus-bookmarks-window.c           |    2 +-
 src/nautilus-connect-server-dialog.c      |    2 +-
 src/nautilus-file-management-properties.c |    2 +-
 src/nautilus-properties-window.c          |   23 ++++++++++++++----
 src/nautilus-shell-ui.xml                 |    7 +++++-
 src/nautilus-view.c                       |    2 +-
 src/nautilus-window-menus.c               |   36 ++++++++++++++++++++++++++--
 7 files changed, 61 insertions(+), 13 deletions(-)
---
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index b9e6d0b..5b68b01 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -145,7 +145,7 @@ nautilus_bookmarks_window_response_callback (GtkDialog *dialog,
 		GError *error = NULL;
 
 		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
-			      "ghelp:gnome-help#nautilus-bookmarks-edit",
+			      "help:gnome-help/nautilus-bookmarks-edit",
 			      gtk_get_current_event_time (), &error);
 
 		if (error) {
diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c
index cd409dc..0292c0c 100644
--- a/src/nautilus-connect-server-dialog.c
+++ b/src/nautilus-connect-server-dialog.c
@@ -695,7 +695,7 @@ connect_dialog_response_cb (NautilusConnectServerDialog *dialog,
 	case GTK_RESPONSE_HELP :
 		error = NULL;
 		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
-			      "ghelp:gnome-help#nautilus-connect",
+			      "help:gnome-help/nautilus-connect",
 			      gtk_get_current_event_time (), &error);
 		if (error) {
 			eel_show_error_dialog (_("There was an error displaying help."), error->message,
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index 29ee700..a759e16 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -188,7 +188,7 @@ preferences_show_help (GtkWindow *parent,
 	g_assert (helpfile != NULL);
 	g_assert (sect_id != NULL);
 
-	help_string = g_strdup_printf ("ghelp:%s#%s", helpfile, sect_id);
+	help_string = g_strdup_printf ("help:%s/%s", helpfile, sect_id);
 
 	gtk_show_uri (gtk_window_get_screen (parent),
 		      help_string, gtk_get_current_event_time (),
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 3b0df9b..3f8185d 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2347,7 +2347,8 @@ append_directory_contents_fields (NautilusPropertiesWindow *window,
 
 static GtkWidget *
 create_page_with_hbox (GtkNotebook *notebook,
-		       const char *title)
+		       const char *title,
+		       const char *help_uri)
 {
 	GtkWidget *hbox;
 
@@ -2359,13 +2360,15 @@ create_page_with_hbox (GtkNotebook *notebook,
 	gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
 	gtk_box_set_spacing (GTK_BOX (hbox), 12);
 	gtk_notebook_append_page (notebook, hbox, gtk_label_new (title));
+	g_object_set_data_full (G_OBJECT (hbox), "help-uri", g_strdup (help_uri), g_free);
 
 	return hbox;
 }
 
 static GtkWidget *
 create_page_with_vbox (GtkNotebook *notebook,
-		       const char *title)
+		       const char *title,
+		       const char *help_uri)
 {
 	GtkWidget *vbox;
 
@@ -2376,6 +2379,7 @@ create_page_with_vbox (GtkNotebook *notebook,
 	gtk_widget_show (vbox);
 	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
 	gtk_notebook_append_page (notebook, vbox, gtk_label_new (title));
+	g_object_set_data_full (G_OBJECT (vbox), "help-uri", g_strdup (help_uri), g_free);
 
 	return vbox;
 }		       
@@ -3045,7 +3049,8 @@ create_basic_page (NautilusPropertiesWindow *window)
 	
 	guint last_row, row;
 
-	hbox = create_page_with_hbox (window->details->notebook, _("Basic"));
+	hbox = create_page_with_hbox (window->details->notebook, _("Basic"),
+				      "help:gnome-help/nautilus-file-properties-basic");
 	
 	/* Icon pixmap */
 
@@ -4526,7 +4531,8 @@ create_permissions_page (NautilusPropertiesWindow *window)
 	gint nrows;
 
 	vbox = create_page_with_vbox (window->details->notebook,
-				      _("Permissions"));
+				      _("Permissions"),
+				      "help:gnome-help/nautilus-file-properties-permissions");
 
 	file_list = window->details->original_files;
 
@@ -4824,6 +4830,7 @@ create_open_with_page (NautilusPropertiesWindow *window)
 	gtk_widget_show (vbox);
 	g_free (mime_type);
 
+	g_object_set_data_full (G_OBJECT (vbox), "help-uri", g_strdup ("help:gnome-help/files-open"), g_free);
 	gtk_notebook_append_page (window->details->notebook, 
 				  vbox, gtk_label_new (_("Open With")));
 }
@@ -5154,11 +5161,17 @@ real_response (GtkDialog *dialog,
 	       int        response)
 {
 	GError *error = NULL;
+	NautilusPropertiesWindow *window = NAUTILUS_PROPERTIES_WINDOW (dialog);
+	GtkWidget *curpage;
+	const char *helpuri;
 
 	switch (response) {
 	case GTK_RESPONSE_HELP:
+		curpage = gtk_notebook_get_nth_page (window->details->notebook,
+						     gtk_notebook_get_current_page (window->details->notebook));
+		helpuri = g_object_get_data (G_OBJECT (curpage), "help-uri");
 		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
-			      "ghelp:gnome-help#nautilus-file-properties-basic",
+			      helpuri ? helpuri : "help:gnome-help/files",
 			      gtk_get_current_event_time (),
 			      &error);
 		if (error != NULL) {
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index a606251..b7ec379 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -108,7 +108,12 @@
 
 	</placeholder>
 	<menu action="Help">
-		<menuitem name="Nautilus Manual" action="Nautilus Manual"/>
+		<menuitem action="NautilusHelp"/>
+		<menuitem action="NautilusHelpSearch"/>
+		<menuitem action="NautilusHelpSort"/>
+		<menuitem action="NautilusHelpLost"/>
+		<menuitem action="NautilusHelpShare"/>
+		<separator/>
 		<menuitem name="About Nautilus" action="About Nautilus"/>
 	</menu>
 </menubar>
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 86e352c..69379b0 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -1531,7 +1531,7 @@ pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data)
 	case GTK_RESPONSE_HELP :
 		error = NULL;
 		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
-			      "ghelp:gnome-help#files-select",
+			      "help:gnome-help/files-select",
 			      gtk_get_current_event_time (), &error);
 		if (error) {
 			eel_show_error_dialog (_("There was an error displaying help."), error->message,
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 8773ed9..6ad70f3 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -422,15 +422,29 @@ action_nautilus_manual_callback (GtkAction *action,
 	NautilusWindow *window;
 	GError *error;
 	GtkWidget *dialog;
+	const char* helpuri;
+	const char* name = gtk_action_get_name (action);
 
 	error = NULL;
 	window = NAUTILUS_WINDOW (user_data);
 
+	if (g_str_equal (name, "NautilusHelpSearch")) {
+		helpuri = "help:gnome-help/files-search";
+	} else if (g_str_equal (name,"NautilusHelpSort")) {
+		helpuri = "help:gnome-help/files-sort";
+	} else if (g_str_equal (name, "NautilusHelpLost")) {
+		helpuri = "help:gnome-help/files-lost";
+	} else if (g_str_equal (name, "NautilusHelpShare")) {
+		helpuri = "help:gnome-help/files-share";
+	} else {
+		helpuri = "help:gnome-help/files";
+	}
+
 	if (NAUTILUS_IS_DESKTOP_WINDOW (window)) {
 		nautilus_launch_application_from_command (gtk_window_get_screen (GTK_WINDOW (window)), "gnome-help", FALSE, NULL);
 	} else {
 		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)),
-			      "ghelp:gnome-help#files",
+			      helpuri,
 			      gtk_get_current_event_time (), &error);
 	}
 
@@ -925,10 +939,26 @@ static const GtkActionEntry main_entries[] = {
   /* label, accelerator */       N_("_Reload"), "<control>R",
   /* tooltip */                  N_("Reload the current location"),
                                  G_CALLBACK (action_reload_callback) },
-  /* name, stock id */         { "Nautilus Manual", GTK_STOCK_HELP,
-  /* label, accelerator */       N_("_Contents"), "F1",
+  /* name, stock id */         { "NautilusHelp", GTK_STOCK_HELP,
+  /* label, accelerator */       N_("_All Topics"), "F1",
   /* tooltip */                  N_("Display Nautilus help"),
                                  G_CALLBACK (action_nautilus_manual_callback) },
+  /* name, stock id */         { "NautilusHelpSearch", NULL,
+  /* label, accelerator */       N_("Search for files"), NULL,
+  /* tooltip */                  N_("Locate files based on file name and type. Save your searches for later use."),
+                                 G_CALLBACK (action_nautilus_manual_callback) },
+  /* name, stock id */         { "NautilusHelpSort", NULL,
+  /* label, accelerator */       N_("Sort files and folders"), NULL,
+  /* tooltip */                  N_("Arrange files by name, size, type, or when they were changed."),
+                                 G_CALLBACK (action_nautilus_manual_callback) },
+  /* name, stock id */         { "NautilusHelpLost", NULL,
+  /* label, accelerator */       N_("Find a lost file"), NULL,
+  /* tooltip */                  N_("Follow these tips if you can't find a file you created or downloaded."),
+                                 G_CALLBACK (action_nautilus_manual_callback) },
+  /* name, stock id */         { "NautilusHelpShare", NULL,
+  /* label, accelerator */       N_("Share and transfer files"), NULL,
+  /* tooltip */                  N_("Easily transfer files to your contacts and devices from the file manager."),
+                                 G_CALLBACK (action_nautilus_manual_callback) },
   /* name, stock id */         { "About Nautilus", GTK_STOCK_ABOUT,
   /* label, accelerator */       N_("_About"), NULL,
   /* tooltip */                  N_("Display credits for the creators of Nautilus"),



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