Skip to content

Commit

Permalink
Themed menus: allow Undo/Redo options to always be displayed.
Browse files Browse the repository at this point in the history
This changes the treatment of the Undo and Redo menu items in the
cutlist editor so that they can always be displayed, even when no undo
or redo action is available.  By default, unavailable undo/redo
actions are hidden via the show="active" attribute.
  • Loading branch information
stichnot committed May 20, 2013
1 parent b91b19b commit 0e19c38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
24 changes: 10 additions & 14 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -11203,23 +11203,19 @@ bool TV::MenuItemDisplayCutlist(const MenuItemContext &c)
}
else if (actionName == "DIALOG_CUTPOINT_UNDO_0")
{
if (ctx->player->DeleteMapHasUndo())
{
//: %1 is the undo message
QString text = tr("Undo - %1");
addButton(c, osd, active, result, actionName, text, "", false,
ctx->player->DeleteMapGetUndoMessage());
}
active = ctx->player->DeleteMapHasUndo();
//: %1 is the undo message
QString text = tr("Undo - %1");
addButton(c, osd, active, result, actionName, text, "", false,
ctx->player->DeleteMapGetUndoMessage());
}
else if (actionName == "DIALOG_CUTPOINT_REDO_0")
{
if (ctx->player->DeleteMapHasRedo())
{
//: %1 is the redo message
QString text = tr("Redo - %1");
addButton(c, osd, active, result, actionName, text, "", false,
ctx->player->DeleteMapGetRedoMessage());
}
active = ctx->player->DeleteMapHasRedo();
//: %1 is the redo message
QString text = tr("Redo - %1");
addButton(c, osd, active, result, actionName, text, "", false,
ctx->player->DeleteMapGetRedoMessage());
}
else if (actionName == "DIALOG_CUTPOINT_CLEARMAP_0")
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/themes/default/menu_cutlist.xml
Expand Up @@ -20,8 +20,8 @@
<item action="DIALOG_CUTPOINT_DELETE_0"
XXXtext="Join Surrounding Cuts" show="inactive" />
<item action="DIALOG_CUTPOINT_NEWCUT_0" XXXtext="Add New Cut" />
<item action="DIALOG_CUTPOINT_UNDO_0" XXXtext="Undo - %1" />
<item action="DIALOG_CUTPOINT_REDO_0" XXXtext="Redo - %1" />
<item action="DIALOG_CUTPOINT_UNDO_0" XXXtext="Undo - %1" show="active" />
<item action="DIALOG_CUTPOINT_REDO_0" XXXtext="Redo - %1" show="active" />
<menu text="Cut List Options">
<item action="DIALOG_CUTPOINT_CLEARMAP_0" XXXtext="Clear Cuts" />
<item action="DIALOG_CUTPOINT_INVERTMAP_0" XXXtext="Reverse Cuts" />
Expand Down

0 comments on commit 0e19c38

Please sign in to comment.