[mythtv] patch - yes, delete, and also forget recording

Kirby Vandivort kvandivo at ks.uiuc.edu
Fri Dec 5 16:38:10 EST 2003


Rev 2 attached.   New and improved, of course.  ijr, I got rid of
the extra fct in mainserver.  capt, Correct became forgetHistory,
and I've tweaked the text on the button. 

On Fri, Dec 05, 2003 at 12:47:22PM -0800, Bruce Markey wrote:
> Kirby Vandivort wrote:
> >On Fri, Dec 05, 2003 at 11:27:42AM -0500, Chris Pinkham wrote:
> >
> >>>Sometimes Myth incorrectly records something.  This is virtually never
> >>>Myth's fault.  Usually, the game ran late, which pushed all the 
> >>>subsequent
> >>>shows back, or the station changed their schedule, or something..
> >>>
> >>>In cases like that, it would be nice to be able to tell myth that you
> >>>want to delete the incorrect recording, and to go ahead and pick that
> >>>particular recording up again next time it is on so that you don't miss
> >>>that episode.
> >>
> >>Looks like a good idea.  I wonder about the use of "correct" vs 
> >>"incorrect"
> >>though.  What if I just want to tell Myth "delete this now to free up disk
> >>space, but if it ever comes on again I'd like to watch it again".  That's
> >>a use of your new option but isn't really "incorrect".  You could just
> >>have DoDelete() and DoDeleteForgetHistory() or something like that.
> >
> >
> >True, the variable name could change.  I agonized over the wording
> >as well.  The button has multiple uses, like the one you mentioned, but
> >I couldn't come up with something that described what it actually does
> >without it being longer than I wanted.  For savvy users, they understand
> >what is going on behind the scenes and know whether or not to choose
> >that button, but describing what is happening to others is trickier.
> 
> I don't know if this is any better but how about "delete this
> and allow this episode to be recorded again in the future" with
> tmpmessage "Yes, delete and allow re-record" or something 
> similar.
> 


-- 

Kirby Vandivort                      Theoretical and 
Senior Research Programmer            Computational Biophysics 
Email: kvandivo at ks.uiuc.edu          3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/    University of Illinois
Phone: (217) 244-5711                405 N. Mathews Ave
Fax  : (217) 244-6078                Urbana, IL  61801, USA
-------------- next part --------------
Index: libs/libmythtv/remoteutil.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/remoteutil.cpp,v
retrieving revision 1.21
diff -b -u -2 -r1.21 remoteutil.cpp
--- libs/libmythtv/remoteutil.cpp	1 Dec 2003 20:17:55 -0000	1.21
+++ libs/libmythtv/remoteutil.cpp	5 Dec 2003 21:33:18 -0000
@@ -84,10 +84,20 @@
 }
 
-void RemoteDeleteRecording(ProgramInfo *pginfo)
+void RemoteDeleteRecording(ProgramInfo *pginfo, const int kiForgetHistory)
 {
-    QStringList strlist = QString("DELETE_RECORDING");
+    QStringList strlist;
+    strlist = QString("DELETE_RECORDING");
     pginfo->ToStringList(strlist);
 
     gContext->SendReceiveStringList(strlist);
+
+    if (kiForgetHistory == 1)
+    {
+        strlist = QString("FORGET_RECORDING");
+        pginfo->ToStringList(strlist);
+
+        gContext->SendReceiveStringList(strlist);
+    }
+
 }
 
Index: libs/libmythtv/remoteutil.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/remoteutil.h,v
retrieving revision 1.16
diff -b -u -2 -r1.16 remoteutil.h
--- libs/libmythtv/remoteutil.h	1 Nov 2003 18:08:35 -0000	1.16
+++ libs/libmythtv/remoteutil.h	5 Dec 2003 21:33:18 -0000
@@ -13,5 +13,5 @@
 void RemoteQueueTranscode(ProgramInfo *pginfo, int state);
 void RemoteStopRecording(ProgramInfo *pginfo);
-void RemoteDeleteRecording(ProgramInfo *pginfo);
+void RemoteDeleteRecording(ProgramInfo *pginfo, const int kiForgetHistory);
 bool RemoteGetAllPendingRecordings(vector<ProgramInfo *> &recordinglist);
 void RemoteGetAllScheduledRecordings(vector<ProgramInfo *> &scheduledlist);
Index: libs/libmythtv/scheduledrecording.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/scheduledrecording.cpp,v
retrieving revision 1.54
diff -b -u -2 -r1.54 scheduledrecording.cpp
--- libs/libmythtv/scheduledrecording.cpp	23 Nov 2003 15:57:37 -0000	1.54
+++ libs/libmythtv/scheduledrecording.cpp	5 Dec 2003 21:33:20 -0000
@@ -701,9 +701,13 @@
     QSqlQuery result = db->exec(query);
     if (!result.isActive())
+    {
         MythContext::DBError("doneRecording", result);
-
+    }
+    else
+    {
     // The addition of an entry to oldrecorded may affect near-future
     // scheduling decisions, so recalculate
     signalChange(db);
+    }
 }
 
@@ -724,5 +728,13 @@
     QSqlQuery result = db->exec(query);
     if (!result.isActive())
