Commit 532a249a authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

shortcuts: added other flags: INTERNAL and FIXED

parent 08ede3b0
......@@ -449,6 +449,12 @@ shortcuts__dlg_preferences_construct_cb (GtkWidget *dialog,
if (g_strcmp0 (shortcut->category, GTH_SHORTCUT_CATEGORY_HIDDEN) == 0)
continue;
if ((shortcut->context & GTH_SHORTCUT_CONTEXT_INTERNAL) != 0)
continue;
if ((shortcut->context & GTH_SHORTCUT_CONTEXT_FIXED) != 0)
continue;
if (g_strcmp0 (shortcut->category,last_category) != 0) {
last_category = shortcut->category;
n_category++;
......
......@@ -172,7 +172,10 @@ gth_shortcuts_write_to_file (GPtrArray *shortcuts_v,
for (i = 0; i < shortcuts_v->len; i++) {
GthShortcut *shortcut = g_ptr_array_index (shortcuts_v, i);
if (shortcut->context == GTH_SHORTCUT_CONTEXT_INTERNAL)
if ((shortcut->context & GTH_SHORTCUT_CONTEXT_INTERNAL) != 0)
continue;
if ((shortcut->context & GTH_SHORTCUT_CONTEXT_FIXED) != 0)
continue;
dom_element_append_child (shortcuts,
......
......@@ -733,7 +733,7 @@ gth_window_add_accelerators (GthWindow *window,
shortcut = gth_shortcut_new ();
shortcut->action_name = g_strdup (acc->action_name);
shortcut->context = GTH_SHORTCUT_CONTEXT_INTERNAL;
shortcut->context = GTH_SHORTCUT_CONTEXT_INTERNAL | GTH_SHORTCUT_CONTEXT_ANY;
shortcut->category = GTH_SHORTCUT_CATEGORY_HIDDEN;
gth_shortcut_set_accelerator (shortcut, acc->accelerator);
_gth_window_add_shortcut (window, shortcut);
......
......@@ -132,11 +132,24 @@ typedef enum /*< skip >*/ {
typedef enum /*< skip >*/ {
GTH_SHORTCUT_CONTEXT_BROWSER = 1 << 1,
GTH_SHORTCUT_CONTEXT_VIEWER = 1 << 2,
GTH_SHORTCUT_CONTEXT_SLIDESHOW = 1 << 3,
/* Shortcut handled by Gtk, not customizable, specified for
* documentation. */
GTH_SHORTCUT_CONTEXT_INTERNAL = 1 << 1,
/* aggregated values */
/* Shortcut handled in gth_window_activate_shortcut, not customizable,
* specified for documentation. */
GTH_SHORTCUT_CONTEXT_FIXED = 1 << 2,
/* Shortcut available when the window is in browser mode. */
GTH_SHORTCUT_CONTEXT_BROWSER = 1 << 3,
/* Shortcut available when the window is in viewer mode. */
GTH_SHORTCUT_CONTEXT_VIEWER = 1 << 4,
/* Shortcut available in slideshows. */
GTH_SHORTCUT_CONTEXT_SLIDESHOW = 1 << 5,
/* Aggregated values: */
GTH_SHORTCUT_CONTEXT_BROWSER_VIEWER = (GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_VIEWER),
GTH_SHORTCUT_CONTEXT_ANY = (GTH_SHORTCUT_CONTEXT_BROWSER | GTH_SHORTCUT_CONTEXT_VIEWER | GTH_SHORTCUT_CONTEXT_SLIDESHOW),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment