Ticket #7423: 7423-2.patch
File 7423-2.patch, 9.1 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/tv_play.h
58 58 typedef void (*EMBEDRETURNVOID) (void *, bool); 59 59 typedef void (*EMBEDRETURNVOIDEPG) (uint, const QString &, TV *, bool, bool, int); 60 60 typedef void (*EMBEDRETURNVOIDFINDER) (TV *, bool, bool); 61 typedef void (*EMBEDRETURNVOIDSCHEDIT) (const ProgramInfo * );61 typedef void (*EMBEDRETURNVOIDSCHEDIT) (const ProgramInfo *, void *); 62 62 63 63 // Locking order 64 64 // -
libs/libmythtv/tv_play.cpp
7938 7938 } 7939 7939 7940 7940 pause_active |= kScheduledRecording == editType; 7941 pause_active |= kViewSchedule == editType; 7941 7942 pause_active |= 7942 7943 !isLiveTV && (!db_continue_embedded || isNearEnd); 7943 7944 pause_active |= actx->paused; … … 7982 7983 } 7983 7984 case kScheduledRecording: 7984 7985 { 7985 RunScheduleEditorPtr(&pginfo );7986 RunScheduleEditorPtr(&pginfo, (void *)this); 7986 7987 ignoreKeyPresses = true; 7987 7988 break; 7988 7989 } … … 8702 8703 DoEditSchedule(editType); 8703 8704 } 8704 8705 8705 if (message.left(11) == "EPG_EXITING" || message.left(18) == "PROGFINDER_EXITING") 8706 if (message.left(11) == "EPG_EXITING" || 8707 message.left(18) == "PROGFINDER_EXITING" || 8708 message.left(21) == "VIEWSCHEDULED_EXITING" || 8709 message.left(22) == "SCHEDULEEDITOR_EXITING") 8706 8710 { 8707 8711 GetMythMainWindow()->SetDrawEnabled(false); 8708 8712 // Resize the window back to the MythTV Player size -
libs/libmythtv/recordingrule.cpp
158 158 if (proginfo->recordid) 159 159 { 160 160 m_recordID = proginfo->recordid; 161 if (!Load()) 162 return false; 161 Load(); 163 162 } 164 163 165 164 if (m_searchType == kNoSearch || m_searchType == kManualSearch) -
programs/mythfrontend/viewscheduled.h
50 50 void selected(MythUIButtonListItem *); 51 51 void updateInfo(MythUIButtonListItem *); 52 52 void SwitchList(void); 53 void Close(void); 53 54 54 55 private: 55 56 void FillList(void); -
programs/mythfrontend/scheduleeditor.cpp
4 4 // QT 5 5 #include <QString> 6 6 #include <QHash> 7 #include <QApplication> 7 8 8 9 // Libmyth 9 10 #include "mythcontext.h" … … 12 13 // Libmythtv 13 14 #include "playgroup.h" 14 15 #include "viewschdiff.h" 16 #include "tv_play.h" 15 17 16 18 // Libmythui 17 19 #include "mythmainwindow.h" … … 31 33 #define ENUM_TO_QVARIANT(a) qVariantFromValue(static_cast<int>(a)) 32 34 33 35 34 void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo )36 void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo, void *player) 35 37 { 36 38 RecordingRule *rule = new RecordingRule(); 37 39 rule->LoadByProgram(proginfo); 38 40 39 41 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 40 ScheduleEditor *se = new ScheduleEditor(mainStack, rule); 42 ScheduleEditor *se = new ScheduleEditor(mainStack, rule, 43 static_cast<TV*>(player)); 41 44 42 45 if (se->Create()) 43 mainStack->AddScreen(se );46 mainStack->AddScreen(se, (player == NULL)); 44 47 else 45 48 delete se; 46 49 … … 53 56 */ 54 57 55 58 ScheduleEditor::ScheduleEditor(MythScreenStack *parent, 56 RecordingInfo *recInfo )59 RecordingInfo *recInfo, TV *player) 57 60 : ScheduleCommon(parent, "ScheduleEditor"), 58 61 m_recInfo(new RecordingInfo(*recInfo)), m_recordingRule(NULL), 59 62 m_sendSig(false), 60 63 m_saveButton(NULL), m_cancelButton(NULL), m_rulesList(NULL), 61 64 m_schedOptButton(NULL), m_storeOptButton(NULL), 62 65 m_postProcButton(NULL), m_schedInfoButton(NULL), 63 m_previewButton(NULL) 66 m_previewButton(NULL), m_player(player) 64 67 { 65 68 m_recordingRule = new RecordingRule(); 66 69 m_recordingRule->m_recordID = m_recInfo->recordid; 67 70 } 68 71 69 72 ScheduleEditor::ScheduleEditor(MythScreenStack *parent, 70 RecordingRule *recRule )73 RecordingRule *recRule, TV *player) 71 74 : ScheduleCommon(parent, "ScheduleEditor"), 72 75 m_recInfo(NULL), m_recordingRule(recRule), 73 76 m_sendSig(false), 74 77 m_saveButton(NULL), m_cancelButton(NULL), m_rulesList(NULL), 75 78 m_schedOptButton(NULL), m_storeOptButton(NULL), 76 79 m_postProcButton(NULL), m_schedInfoButton(NULL), 77 m_previewButton(NULL) 80 m_previewButton(NULL), m_player(player) 78 81 { 79 82 } 80 83 81 84 ScheduleEditor::~ScheduleEditor(void) 82 85 { 83 86 delete m_recordingRule; 87 88 // if we have a player, we need to tell we are done 89 if (m_player) 90 { 91 QString message = QString("VIEWSCHEDULED_EXITING"); 92 qApp->postEvent(m_player, new MythEvent(message)); 93 } 84 94 } 85 95 86 96 bool ScheduleEditor::Create() … … 142 152 return true; 143 153 } 144 154 155 void ScheduleEditor::Close() 156 { 157 // don't fade the screen if we are returning to the player 158 if (m_player) 159 GetScreenStack()->PopScreen(this, false); 160 else 161 GetScreenStack()->PopScreen(this, true); 162 } 163 145 164 void ScheduleEditor::Load() 146 165 { 147 166 // Copy this now, it will change briefly after the first item is inserted -
programs/mythfrontend/main.cpp
23 23 #include "tv.h" 24 24 #include "proglist.h" 25 25 #include "progfind.h" 26 #include "scheduleeditor.h" 26 27 #include "manualschedule.h" 27 28 #include "playbackbox.h" 28 29 #include "customedit.h" … … 915 916 TV::SetFuncPtr("viewscheduled", (void *)ViewScheduled::RunViewScheduled); 916 917 TV::SetFuncPtr("programguide", (void *)GuideGrid::RunProgramGuide); 917 918 TV::SetFuncPtr("programfinder", (void *)RunProgramFinder); 918 TV::SetFuncPtr("scheduleeditor", (void *) RunProgramFinder);919 TV::SetFuncPtr("scheduleeditor", (void *)ScheduleEditor::RunScheduleEditor); 919 920 } 920 921 921 922 -
programs/mythfrontend/viewscheduled.cpp
28 28 showTV); 29 29 30 30 if (vsb->Create()) 31 mainStack->AddScreen(vsb );31 mainStack->AddScreen(vsb, (player == NULL)); 32 32 else 33 33 delete vsb; 34 34 … … 65 65 { 66 66 gContext->removeListener(this); 67 67 gContext->SaveSetting("ViewSchedShowLevel", !m_showAll); 68 69 // if we have a player, we need to tell we are done 70 if (m_player) 71 { 72 QString message = QString("VIEWSCHEDULED_EXITING"); 73 qApp->postEvent(m_player, new MythEvent(message)); 74 } 68 75 } 69 76 70 77 bool ViewScheduled::Create() … … 109 116 return true; 110 117 } 111 118 119 void ViewScheduled::Close() 120 { 121 // don't fade the screen if we are returning to the player 122 if (m_player) 123 GetScreenStack()->PopScreen(this, false); 124 else 125 GetScreenStack()->PopScreen(this, true); 126 } 127 112 128 void ViewScheduled::SwitchList() 113 129 { 114 130 if (GetFocusWidget() == m_groupList) -
programs/mythfrontend/scheduleeditor.h
22 22 class MythUIButtonListItem; 23 23 class MythUIStateType; 24 24 class MythUISpinBox; 25 class TV; 25 26 26 27 class ScheduleEditor : public ScheduleCommon 27 28 { 28 29 Q_OBJECT 29 30 public: 30 ScheduleEditor(MythScreenStack *parent, RecordingInfo* recinfo); 31 ScheduleEditor(MythScreenStack *parent, RecordingRule* recrule); 31 ScheduleEditor(MythScreenStack *parent, RecordingInfo* recinfo, 32 TV *player = NULL); 33 ScheduleEditor(MythScreenStack *parent, RecordingRule* recrule, 34 TV *player = NULL); 32 35 ~ScheduleEditor(); 33 36 34 37 bool Create(void); 35 38 void customEvent(QEvent *event); 36 39 37 40 /// Callback 38 void *RunScheduleEditor(ProgramInfo *proginfo);41 static void *RunScheduleEditor(ProgramInfo *proginfo, void *player = NULL); 39 42 40 43 signals: 41 44 void ruleSaved(int ruleId); … … 48 51 void ShowSchedInfo(void); 49 52 void ShowPreview(void); 50 53 void Save(void); 54 void Close(void); 51 55 52 56 private: 53 57 void Load(void); … … 73 77 MythUIButton *m_schedInfoButton; 74 78 MythUIButton *m_previewButton; 75 79 80 TV *m_player; 76 81 }; 77 82 78 83 class SchedOptEditor : public MythScreenType