Commit Graph

21 Commits

Author SHA1 Message Date
Ell 2816695eda app: add gimp_action_history_is_blacklisted_action()
... and rename gimp_action_history_excluded_action() to
gimp_action_history_is_excluded_action().

is_blacklisted_action() determines whether an action should be
excluded from *both* the history and the search results, while
is_excluded_action() determines if an action should be excluded
only from the history.  This eliminates some redundancy across
gimpaction-history and action-search-dialog.
2018-02-17 04:57:28 -05:00
Michael Natterer 35ecf06f56 app: don't add blacklisted/excluded actions to the action history
gimp_action_history_init(): when deserializing the action history,
check each action against gimp_action_history_excluded_action() so
when we decide to exclude an action, it doesn't come back as history
zombie from disk.
2018-01-13 21:29:48 +01:00
Michael Natterer 6131b00b54 Bug 774890 - "Keyboard shortcuts" dialog does not show all actions
Revert "app: action search should search accross all available actions."

This reverts commit 53b3673bd8.

Had to revert these two commits, quoting comment 6 of the bug:

Thinking again, that entire change is unfortunately wrong, the only
right UI manager is in fact

gimp_ui_managers_from_name ("<Image>")->data

because it's the global popup <Image> UI manager which is independent
of a display and it always in the right state for the currently
active image, all other UI managers are wrong.
2016-11-24 21:08:34 +01:00
Michael Natterer 1517a0952b Bug 774890 - "Keyboard shortcuts" dialog does not show all actions
Revert "app: do not show the actions from <Dockable> GimpUIManager."

This reverts commit b795ae2296.
2016-11-24 21:07:53 +01:00
Jehan b795ae2296 app: do not show the actions from <Dockable> GimpUIManager.
<Dockable> has this whole list of actions named similarly to dialogs-*
actions, and we don't want these to take precedence, especially since
they would always create a new dock instead of just showing the existing
one if already present.
Also fix the redundancy check on already added actions.
2016-11-23 07:58:18 +01:00
Jehan 53b3673bd8 app: action search should search accross all available actions.
It was only searching through the "<Image>" GimpUIManager, so several
action groups were ignored, for instance all palettes-* actions.
2016-11-23 04:01:30 +01:00
Jehan 754034146d app: plug-in-repeat and plug-in-reshow were renamed...
... in commit ac50da2a, respectively into filters-repeat and
filters-reshow.
2016-11-22 22:55:50 +01:00
Michael Natterer 1449d3cb8f app: remove the "Recent Filters" actions from action search again
The code was still checking for "plug-in-recent-*". Also, rename the
actions to "filters-recent-*" instead of "filter-recent-*" for
consistency with the other filters actions.
2016-11-03 22:37:13 +01:00
Jehan 0377e61cc4 app: "help-action-search" has been renamed to "dialogs-action-search"...
... since commits 36f87b5b and 2b6a10b7.
With the renaming, action-search was showing itself in its list.
2016-09-12 01:49:08 +02:00
Ell 8d9df886e2 app: don't hold a direct reference to actions in the action history
Instead, store only the action's name, and look it up upon searching.

Keeping a reference to the actions in the history extended the lifetime of
actions that sohuld have otherwise died, leading to all sorts of nastiness.  In
particular, the Alt+[n] actions to switch between images would remain bound to
their accelerator after the image has been closed, holding a dangling display
pointer, which would lead to a segfault, or fail with a CRITICAL message, when
using the accelerator again.
2016-05-16 12:47:20 +00:00
Jehan b9a9169656 app: update action search to use glib API.
I now normalize with g_str_tokenize_and_fold() which uses standard
Unicode normalization.
I don't use g_str_match_string() directly though, because I want to
run additional checks to order the results by relevance. For instance
I still want actions whose labels starts with the search string to be
at the top, and results with same order as search token before those
with a different order. Then results with match in the tooltip. Finally
I also returns results with partial match in the label, and the rest in
the tooltip, though at the bottom of the list.
Other than that, this returns the same results as g_str_match_string()
with a similar algorithm. In particular now we only match the start of
tokens (a substring in the middle of a token won't match anymore).
I kept the small 2-character trick matching the first letters of the
first 2 words of the label, but I got rid of the fuzzy search (that none
really found ever relevant anyway).
2014-09-16 04:03:43 +02:00
Mikael Magnusson 16637900b6 app: initialize variable 2014-08-16 02:54:57 +02:00
Michael Natterer c077fb8dad app: add --verbose output when parsing and writing the action history 2014-07-29 18:13:57 +02:00
Michael Natterer 50ca9068da app: more cleanup in the action history code, mostly general consistency 2014-07-29 12:28:18 +02:00
Michael Natterer b81f46185e app: port the action history to GimpConfigWriter, GimpScanner and to GIO
which means the file format has changed, but it will silently ignore
the parse error when encountering the old format.
2014-07-28 16:44:44 +02:00
Michael Natterer 57cecb54fb app: some serious cleanup in gimpaction-history.c, still a lot to do 2014-07-28 11:22:20 +02:00
Michael Natterer dcad833d1c app: add gimp_action_is_gui_blacklisted()
which filters out some implementation details but mainly all the
tool-specific options actions which only exist as redirect targets for
the generic tool opaticy, size, aspect and angle actions. Use the new
function from the shortcut editor and from action search so stuff is
consistently hidden.
2014-04-20 15:57:57 +02:00
Michael Natterer 87df804f8a app: exclude generated submenu actions for plug-ins from the search 2014-02-19 01:24:27 +01:00
Michael Natterer 0d16c328c8 app: use gimp_personal_rc_file() not g_build_filename()
for saving the action history.
2014-02-18 23:31:25 +01:00
Michael Natterer 00348ffc0c app: more action search cleanup
- standard copyright headers
- use gtk_action_is_sensitive() not get_sensitive()
- formatting
2014-02-18 23:24:48 +01:00
Jehan 5903e53d51 Bug 708174 - Improve the original search dialog patch.
Fix various bugs, improve code design and efficiency, change feature
name, update the feature up to our standards (now uses GIMP preferences,
session management, less overwhelming settings...).
Also now action history is tightly tied to GimpAction and logs all
action activation (however it activates, and the show_unavailable
parameter also applies to history).
Search algorithm greatly improved with basic tokenization, better
ordering, filtering, etc.
2014-02-18 19:13:03 +01:00