Fix #434: Part 2.0
authorColin Clark <cclark@mcb.net>
Tue, 20 Dec 2016 21:36:52 +0000 (21:36 +0000)
committerColin Clark <cclark@mcb.net>
Tue, 20 Dec 2016 21:36:52 +0000 (21:36 +0000)
https://github.com/BestImageViewer/geeqie/issues/434

Remove data duplicated in the README and Help files
Include context-sensitive help in all preferences windows
Minor addition to README file

README
doc/docbook/GuideIndex.xml
doc/docbook/GuideOptions.xml [deleted file]
src/cache_maint.c
src/desktop_file.c
src/layout.c
src/layout_util.c
src/preferences.c
src/window.c

diff --git a/README b/README
index e3efc7d..41933cf 100644 (file)
--- a/README
+++ b/README
@@ -114,11 +114,12 @@ See NEWS file.
 
   Known bugs:
 
-    See the Geeqie Bug Tracker at TODO file.
+    See the Geeqie Bug Tracker at https://github.com/BestImageViewer/geeqie/issues
 
 ## Installation
 
   Compilation: ./autogen.sh ; make
+  Show compile options: ./autogen.sh --help
   General install: make install
   Removal: make uninstall
 
@@ -143,232 +144,6 @@ See NEWS file.
       - input: side-by-side (JPS) and MPO format
       - output: single image, anaglyph, SBS, mirror, SBS half size (3DTV)
 
-## Documentation (brief)                         [section:documentation]
-
-This sections lists default hotkeys. Most of the hotkeys can be redefined in the
-Preferences dialog.
-
-  Keyboard commands:
-    [PageDown], [Keypad PageDown]      next image
-    [PageUp], [Keypad PageUp]          previous image
-    [Home], [Keypad Home]              first image in list
-    [End], [Keypad End]                last image in list
-    [Tab]                              tab completion in path entry window
-    [Escape]                           cancel completion in path entry window
-
-  Keyboard commands valid when image has focus (image has black rectangle)
-    arrow keys, [Keypad arrows]        pan image
-    [Shift] - arrow keys               pan image faster
-    [Space]                            next image
-    [Backspace] , B                    previous image
-
-  File menu related:
-    [Ctrl] - N                         new window
-    C                                  new empty collection
-    O                                  open collection
-    D                                  open a Find Duplicates window
-    [Shift]- P                         open Print dialog
-    [Ctrl] - F                         new folder
-    [Ctrl] - C                         copy file
-    [Ctrl] - M                         move file
-    [Ctrl] - R                         rename file
-    [Ctrl] - D, [Delete]               delete file
-    [Ctrl] - W                         close window
-    [Ctrl] - Q                         exit Geeqie
-
-  Edit menu related:
-    1 .. 6                             toggle mark
-    [Ctrl] - 1..6                      select mark
-    [Ctrl] - A                         select all files
-    [Ctrl] - [Shift] - A               unselect all files
-    [Ctrl] - P                         display image properties window
-    [Ctrl] - O                         configure Options
-    ]                                  rotate image clockwise
-    [                                  rotate image counterclockwise
-    [Shift] - R                        rotate image 180 degrees
-    [Shift] - M                        mirror image (horizontal)
-    [Shift] - F                        flip image (vertical)
-    [Shift] - G                        grayscale image
-
-  View menu related:
-    +, =, [Keypad +]                   zoom in
-    -, [Keypad -]                      zoom out
-    Z, [Keypad /]                      zoom to original size
-    X, [Keypad *]                      zoom to fit within window
-    W                                  zoom to fit width of window
-    H                                  zoom to fit height of window
-    T                                  toggle thumbnails in list view
-    [Ctrl] - L                         display files as list view
-    [Ctrl] - I                         display files as icon view
-    [Ctrl] - T                         toggle tree view of directories
-    R                                  refresh list
-    L                                  (Un)float file selection area
-    [ctrl] - H                         (Un)hide file selection area
-    [Ctrl] - K                         toggle sidebar with EXIF or keywords
-    [Ctrl] - E                         show EXIF window
-    [Ctrl] - S                         toggle sort manager sidebar
-    F, V                               toggle full screen
-    S                                  toggle slide show
-    P                                 (Un)pause slideshow
-    [Ctrl] - V                         display current image in new window
-
-  Collection windows:
-
-    arrows, [Keypad arrows]            move selection
-    [Shift] + arrows                   select multiple images
-    [Ctrl] + arrows                    move without changing selection
-    [Space]                            select only image with focus
-    [Ctrl] + [Space]                   toggle selection of image with focus
-    [Home], [Keypad Home]              move focus to top of images
-    [End], [Keypad End]                move focus to end of images
-      (shift and ctrl work with Home, End, PageUp/Down as with arrows)
-    [Ctrl] - A                         select all images
-    [Ctrl] - [Shift] - A               unselect all images
-
-    [Delete], [Keypad Delete]          remove selected images from collection
-                                       (does not delete file)
-    [Ctrl] - L                         add images from main window file list
-
-    [Ctrl] - T                         toggle display of icon filename text
-
-    N                                  sort collection by name
-    D                                  sort collection by date
-    B                                  sort collection by size (bytes)
-    P                                  sort collection by location (path)
-    I (*)                              sort collection by name numerically
-                                   (file1 file10 file2 -> file1 file2 file10)
-
-    [Enter], [Keypad Enter]            view image with focus in main window
-    V                                  view image with focus in new window
-
-    S                                  save collection
-    [Ctrl] - S                         save collection as...
-    A                                  append to collection...
-
-    [Shift] - P                        print selected images...
-
-    [Ctrl] - C                         copy selected files...
-    [Ctrl] - M                         move selected files...
-    [Ctrl] - R                         rename selected files...
-    [Ctrl] - D                         delete selected files
-
-    [Ctrl] - P                         display image properties window
-
-    [Ctrl] - W                         close window
-
-  Find Duplicates window:
-
-    [Ctrl] - A                         select all images
-    [Ctrl] - [Shift] - A               unselect all images
-    1                                  select group 1 duplicates
-    2                                  select group 2 duplicates
-
-    [Ctrl] - L                         add images from main window file list
-    C                                  add selected images to new collection
-
-    [Delete], [Keypad Delete]          remove selected images from list
-    [Ctrl] - [Delete]                  clear window
-
-    [Enter], [Keypad Enter]            view image with focus in main window
-    V                                  view image with focus in new window
-    [Ctrl] - 1 .. 0                    open selected image(s) in editor
-
-    [Ctrl] - C                         copy selected files...
-    [Ctrl] - M                         move selected files...
-    [Ctrl] - R                         rename selected files...
-    [Ctrl] - D                         delete selected files
-
-    [Ctrl] - P                         display image properties window
-
-    [Ctrl] - W                         close window
-
-  Pan View:
-
-    [Ctrl] - F, /                      show search bar
-    [Ctrl] - G                         repeat previous search
-
-  (*) This is a compile time option enabled when strverscmp is found.
-
-  Mouse image control:
-
-    Button 1                           view next image
-    Button 2                           view previous image
-    Button 3                           context menu
-
-    Button 1 drag                      scroll/pan image
-    Button 2 drag                      initiate drag and drop
-
-    Wheel up/down                      change to previous/next image
-    Wheel up/down + [Shift]            scroll image up/down
-    Wheel up/down + [Control]          zoom image in/out
-
-## Editor command macros                               [section:editors]
-
-Editors are configured via standard desktop files.
-
-## Overlay Info                                        [section:overlay]
-
-Overlay info format string syntax is: %tag[:max_length][:extra]%
-
-  %name%          Filename of the picture.
-  %collection%    Name of the collection
-  %number%        Current number of image in the list
-  %total%         Total number of images
-  %date%          File date
-  %size%          File size
-  %width%         Image width
-  %height%        Image height
-  %res%           Image resolution
-  %keywords%      Image keywords from metadata
-  %comment%       Image comment from metadata
-  %lua/file.lua/% Lua functionality
-
-  To access exif data use the exif name:
-  %Exif.Photo.DateTimeOriginal%        Date of the original shot
-
-  Pre-formatted exif data is also available:
-  formatted.Camera              Camera and sofware name
-  formatted.DateTime            Image Date
-  formatted.ShutterSpeed        Shutter speed in seconds (ie. 1/60s)
-  formatted.Aperture            Aperture (ie. f5.6)
-  formatted.ExposureBias        Exposure bias (ie. +0.3)
-  formatted.ISOSpeedRating      ISO sensitivity (ie. 100)
-  formatted.FocalLength         Focal length
-  formatted.FocalLength35mmFilm Focal length 35mm
-  formatted.SubjectDistance     Subject distance
-  formatted.Flash               Flash
-  formatted.Resolution          Resolution
-  formatted.ColorProfile        Color profile
-  formatted.GPSPosition                GPS position
-  formatted.GPSAltitude                GPS altitude
-
-  You can limit the length of displayed data using :number notation:
-  %formatted.Camera:20% will truncate the displayed data to 20 characters and
-  will add 3 dots at the end to denote the truncation.
-
-  If two or more variables are connected with the |-sign, it prints available
-  variables with a separator:
-  %formatted.ShutterSpeed%|%formatted.ISOSpeedRating%|%formatted.FocalLength%
-  could show:
-    "1/20s - 400 - 80 mm"
-  or
-    "1/200 - 80 mm" if there's no ISO information in the Exif data.
-
-  If a line is empty, it is removed. This allows one to add lines that totally
-  disappear when no data is available.
-
-  Extra string uses special character '*' to mark the position of the data. If
-  no '*' is present, then extra string is just appended to data. Any "\n" is
-  replaced by a newline on display. Pango mark up is accepted in left and right
-  parts. If data is empty, nothing will be displayed.
-
-  Examples:
-  "%name:<i>*</i>\n%" -> name is displayed in italics ended with a newline
-  "%size:\n%"         -> size is displayed with a newline at end
-  "%formatted.ISOSpeedRating:ISO *%"      -> ie. "ISO 100"
-  "%collection: Collection <b>*</b>\n%" -> display collection name in bold prefixed by
-                             "Collection " and a newline is appended
-
 ## Credits                                             [section:credits]
 
   Translations:
index 9c33723..8265699 100644 (file)
@@ -69,7 +69,8 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideColorManagement.xml" />\r
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideImagePresentation.xml" />\r
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuidePrinting.xml" />\r
-  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptions.xml" />\r
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsMain.xml" />\r
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsAdditional.xml" />\r
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideReference.xml" />\r
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideFaq.xml" />\r
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideLicence.xml" />\r
diff --git a/doc/docbook/GuideOptions.xml b/doc/docbook/GuideOptions.xml
deleted file mode 100644 (file)
index b57fa18..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<chapter id="GuideOptions">\r
-  <title id="titleGuideOptions">Preferences</title>\r
-  <para>There are two sets of preferences in Geeqie: those set via the main Preferences tabbed dialogue, and those set either via a menu entry or by editing a configuration file.</para>\r
-  <section>\r
-    <title>Main Preferences</title>\r
-    <para>\r
-      This chapter explains in detail the main Geeqie preferences dialog, which is accessed via\r
-      <menuchoice>\r
-        <shortcut>\r
-          <keycombo>\r
-            <keycap>Ctrl</keycap>\r
-            <keycap>O</keycap>\r
-          </keycombo>\r
-        </shortcut>\r
-        <guimenu>Edit</guimenu>\r
-        <guimenuitem>Preferences</guimenuitem>\r
-        <guimenuitem>Preferences</guimenuitem>\r
-      </menuchoice>\r
-      or\r
-      <guiicon>\r
-        <inlinegraphic fileref="preferences-desktop.png" />\r
-      </guiicon>\r
-      on the Toolbar.\r
-    </para>\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsGeneral.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsImage.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsWindow.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsKeyboard.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsFiltering.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsMetadata.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsColor.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsStereo.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsBehavior.xml" />\r
-  </section>\r
-  <section>\r
-    <title>Additional Preferences</title>\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsLayout.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideEditorsConfig.xml" />\r
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="GuideOptionsHidden.xml" />\r
-    <para />\r
-  </section>\r
-</chapter>\r
index 1a574e6..aa47a1a 100644 (file)
@@ -1029,6 +1029,11 @@ static void cache_manager_close_cb(GenericDialog *gd, gpointer data)
        cache_manager = NULL;
 }
 
