[mythtv] PATCH to allow single record directly from the program guide

John Steele mythtv-dev@snowman.net
Mon, 23 Dec 2002 14:24:06 -0500 (EST)


This patch allows pressing 'R' to toggle the single record status of a
program directly from the program guide.
John Steele
------------------------------------------------------
? libs/libmythtv/moc_videosource.cpp
Index: keys.txt
===================================================================
RCS file: /var/lib/cvs/MC/keys.txt,v
retrieving revision 1.8
diff -u -r1.8 keys.txt
--- keys.txt	4 Dec 2002 21:40:42 -0000	1.8
+++ keys.txt	23 Dec 2002 19:00:05 -0000
@@ -73,6 +73,8 @@
      "Instant Record" a program.
 - Pressing M when on a channel will change to that channel.
 - Pressing ESC or C exits without changing the channel.
+- R toggles between "Don't record this progam" and "Record only this
showing of the program"+  it will not do anything if other recording types are selected for the
highlighted entry.

 Remote Controls
Index: libs/libmyth/guidegrid.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmyth/guidegrid.cpp,v
retrieving revision 1.66
diff -u -r1.66 guidegrid.cpp
--- libs/libmyth/guidegrid.cpp	19 Dec 2002 05:02:56 -0000	1.66
+++ libs/libmyth/guidegrid.cpp	23 Dec 2002 19:00:10 -0000
@@ -153,6 +153,7 @@
     accel->connectItem(accel->insertItem(Key_I), this, SLOT(displayInfo()));
     accel->connectItem(accel->insertItem(Key_Space), this,
     SLOT(displayInfo()));     accel->connectItem(accel->insertItem(Key_Enter), this,
     SLOT(displayInfo()));+    accel->connectItem(accel->insertItem(Key_R), this, SLOT(quickRecord()));

     connect(this, SIGNAL(killTheApp()), this, SLOT(accept()));

@@ -1993,6 +1994,22 @@
 {
     unsetCursor();
     emit killTheApp();
+}
+
+void GuideGrid::quickRecord()
+{
+
+    ProgramInfo *pginfo = m_programInfos[m_currentRow][m_currentCol];
+    RecordingType currType = pginfo->GetProgramRecordingStatus();
+
+    if ( currType == kSingleRecord )
+    	pginfo->ApplyRecordStateChange(kNotRecording);
+    else if ( currType == kNotRecording )
+    	pginfo->ApplyRecordStateChange(kSingleRecord);
+
+    fillProgramInfos();
+    update(programRect());
+
 }

 void GuideGrid::displayInfo()
Index: libs/libmyth/guidegrid.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmyth/guidegrid.h,v
retrieving revision 1.26
diff -u -r1.26 guidegrid.h
--- libs/libmyth/guidegrid.h	17 Dec 2002 06:09:26 -0000	1.26
+++ libs/libmyth/guidegrid.h	23 Dec 2002 19:00:10 -0000
@@ -63,6 +63,7 @@
     void enter();
     void escape();

+    void quickRecord();
     void displayInfo();

   protected: