Go to the documentation of this file.
7 #include <QApplication>
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())
126 while (thread->isRunning())
128 QCoreApplication::processEvents();
134 ShowOkPopup(tr(
"Either you don't have any recordings or "
135 "no recordings are available locally!"));
159 for (
int i = 0; i < actions.size() && !handled; i++)
161 QString
action = actions[i];
182 auto *menuPopup =
new MythDialogBox(tr(
"Menu"), popupStack,
"actionmenu");
184 if (menuPopup->Create())
187 menuPopup->SetReturnEvent(
this,
"action");
245 .toString(
"dd MMM yy (hh:mm)"));
250 ((!
p->GetSubtitle().isEmpty()) ?
p->GetSubtitle() +
"\n" :
"") +
251 p->GetDescription());
270 if (QFile::exists(
p->GetPathname() +
".png"))
287 QList<ArchiveItem *> tempAList;
294 if (a->type !=
"Recording" || a->filename ==
p->GetPlaybackURL(
false,
true))
305 for (
auto *x : qAsConst(tempAList))
309 QList<ProgramInfo *> tempSList;
314 if (a->filename ==
p->GetPlaybackURL(
false,
true))
322 for (
auto *x : qAsConst(tempSList))
329 a->
type =
"Recording";
330 a->title =
p->GetTitle();
331 a->subtitle =
p->GetSubtitle();
332 a->description =
p->GetDescription();
333 a->startDate =
p->GetScheduledStartTime()
334 .toLocalTime().toString(
"dd MMM yy");
335 a->startTime =
p->GetScheduledStartTime()
336 .toLocalTime().toString(
"(hh:mm)");
337 a->size =
p->GetFilesize();
338 a->filename =
p->GetPlaybackURL(
false,
true);
339 a->hasCutlist =
p->HasCutlist();
340 a->useCutlist =
false;
347 a->encoderProfile =
nullptr;
348 a->editedDetails =
false;
378 p->GetTitle() +
" ~ " +
379 p->GetScheduledStartTime().toLocalTime()
380 .toString(
"dd MMM yy (hh:mm)"));
381 item->setCheckable(
true);
391 QString title =
p->GetTitle();
392 QString subtitle =
p->GetSubtitle();
394 QDateTime recstartts =
p->GetScheduledStartTime();
395 QDateTime recendts =
p->GetScheduledEndTime();
397 QString timedate = QString(
"%1 - %2")
401 uint season =
p->GetSeason();
402 uint episode =
p->GetEpisode();
406 if (season && episode)
408 seasone = QString(
"s%1e%2")
411 seasonx = QString(
"%1x%2")
416 item->SetText(title,
"title");
417 item->SetText(subtitle,
"subtitle");
418 if (subtitle.isEmpty())
419 item->SetText(title,
"titlesubtitle");
421 item->SetText(title +
" - \"" + subtitle +
'"',
424 item->SetText(timedate,
"timedate");
425 item->SetText(
p->GetDescription(),
"description");
429 item->SetText(QString::number(season),
"season");
430 item->SetText(QString::number(episode),
"episode");
431 item->SetText(seasonx,
"00x00");
432 item->SetText(seasone,
"s00e00");
434 item->DisplayState(
p->HasCutlist() ?
"yes" :
"no",
"cutlist");
436 item->SetData(QVariant::fromValue(
p));
438 QCoreApplication::processEvents();
458 if (
p->GetRecordingGroup() ==
"LiveTV" ||
459 p->GetRecordingGroup() ==
"Deleted")
506 if (
p->GetPlaybackURL(
false,
true) == a->filename)
513 QCoreApplication::processEvents();
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
RecordingSelector * m_parent
void setCategory(MythUIButtonListItem *item)
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
void ShowMenu(void) override
MythUIButtonList * m_categorySelector
void toggleSelected(MythUIButtonListItem *item)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
MythUIText * m_filesizeText
MythUIType * GetFocusWidget(void) const
void getRecordingList(void)
MythUIImage * m_previewImage
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
bool SetFocusWidget(MythUIType *widget=nullptr)
void titleChanged(MythUIButtonListItem *item)
Basic menu dialog, message and a list of options.
QList< ProgramInfo * > m_selectedList
void BuildFocusList(void)
void updateRecordingList(void)
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
void updateSelectedList(void)
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
void updateCategorySelector(void)
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
MythUIButton * m_okButton
MythUIButtonList * m_recordingButtonList
Holds information on recordings and videos.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUIText * m_datetimeText
friend class GetRecordingListThread
std::vector< ProgramInfo * > * m_recordingList
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
virtual void SetText(const QString &text)
~RecordingSelector(void) override
This is a wrapper around QThread that does several additional things.
MythUIImage * m_cutlistImage
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
MythUIText * m_descriptionText
GetRecordingListThread(RecordingSelector *parent)
@ kDateTimeFull
Default local time.
std::vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
@ kTime
Default local time.
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
MythUIButton * m_cancelButton
QList< ArchiveItem * > * m_archiveList