Commit Graph

50017 Commits

Author SHA1 Message Date
Anders Jonsson 9d175f681a plug-ins: fix typos in sparkle 2023-04-14 10:54:05 +00:00
Martin 70bb6fe939 Update Slovenian translation 2023-04-14 10:50:06 +00:00
Martin 998039ffa6 Update Slovenian translation 2023-04-14 10:42:24 +00:00
Alx Sa 82a4f568d4 plug-ins: Port sparkle to GimpProcedureDialog 2023-04-14 04:23:11 +00:00
Ekaterine Papava 71ecdd30ea Update Georgian translation 2023-04-14 04:17:40 +00:00
Alx Sa fe9b13f43c plug-ins: Update GimpPreview format in despeckle 2023-04-14 02:25:36 +00:00
Anders Jonsson e0eb79b5c1 Update POTFILES.in 2023-04-13 23:21:49 +00:00
Jehan 341fd90958 Issue #9349: add concept of "short" (contextual) vs "long" label for actions.
Basically actions in menus should show the short label (we assume the menu
position brings contextuality) when available, whereas it will use the longer
label in GUI lacking contextuality.

As a first such usage, the `file-open-recent-*` actions have the file name which
will be opened as short label. This is used in menus since the submenu `File >
Open Recent` ensures that the action which will run is perfectly understandable.
On the other hand, in the action search, the action is named 'Open "<file
name>"' since an action named only with a file name would not be understandable.
2023-04-14 00:17:15 +02:00
Jehan 747cbf70db app: add a "Filters > Generic > GEGL Operations" submenu with generated actions.
Since we now generate actions for GEGL ops, we might as well generate menu items
for these too.

What I did:

- Move the "GEGL Operation…" tool (generic dialog with a drop-down list of all
  non-ignored GEGL ops) to Tools menu.
- Create a "GEGL Operations" submenu in Filters > Generic.
- Move "GEGL Graph" to the top of this new submenu.
- Generate a new menu item for each generated action tied to a GEGL plug-in,
  alphabetically sorted.
2023-04-13 23:06:54 +02:00
Alexander Shopov 0568866871 Update Bulgarian translation 2023-04-13 20:30:34 +00:00
Alexander Shopov a8ed8a7e0c Update Bulgarian translation 2023-04-13 19:32:03 +00:00
Jehan d51c64ec06 Issue #9228: make GEGL Operation tool's operations their own actions too.
Though the GEGL Operation tool is still useful as a generic dialog, let's
generate also per-operation (the ones not ignored and not already special-cased
in the rest of the GUI) tools and actions.

These "tools" are mostly hidden (e.g. not selectable in toolbox where it would
be a bit useless as they would show with the generic GEGL icon or none), but
they can be searched with the action search, shortcuts can be assigned and they
can be added to menus.
2023-04-13 21:28:52 +02:00
Alexander Shopov 60354a0e59 Update Bulgarian translation 2023-04-13 19:22:04 +00:00
Yuri Chornoivan 171d9b8f0c Update Ukrainian translation 2023-04-13 16:19:28 +00:00
Jehan 6776439c6f NEWS: update. 2023-04-13 12:18:54 +02:00
Martin 73b73153d3 Update Slovenian translation 2023-04-13 10:04:12 +00:00
Alexander Shopov 5919f44d9d Update Bulgarian translation 2023-04-13 10:03:30 +00:00
Martin 045bc02e15 Update Slovenian translation 2023-04-13 10:01:14 +00:00
Alexander Shopov 4a4ef92120 Update Bulgarian translation 2023-04-13 08:26:23 +00:00
Ekaterine Papava c3732bfd02 Update Georgian translation 2023-04-13 04:31:32 +00:00
Jehan 0ee620f4e6 menus: fix autotools distclean.
Fixes the following build error on CI:

> ERROR: files left in build directory after distclean:
2023-04-12 22:36:21 +02:00
Jehan 5790adcfd3 menus: do not validate the DTD for GtkBuilder UI format. 2023-04-12 22:07:09 +02:00
Jehan c7c5f126b1 app: disable some unit tests temporarily.
Since the recent changes, these 3 tests are not working:
- tools
- session-2-8-compatibility-multi-window
- session-2-8-compatibility-single-window

(the 2 latters were only working with xvfb anyway)

I could just dig further as I did a bit these last few days, and tweak more and
more the testing code. But I think our current unit-testing framework is just
non-reliable and for all these years, we have spent more time fixing the tests
than actually relying on them to tell us there is a bug in GIMP.
Furthermore creating new tests is so cumbersome that basically none do it.

