Skip to content

Commit

Permalink
Add the ability for menu themes to jump directly to a specific Record…
Browse files Browse the repository at this point in the history
…ing Group

when opening the Watch Recordings screen.  This can be useful in base themes
for creating a menu button to display the 'Deleted' recgroup for instance, and
it can be used by individual users to create menu buttons for their own
custom recording groups.  This new ability is enabled by appending the
recording group name in the <action> in the menu button entry.

Examples:

   <action>TV_WATCH_RECORDING</action>              (Default/current usage)
   <action>TV_WATCH_RECORDING Deleted</action>      (Show Deleted RecGroup)
   <action>TV_WATCH_RECORDING Dad</action>          (Show Dad's RecGroup)

If there are no entries in the given recgroup, the user will be presented
with a blank list rather than Myth popping up the Recording Group chooser.
If there is a password set on the given recgroup then the password prompt
will be displayed.



git-svn-id: http://svn.mythtv.org/svn/trunk@16559 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
cpinkham committed Mar 15, 2008
1 parent 52277c2 commit 80b66d3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
20 changes: 17 additions & 3 deletions mythtv/programs/mythfrontend/main.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -232,16 +232,24 @@ void startCustomPriority(void)
qApp->lock(); qApp->lock();
} }


void startPlayback(void) void startPlaybackWithGroup(QString recGroup = "")
{ {
PlaybackBox pbb(PlaybackBox::Play, gContext->GetMainWindow(), PlaybackBox pbb(PlaybackBox::Play, gContext->GetMainWindow(),
"tvplayselect"); "tvplayselect");


if (recGroup != "")
pbb.displayRecGroup(recGroup);

qApp->unlock(); qApp->unlock();
pbb.exec(); pbb.exec();
qApp->lock(); qApp->lock();
} }


void startPlayback(void)
{
startPlaybackWithGroup();
}

void startDelete(void) void startDelete(void)
{ {
PlaybackBox delbox(PlaybackBox::Delete, gContext->GetMainWindow(), PlaybackBox delbox(PlaybackBox::Delete, gContext->GetMainWindow(),
Expand Down Expand Up @@ -332,8 +340,14 @@ void TVMenuCallback(void *data, QString &selection)
startTVNormal(); startTVNormal();
else if (sel == "tv_watch_live_epg") else if (sel == "tv_watch_live_epg")
startTVInGuide(); startTVInGuide();
else if (sel == "tv_watch_recording") else if (sel.left(18) == "tv_watch_recording")
startPlayback(); {
// use selection here because its case is untouched
if ((selection.length() > 19) && (selection.mid(18, 1) == " "))
startPlaybackWithGroup(selection.mid(19));
else
startPlayback();
}
else if (sel == "tv_schedule") else if (sel == "tv_schedule")
startGuide(); startGuide();
else if (sel == "tv_delete") else if (sel == "tv_delete")
Expand Down
23 changes: 21 additions & 2 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -497,6 +497,16 @@ PlaybackBox::~PlaybackBox(void)
} }
} }


void PlaybackBox::displayRecGroup(QString newRecGroup)
{
setGroupFilter(newRecGroup);

connected = FillList(true);

progIndex = 0;
titleIndex = 0;
}

DialogCode PlaybackBox::exec(void) DialogCode PlaybackBox::exec(void)
{ {
if (recGroup != "") if (recGroup != "")
Expand Down Expand Up @@ -5263,12 +5273,17 @@ void PlaybackBox::recGroupChooserListBoxChanged(void)
recGroupLastItem = recGroupListBox->currentItem(); recGroupLastItem = recGroupListBox->currentItem();
} }


void PlaybackBox::setGroupFilter(void) void PlaybackBox::setGroupFilter(QString newRecGroup)
{ {
QString savedPW = recGroupPassword; QString savedPW = recGroupPassword;
QString savedRecGroup = recGroup; QString savedRecGroup = recGroup;


recGroup = recGroupListBox->currentText().section(" [", 0, 0); if (newRecGroup != "")
recGroup = newRecGroup;
else if (recGroupListBox)
recGroup = recGroupListBox->currentText().section(" [", 0, 0);
else
return;


if (recGroup == tr("Default")) if (recGroup == tr("Default"))
recGroup = "Default"; recGroup = "Default";
Expand Down Expand Up @@ -5306,6 +5321,10 @@ void PlaybackBox::setGroupFilter(void)
if (groupnameAsAllProg) if (groupnameAsAllProg)
groupDisplayName = tr(recGroup); groupDisplayName = tr(recGroup);


// Don't save anything if we forced a new group
if (newRecGroup != "")
return;

if (gContext->GetNumSetting("RememberRecGroup",1)) if (gContext->GetNumSetting("RememberRecGroup",1))
gContext->SaveSetting("DisplayRecGroup", recGroup); gContext->SaveSetting("DisplayRecGroup", recGroup);


Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythfrontend/playbackbox.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class PlaybackBox : public MythDialog


public slots: public slots:
DialogCode exec(); DialogCode exec();
void displayRecGroup(QString newRecGroup = "");


protected slots: protected slots:
void timeout(void); void timeout(void);
Expand Down Expand Up @@ -215,7 +216,7 @@ class PlaybackBox : public MythDialog


void initRecGroupPopup(QString title, QString name); void initRecGroupPopup(QString title, QString name);
void closeRecGroupPopup(bool refreshList = true); void closeRecGroupPopup(bool refreshList = true);
void setGroupFilter(void); void setGroupFilter(QString newRecGroup = "");
void recGroupChangerListBoxChanged(void); void recGroupChangerListBoxChanged(void);
void recGroupChooserListBoxChanged(void); void recGroupChooserListBoxChanged(void);
void setRecGroup(void); void setRecGroup(void);
Expand Down

0 comments on commit 80b66d3

Please sign in to comment.