[epiphany/wip/userhelp: 2/3] Update links to help, add app menuitem



commit cebf41dba105381cde71b14ff8d2be32b560d5c8
Author: Ekaterina Gerasimova <kittykat3756 gmail com>
Date:   Sat Jul 6 22:54:56 2013 +0100

    Update links to help, add app menuitem
    
    Update ephy_gui_help to link to pages, not sections. Update links to pages in the new help. Add an app 
menu Help item. Change the link from the preference dialog to link to the pref.page because one page per tab 
is not compatible with the help style…

 lib/ephy-gui.c                                |   12 ++++++------
 lib/ephy-gui.h                                |    2 +-
 src/bookmarks/ephy-bookmark-properties.c      |    2 +-
 src/bookmarks/ephy-bookmarks-editor.c         |    2 +-
 src/ephy-encoding-dialog.c                    |    2 +-
 src/ephy-history-window.c                     |    2 +-
 src/ephy-shell.c                              |   13 +++++++++++++
 src/ephy-window.c                             |    3 +++
 src/pdm-dialog.c                              |    4 ++--
 src/prefs-dialog.c                            |   20 +-------------------
 src/resources/epiphany-application-menu.ui    |    4 ++++
 src/resources/epiphany-bookmark-editor-ui.xml |    1 +
 src/resources/epiphany-history-window-ui.xml  |    1 +
 src/resources/epiphany-ui.xml                 |    1 +
 src/window-commands.c                         |    7 +++++++
 src/window-commands.h                         |    2 ++
 16 files changed, 46 insertions(+), 32 deletions(-)
