diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
index 1361286..f944446 100644
a
|
b
|
QWaitCondition epgIsVisibleCond; |
64 | 64 | const QString kUnknownTitle = ""; |
65 | 65 | //const QString kUnknownCategory = QObject::tr("Unknown"); |
66 | 66 | const unsigned long kUpdateMS = 60 * 1000UL; // Grid update interval (mS) |
| 67 | static bool SelectionIsTunable(const ChannelInfoList &selection); |
67 | 68 | |
68 | 69 | JumpToChannel::JumpToChannel( |
69 | 70 | JumpToChannelListener *parent, const QString &start_entry, |
… |
… |
bool GuideGrid::keyPressEvent(QKeyEvent *event) |
805 | 806 | Close(); |
806 | 807 | else if (action == ACTION_SELECT) |
807 | 808 | { |
| 809 | ProgramInfo *pginfo = |
| 810 | m_programInfos[m_currentRow][m_currentCol]; |
| 811 | int secsTillStart = |
| 812 | (pginfo) ? MythDate::current().secsTo( |
| 813 | pginfo->GetScheduledStartTime()) : 0; |
808 | 814 | if (m_player && (m_player->GetState(-1) == kState_WatchingLiveTV)) |
809 | 815 | { |
810 | 816 | // See if this show is far enough into the future that it's |
811 | 817 | // probable that the user wanted to schedule it to record |
812 | 818 | // instead of changing the channel. |
813 | | ProgramInfo *pginfo = |
814 | | m_programInfos[m_currentRow][m_currentCol]; |
815 | | int secsTillStart = |
816 | | (pginfo) ? MythDate::current().secsTo( |
817 | | pginfo->GetScheduledStartTime()) : 0; |
818 | 819 | if (pginfo && (pginfo->GetTitle() != kUnknownTitle) && |
819 | 820 | ((secsTillStart / 60) >= m_selectRecThreshold)) |
820 | 821 | { |
… |
… |
bool GuideGrid::keyPressEvent(QKeyEvent *event) |
826 | 827 | } |
827 | 828 | } |
828 | 829 | else |
829 | | EditRecording(); |
| 830 | // Edit Recording should include "Watch this channel" |
| 831 | // is we selected a show that is current. |
| 832 | EditRecording(!m_player |
| 833 | && SelectionIsTunable(GetSelection()) |
| 834 | && (secsTillStart / 60) < m_selectRecThreshold); |
830 | 835 | } |
831 | 836 | else if (action == "EDIT") |
832 | 837 | EditScheduled(); |
… |
… |
void GuideGrid::ShowMenu(void) |
1100 | 1105 | |
1101 | 1106 | if (m_player && (m_player->GetState(-1) == kState_WatchingLiveTV)) |
1102 | 1107 | menuPopup->AddButton(tr("Change to Channel")); |
1103 | | else if (SelectionIsTunable(GetSelection())) |
| 1108 | else if (!m_player && SelectionIsTunable(GetSelection())) |
1104 | 1109 | menuPopup->AddButton(tr("Watch This Channel")); |
1105 | 1110 | |
1106 | 1111 | menuPopup->AddButton(tr("Record This")); |
… |
… |
void GuideGrid::customEvent(QEvent *event) |
1918 | 1923 | delete record; |
1919 | 1924 | } |
1920 | 1925 | } |
| 1926 | // Test for this here because it can come from |
| 1927 | // different menus. |
| 1928 | else if (resulttext == tr("Watch This Channel")) |
| 1929 | { |
| 1930 | ChannelInfoList selection = GetSelection(); |
| 1931 | if (SelectionIsTunable(selection)) |
| 1932 | TV::StartTV(NULL, kStartTVNoFlags, selection); |
| 1933 | } |
1921 | 1934 | else if (resultid == "guidemenu") |
1922 | 1935 | { |
1923 | 1936 | if (resulttext == tr("Record This")) |
… |
… |
void GuideGrid::customEvent(QEvent *event) |
1928 | 1941 | { |
1929 | 1942 | enter(); |
1930 | 1943 | } |
1931 | | else if (resulttext == tr("Watch This Channel")) |
1932 | | { |
1933 | | ChannelInfoList selection = GetSelection(); |
1934 | | if (SelectionIsTunable(selection)) |
1935 | | TV::StartTV(NULL, kStartTVNoFlags, selection); |
1936 | | } |
1937 | 1944 | else if (resulttext == tr("Program Details")) |
1938 | 1945 | { |
1939 | 1946 | ShowDetails(); |
diff --git a/mythtv/programs/mythfrontend/schedulecommon.cpp b/mythtv/programs/mythfrontend/schedulecommon.cpp
index ca0bc58..96dfa48 100644
a
|
b
|
void ScheduleCommon::ShowPrevious(void) const |
266 | 266 | * \brief Creates a dialog for editing the recording status, |
267 | 267 | * blocking until user leaves dialog. |
268 | 268 | */ |
269 | | void ScheduleCommon::EditRecording(void) |
| 269 | void ScheduleCommon::EditRecording(bool may_watch_now) |
270 | 270 | { |
271 | 271 | ProgramInfo *pginfo = GetCurrentProgram(); |
272 | 272 | if (!pginfo) |
… |
… |
void ScheduleCommon::EditRecording(void) |
329 | 329 | |
330 | 330 | QDateTime now = MythDate::current(); |
331 | 331 | |
| 332 | if(may_watch_now) |
| 333 | menuPopup->AddButton(tr("Watch This Channel")); |
| 334 | |
332 | 335 | if (recinfo.GetRecordingStatus() == RecStatus::Unknown) |
333 | 336 | { |
334 | 337 | if (recinfo.GetRecordingEndTime() > now) |
diff --git a/mythtv/programs/mythfrontend/schedulecommon.h b/mythtv/programs/mythfrontend/schedulecommon.h
index 590e56e..909ddc9 100644
a
|
b
|
class ScheduleCommon : public MythScreenType |
33 | 33 | virtual void ShowDetails(void) const; |
34 | 34 | |
35 | 35 | protected slots: |
36 | | virtual void EditRecording(void); |
| 36 | virtual void EditRecording(bool may_watch_now = false); |
37 | 37 | virtual void QuickRecord(void); |
38 | 38 | virtual void ShowPrevious(void) const; |
39 | 39 | virtual void ShowUpcoming(void) const; |