[mythtv] [PATCH] Add play from beginning to watch recordings and
advanced actions
Kevin Kuphal
kuphal at dls.net
Fri Jun 11 01:33:47 EDT 2004
This patch adds a "Play from Beginning" option to the actions menu for
the Watch Recordings screen. This will ignore any bookmarks set on the
recording for the one play only.
As a result of this, the action menu got rather large on my screen so
this patch also adds a "Show Advanced Actions" button to the action menu
with a number of items moved into a second pop-up. I tried to take
those that I felt would be lesser used items and moved them to the
advanced menu but if anyone has a better organization, I'm all ears.
I hope I got the tabs/spaces right in this one.
Thanks for all your work in 0.15.1 as I haven't had a chance to say it yet.
Kevin
-------------- next part --------------
Index: mythtv/libs/libmythtv/programinfo.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.cpp,v
retrieving revision 1.139
diff -n -u -r1.139 programinfo.cpp
--- mythtv/libs/libmythtv/programinfo.cpp 6 Jun 2004 19:17:53 -0000 1.139
+++ mythtv/libs/libmythtv/programinfo.cpp 11 Jun 2004 05:28:51 -0000
@@ -57,6 +57,8 @@
repeat = false;
record = NULL;
+
+ ignoreBookmark = false;
}
ProgramInfo::ProgramInfo(const ProgramInfo &other)
@@ -108,6 +110,8 @@
programid = other.programid;
record = NULL;
+
+ ignoreBookmark = other.ignoreBookmark;
}
ProgramInfo &ProgramInfo::operator=(const ProgramInfo &other)
@@ -162,6 +166,8 @@
programid = other.programid;
record = NULL;
+
+ ignoreBookmark = other.ignoreBookmark;
return *this;
}
@@ -995,6 +1001,8 @@
long long pos = 0;
+ if (ignoreBookmark) return pos;
+
QString starts = recstartts.toString("yyyyMMddhhmm");
starts += "00";
Index: mythtv/libs/libmythtv/programinfo.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.h,v
retrieving revision 1.80
diff -n -u -r1.80 programinfo.h
--- mythtv/libs/libmythtv/programinfo.h 6 Jun 2004 19:17:53 -0000 1.80
+++ mythtv/libs/libmythtv/programinfo.h 11 Jun 2004 05:28:51 -0000
@@ -271,6 +271,7 @@
QString seriesid;
QString programid;
+ bool ignoreBookmark;
private:
void handleRecording(QSqlDatabase *db);
Index: mythtv/programs/mythfrontend/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.cpp,v
retrieving revision 1.157
diff -n -u -r1.157 playbackbox.cpp
--- mythtv/programs/mythfrontend/playbackbox.cpp 5 Jun 2004 01:20:32 -0000 1.157
+++ mythtv/programs/mythfrontend/playbackbox.cpp 11 Jun 2004 05:28:51 -0000
@@ -1743,8 +1743,11 @@
expectingPopup = true;
}
-void PlaybackBox::showActionPopup(ProgramInfo *program)
+void PlaybackBox::showAdvActionPopup()
{
+ if (expectingPopup)
+ cancelPopup();
+
backup.begin(this);
grayOut(&backup);
backup.end();
@@ -1753,22 +1756,11 @@
popupForeground, popupBackground,
popupHighlight, "action popup");
- initPopup(popup, program, "", tr("Select action:"));
+ initPopup(popup, delitem, "", tr("Select advanced action:"));
QSqlDatabase *db = QSqlDatabase::database();
- QButton *playButton = popup->addButton(tr("Play"), this, SLOT(doPlay()));
-
-
- if (RemoteGetRecordingStatus(program, overrectime, underrectime) > 0)
- popup->addButton(tr("Stop Recording"), this, SLOT(askStop()));
-
- if (delitem && delitem->GetAutoExpireFromRecorded(db))
- popup->addButton(tr("Don't Auto Expire"), this, SLOT(noAutoExpire()));
- else
- popup->addButton(tr("Auto Expire"), this, SLOT(doAutoExpire()));
-
- popup->addButton(tr("Change Recording Group"), this,
+ QButton *recButton = popup->addButton(tr("Change Recording Group"), this,
SLOT(showRecGroupChanger()));
popup->addButton(tr("Edit Recording Schedule"), this,
@@ -1796,9 +1788,47 @@
popup->addButton(tr("Begin Commercial Flagging"), this,
SLOT(doBeginFlagging()));
+ popup->addButton(tr("Cancel"), this, SLOT(doCancel()));
+
+ popup->ShowPopup(this, SLOT(doCancel()));
+
+ recButton->setFocus();
+
+ expectingPopup = true;
+}
+
+void PlaybackBox::showActionPopup(ProgramInfo *program)
+{
+ backup.begin(this);
+ grayOut(&backup);
+ backup.end();
+
+ popup = new MythPopupBox(gContext->GetMainWindow(), graphicPopup,
+ popupForeground, popupBackground,
+ popupHighlight, "action popup");
+
+ initPopup(popup, program, "", tr("Select action:"));
+
+ QSqlDatabase *db = QSqlDatabase::database();
+
+ QButton *playButton = popup->addButton(tr("Play"), this, SLOT(doPlay()));
+
+ popup->addButton(tr("Play from Beginning"), this, SLOT(doPlayFromBeg()));
+
+ if (RemoteGetRecordingStatus(program, overrectime, underrectime) > 0)
+ popup->addButton(tr("Stop Recording"), this, SLOT(askStop()));
+
+ if (delitem && delitem->GetAutoExpireFromRecorded(db))
+ popup->addButton(tr("Don't Auto Expire"), this, SLOT(noAutoExpire()));
+ else
+ popup->addButton(tr("Auto Expire"), this, SLOT(doAutoExpire()));
+
popup->addButton(tr("Delete"), this, SLOT(askDelete()));
+
popup->addButton(tr("Cancel"), this, SLOT(doCancel()));
+ popup->addButton(tr("Show Advanced Actions"), this, SLOT(showAdvActionPopup()));
+
popup->ShowPopup(this, SLOT(doCancel()));
playButton->setFocus();
@@ -1866,6 +1896,12 @@
play(delitem);
}
+void PlaybackBox::doPlayFromBeg(void)
+{
+ delitem->ignoreBookmark = true;
+ doPlay();
+}
+
void PlaybackBox::askStop(void)
{
if (!expectingPopup)
Index: mythtv/programs/mythfrontend/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.h,v
retrieving revision 1.54
diff -n -u -r1.54 playbackbox.h
--- mythtv/programs/mythfrontend/playbackbox.h 5 Jun 2004 01:20:32 -0000 1.54
+++ mythtv/programs/mythfrontend/playbackbox.h 11 Jun 2004 05:28:51 -0000
@@ -50,8 +50,10 @@
void showRecGroupChanger();
void showRecGroupChooser();
void showRecGroupPasswordChanger();
+ void showAdvActionPopup();
void doPlay();
+ void doPlayFromBeg();
void askStop();
void doStop();
More information about the mythtv-dev
mailing list