---
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index f3ded52..2f5f812 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -269,25 +269,25 @@ ephy_gui_check_location_writable (GtkWidget *parent,
 /**
  * ephy_gui_help:
  * @parent: the parent window where help is being called
- * @section: help section to open or %NULL
+ * @page: help page to open or %NULL
  *
- * Displays Epiphany's help, opening the section indicated by @section.
+ * Displays Epiphany's help, opening the page indicated by @page.
  *
  * Note that @parent is used to know the #GdkScreen where to open the help
  * window.
  **/
 void
 ephy_gui_help (GtkWidget *parent,
-              const char *section)
+              const char *page)
 {
        GError *error = NULL;
        GdkScreen *screen;
        char *url;
 
-       if (section)
-               url = g_strdup_printf ("ghelp:epiphany?%s", section);
+       if (page)
+               url = g_strdup_printf ("help:epiphany/%s", page);
        else
-               url = g_strdup ("ghelp:epiphany");
+               url = g_strdup ("help:epiphany");
 
        if (parent)
            screen = gtk_widget_get_screen (parent);
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 505a7c5..b4a8844 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -59,7 +59,7 @@ gboolean      ephy_gui_check_location_writable         (GtkWidget *parent,
                                                          const char *filename);
 
 void           ephy_gui_help                            (GtkWidget *parent,
-                                                         const char *section);
+                                                         const char *page);
 
 void           ephy_gui_window_update_user_time         (GtkWidget *window,
                                                          guint32 user_time);
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c
index 294f0c0..ec26c61 100644
--- a/src/bookmarks/ephy-bookmark-properties.c
+++ b/src/bookmarks/ephy-bookmark-properties.c
@@ -381,7 +381,7 @@ bookmark_properties_response_cb (GtkDialog *dialog,
        {
                case GTK_RESPONSE_HELP:
                        ephy_gui_help (GTK_WIDGET (dialog),
-                                      "to-edit-bookmark-properties");
+                                      "bookmark-add");
                        return;
                case GTK_RESPONSE_ACCEPT:
                        priv->creating = FALSE;
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index e9430f2..6d3fdfc 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -976,7 +976,7 @@ static void
 cmd_help_contents (GtkAction *action,
                   EphyBookmarksEditor *editor)
 {
-       ephy_gui_help (GTK_WIDGET (editor), "ephy-managing-bookmarks");
+       ephy_gui_help (GTK_WIDGET (editor), "bookmark");
 }
 
 static void
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index ac5d89a..411745c 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -281,7 +281,7 @@ ephy_encoding_dialog_response_cb (GtkWidget *widget,
 {
        if (response == GTK_RESPONSE_HELP)
        {
-               ephy_gui_help (widget, "text-encoding");
+               ephy_gui_help (widget, NULL);
                return;
        }
 
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 81ba3b1..a0adb72 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -497,7 +497,7 @@ static void
 cmd_help_contents (GtkAction *action,
                   EphyHistoryWindow *editor)
 {
-       ephy_gui_help (GTK_WIDGET (editor), "ephy-managing-history");
+       ephy_gui_help (GTK_WIDGET (editor), "history");
 }
 
 G_DEFINE_TYPE (EphyHistoryWindow, ephy_history_window, GTK_TYPE_WINDOW)
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index bfb6d7a..8b286c6 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -188,6 +188,18 @@ show_pdm (GSimpleAction *action,
 }
 
 static void
+show_help (GSimpleAction *action,
+            GVariant *parameter,
+            gpointer user_data)
+{
+  GtkWindow *window;
+
+  window = gtk_application_get_active_window (GTK_APPLICATION (ephy_shell));
+
+  window_cmd_help_contents (NULL, GTK_WIDGET (window));
+}
+
+static void
 show_about (GSimpleAction *action,
             GVariant *parameter,
             gpointer user_data)
@@ -214,6 +226,7 @@ static GActionEntry app_entries[] = {
   { "history", show_history, NULL, NULL, NULL },
   { "preferences", show_preferences, NULL, NULL, NULL },
   { "pdm", show_pdm, NULL, NULL, NULL },
+  { "help", show_help, NULL, NULL, NULL },
   { "about", show_about, NULL, NULL, NULL },
   { "quit", quit_application, NULL, NULL, NULL },
 };
diff --git a/src/ephy-window.c b/src/ephy-window.c
index bec4113..fc37726 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -194,6 +194,8 @@ static const GtkActionEntry ephy_menu_entries [] = {
 
        /* Help. */
 
+       { "HelpContents", NULL, N_("_Help"), NULL, NULL,
+         G_CALLBACK (window_cmd_help_contents) },
        { "HelpAbout", NULL, N_("_About"), NULL, NULL,
          G_CALLBACK (window_cmd_help_about) }
 };
@@ -3759,6 +3761,7 @@ static const gchar* app_actions[] = {
        "EditBookmarks",
        "EditHistory",
        "FileQuit",
+       "HelpContents",
        "HelpAbout"
 };
 
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index 4a09260..1cff2d2 100644
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -142,8 +142,8 @@ pdm_dialog_show_help (PdmDialog *pd)
        int id;
 
        static char * const help_preferences[] = {
-               "managing-cookies",
-               "managing-passwords"
+               "data-cookies",
+               "data-passwords"
        };
 
        ephy_dialog_get_controls (EPHY_DIALOG (pd),
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 932da63..0406ff8 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -115,25 +115,7 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
 static void
 prefs_dialog_show_help (EphyDialog *dialog)
 {
-       GtkWidget *window, *notebook;
-       int id;
-
-       static const char help_preferences[][28] = {
-               "general-preferences",
-               "fonts-and-style-preferences",
-               "privacy-preferences",
-               "language-preferences"
-       };
-
-       ephy_dialog_get_controls (dialog,
-                                 "prefs_dialog", &window,
-                                 "prefs_notebook", &notebook,
-                                 NULL);
-
-       id = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
-       id = CLAMP (id, 0, 3);
-
-       ephy_gui_help (window, help_preferences[id]);
+       ephy_gui_help (GTK_WIDGET (dialog), "pref");
 }
 
 static void
diff --git a/src/resources/epiphany-application-menu.ui b/src/resources/epiphany-application-menu.ui
index d521212..96b1419 100644
--- a/src/resources/epiphany-application-menu.ui
+++ b/src/resources/epiphany-application-menu.ui
@@ -44,6 +44,10 @@
     </section>
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Help</attribute>
+        <attribute name="action">app.help</attribute>
+      </item>
+      <item>
         <attribute name="label" translatable="yes">_About</attribute>
         <attribute name="action">app.about</attribute>
       </item>
diff --git a/src/resources/epiphany-bookmark-editor-ui.xml b/src/resources/epiphany-bookmark-editor-ui.xml
index dcad180..2998d47 100644
--- a/src/resources/epiphany-bookmark-editor-ui.xml
+++ b/src/resources/epiphany-bookmark-editor-ui.xml
@@ -32,6 +32,7 @@
 </menu>
 
 <menu name="HelpMenu" action="Help">
+       <menuitem action="HelpContents"/>
        <menuitem action="HelpAbout"/>
 </menu>
 
diff --git a/src/resources/epiphany-history-window-ui.xml b/src/resources/epiphany-history-window-ui.xml
index 34ed611..5592ec2 100644
--- a/src/resources/epiphany-history-window-ui.xml
+++ b/src/resources/epiphany-history-window-ui.xml
@@ -28,6 +28,7 @@
 </menu>
 
 <menu name="HelpMenu" action="Help">
+       <menuitem name="HelpContents" action="HelpContents"/>
        <menuitem name="HelpAbout" action="HelpAbout"/>
 </menu>
 
diff --git a/src/resources/epiphany-ui.xml b/src/resources/epiphany-ui.xml
index 976dddc..ba40007 100644
--- a/src/resources/epiphany-ui.xml
+++ b/src/resources/epiphany-ui.xml
@@ -101,6 +101,7 @@
                 </menu>
                 <menuitem name="ViewPageSourceMenu" action="ViewPageSource"/>
                 <separator name="FileSep7"/>
+                <menuitem name="HelpContentsMenu" action="HelpContents"/>
                 <menuitem name="HelpAboutMenu" action="HelpAbout"/>
                 <menuitem name="FileCloseWindowMenu" action="FileCloseTab"/>
                 <menuitem name="FileQuitMenu" action="FileQuit"/>
diff --git a/src/window-commands.c b/src/window-commands.c
index 8e73ce7..eb97a9d 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -1659,6 +1659,13 @@ window_cmd_view_page_source (GtkAction *action,
        }
 }
 
+void
+window_cmd_help_contents (GtkAction *action,
+                         GtkWidget *window)
+{
+       ephy_gui_help (window, NULL);
+}
+
 #define ABOUT_GROUP "About"
 
 void
diff --git a/src/window-commands.h b/src/window-commands.h
index abf5865..ddc85ea 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -84,6 +84,8 @@ void window_cmd_view_zoom_normal          (GtkAction  *action,
                                            EphyWindow *window);
 void window_cmd_view_page_source          (GtkAction  *action,
                                            EphyWindow *window);
+void window_cmd_help_contents             (GtkAction  *action,
+                                           GtkWidget  *window);
 void window_cmd_help_about                (GtkAction  *action,
                                            GtkWidget  *window);
 void window_cmd_tabs_next                 (GtkAction  *action,


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