I have a plan laid out in #9339 for a much better and more reliable unit testing
infrastructure, based on the GIMP executable itself and a very simple syntax to
create new test scenari (so that even non-developers should be able to create
them eventually). So until then, let's disable these tests and stop wasting
time.
2023-04-12 22:07:09 +02:00
Jehan aa8ccf3ba8 Issue #6612: support numpad's divide ('/') as secondary action search shortcut. 2023-04-12 22:07:09 +02:00
Jehan af5612eda2 Issue #3834: keys Copy, Cut and Paste now supported as secondary shortcuts. 2023-04-12 22:07:09 +02:00
Jehan ab33d032ad app: support Forward and Back keys.
Same as ZoomIn/Out keys, these are implemented as secondary shortcuts to actions
"windows-show-display-next" and "windows-show-display-previous" respectively.

See issue #637.
2023-04-12 22:07:09 +02:00
Jehan 9e8304aeb9 Issue #637: support ZoomIn and ZoomOut special keys.
These will simply be recorded as secondary shortcuts for view-zoom-in and
view-zoom-out.
2023-04-12 22:07:09 +02:00
Jehan 71c8ff1f21 app: change all action entry structs to allow several shortcuts.
- The `accelerator` variable is a NULL-terminated array, allowing up to 3
  accelerators per action (so far, none has more than 2).
- Only the struct GimpProcedureActionEntry still has a single accelerator as I
  don't think it makes sense that we change the plug-in API to allow a plug-in
  to register more than 1 shortcut for a procedure (e.g. we don't want a plug-in
  to just register all possible keys for their procedure!).
  Of course, users will still be allowed to register more shortcuts for plug-in
  actions through the shortcut dialog. It's only the initialization which
  1-shortcut max for procedure actions.
- Remove all actions ending up in "-accel" as these were only a trick to
  register more shortcut for a same action. Now we just have the real
  possibility (rather than creating bogus duplicate actions). As a consequence,
  these actions accelerators have been moved as secondary accelerator to their
  main action.
  The deleted actions are: "view-zoom-out-accel", "view-zoom-in-accel",
  "view-zoom-16-1-accel", "view-zoom-4-1-accel", "view-zoom-2-1-accel" and
  "view-zoom-1-1-accel".
2023-04-12 22:07:09 +02:00
Jehan d6a86b1ab7 app: fix "Remove all Keyboard Shortcuts" and "Reset Keyboard Shortcuts to…
… Default Values" buttons in Preferences.

I considered just deleting the "Remove all shortcuts" action, because really I
am wondering how useful (and often used) it is, and if we are not over-featuring
the shortcut code.
I could find the origin commit 6da388be93, from 2006. Basically the use case is
for people who want such a different mapping overall that it's much better to
start from a blank slate (e.g. DVORAK users, like in the original report).
See: https://bugzilla.gnome.org/show_bug.cgi?id=331839

So in the end, I just reimplemented this with newer code.

Also this commit fixes the "Reset Keyboard Shortcuts to Default Values" code.
2023-04-12 22:07:09 +02:00
Jehan beb093f549 app: remove the "Save" button from the "Configure Keyboard Shortcuts" dialog.
This was always confusing to people that they had to click "Save" then "Close".
With new code anyway, any change is instantly put into effect, and the only
point of "Save" is to actually store immediately in the shortcutsrc file. But
this is clearly not very clear to people (and it can be done in the Preferences
dialog too).

Instead let's just have a "OK" button. The file will be actually updated on exit
only (if "Save keyboard shortcuts on exit" is checked). And that's it.

The only missing feature would be the ability to cancel the latest changes
before hitting OK, i.e. having a "Cancel" button too. Let's see to do this
later.
2023-04-12 22:07:09 +02:00
Jehan 817ee1c660 app, docs, etc.: transform menurc in shortcutsrc after an update.
Also get rid of various old references to menurc and don't install it anymore to
etc/ (neither the new shortcutsrc as it doesn't look like it brings much value
to do so).
2023-04-12 22:07:09 +02:00
Jehan 42bc6ba1c0 app: fix ignoring paths with parentheses.
I had the case of a path with parentheses in the folder name. Just don't assume
any character should not be in a path.
2023-04-12 22:07:09 +02:00
Jehan 73f607fd73 app: the menu "paths" must be based on the English original whereas…
… the actual labels can be localized.

This fixes menu creation when GIMP is localized.
2023-04-12 22:07:09 +02:00
Jehan df0bd8c183 app: cleanly delete the UI manager and action groups associated to finalized…
… dock windows.

