Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add some more scheduler related simplifications.

Remove the channel record recording rule type.  Add a "This channel"
filter to maintain the that functionality.  Automatically convert
existing channel record rules to all record rules with the channel
filter enabled.

Add a dialog to offer common actions instead of immediately entering
the schedule editor when SELECT is pressed on a non-scheduled program.
Pressing the EDIT action still goes straight to the schedule editor.
Change the text in the recording, not recording and not scheduled
dialogs to be a little clearer.

Change the behavior when RECORD is pressed in the EPG and elsewhere.
Previously, this action cycled through the recrding rule types.  if
the program is not scheduled, this action now adds a single record
rule.  If the program is scheduled, it now brings up the appropriate
recording or not recording dialog.
  • Loading branch information...
commit 9497ba1b63a5a6a91b06dbb85beea37444ef3ccc 1 parent 7c0f6b2
David Engel gigem authored
2  mythtv/bindings/perl/MythTV.pm
@@ -115,7 +115,7 @@ package MythTV;
115 115 # schema version supported in the main code. We need to check that the schema
116 116 # version in the database is as expected by the bindings, which are expected
117 117 # to be kept in sync with the main code.
118   - our $SCHEMA_VERSION = "1309";
  118 + our $SCHEMA_VERSION = "1310";
119 119
120 120 # NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
121 121 # the number of items in a ProgramInfo QStringList group used by
4 mythtv/bindings/python/MythTV/static.py
@@ -5,7 +5,7 @@
5 5 """
6 6
7 7 OWN_VERSION = (0,27,-1,0)
8   -SCHEMA_VERSION = 1309
  8 +SCHEMA_VERSION = 1310
9 9 NVSCHEMA_VERSION = 1007
10 10 MUSICSCHEMA_VERSION = 1018
11 11 PROTO_VERSION = '76'
@@ -39,7 +39,7 @@ class RECTYPE( object ):
39 39 kNotRecording = 0
40 40 kSingleRecord = 1
41 41 kDailyRecord = 2
42   - kChannelRecord = 3
  42 + #kChannelRecord = 3 (Obsolete)
43 43 kAllRecord = 4
44 44 kWeeklyRecord = 5
45 45 kOneRecord = 6
9 mythtv/libs/libmyth/programinfo.cpp
@@ -1731,6 +1731,15 @@ uint64_t ProgramInfo::QueryLastFrameInPosMap(void) const
1731 1731 return last_frame;
1732 1732 }
1733 1733
  1734 +bool ProgramInfo::IsGeneric(void) const
  1735 +{
  1736 + return
  1737 + (programid.isEmpty() && subtitle.isEmpty() &&
  1738 + description.isEmpty()) ||
  1739 + (!programid.isEmpty() && programid.endsWith("0000")
  1740 + && catType == "series");
  1741 +}
  1742 +
1734 1743 QString ProgramInfo::toString(const Verbosity v, QString sep, QString grp)
1735 1744 const
1736 1745 {
1  mythtv/libs/libmyth/programinfo.h
@@ -435,6 +435,7 @@ class MPUBLIC ProgramInfo
435 435 uint32_t GetProgramFlags(void) const { return programflags; }
436 436 ProgramInfoType GetProgramInfoType(void) const
437 437 { return (ProgramInfoType)((programflags & FL_TYPEMASK) >> 16); }
  438 + bool IsGeneric(void) const;
438 439 bool IsInUsePlaying(void) const { return programflags & FL_INUSEPLAYING;}
439 440 bool IsCommercialFree(void) const { return programflags & FL_CHANCOMMFREE;}
440 441 bool HasCutlist(void) const { return programflags & FL_CUTLIST; }
11 mythtv/libs/libmyth/recordingtypes.cpp
@@ -15,8 +15,7 @@ int RecTypePrecedence(RecordingType rectype)
15 15 case kOneRecord: return 4; break;
16 16 case kWeeklyRecord: return 6; break;
17 17 case kDailyRecord: return 8; break;
18   - case kChannelRecord: return 9; break;
19   - case kAllRecord: return 10; break;
  18 + case kAllRecord: return 9; break;
20 19 case kTemplateRecord: return 0; break;
21 20 default: return 11;
22 21 }
@@ -29,8 +28,6 @@ QString toString(RecordingType rectype)
29 28 {
30 29 case kSingleRecord:
31 30 return QObject::tr("Single Record");
32   - case kChannelRecord:
33   - return QObject::tr("Channel Record");
34 31 case kAllRecord:
35 32 return QObject::tr("Record All");
36 33 case kOneRecord:
@@ -56,8 +53,6 @@ QString toRawString(RecordingType rectype)
56 53 {
57 54 case kSingleRecord:
58 55 return QString("Single Record");
59   - case kChannelRecord:
60   - return QString("Channel Record");
61 56 case kAllRecord:
62 57 return QString("Record All");
63 58 case kOneRecord:
@@ -80,8 +75,6 @@ RecordingType recTypeFromString(QString type)
80 75 return kNotRecording;
81 76 if (type.toLower() == "single record" || type.toLower() == "single")
82 77 return kSingleRecord;
83   - else if (type.toLower() == "channel record" || type.toLower() == "channel")
84   - return kChannelRecord;
85 78 else if (type.toLower() == "record all" || type.toLower() == "all")
86 79 return kAllRecord;
87 80 else if (type.toLower() == "record one" || type.toLower() == "one" ||
@@ -109,8 +102,6 @@ QChar toQChar(RecordingType rectype)
109 102 {
110 103 case kSingleRecord:
111 104 ret = QObject::tr("S", "RecTypeChar kSingleRecord"); break;
112   - case kChannelRecord:
113   - ret = QObject::tr("C", "RecTypeChar kChannelRecord"); break;
114 105 case kAllRecord:
115 106 ret = QObject::tr("A", "RecTypeChar kAllRecord"); break;
116 107 case kOneRecord:
2  mythtv/libs/libmyth/recordingtypes.h
@@ -21,7 +21,7 @@ typedef enum RecordingTypes
21 21 kNotRecording = 0,
22 22 kSingleRecord = 1,
23 23 kDailyRecord = 2,
24   - kChannelRecord = 3,
  24 + //kChannelRecord = 3, (Obsolete)
25 25 kAllRecord = 4,
26 26 kWeeklyRecord = 5,
27 27 kOneRecord = 6,
4 mythtv/libs/libmythbase/mythversion.h
@@ -12,7 +12,7 @@
12 12 /// Update this whenever the plug-in API changes.
13 13 /// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
14 14 /// libmythui class methods used by plug-ins.
15   -#define MYTH_BINARY_VERSION "0.27.20121227-1"
  15 +#define MYTH_BINARY_VERSION "0.27.20121227-2"
16 16
17 17 /** \brief Increment this whenever the MythTV network protocol changes.
18 18 *
@@ -57,7 +57,7 @@
57 57 * mythtv/bindings/php/MythBackend.php
58 58 #endif
59 59
60   -#define MYTH_DATABASE_VERSION "1309"
  60 +#define MYTH_DATABASE_VERSION "1310"
61 61
62 62
63 63 MBASE_PUBLIC const char *GetMythSourceVersion();
14 mythtv/libs/libmythtv/dbcheck.cpp
@@ -2325,6 +2325,20 @@ NULL
2325 2325 return false;
2326 2326 }
2327 2327
  2328 + if (dbver == "1309")
  2329 + {
  2330 + const char *updates[] = {
  2331 +// Add this channel filter
  2332 +"REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
  2333 +" VALUES (10, 'This channel', 'channel.callsign = RECTABLE.station', 0)",
  2334 +// Convert old, Channel rules to All with channel filter
  2335 +"UPDATE record SET type = 4, filter = filter|1024 WHERE type = 3",
  2336 +NULL
  2337 +};
  2338 + if (!performActualUpdate(&updates[0], "1310", dbver))
  2339 + return false;
  2340 + }
  2341 +
2328 2342 return true;
2329 2343 }
2330 2344
49 mythtv/libs/libmythtv/recordinginfo.cpp
@@ -766,53 +766,14 @@ void RecordingInfo::ApplyTranscoderProfileChange(const QString &profile) const
766 766 }
767 767 }
768 768
769   -/** \fn RecordingInfo::ToggleRecord(void)
770   - * \brief Cycles through recording types.
771   - *
772   - * If the program recording status is kNotRecording,
773   - * ApplyRecordStateChange(kSingleRecord) is called.
774   - * If the program recording status is kSingleRecording,
775   - * ApplyRecordStateChange(kOneRecord) is called.
776   - * <br>etc...
777   - *
778   - * The states in order are: kNotRecording, kSingleRecord, kOneRecord,
779   - * kWeeklyRecord, kDailyRecord, kChannelRecord, kAllRecord.<br>
780   - * And: kOverrideRecord, kDontRecord.
781   - *
782   - * That is if you the recording is in any of the first set of states,
783   - * we cycle through those, if not we toggle between kOverrideRecord and
784   - * kDontRecord.
  769 +/** \fn RecordingInfo::QuickRecord(void)
  770 + * \brief Create a kSingleRecord if not already scheduled.
785 771 */
786   -void RecordingInfo::ToggleRecord(void)
  772 +void RecordingInfo::QuickRecord(void)
787 773 {
788 774 RecordingType curType = GetProgramRecordingStatus();
789   -
790   - switch (curType)
791   - {
792   - case kNotRecording:
793   - ApplyRecordStateChange(kSingleRecord);
794   - break;
795   - case kSingleRecord:
796   - ApplyRecordStateChange(kOneRecord);
797   - break;
798   - case kOneRecord:
799   - ApplyRecordStateChange(kAllRecord);
800   - break;
801   - case kAllRecord:
802   - ApplyRecordStateChange(kSingleRecord);
803   - break;
804   -
805   - case kOverrideRecord:
806   - ApplyRecordStateChange(kDontRecord);
807   - break;
808   - case kDontRecord:
809   - ApplyRecordStateChange(kOverrideRecord);
810   - break;
811   -
812   - default:
813   - ApplyRecordStateChange(kAllRecord);
814   - break;
815   - }
  775 + if (curType == kNotRecording)
  776 + ApplyRecordStateChange(kSingleRecord);
816 777 }
817 778
818 779 /**
2  mythtv/libs/libmythtv/recordinginfo.h
@@ -220,7 +220,7 @@ class MTV_PUBLIC RecordingInfo : public ProgramInfo
220 220 QString GetProgramRecordingProfile(void) const;
221 221 void ApplyRecordStateChange(RecordingType newstate, bool save = true);
222 222 void ApplyRecordRecPriorityChange(int);
223   - void ToggleRecord(void);
  223 + void QuickRecord(void);
224 224
225 225 // Used in determining start and end for RecordingQuality determination
226 226 void SetDesiredStartTime(const QDateTime &dt) { desiredrecstartts = dt; }
8 mythtv/libs/libmythtv/tv_play.cpp
@@ -3901,7 +3901,7 @@ bool TV::BrowseHandleAction(PlayerContext *ctx, const QStringList &actions)
3901 3901 browsehelper->BrowseEnd(ctx, false);
3902 3902 }
3903 3903 else if (has_action(ACTION_TOGGLERECORD, actions))
3904   - ToggleRecord(ctx);
  3904 + QuickRecord(ctx);
3905 3905 else
3906 3906 {
3907 3907 handled = false;
@@ -4481,7 +4481,7 @@ bool TV::ToggleHandleAction(PlayerContext *ctx,
4481 4481 else if (has_action(ACTION_TOGGLESLEEP, actions))
4482 4482 ToggleSleepTimer(ctx);
4483 4483 else if (has_action(ACTION_TOGGLERECORD, actions) && islivetv)
4484   - ToggleRecord(ctx);
  4484 + QuickRecord(ctx);
4485 4485 else if (has_action(ACTION_TOGGLEFAV, actions) && islivetv)
4486 4486 ToggleChannelFavorite(ctx);
4487 4487 else if (has_action(ACTION_TOGGLECHANCONTROLS, actions) && islivetv)
@@ -9487,7 +9487,7 @@ void TV::customEvent(QEvent *e)
9487 9487 }
9488 9488 }
9489 9489
9490   -void TV::ToggleRecord(PlayerContext *ctx)
  9490 +void TV::QuickRecord(PlayerContext *ctx)
9491 9491 {
9492 9492 BrowseInfo bi = browsehelper->GetBrowsedInfo();
9493 9493 if (bi.m_chanid)
@@ -9498,7 +9498,7 @@ void TV::ToggleRecord(PlayerContext *ctx)
9498 9498 RecordingInfo::LoadStatus status;
9499 9499 RecordingInfo recinfo(bi.m_chanid, startts, false, 0, &status);
9500 9500 if (RecordingInfo::kFoundProgram == status)
9501   - recinfo.ToggleRecord();
  9501 + recinfo.QuickRecord();
9502 9502 recinfo.ToMap(infoMap);
9503 9503 infoMap["iconpath"] = ChannelUtil::GetIcon(recinfo.GetChanID());
9504 9504 if ((recinfo.IsVideoFile() || recinfo.IsVideoDVD() ||
2  mythtv/libs/libmythtv/tv_play.h
@@ -317,7 +317,7 @@ class MTV_PUBLIC TV : public QObject
317 317
318 318 // Other toggles
319 319 void ToggleAutoExpire(PlayerContext*);
320   - void ToggleRecord(PlayerContext*);
  320 + void QuickRecord(PlayerContext*);
321 321
322 322 // General TV state
323 323 static bool StateIsRecording(TVState state);
23 mythtv/programs/mythbackend/scheduler.cpp
@@ -3559,29 +3559,24 @@ void Scheduler::UpdateMatches(uint recordid, uint sourceid, uint mplexid,
3559 3559 QString(" AND channel.visible = 1 ") +
3560 3560 filterClause + QString(" AND "
3561 3561
3562   -"((RECTABLE.type = %1 " // all record
  3562 +"("
  3563 +" (RECTABLE.type = %1 " // all record
3563 3564 " OR RECTABLE.type = %2 " // one record
3564 3565 " OR RECTABLE.type = %3 " // daily record
3565 3566 " OR RECTABLE.type = %4) " // weekly record
3566 3567 " OR "
3567   -" ((RECTABLE.station = channel.callsign) " // channel matches
3568   -" AND "
3569   -" ((RECTABLE.type = %5) " // channel record
3570   -" OR"
3571   -" ((ADDTIME(RECTABLE.startdate, RECTABLE.starttime) = program.starttime) " // date/time matches
3572   -" AND "
3573   -" (RECTABLE.type = %6 "
3574   -" OR RECTABLE.type = %7 "
3575   -" OR RECTABLE.type = %8)" // single/override/don't record
3576   -" )"
3577   -" )"
3578   -" )"
  3568 +" ((RECTABLE.type = %6 " // single record
  3569 +" OR RECTABLE.type = %7 " // override record
  3570 +" OR RECTABLE.type = %8)" // don't record
  3571 +" AND "
  3572 +" ADDTIME(RECTABLE.startdate, RECTABLE.starttime) = program.starttime " // date/time matches
  3573 +" AND "
  3574 +" RECTABLE.station = channel.callsign) " // channel matches
3579 3575 ") ")
3580 3576 .arg(kAllRecord)
3581 3577 .arg(kOneRecord)
3582 3578 .arg(kDailyRecord)
3583 3579 .arg(kWeeklyRecord)
3584   - .arg(kChannelRecord)
3585 3580 .arg(kSingleRecord)
3586 3581 .arg(kOverrideRecord)
3587 3582 .arg(kDontRecord);
8 mythtv/programs/mythfrontend/guidegrid.cpp
@@ -1303,9 +1303,6 @@ void GuideGrid::fillProgramRowInfos(unsigned int row, bool useExistingData)
1303 1303 case kDailyRecord:
1304 1304 recFlag = 2;
1305 1305 break;
1306   - case kChannelRecord:
1307   - recFlag = 3;
1308   - break;
1309 1306 case kAllRecord:
1310 1307 recFlag = 4;
1311 1308 break;
@@ -1983,10 +1980,7 @@ void GuideGrid::quickRecord()
1983 1980 if (pginfo->GetTitle() == kUnknownTitle)
1984 1981 return;
1985 1982
1986   - RecordingInfo ri(*pginfo);
1987   - ri.ToggleRecord();
1988   - *pginfo = ri;
1989   -
  1983 + QuickRecord(pginfo);
1990 1984 LoadFromScheduler(m_recList);
1991 1985 fillProgramInfos();
1992 1986 updateInfo();
6 mythtv/programs/mythfrontend/progfind.cpp
@@ -415,11 +415,7 @@ void ProgFinder::getInfo(bool toggle)
415 415 if (curPick)
416 416 {
417 417 if (toggle)
418   - {
419   - RecordingInfo ri(*curPick);
420   - ri.ToggleRecord();
421   - *curPick = ri;
422   - }
  418 + QuickRecord(curPick);
423 419 else
424 420 EditRecording(curPick);
425 421 }
6 mythtv/programs/mythfrontend/proglist.cpp
@@ -608,11 +608,7 @@ void ProgLister::RecordSelected(void)
608 608 {
609 609 ProgramInfo *pi = GetCurrent();
610 610 if (pi)
611   - {
612   - RecordingInfo ri(*pi);
613   - ri.ToggleRecord();
614   - *pi = ri;
615   - }
  611 + QuickRecord(pi);
616 612 }
617 613
618 614 void ProgLister::HandleClicked(void)
193 mythtv/programs/mythfrontend/schedulecommon.cpp
@@ -99,6 +99,24 @@ void ScheduleCommon::ShowUpcomingScheduled(ProgramInfo *pginfo) const
99 99 }
100 100
101 101 /**
  102 +* \brief Create a kSingleRecord or bring up recording dialog.
  103 +*/
  104 +void ScheduleCommon::QuickRecord(ProgramInfo *pginfo)
  105 +{
  106 + if (!pginfo)
  107 + return;
  108 +
  109 + if (pginfo->GetRecordingRuleID())
  110 + EditRecording(pginfo);
  111 + else
  112 + {
  113 + RecordingInfo ri(*pginfo);
  114 + ri.QuickRecord();
  115 + *pginfo = ri;
  116 + }
  117 +}
  118 +
  119 +/**
102 120 * \brief Creates a dialog for editing the recording status,
103 121 * blocking until user leaves dialog.
104 122 */
@@ -110,7 +128,7 @@ void ScheduleCommon::EditRecording(ProgramInfo *pginfo)
110 128 RecordingInfo ri(*pginfo);
111 129
112 130 if (!ri.GetRecordingRuleID())
113   - EditScheduled(&ri);
  131 + ShowNotScheduledDialog(ri);
114 132 else if (ri.GetRecordingStatus() <= rsWillRecord ||
115 133 ri.GetRecordingStatus() == rsOtherShowing)
116 134 ShowRecordingDialog(ri);
@@ -219,10 +237,10 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
219 237 recinfo.GetRecordingStatus() != rsTuning &&
220 238 recinfo.GetRecordingStatus() != rsOtherRecording &&
221 239 recinfo.GetRecordingStatus() != rsOtherTuning)
222   - menuPopup->AddButton(tr("Reactivate"),
  240 + menuPopup->AddButton(tr("Restart recording this showing"),
223 241 qVariantFromValue(recinfo));
224 242 else
225   - menuPopup->AddButton(tr("Stop recording"),
  243 + menuPopup->AddButton(tr("Stop recording this showing"),
226 244 qVariantFromValue(recinfo));
227 245 }
228 246
@@ -233,7 +251,7 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
233 251 {
234 252 if (recinfo.GetRecordingStartTime() > now)
235 253 {
236   - menuPopup->AddButton(tr("Don't record"),
  254 + menuPopup->AddButton(tr("Don't record this showing"),
237 255 qVariantFromValue(recinfo));
238 256 }
239 257
@@ -261,7 +279,7 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
261 279 (!recinfo.GetSubtitle().isEmpty() ||
262 280 !recinfo.GetDescription().isEmpty())) ))
263 281 {
264   - menuPopup->AddButton(tr("Never record"),
  282 + menuPopup->AddButton(tr("Never record this episode"),
265 283 qVariantFromValue(recinfo));
266 284 }
267 285 }
@@ -274,20 +292,17 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
274 292 recinfo.GetRecordingStatus() == rsOtherRecording ||
275 293 recinfo.GetRecordingStatus() == rsOtherTuning)
276 294 {
277   - menuPopup->AddButton(tr("Modify Recording Options"),
  295 + menuPopup->AddButton(tr("Edit options for this showing"),
278 296 qVariantFromValue(recinfo));
279 297 }
280 298 else
281 299 {
282   - menuPopup->AddButton(tr("Edit Options"),
283   - qVariantFromValue(recinfo));
284   -
285   - if (recinfo.GetRecordingRuleType() != kSingleRecord &&
286   - recinfo.GetRecordingRuleType() != kOneRecord)
  300 + if (recinfo.GetRecordingRuleType() != kSingleRecord)
287 301 {
288   - menuPopup->AddButton(tr("Add Override"),
  302 + menuPopup->AddButton(tr("Override this showing with options"),
289 303 qVariantFromValue(recinfo));
290 304 }
  305 +
291 306 }
292 307 }
293 308
@@ -299,19 +314,28 @@ void ScheduleCommon::ShowRecordingDialog(const RecordingInfo& recinfo)
299 314 recinfo.GetRecordingStatus() == rsOtherRecording ||
300 315 recinfo.GetRecordingStatus() == rsOtherTuning)
301 316 {
302   - menuPopup->AddButton(tr("Modify Recording Options"),
  317 + menuPopup->AddButton(tr("Edit options for this showing"),
303 318 qVariantFromValue(recinfo));
304 319 }
305 320 else
306 321 {
307   - menuPopup->AddButton(tr("Edit Override"),
  322 + menuPopup->AddButton(tr("Edit override options"),
308 323 qVariantFromValue(recinfo));
309   - menuPopup->AddButton(tr("Clear Override"),
  324 + menuPopup->AddButton(tr("Delete override rule"),
310 325 qVariantFromValue(recinfo));
311 326 }
312 327 }
313 328 }
314 329
  330 + if (recinfo.GetRecordingRuleType() != kOverrideRecord &&
  331 + recinfo.GetRecordingRuleType() != kDontRecord)
  332 + {
  333 + menuPopup->AddButton(tr("Edit recording options"),
  334 + qVariantFromValue(recinfo));
  335 + menuPopup->AddButton(tr("Delete recording rule"),
  336 + qVariantFromValue(recinfo));
  337 + }
  338 +
315 339 popupStack->AddScreen(menuPopup);
316 340 }
317 341 else
@@ -382,7 +406,7 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
382 406 (recinfo.GetRecordingStatus() != rsDontRecord) &&
383 407 (recinfo.GetRecordingStatus() != rsNotListed))
384 408 {
385   - menuPopup->AddButton(tr("Reactivate"),
  409 + menuPopup->AddButton(tr("Restart recording this showing"),
386 410 qVariantFromValue(recinfo));
387 411 }
388 412
@@ -399,12 +423,12 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
399 423 recinfo.GetRecordingStatus() == rsInactive ||
400 424 recinfo.GetRecordingStatus() == rsLaterShowing))
401 425 {
402   - menuPopup->AddButton(tr("Record anyway"),
  426 + menuPopup->AddButton(tr("Record this showing anyway"),
403 427 qVariantFromValue(recinfo));
404 428 if (recinfo.GetRecordingStatus() == rsPreviousRecording ||
405 429 recinfo.GetRecordingStatus() == rsNeverRecord)
406 430 {
407   - menuPopup->AddButton(tr("Forget Previous"),
  431 + menuPopup->AddButton(tr("Forget previous recording"),
408 432 qVariantFromValue(recinfo));
409 433 }
410 434 }
@@ -420,7 +444,7 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
420 444 {
421 445 if (recinfo.GetRecordingStartTime() > now)
422 446 {
423   - menuPopup->AddButton(tr("Don't record"),
  447 + menuPopup->AddButton(tr("Don't record this showing"),
424 448 qVariantFromValue(recinfo));
425 449 }
426 450
@@ -444,29 +468,31 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
444 468 (!recinfo.GetSubtitle().isEmpty() ||
445 469 !recinfo.GetDescription().isEmpty())) ))
446 470 {
447   - menuPopup->AddButton(tr("Never record"),
  471 + menuPopup->AddButton(tr("Never record this episode"),
448 472 qVariantFromValue(recinfo));
449 473 }
450 474 }
451 475
452   - menuPopup->AddButton(tr("Edit Options"),
453   - qVariantFromValue(recinfo));
454   -
455 476 if (recinfo.GetRecordingRuleType() != kSingleRecord &&
456 477 recinfo.GetRecordingRuleType() != kOneRecord &&
457 478 recinfo.GetRecordingStatus() != rsNotListed)
458 479 {
459   - menuPopup->AddButton(tr("Add Override"),
  480 + menuPopup->AddButton(tr("Override this showing with options"),
460 481 qVariantFromValue(recinfo));
461 482 }
  483 +
  484 + menuPopup->AddButton(tr("Edit recording options"),
  485 + qVariantFromValue(recinfo));
  486 + menuPopup->AddButton(tr("Delete recording rule"),
  487 + qVariantFromValue(recinfo));
462 488 }
463 489
464 490 if (recinfo.GetRecordingRuleType() == kOverrideRecord ||
465 491 recinfo.GetRecordingRuleType() == kDontRecord)
466 492 {
467   - menuPopup->AddButton(tr("Edit Override"),
  493 + menuPopup->AddButton(tr("Edit override options"),
468 494 qVariantFromValue(recinfo));
469   - menuPopup->AddButton(tr("Clear Override"),
  495 + menuPopup->AddButton(tr("Delete override rule"),
470 496 qVariantFromValue(recinfo));
471 497 }
472 498 }
@@ -477,6 +503,52 @@ void ScheduleCommon::ShowNotRecordingDialog(const RecordingInfo& recinfo)
477 503 delete menuPopup;
478 504 }
479 505
  506 +/**
  507 +* \brief Creates a dialog displaying current recording status and options
  508 +* available
  509 +*/
  510 +void ScheduleCommon::ShowNotScheduledDialog(const RecordingInfo& recinfo)
  511 +{
  512 + QString message = recinfo.toString(ProgramInfo::kTitleSubtitle, " - ");
  513 +
  514 + message += "\n\n";
  515 + message += toDescription(recinfo.GetRecordingStatus(),
  516 + recinfo.GetRecordingRuleType(),
  517 + recinfo.GetRecordingStartTime());
  518 +
  519 + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
  520 + MythDialogBox *menuPopup = new MythDialogBox(message, popupStack,
  521 + "notSchedOptionPopup", true);
  522 +
  523 + if (menuPopup->Create())
  524 + {
  525 + menuPopup->SetReturnEvent(this, "schedulenotscheduled");
  526 +
  527 + QDateTime now = MythDate::current();
  528 +
  529 + if (recinfo.GetRecordingEndTime() > now)
  530 + menuPopup->AddButton(tr("Record only this showing"),
  531 + qVariantFromValue(recinfo));
  532 +
  533 + menuPopup->AddButton(tr("Record all showings"),
  534 + qVariantFromValue(recinfo));
  535 +
  536 + if (!recinfo.IsGeneric())
  537 + menuPopup->AddButton(tr("Record one showing of this episode"),
  538 + qVariantFromValue(recinfo));
  539 +
  540 + menuPopup->AddButton(tr("Record all showings on this channel"),
  541 + qVariantFromValue(recinfo));
  542 +
  543 + menuPopup->AddButton(tr("Record with more options"),
  544 + qVariantFromValue(recinfo));
  545 +
  546 + popupStack->AddScreen(menuPopup);
  547 + }
  548 + else
  549 + delete menuPopup;
  550 +}
  551 +
480 552 void ScheduleCommon::customEvent(QEvent *event)
481 553 {
482 554 if (event->type() == DialogCompletionEvent::kEventType)
@@ -486,7 +558,36 @@ void ScheduleCommon::customEvent(QEvent *event)
486 558 QString resultid = dce->GetId();
487 559 QString resulttext = dce->GetResultText();
488 560
489   - if (resultid == "schedulenotrecording")
  561 + if (resultid == "schedulenotscheduled")
  562 + {
  563 + if (!qVariantCanConvert<RecordingInfo>(dce->GetData()))
  564 + return;
  565 +
  566 + RecordingInfo recInfo = qVariantValue<RecordingInfo>
  567 + (dce->GetData());
  568 +
  569 + if (resulttext == tr("Record only this showing"))
  570 + recInfo.ApplyRecordStateChange(kSingleRecord);
  571 + else if (resulttext == tr("Record all showings"))
  572 + recInfo.ApplyRecordStateChange(kAllRecord);
  573 + else if (resulttext == tr("Record one showing of this episode"))
  574 + {
  575 + recInfo.ApplyRecordStateChange(kOneRecord, false);
  576 + recInfo.GetRecordingRule()->m_filter |= 64; // This episode
  577 + recInfo.GetRecordingRule()->Save();
  578 + }
  579 + else if (resulttext == tr("Record all showings on this channel"))
  580 + {
  581 + recInfo.ApplyRecordStateChange(kAllRecord, false);
  582 + recInfo.GetRecordingRule()->m_filter |= 1024; // This channel
  583 + recInfo.GetRecordingRule()->Save();
  584 + }
  585 + else if (resulttext == tr("Record with more options"))
  586 + {
  587 + EditScheduled(&recInfo);
  588 + }
  589 + }
  590 + else if (resultid == "schedulenotrecording")
490 591 {
491 592 if (!qVariantCanConvert<RecordingInfo>(dce->GetData()))
492 593 return;
@@ -494,33 +595,34 @@ void ScheduleCommon::customEvent(QEvent *event)
494 595 RecordingInfo recInfo = qVariantValue<RecordingInfo>
495 596 (dce->GetData());
496 597
497   - if (resulttext == tr("Reactivate"))
  598 + if (resulttext == tr("Restart recording this showing"))
498 599 recInfo.ReactivateRecording();
499   - else if (resulttext == tr("Record anyway"))
  600 + else if (resulttext == tr("Record this showing anyway"))
500 601 {
501 602 recInfo.ApplyRecordStateChange(kOverrideRecord);
502 603 if (recInfo.GetRecordingStartTime() < MythDate::current())
503 604 recInfo.ReactivateRecording();
504 605 }
505   - else if (resulttext == tr("Forget Previous"))
  606 + else if (resulttext == tr("Forget previous recording"))
506 607 recInfo.ForgetHistory();
507   - else if (resulttext == tr("Don't record"))
  608 + else if (resulttext == tr("Don't record this showing"))
508 609 recInfo.ApplyRecordStateChange(kDontRecord);
509   - else if (resulttext == tr("Never record"))
  610 + else if (resulttext == tr("Never record this episode"))
510 611 {
511 612 recInfo.SetRecordingStatus(rsNeverRecord);
512 613 recInfo.SetScheduledStartTime(MythDate::current());
513 614 recInfo.SetScheduledEndTime(recInfo.GetRecordingStartTime());
514 615 recInfo.AddHistory(true, true);
515 616 }
516   - else if (resulttext == tr("Clear Override"))
  617 + else if (resulttext == tr("Delete override rule") ||
  618 + resulttext == tr("Delete recording rule"))
517 619 recInfo.ApplyRecordStateChange(kNotRecording);
518   - else if (resulttext == tr("Edit Override") ||
519   - resulttext == tr("Edit Options"))
  620 + else if (resulttext == tr("Edit override options") ||
  621 + resulttext == tr("Edit recording options"))
520 622 {
521 623 EditScheduled(&recInfo);
522 624 }
523   - else if (resulttext == tr("Add Override"))
  625 + else if (resulttext == tr("Override this showing with options"))
524 626 {
525 627 MakeOverride(&recInfo);
526 628 }
@@ -533,27 +635,28 @@ void ScheduleCommon::customEvent(QEvent *event)
533 635 RecordingInfo recInfo = qVariantValue<RecordingInfo>
534 636 (dce->GetData());
535 637
536   - if (resulttext == tr("Reactivate"))
  638 + if (resulttext == tr("Restart recording this showing"))
537 639 recInfo.ReactivateRecording();
538   - else if (resulttext == tr("Stop recording"))
  640 + else if (resulttext == tr("Stop recording this showing"))
539 641 {
540 642 ProgramInfo pginfo(
541 643 recInfo.GetChanID(), recInfo.GetRecordingStartTime());
542 644 if (pginfo.GetChanID())
543 645 RemoteStopRecording(&pginfo);
544 646 }
545   - else if (resulttext == tr("Don't record"))
  647 + else if (resulttext == tr("Don't record this showing"))
546 648 recInfo.ApplyRecordStateChange(kDontRecord);
547   - else if (resulttext == tr("Never record"))
  649 + else if (resulttext == tr("Never record this episode"))
548 650 {
549 651 recInfo.SetRecordingStatus(rsNeverRecord);
550 652 recInfo.SetScheduledStartTime(MythDate::current());
551 653 recInfo.SetScheduledEndTime(recInfo.GetRecordingStartTime());
552 654 recInfo.AddHistory(true, true);
553 655 }
554   - else if (resulttext == tr("Clear Override"))
  656 + else if (resulttext == tr("Delete override rule") ||
  657 + resulttext == tr("Delete recording rule"))
555 658 recInfo.ApplyRecordStateChange(kNotRecording);
556   - else if (resulttext == tr("Modify Recording Options"))
  659 + else if (resulttext == tr("Edit options for this showing"))
557 660 {
558 661 if (recInfo.GetRecordingRuleType() == kSingleRecord ||
559 662 recInfo.GetRecordingRuleType() == kOverrideRecord ||
@@ -562,12 +665,12 @@ void ScheduleCommon::customEvent(QEvent *event)
562 665 else
563 666 MakeOverride(&recInfo, true);
564 667 }
565   - else if (resulttext == tr("Edit Override") ||
566   - resulttext == tr("Edit Options"))
  668 + else if (resulttext == tr("Edit override options") ||
  669 + resulttext == tr("Edit recording options"))
567 670 {
568 671 EditScheduled(&recInfo);
569 672 }
570   - else if (resulttext == tr("Add Override"))
  673 + else if (resulttext == tr("Override this showing with options"))
571 674 {
572 675 MakeOverride(&recInfo);
573 676 }
2  mythtv/programs/mythfrontend/schedulecommon.h
@@ -25,6 +25,7 @@ class ScheduleCommon : public MythScreenType
25 25 void ShowUpcoming(const QString &title, const QString &seriesid) const;
26 26 void ShowUpcoming(ProgramInfo *pginfo) const;
27 27 void ShowUpcomingScheduled(ProgramInfo *pginfo) const;
  28 + void QuickRecord(ProgramInfo *pginfo);
28 29 void EditRecording(ProgramInfo *pginfo);
29 30 void EditScheduled(ProgramInfo *pginfo);
30 31 void EditScheduled(RecordingInfo *recinfo);
@@ -32,6 +33,7 @@ class ScheduleCommon : public MythScreenType
32 33 void MakeOverride(RecordingInfo *recinfo, bool startActive = false);
33 34 void ShowRecordingDialog(const RecordingInfo &recinfo);
34 35 void ShowNotRecordingDialog(const RecordingInfo &recinfo);
  36 + void ShowNotScheduledDialog(const RecordingInfo &recinfo);
35 37
36 38 virtual void customEvent(QEvent*);
37 39
5 mythtv/programs/mythfrontend/scheduleeditor.cpp
@@ -54,6 +54,7 @@ static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"));
54 54 static QString fs7(QT_TRANSLATE_NOOP("SchedFilterEditor", "This series"));
55 55 static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"));
56 56 static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"));
  57 +static QString fs10(QT_TRANSLATE_NOOP("SchedFilterEditor", "This channel"));
57 58
58 59 void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo, void *player)
59 60 {
@@ -296,10 +297,6 @@ void ScheduleEditor::Load()
296 297 new MythUIButtonListItem(m_rulesList,
297 298 tr("Record one showing every day"),
298 299 ENUM_TO_QVARIANT(kDailyRecord));
299   - if (hasChannel && !isManual)
300   - new MythUIButtonListItem(m_rulesList,
301   - tr("Record all showings on this channel"),
302   - ENUM_TO_QVARIANT(kChannelRecord));
303 300 if (!isManual)
304 301 new MythUIButtonListItem(m_rulesList,
305 302 ("Record all showings"),

0 comments on commit 9497ba1

Please sign in to comment.
Something went wrong with that request. Please try again.