Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 12 months ago

Last modified 9 months ago

#11533 new Developer Task

Themed menus

Reported by: stichnot Owned by: stichnot
Priority: minor Milestone: 0.28
Component: MythTV - User Interface Library Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Initial implementation of Themed Menus.

Themed Menus allows customization of menus through a hierarchical xml
description, consisting of actions, action groups, and submenus. An
action group is essentially a macro that expands into a possibly
context-dependent list of actions.

This is demonstrated by replacing the deeply complex and hierarchical
Playback OSD menu with a themed version, defined in menu_playback.xml.
In addition, a "compact" version of the Playback OSD menu is
supported, with the MENUCOMPACT action and an associated key binding
to display it.

When more menus are converted to themed versions, the MenuBase? class
should be moved out of tv_play.cpp and tv_play.h into a new file.

Attachments (1)

themedmenu.patch (110.5 KB) - added by stichnot 12 months ago.

Download all attachments as: .zip

Change History (11)

Changed 12 months ago by stichnot

comment:1 Changed 12 months ago by Jim Stichnoth <jstichnoth@…>

In 9bb9c61166188ae0222b22ae0091b1e63ffa196c/mythtv:

Initial implementation of Themed Menus. Refs #11533

Themed Menus allows customization of menus through a hierarchical xml
description, consisting of actions, action groups, and submenus. An
action group is essentially a macro that expands into a possibly
context-dependent list of actions.

This is demonstrated by replacing the deeply complex and hierarchical
Playback OSD menu with a themed menu equivalent, defined in
menu_playback.xml in the themes/default/ directory.

In addition, a "compact" version of the Playback OSD menu is added,
with the MENUCOMPACT action and an associated keybinding to display it
(defaults to Alt+M). The default compact menu contains just a single
entry that invokes the regular Playback OSD menu (for now, I don't
want to impose my personal preferences about the most commonly used
actions). As such, the compact menu is useful even for remote
controls without extra buttons to spare -- simply remap the MENU
button to the MENUCOMPACT action in the "TV Playback" context.

When more menus are converted to themed versions, the MenuBase? class
should be moved out of tv_play.cpp and tv_play.h into a new file.

Note: This commit is broken into two parts: addition of new code, and
deletion of old code. This is to make the diffs vastly more readable.

comment:2 Changed 12 months ago by Jim Stichnoth <jstichnoth@…>

In 46d96bfc12654b89e4f7df63a9747fc9709322e2/mythtv:

Themed Menus part 2: remove old code. Refs #11533

comment:3 Changed 12 months ago by Jim Stichnoth <jstichnoth@…>

In 892cd6426e98ee25b0d8afb68d55b7b0b4fb3bbe/mythtv:

Themed menus: Prepend GetConfDir?() to the search path.

This means $MYTHCONFDIR or ~/.mythtv is searched first. Refs #11533.

comment:4 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In b5624f2a89c67abdce94d746ed73c9b097fadfb4/mythtv:

Themed menus: clean up the classes/interface.

This prepares for converting more TV Playback menus into equivalent
themed menus. Refs #11533

comment:5 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In d320993db3000b1723f979ae2d0dea04da561d82/mythtv:

Simplify action names in the cutlist editor.

Many of the cutlist editor actions contain the frame number as one of
the components of the action string. This is unnecessary because the
frame number is always the same, i.e. the current frame number, when
the action is handled. These action strings are now simplified, and
several methods that took the frame number as an argument are also
simplfied since that argument is redundant. Refs #11533.

comment:6 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In d0966aff3e7d582938559e16aa4d3be328fb0b92/mythtv:

Themed menus: Implement the cutlist editor menus. Refs #11533

Provides an implementation of the main cutlist editor menu
(menu_cutlist.xml), and the exit dialog menu (menu_cutlist_exit.xml).

There is a slight change in behavior - pressing SELECT within a cut
region brings up the entire cutlist menu, rather than a subset. The
original code suppresses the submenu entry at the end on the SELECT
action. The original behavior could be restored by adding a third
cutlist menu, or by designing a way to pass extra state to the menu
builder.

To make this work seamlessly with existing action handlers, clumsy
action names like DIALOG_CUTPOINT_NEWCUT_0 are preserved. This will
need some cleanup.

There is one remaining cutlist-related menu that could be implemented

  • the "already editing" dialog.

comment:7 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In 8ad2c1db07bef914b13b40195a24f27f6bfd6396/mythtv:

Themed menus: clean up processing of includes.

Removes the ephemeral m_recursionLevel field from MenuBase?, and
handles the guarding against infinite include recursion through method
arguments. Refs #11533.

comment:8 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In 95c7a875aaf0c640676b92dd9314a7b90bdeca7e/mythtv:

Themed menus: Allow an item to always be set as current.

The current="active" attribute is extended to allow current="y", so
that a menu item can always be set as currently selected when entering
a menu. The exception, as before, is when returning from a submenu,
in which case that submenu is always set as current.

Synonyms for "y" are anything starting with "y", anything starting
with "t", or "1".

Refs #11533

comment:9 Changed 11 months ago by Jim Stichnoth <jstichnoth@…>

In ba1f339093045799b98a95714bc0d29de281afa1/mythtv:

Themed menus: Add a compact version of the cutlist menu.

The compact version is taken from menu_cutlist_compact.xml. Revert
the addition of menu_cutlist_exit.xml, as there's really no need to
allow such customization. (Users may want to manually remove
menu_cutlist_exit.xml from their installation directory.) Add the
ability to take a menu description from an internal string rather than
an external file. Refs #11533.

comment:10 Changed 9 months ago by stichnot

  • Milestone changed from 0.27 to 0.28

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.