From a95276149a4f38d9ed609ba3f59002be69800efc Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Fri, 30 Sep 2022 15:15:12 -0400 Subject: [PATCH 1/8] mythfrontend/manualschedule: add optional theme element to set subtitle If the element is absent, the behavior is unchanged. --- mythtv/libs/libmythtv/programinfo.cpp | 5 ++++- mythtv/libs/libmythtv/programinfo.h | 2 +- mythtv/programs/mythfrontend/manualschedule.cpp | 6 ++++++ mythtv/programs/mythfrontend/manualschedule.h | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythtv/programinfo.cpp b/mythtv/libs/libmythtv/programinfo.cpp index d72eaa45b85..c4bd9973f08 100644 --- a/mythtv/libs/libmythtv/programinfo.cpp +++ b/mythtv/libs/libmythtv/programinfo.cpp @@ -787,7 +787,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) { @@ -822,6 +824,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")); diff --git a/mythtv/libs/libmythtv/programinfo.h b/mythtv/libs/libmythtv/programinfo.h index c5c6c619a4c..6b788f47bd7 100644 --- a/mythtv/libs/libmythtv/programinfo.h +++ b/mythtv/libs/libmythtv/programinfo.h @@ -278,7 +278,7 @@ class MTV_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, diff --git a/mythtv/programs/mythfrontend/manualschedule.cpp b/mythtv/programs/mythfrontend/manualschedule.cpp index 759f4b08a46..35536dbf41d 100644 --- a/mythtv/programs/mythfrontend/manualschedule.cpp +++ b/mythtv/programs/mythfrontend/manualschedule.cpp @@ -42,6 +42,7 @@ bool ManualSchedule::Create(void) m_durationSpin = dynamic_cast(GetChild("duration")); m_titleEdit = dynamic_cast(GetChild("title")); + m_subtitleEdit = dynamic_cast(GetChild("subtitle")); m_recordButton = dynamic_cast(GetChild("next")); m_cancelButton = dynamic_cast(GetChild("cancel")); @@ -126,6 +127,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(); @@ -244,6 +249,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); diff --git a/mythtv/programs/mythfrontend/manualschedule.h b/mythtv/programs/mythfrontend/manualschedule.h index 09d1ffd5e39..5de0bccd1cb 100644 --- a/mythtv/programs/mythfrontend/manualschedule.h +++ b/mythtv/programs/mythfrontend/manualschedule.h @@ -43,6 +43,7 @@ class ManualSchedule : public MythScreenType QList m_chanids; MythUITextEdit *m_titleEdit {nullptr}; + MythUITextEdit *m_subtitleEdit {nullptr}; MythUIButtonList *m_channelList {nullptr}; MythUIButtonList *m_startdateList {nullptr}; From 858029ace0fc33e63ee2064aee5e67d500a03f5b Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Fri, 30 Sep 2022 17:35:32 -0400 Subject: [PATCH 2/8] MythCenter: add "manualschedule" "subtitle" Move "title" up slightly and squeeze in "subtitle", moving the rest down slightly, except "duration", which I moved up slightly to make the spacing more even. --- mythtv/themes/MythCenter/schedule-ui.xml | 37 +++++++++++++++--------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/mythtv/themes/MythCenter/schedule-ui.xml b/mythtv/themes/MythCenter/schedule-ui.xml index 45e60e13f6f..a33eca7e2d4 100644 --- a/mythtv/themes/MythCenter/schedule-ui.xml +++ b/mythtv/themes/MythCenter/schedule-ui.xml @@ -340,65 +340,76 @@ - 300,120 + 300,70 + + + + + + 300,135 - 300,200 + 300,205 - 300,280 + 300,285 - 300,360 + 300,365 - 500,360 + 500,365 - 300,450 + 300,445