Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Recordings: add optional UI element to set subtitle #646

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion mythtv/libs/libmythbase/programinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ ProgramInfo::ProgramInfo(const QString &_pathname,
/** \fn ProgramInfo::ProgramInfo()
* \brief Constructs a manual record ProgramInfo.
*/
ProgramInfo::ProgramInfo(const QString &_title, uint _chanid,
ProgramInfo::ProgramInfo(const QString &_title,
const QString &subtitle,
uint _chanid,
const QDateTime &_startts,
const QDateTime &_endts)
{
Expand Down Expand Up @@ -814,6 +816,7 @@ ProgramInfo::ProgramInfo(const QString &_title, uint _chanid,
m_title = QString("%1 - %2").arg(ChannelText(channelFormat),
MythDate::toString(m_startTs, MythDate::kTime));
}
m_subtitle = subtitle;

m_description = m_title =
QString("%1 (%2)").arg(m_title, QObject::tr("Manual Record"));
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/programinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class MBASE_PUBLIC ProgramInfo
uint year,
const QString &programid);
/// Constructs a manual record ProgramInfo.
ProgramInfo(const QString &_title, uint _chanid,
ProgramInfo(const QString &_title, const QString &subtitle, uint _chanid,
const QDateTime &_startts, const QDateTime &_endts);
/// Constructs a Dummy ProgramInfo (used by GuideGrid)
ProgramInfo(QString _title, QString _category,
Expand Down
6 changes: 6 additions & 0 deletions mythtv/programs/mythfrontend/manualschedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bool ManualSchedule::Create(void)
m_durationSpin = dynamic_cast<MythUISpinBox *>(GetChild("duration"));

m_titleEdit = dynamic_cast<MythUITextEdit *>(GetChild("title"));
m_subtitleEdit = dynamic_cast<MythUITextEdit *>(GetChild("subtitle"));

m_recordButton = dynamic_cast<MythUIButton *>(GetChild("next"));
m_cancelButton = dynamic_cast<MythUIButton *>(GetChild("cancel"));
Expand Down Expand Up @@ -125,6 +126,10 @@ bool ManualSchedule::Create(void)
connect(m_cancelButton, &MythUIButton::Clicked, this, &MythScreenType::Close);

m_titleEdit->SetMaxLength(128);
if (m_subtitleEdit)
{
m_subtitleEdit->SetMaxLength(128);
}

BuildFocusList();

Expand Down Expand Up @@ -220,6 +225,7 @@ void ManualSchedule::recordClicked(void)
}

ProgramInfo p(m_titleEdit->GetText().trimmed(),
m_subtitleEdit ? m_subtitleEdit->GetText().trimmed() : QString(),
m_chanids[m_channelList->GetCurrentPos()],
m_startDateTime, endts);

Expand Down
1 change: 1 addition & 0 deletions mythtv/programs/mythfrontend/manualschedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ManualSchedule : public MythScreenType
QList<uint32_t> m_chanids;

MythUITextEdit *m_titleEdit {nullptr};
MythUITextEdit *m_subtitleEdit {nullptr};

MythUIButtonList *m_channelList {nullptr};
MythUIButtonList *m_startdateList {nullptr};
Expand Down
33 changes: 22 additions & 11 deletions mythtv/themes/MythCenter-wide/schedule-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -403,56 +403,67 @@
</textarea>

<textarea name="titlelabel" from="basetextarea">
<area>40,130,400,30</area>
<area>40,80,400,30</area>
<font>basemedium</font>
<align>right</align>
<value>Title (Optional):</value>
</textarea>

<textedit name="title" from="basetextedit">
<position>480,120</position>
<position>480,70</position>
</textedit>

<textarea name="subtitlelabel" from="basetextarea">
<area>40,145,400,30</area>
<font>basemedium</font>
<align>right</align>
<value>Subtitle (Optional):</value>
</textarea>

<textedit name="subtitle" from="basetextedit">
<position>480,135</position>
</textedit>

<textarea name="channellabel" from="titlelabel">
<position>40,208</position>
<position>40,213</position>
<value>Channel:</value>
</textarea>

<buttonlist name="channel" from="basewideselector">
<position>480,204</position>
<position>480,209</position>
</buttonlist>

<textarea name="datelabel" from="titlelabel">
<area>40,288,400,30</area>
<area>40,293,400,30</area>
<value>Date, or day of week:</value>
</textarea>

<buttonlist name="startdate" from="basewideselector">
<position>480,284</position>
<position>485,284</position>
</buttonlist>

<textarea name="timelabel" from="titlelabel">
<area>40,368,400,30</area>
<area>40,373,400,30</area>
<value>Start Time:</value>
</textarea>

<textarea name="hourlabel" from="basetextarea">
<area>460,370,80,30</area>
<area>460,375,80,30</area>
<value>Hour</value>
<align>right</align>
</textarea>

<spinbox name="starthour" from="base_centered_spinbox">
<position>550,364</position>
<position>550,369</position>
</spinbox>

<textarea name="minutelabel" from="hourlabel">
<position>700,370</position>
<position>700,375</position>
<value>Minute</value>
</textarea>

<spinbox name="startminute" from="base_centered_spinbox">
<position>784,364</position>
<position>784,369</position>
</spinbox>

<textarea name="durationlabel" from="titlelabel">
Expand Down
2 changes: 1 addition & 1 deletion mythtv/themes/MythCenter-wide/themeinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<major>1</major>

<!-- Minor version changes are backwards compatible -->
<minor>10</minor>
<minor>11</minor>
</version>

<!-- Theme Details (Required) -->
Expand Down
37 changes: 24 additions & 13 deletions mythtv/themes/MythCenter/schedule-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,65 +340,76 @@
</textarea>

<textarea name="titlelabel" from="basetextarea">
<area>40,130,250,30</area>
<area>40,80,250,30</area>
<font>basemedium</font>
<align>right</align>
<value>Title (Optional):</value>
</textarea>

<textedit name="title" from="basetextedit">
<position>300,120</position>
<position>300,70</position>
</textedit>

<textarea name="subtitlelabel" from="basetextarea">
<area>40,145,250,30</area>
<font>basemedium</font>
<align>right</align>
<value>Subtitle (Optional):</value>
</textarea>

<textedit name="subtitle" from="basetextedit">
<position>300,135</position>
</textedit>

<textarea name="channellabel" from="titlelabel">
<position>40,208</position>
<position>40,213</position>
<value>Channel:</value>
</textarea>

<buttonlist name="channel" from="basewideselector">
<position>300,200</position>
<position>300,205</position>
</buttonlist>

<textarea name="datelabel" from="titlelabel">
<position>40,288</position>
<position>40,293</position>
<value>Date, or day of week:</value>
</textarea>

<buttonlist name="startdate" from="basewideselector">
<position>300,280</position>
<position>300,285</position>
</buttonlist>

<textarea name="timelabel" from="titlelabel">
<area>40,368,160,30</area>
<area>40,373,160,30</area>
<value>Start Time:</value>
</textarea>

<textarea name="hourlabel" from="basetextarea">
<area>210,370,80,30</area>
<area>210,375,80,30</area>
<value>Hour</value>
<align>right</align>
</textarea>

<spinbox name="starthour" from="basespinbox">
<position>300,360</position>
<position>300,365</position>
</spinbox>

<textarea name="minutelabel" from="hourlabel">
<position>410,370</position>
<position>410,375</position>
<value>Minute</value>
</textarea>

<spinbox name="startminute" from="basespinbox">
<position>500,360</position>
<position>500,365</position>
</spinbox>

<textarea name="durationlabel" from="titlelabel">
<position>40,458</position>
<position>40,453</position>
<value>Duration:</value>
</textarea>

<spinbox name="duration" from="basespinbox">
<position>300,450</position>
<position>300,445</position>
</spinbox>

<button name="cancel" from="basebutton">
Expand Down
2 changes: 1 addition & 1 deletion mythtv/themes/MythCenter/themeinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<major>1</major>

<!-- Minor version changes are backwards compatible -->
<minor>6</minor>
<minor>7</minor>
</version>

<!-- Theme Details (Required) -->
Expand Down
33 changes: 22 additions & 11 deletions mythtv/themes/Terra/schedule-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,69 @@
</textarea>

<textarea name="titlelabel" from="basetextarea">
<area>40,130,400,30</area>
<area>40,80,400,30</area>
<font>basemedium</font>
<align>right</align>
<value>Title (Optional):</value>
</textarea>

<textedit name="title" from="basetextedit">
<position>480,120</position>
<position>480,70</position>
</textedit>

<textarea name="subtitlelabel" from="basetextarea">
<area>40,145,400,30</area>
<font>basemedium</font>
<align>right</align>
<value>Subtitle (Optional):</value>
</textarea>

<textedit name="subtitle" from="basetextedit">
<position>480,135</position>
</textedit>

<textarea name="channellabel" from="titlelabel">
<position>40,208</position>
<position>40,213</position>
<value>Channel:</value>
</textarea>

<buttonlist name="channel" from="basewideselector">
<position>480,200</position>
<position>480,205</position>
</buttonlist>

<textarea name="datelabel" from="titlelabel">
<!-- <position>40,288</position> -->
<area>40,288,400,30</area>
<area>40,293,400,30</area>
<value>Date, or day of week:</value>
</textarea>

<buttonlist name="startdate" from="basewideselector">
<position>480,280</position>
<position>480,285</position>
</buttonlist>

<textarea name="timelabel" from="titlelabel">
<area>40,368,400,30</area>
<area>40,373,400,30</area>
<align>right</align>
<value>Start Time:</value>
</textarea>

<textarea name="hourlabel" from="basetextarea">
<area>460,370,80,30</area>
<area>460,375,80,30</area>
<align>right</align>
<value>Hour</value>
</textarea>

<spinbox name="starthour" from="basespinbox">
<position>550,360</position>
<position>550,365</position>
</spinbox>

<textarea name="minutelabel" from="hourlabel">
<position>700,370</position>
<position>700,375</position>
<value>Minute</value>
</textarea>

<spinbox name="startminute" from="basespinbox">
<position>785,360</position>
<position>785,365</position>
</spinbox>

<textarea name="durationlabel" from="titlelabel">
Expand Down
2 changes: 1 addition & 1 deletion mythtv/themes/Terra/themeinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<major>1</major>

<!-- Minor version changes are backwards compatible -->
<minor>5</minor>
<minor>6</minor>
</version>

<!-- Theme Details (Required) -->
Expand Down
Loading
Loading