43 void run(
void)
override
63 bool foundtheme =
LoadWindowFromXML(
"mytharchive-ui.xml",
"recording_selector",
this);
82 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'recording_selector'");
110 QString message = tr(
"Retrieving Recording List.\nPlease Wait...");
114 auto *busyPopup =
new
117 if (busyPopup->Create())
128 while (thread->isRunning())
130 QCoreApplication::processEvents();
131 std::this_thread::sleep_for(2ms);
136 ShowOkPopup(tr(
"Either you don't have any recordings or "
137 "no recordings are available locally!"));
161 for (
int i = 0; i < actions.size() && !handled; i++)
163 const QString&
action = actions[i];
186 auto *menuPopup =
new MythDialogBox(tr(
"Menu"), popupStack,
"actionmenu");
188 if (menuPopup->Create())
191 menuPopup->SetReturnEvent(
this,
"action");
249 .toString(
"dd MMM yy (hh:mm)"));
254 ((!
p->GetSubtitle().isEmpty()) ?
p->GetSubtitle() +
"\n" :
"") +
255 p->GetDescription());
291 QList<ArchiveItem *> tempAList;
298 if (a->type !=
"Recording" || a->filename ==
p->GetPlaybackURL(
false,
true))
309 for (
auto *x : std::as_const(tempAList))
313 QList<ProgramInfo *> tempSList;
318 if (a->filename ==
p->GetPlaybackURL(
false,
true))
326 for (
auto *x : std::as_const(tempSList))
333 a->
type =
"Recording";
334 a->title =
p->GetTitle();
335 a->subtitle =
p->GetSubtitle();
336 a->description =
p->GetDescription();
337 a->startDate =
p->GetScheduledStartTime()
338 .toLocalTime().toString(
"dd MMM yy");
339 a->startTime =
p->GetScheduledStartTime()
340 .toLocalTime().toString(
"(hh:mm)");
341 a->size =
p->GetFilesize();
342 a->filename =
p->GetPlaybackURL(
false,
true);
343 a->hasCutlist =
p->HasCutlist();
344 a->useCutlist =
false;
351 a->encoderProfile =
nullptr;
352 a->editedDetails =
false;
382 p->GetTitle() +
" ~ " +
383 p->GetScheduledStartTime().toLocalTime()
384 .toString(
"dd MMM yy (hh:mm)"));
385 item->setCheckable(
true);
395 QString title =
p->GetTitle();
396 QString subtitle =
p->GetSubtitle();
398 QDateTime recstartts =
p->GetScheduledStartTime();
399 QDateTime recendts =
p->GetScheduledEndTime();
401 QString timedate = QString(
"%1 - %2")
405 uint season =
p->GetSeason();
406 uint episode =
p->GetEpisode();
410 if (season && episode)
412 seasone = QString(
"s%1e%2")
415 seasonx = QString(
"%1x%2")
420 item->SetText(title,
"title");
421 item->SetText(subtitle,
"subtitle");
422 if (subtitle.isEmpty())
423 item->SetText(title,
"titlesubtitle");
425 item->SetText(title +
" - \"" + subtitle +
'"',
428 item->SetText(timedate,
"timedate");
429 item->SetText(
p->GetDescription(),
"description");
433 item->SetText(QString::number(season),
"season");
434 item->SetText(QString::number(episode),
"episode");
435 item->SetText(seasonx,
"00x00");
436 item->SetText(seasone,
"s00e00");
438 item->DisplayState(
p->HasCutlist() ?
"yes" :
"no",
"cutlist");
440 item->SetData(QVariant::fromValue(
p));
442 QCoreApplication::processEvents();
462 if (
p->GetRecordingGroup() ==
"LiveTV" ||
463 p->GetRecordingGroup() ==
"Deleted")
509 if (
p->GetPlaybackURL(
false,
true) == a->filename)
516 QCoreApplication::processEvents();
RecordingSelector * m_parent
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
GetRecordingListThread(RecordingSelector *parent)
This is a wrapper around QThread that does several additional things.
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
Basic menu dialog, message and a list of options.
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
virtual void SetText(const QString &text)
Holds information on recordings and videos.
MythUIText * m_descriptionText
void updateSelectedList(void)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void toggleSelected(MythUIButtonListItem *item)
QList< ProgramInfo * > m_selectedList
void updateCategorySelector(void)
MythUIText * m_datetimeText
friend class GetRecordingListThread
void getRecordingList(void)
void titleChanged(MythUIButtonListItem *item)
void setCategory(MythUIButtonListItem *item)
MythUIImage * m_cutlistImage
MythUIButtonList * m_categorySelector
std::vector< ProgramInfo * > * m_recordingList
MythUIButton * m_cancelButton
~RecordingSelector(void) override
QList< ArchiveItem * > * m_archiveList
void updateRecordingList(void)
MythUIImage * m_previewImage
MythUIButton * m_okButton
MythUIButtonList * m_recordingButtonList
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
MythUIText * m_filesizeText
void ShowMenu(void) override
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kDateTimeFull
Default local time.
@ kTime
Default local time.
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
std::vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)