Skip to content

Avoid deprecation warnings 4: GtkUIManager and GtkAction

Follows !24 (merged).

Fixes #58 (closed), #61 (closed).

This MR replaces GtkUIManager and GtkAction with GtkBuilder and GAction, hence it also replaces GtkMenu with GMenu (all of this by the surrounding use of GtkApplication and GActionMap).

There are a few uses left for GtkMenu (for contextual menus and status bar tooltips), but all the rest has been removed, so that this MR should be a significant step in the transition to GTK+ 4. Note also that GtkToolbar will have to be replaced at that time.

The first commit is a step that I wanted to keep in the commit history of the MR: the old code has been kept, so that there are two menubars: the old one and the new one. This is handy to compare them in the same window, and it could be useful thereafter, e.g. in case of regression, to be able to build from this commit to retrieve this state.

The second and third commits do the same for the toolbar. The second commit is only kept as a reminder: see !25 (comment 15349) and !25 (comment 15371).

The fourth commit removes the old code and replaces the contextual menus: see !25 (comment 15380). There is no more trace of GtkUIManager, and no more trace of GtkAction except in commented code.

The fifth and sixth last commits restore the tooltips display in the status bar: see !25 (comment 15650) and !25 (comment 15864).

There is only one icon left that I wasn't able to recover: I don't know how to apply icons to submenus, either by hand or via the GtkBuilder XML file. I put a TODO for that, and others for certain perspectives that are beyond the scope of this MR.

Edited by Gaël Bonithon

Merge request reports