53 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'file_selector'");
104 for (
int i = 0; i < actions.size() && !handled; i++)
106 const QString&
action = actions[i];
134 if (fileData->directory)
136 if (fileData->filename ==
"..")
158 if (!fullPath.endsWith(
"/"))
160 fullPath += fileData->filename;
214 QList<ArchiveItem *> tempAList;
217 if (a->type !=
"File")
221 {
return a->filename == f; } ))
225 for (
auto *x : std::as_const(tempAList))
229 QStringList tempSList;
232 auto namematch = [f](
const auto *a){
return a->filename == f; };
233 if (std::ranges::any_of(std::as_const(*
m_archiveList), namematch))
237 for (
const auto & name : std::as_const(tempSList))
247 int pos = f.lastIndexOf(
'/');
249 title = f.mid(pos + 1);
258 a->size = (int64_t)
file.size();
260 a->hasCutlist =
false;
261 a->useCutlist =
false;
268 a->encoderProfile =
nullptr;
269 a->editedDetails =
false;
281 if (!fileData->directory)
283 ShowOkPopup(tr(
"The selected item is not a directory!"));
287 if (fileData->filename !=
"..")
296 if (fileData->directory)
365 QFileInfoList list =
d.entryInfoList(filters, QDir::Dirs, QDir::Name);
367 for (
const auto & fi : std::as_const(list))
369 if (fi.fileName() !=
".")
373 data->directory =
true;
374 data->filename = fi.fileName();
381 item->setCheckable(
false);
382 item->SetImage(
"ma_folder.png");
383 item->SetData(QVariant::fromValue(data));
391 filters =
m_filemask.split(
" ", Qt::SkipEmptyParts);
392 list =
d.entryInfoList(filters, QDir::Files, QDir::Name);
393 for (
const auto & fi : std::as_const(list))
397 data->directory =
false;
398 data->filename = fi.fileName();
399 data->size = fi.size();
409 item->setCheckable(
true);
412 if (!fullPath.endsWith(
"/"))
414 fullPath += data->filename;
427 item->setCheckable(
false);
430 item->SetData(QVariant::fromValue(data));
438 LOG(VB_GENERAL, LOG_ERR,
439 "MythArchive: current directory does not exist!");
MythUIButton * m_okButton
QString getSelected(void)
void updateSelectedList(void)
MythUIButtonList * m_fileButtonList
QStringList m_selectedList
MythUIButton * m_homeButton
MythUITextEdit * m_locationEdit
void updateFileList(void)
bool Create(void) override
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void locationEditLostFocus(void)
void itemClicked(MythUIButtonListItem *item)
QList< ArchiveItem * > * m_archiveList
QList< FileData * > m_fileData
MythUIButton * m_backButton
MythUIButton * m_cancelButton
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 BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
virtual void SetText(const QString &text)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
static const iso6937table * d
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)