+static void cache_manager_help_cb(GenericDialog *gd, gpointer data)
+{
+       help_window_show("GuideReferenceManagement.html");
+}
+
 static GtkWidget *cache_manager_location_label(GtkWidget *group, const gchar *subdir)
 {
        GtkWidget *label;
@@ -1070,6 +1075,8 @@ void cache_manager_show(void)
        gd->cancel_cb = cache_manager_close_cb;
        generic_dialog_add_button(gd, GTK_STOCK_CLOSE, NULL,
                                  cache_manager_close_cb, FALSE);
+       generic_dialog_add_button(gd, GTK_STOCK_HELP, NULL,
+                                 cache_manager_help_cb, FALSE);
 
        generic_dialog_add_message(gd, NULL, _("Cache and Data Maintenance"), NULL);
 
index 5fcf86f..d88259a 100644 (file)
@@ -383,6 +383,11 @@ static void editor_list_window_new_cb(GtkWidget *widget, gpointer data)
        editor_window_new(DESKTOP_FILE_TEMPLATE, _("new.desktop"));
 }
 
+static void editor_list_window_help_cb(GtkWidget *widget, gpointer data)
+{
+       help_window_show("GuideEditorsConfig.html");
+}
+
 static void editor_list_window_selection_changed_cb(GtkWidget *widget, gpointer data)
 {
        EditorListWindow *ewl = data;
@@ -478,6 +483,12 @@ static void editor_list_window_create(void)
        gtk_widget_show(hbox);
 
 
+       button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE,
+                                G_CALLBACK(editor_list_window_help_cb), ewl);
+       gtk_container_add(GTK_CONTAINER(hbox), button);
+       gtk_widget_set_can_default(button, TRUE);
+       gtk_widget_show(button);
+
        button = pref_button_new(NULL, GTK_STOCK_NEW, NULL, FALSE,
                                 G_CALLBACK(editor_list_window_new_cb), ewl);
        gtk_container_add(GTK_CONTAINER(hbox), button);