This fixes crashes which happen when switching from multi-window mode to single
window mode.
2023-04-12 22:07:09 +02:00
Jehan 2967020d16 app: verify shortcutsrc exists before parsing it. 2023-04-12 22:07:09 +02:00
Jehan 7d1155af4a Issue #5601: Command Search (/) Results to show Menu Path. 2023-04-12 22:07:09 +02:00
Jehan 32f93c49de app: handle duplicate accelerators in shortcutsrc parsing. 2023-04-12 22:07:09 +02:00
Jehan 8383928790 app: comment-out actions using default shortcuts in shortcutsrc.
This uses a new concept of "default shortcuts" which must be called only once at
most per action. Any subsequent shortcuts setting are custom settings.

Commenting these lines out is mostly informational as it allows to see in a
quick glimpse in shortcutsrc file which are custom shortcuts or not.
2023-04-12 22:07:09 +02:00
Jehan 94ebb4f821 app: serialize and deserialize the actions' accelerators.
gtk_accel_map_load()/gtk_accel_map_save() are not working with the new
GAction-based code. GtkApplication does not seem to have helper functions to
simply load and save accelerators in a file, so we just implement it ourselves.

A few things are missing right now, namely:

- On parsing, it doesn't handle any kind of duplicate accelerators (possible
  especially if someone edited the new shortcutsrc manually).
- On reading, maybe we should only write down the changed (from defaults)
  actions, while keeping the old ones commented-out, as menurc used to be. This
  is actually useful info both for debugging or even for users who want to look
  at this file and see what they changed.
- We should add import code to transform the menurc into shortcutsrc when
  updating GIMP, otherwise all custom shortcuts would get lost.

There is still the question on whether we should add the group name too. I think
we should, expecially for plug-in's procedure actions, though right now these
are just added in the GtkApplication's main action group anyway. I'll see later
to refine this.
2023-04-12 22:07:09 +02:00
Jehan 0278480f87 app: new gimp_action_set_group() and gimp_action_get_group().
Now that we don't have any action duplicated in groups based on names (i.e. that
there could just be 2 actions with the same name in different groups), let's
have the GimpAction also store its group.

Use this to fix some code which was now crashing when confirming erasing an
existing shortcut.
2023-04-12 22:07:09 +02:00
Jehan d4fb4362c9 app: fix unit tests with GUI.
Run them with the new GApplication logic, otherwise the various new
parts (such as actions) are not properly loaded.
2023-04-12 22:07:09 +02:00
Jehan 6324357051 app: add a weak pointer to GimpEditor's UI Manager.
I only came into a problem during unit-testing while trying to access an
already destroyed ui_manager.
2023-04-12 22:07:09 +02:00
Jehan a752ad5e07 app, menus: add an application menu for systems which wants this.
In particular on macOS, we want to show some default common actions (see
comments in !837) but gtk_application_prefers_app_menu() docs says that it will
always return FALSE on this OS. So we ignore this call on macOS.
2023-04-12 22:07:09 +02:00
Jehan 634bb0836e menus: fix dialogs_dockable_actions being in 2 groups.
Depending on where it's used, this list of action can be either in the
"dockable" or the "dialogs" action group.

The meson rule is a bit more complicated than I wished it were because of the
ever-so-blocking lack of simple dependency in meson.
Cf. my latest comment: https://github.com/mesonbuild/meson/issues/8123#issuecomment-1496168759
2023-04-12 22:07:09 +02:00
Jehan 3e6735872a menus: make sure the generated menus are rebuilt when inserted submenu is…
… modified.
2023-04-12 22:07:09 +02:00
Jehan 9753755249 app: fix action's proxy button clicks.
Using gimp_action_activate() ensures we call the action with the expected
GVariant for the specific class of action (and not a NULL GVariant).
2023-04-12 22:07:09 +02:00
Jehan f3eb6e1677 app: GimpUIManager and GimpActionGroup are for a given (id, user_data) couple.
This deals in particular with the dockable issue. Each dockbook needs its own
GimpUiManager and the action groups inside, which are identified by a string
identifier but also by a different user data (allowing to identify the specific
dockbook an action was call from, so that for instance you close the right
dockable).

It also makes the name requirement of plug-in procedure more flexible as a
procedure name clash can only happen between plug-in procedures now (not with
core actions).
2023-04-12 22:07:09 +02:00
Jehan caf4c68c71 app: move special-casing of radio action submenus from GimpMenu to GimpMenuModel.
This is a continuation of previous work where we are slowly moving to most logic
being in GimpMenuModel so that it works both when we create menus ourselves or
when we let GTK do it for us (e.g. the main menu bar in macOS).
2023-04-12 22:07:09 +02:00
Jehan ce776c947d app, menus: progressively move to action group logics. 2023-04-12 22:07:09 +02:00
Jehan d9b9fa0acd app: only <Image> GimpUIManager's actions should be application actions. 2023-04-12 22:07:09 +02:00