+    {
         MythContext::DBError("forgetHistory", result);
+    }
+    else
+    {
+        // The removal of an entry from oldrecorded may affect near-future
+        // scheduling decisions, so recalculate
+        signalChange(db);
+    }
 }
 
Index: programs/mythbackend/mainserver.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/mainserver.cpp,v
retrieving revision 1.100
diff -b -u -2 -r1.100 mainserver.cpp
--- programs/mythbackend/mainserver.cpp	5 Dec 2003 01:23:18 -0000	1.100
+++ programs/mythbackend/mainserver.cpp	5 Dec 2003 21:33:26 -0000
@@ -248,4 +248,8 @@
         HandleDeleteRecording(listline, pbs);
     }
+    else if (command == "FORGET_RECORDING")
+    {
+        HandleForgetRecording(listline, pbs);
+    }
     else if (command == "QUERY_GETALLPENDING")
     {
@@ -1131,4 +1135,25 @@
 }
 
+void MainServer::HandleForgetRecording(QStringList &slist, PlaybackSock *pbs)
+{
+    ProgramInfo *pginfo = new ProgramInfo();
+    pginfo->FromStringList(slist, 1);
+
+    QSocket *pbssock = NULL;
+    if (pbs)
+        pbssock = pbs->getSocket();
+
+    pginfo->DeleteHistory(m_db);
+
+    if (pbssock)
+    {
+        QStringList outputlist = QString::number(0);
+        SendResponse(pbssock, outputlist);
+    }
+
+    delete pginfo;
+
+}
+
 void MainServer::getFreeSpace(int &totalspace, int &usedspace)
 {
Index: programs/mythbackend/mainserver.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/mainserver.h,v
retrieving revision 1.37
diff -b -u -2 -r1.37 mainserver.h
--- programs/mythbackend/mainserver.h	4 Dec 2003 21:49:35 -0000	1.37
+++ programs/mythbackend/mainserver.h	5 Dec 2003 21:33:28 -0000
@@ -60,4 +60,5 @@
     void HandleDeleteRecording(QStringList &slist, PlaybackSock *pbs);
     void DoHandleDeleteRecording(ProgramInfo *pginfo, PlaybackSock *pbs);
+    void HandleForgetRecording(QStringList &slist, PlaybackSock *pbs);
     void HandleQueryFreeSpace(PlaybackSock *pbs);
     void HandleQueryCheckFile(QStringList &slist, PlaybackSock *pbs);
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.cpp,v
retrieving revision 1.105
diff -b -u -2 -r1.105 playbackbox.cpp
--- programs/mythfrontend/playbackbox.cpp	2 Dec 2003 08:07:49 -0000	1.105
+++ programs/mythfrontend/playbackbox.cpp	5 Dec 2003 21:33:31 -0000
@@ -1308,5 +1308,5 @@
 }
 
-void PlaybackBox::doRemove(ProgramInfo *rec)
+void PlaybackBox::doRemove(ProgramInfo *rec, const int kiForgetHistory)
 {
     if (noUpdate)
@@ -1314,5 +1314,5 @@
 
     noUpdate = true;
-    RemoteDeleteRecording(rec);
+    RemoteDeleteRecording(rec, kiForgetHistory);
     noUpdate = false;
 
@@ -1445,4 +1445,13 @@
     const char *tmpslot;
 
+    if (types == 1 || types == 2)
+    {
+
+        tmpmessage = tr("Yes; allow re-recording"); 
+        tmpslot = SLOT(doDeleteForgetHistory());
+        popup->addButton(tmpmessage, this, tmpslot);
+    }
+
+
     switch (types)
     {
@@ -1668,5 +1677,20 @@
 }
 
-void PlaybackBox::doDelete(void)
+void PlaybackBox::doDelete()
+{
+    if (!expectingPopup)
+        return;
+
+    cancelPopup();
+
+    doRemove(delitem, 0);
+
+    delete delitem;
+    delitem = NULL;
+
+    timer->start(500);
+}
+
+void PlaybackBox::doDeleteForgetHistory()
 {
     if (!expectingPopup)
@@ -1675,5 +1699,5 @@
     cancelPopup();
 
-    doRemove(delitem);
+    doRemove(delitem, 1);
 
     delete delitem;
Index: programs/mythfrontend/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.h,v
retrieving revision 1.34
diff -b -u -2 -r1.34 playbackbox.h
--- programs/mythfrontend/playbackbox.h	23 Nov 2003 17:40:02 -0000	1.34
+++ programs/mythfrontend/playbackbox.h	5 Dec 2003 21:33:31 -0000
@@ -56,4 +56,5 @@
     void askDelete();
     void doDelete();
+    void doDeleteForgetHistory();
     void noDelete();
 
@@ -114,5 +115,5 @@
     void startPlayer(ProgramInfo *rec);
 
-    void doRemove(ProgramInfo *);
+    void doRemove(ProgramInfo *, const int kiForgetHistory);
     void promptEndOfRecording(ProgramInfo *);
     void showDeletePopup(ProgramInfo *, int);


More information about the mythtv-dev mailing list