index 4921b1a..c250e5a 100644 (file)
@@ -1814,6 +1814,11 @@ static void layout_config_apply_cb(GtkWidget *widget, gpointer data)
        layout_apply_options(lc->lw, &lc->options);
 }
 
+static void layout_config_help_cb(GtkWidget *widget, gpointer data)
+{
+       help_window_show("GuideOptionsLayout.html");
+}
+
 static void layout_config_ok_cb(GtkWidget *widget, gpointer data)
 {
        LayoutConfig *lc = data;
@@ -1906,6 +1911,12 @@ void layout_show_config_window(LayoutWindow *lw)
        GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
        gtk_widget_show(button);
 */
+       button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE,
+                                G_CALLBACK(layout_config_help_cb), lc);
+       gtk_container_add(GTK_CONTAINER(hbox), button);
+       gtk_widget_set_can_default(button, TRUE);
+       gtk_widget_show(button);
+
        button = pref_button_new(NULL, GTK_STOCK_APPLY, NULL, FALSE,
                                 G_CALLBACK(layout_config_apply_cb), lc);
        gtk_container_add(GTK_CONTAINER(hbox), button);
index 2f7d216..f7415b5 100644 (file)
@@ -855,7 +855,7 @@ static void layout_menu_help_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       help_window_show("html_contents");
+       help_window_show("index.html");
 }
 
 static void layout_menu_help_keys_cb(GtkAction *action, gpointer data)
@@ -863,7 +863,7 @@ static void layout_menu_help_keys_cb(GtkAction *action, gpointer data)
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       help_window_show("documentation");
+       help_window_show("GuideReferenceKeyboardShortcuts.html");
 }
 
 static void layout_menu_notes_cb(GtkAction *action, gpointer data)
index d7477ad..4f558ab 100644 (file)
@@ -408,6 +408,28 @@ static void config_window_close_cb(GtkWidget *widget, gpointer data)
        filter_store = NULL;
 }
 
