Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
evolution
evolution
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 177
    • Issues 177
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • evolutionevolution
  • Merge Requests
  • !61

Closed
Opened Jul 04, 2020 by Bryan Dunsmore@powgawowContributor
  • Report abuse
Report abuse

WIP: Replace GtkUIManager

  • Overview 24
  • Commits 4
  • Changes 24

Prelude: I'm terribly sorry for the code dump, but this issue touches a lot of code.

Currently, in GTK3, GtkUIManager and GtkAction are deprecated, and in GTK4, both of them will be removed. I've been working on rewriting the code they touch, and I have made a lot of progress. A few items to touch on:

  1. There is no replacement for GtkUIManager so I wrote a replacement for the functionality Evolution uses in commit 093fcdb7. This rewrite is actually more flexible than GtkUIManager since a component merging a menu describes where each menu item is to be merged relative to other items in the menu bar. In the menubar, items are given an id attribute, and in the merged menu, items are given either a before or after attribute describing their position relative to an item in the menubar. An example of this in action is in evolution-plugin-manager.c.

  2. In addition to GtkUIManager and GtkAction, GtkMenuBar will also be removed in GTK4 (GtkMenu, GtkMenuBar and GtkMenuItem are gone). There is a replacement GtkPopoverMenuBar, but it is more limited than GtkMenuBar. For example, in Evolution, if the switcher is hidden, then the user cannot make any changes to the switcher appearance—the menu is disabled. However, there is no way to access this menu item and disable it with GtkPopoverMenuBar. Therefore, instead of reimplementing features such as these in this rewrite, I believe it is best to remove them since they will not be possible in GTK4 or very difficult.

  3. With the switch to the new GAction-based menus, a plugin must provide a GAction for each menu item. In evolution-plugin-manager.c, I create an action to activate the plugin manager dialog, and I install an action map containing that action with a custom prefix on the window so that the action name does not conflict with any other plugin's name. It might be nice to provide every extension with an action map that it can add its actions to in order to guarantee that no names conflict.

I've dumped the code now so that it's hopefully less daunting and I can get some feedback sooner rather than later.

Edited Jul 07, 2020 by Milan Crha
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: GNOME/evolution!61
Source branch: deprecate-gtkuimanager