+static void config_window_help_cb(GtkWidget *widget, gpointer data)
+{
+       GtkWidget *notebook = GTK_NOTEBOOK(data);
+       gint i;
+
+       static gchar *html_section[] =
+       {
+       "GuideOptionsGeneral.html",
+       "GuideOptionsImage.html",
+       "GuideOptionsWindow.html",
+       "GuideOptionsKeyboard.html",
+       "GuideOptionsFiltering.html",
+       "GuideOptionsMetadata.html",
+       "GuideOptionsColor.html",
+       "GuideOptionsSteroa.html",
+       "GuideOptionsBehavior.html"
+       };
+
+       i = gtk_notebook_get_current_page(notebook);
+       help_window_show(html_section[i]);
+}
+
 static gboolean config_window_delete(GtkWidget *widget, GdkEventAny *event, gpointer data)
 {
        config_window_close_cb(NULL, NULL);
@@ -1051,7 +1073,7 @@ static void image_overlay_default_template_cb(GtkWidget *widget, gpointer data)
 
 static void image_overlay_help_cb(GtkWidget *widget, gpointer data)
 {
-       help_window_show("overlay");
+       help_window_show("GuideOptionsWindow.html#OverlayScreenDisplay");
 }
 
 static void image_overlay_set_font_cb(GtkWidget *widget, gpointer data)
@@ -2373,12 +2395,32 @@ static void config_window_create(void)
        gtk_container_add(GTK_CONTAINER(configwindow), win_vbox);
        gtk_widget_show(win_vbox);
 
+       notebook = gtk_notebook_new();
+       gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
+       gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0);
+
+       config_tab_general(notebook);
+       config_tab_image(notebook);
+       config_tab_windows(notebook);
+       config_tab_accelerators(notebook);
+       config_tab_files(notebook);
+       config_tab_metadata(notebook);
+       config_tab_color(notebook);
+       config_tab_stereo(notebook);
+       config_tab_behavior(notebook);
+
        hbox = gtk_hbutton_box_new();
        gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END);
        gtk_box_set_spacing(GTK_BOX(hbox), PREF_PAD_BUTTON_GAP);
        gtk_box_pack_end(GTK_BOX(win_vbox), hbox, FALSE, FALSE, 0);
        gtk_widget_show(hbox);
 
+       button = pref_button_new(NULL, GTK_STOCK_HELP, NULL, FALSE,
+                                G_CALLBACK(config_window_help_cb), notebook);
+       gtk_container_add(GTK_CONTAINER(hbox), button);
+       gtk_widget_set_can_default(button, TRUE);
+       gtk_widget_show(button);
+
        button = pref_button_new(NULL, GTK_STOCK_OK, NULL, FALSE,
                                 G_CALLBACK(config_window_ok_cb), NULL);
        gtk_container_add(GTK_CONTAINER(hbox), button);
@@ -2411,20 +2453,6 @@ static void config_window_create(void)
                gtk_box_reorder_child(GTK_BOX(hbox), ct_button, -1);
                }
 
-       notebook = gtk_notebook_new();
-       gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
-       gtk_box_pack_start(GTK_BOX(win_vbox), notebook, TRUE, TRUE, 0);
-
-       config_tab_general(notebook);
-       config_tab_image(notebook);
-       config_tab_windows(notebook);
-       config_tab_accelerators(notebook);
-       config_tab_files(notebook);
-       config_tab_metadata(notebook);
-       config_tab_color(notebook);
-       config_tab_stereo(notebook);
-       config_tab_behavior(notebook);
-
        gtk_widget_show(notebook);
 
        gtk_widget_show(configwindow);
index f2d51f7..45782d6 100644 (file)
@@ -188,11 +188,11 @@ static gchar *html_browsers[] =
        NULL,           NULL
 };
 
-static void help_browser_run(void)
+static void help_browser_run(const gchar *section)
 {
        gchar *name = options->helpers.html_browser.command_name;
        gchar *cmd = options->helpers.html_browser.command_line;
-       gchar *path = g_build_filename(GQ_HTMLDIR, "index.html", NULL);
+       gchar *path = g_build_filename("file://", GQ_HTMLDIR, section, NULL);
        gchar *result = NULL;
        gint i;
 
@@ -244,9 +244,9 @@ void help_window_show(const gchar *key)
 {
        gchar *path;
 
-       if (key && strcmp(key, "html_contents") == 0)
+       if (key && strstr(key, ".html") != 0)
                {
-               help_browser_run();
+               help_browser_run(key);
                return;
                }