MythTV  master
mythuifilebrowser.cpp
Go to the documentation of this file.
1 #include <chrono>
2 #include <utility>
3 
4 #include <QCoreApplication>
5 #include <QFileInfo>
6 #include <QImageReader>
7 #include <QString>
8 #include <QStringList>
9 #include <QTimer>
10 #include <QUrl>
11 
12 #include "mythlogging.h"
13 
14 #include "mythcorecontext.h"
15 #include "mythdialogbox.h"
16 #include "mythfontproperties.h"
17 #include "mythmainwindow.h"
18 #include "mythuibutton.h"
19 #include "mythuibuttonlist.h"
20 #include "mythuifilebrowser.h"
21 #include "mythuiimage.h"
22 #include "mythuistatetype.h"
23 #include "mythuitext.h"
24 #include "mythuiutils.h"
25 
26 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
27 #define qEnvironmentVariable getenv
28 #endif
29 
31 MFileInfo::MFileInfo(const QString& fileName, QString sgDir, bool isDir, qint64 size)
32 {
33  init(fileName, std::move(sgDir), isDir, size);
34 }
35 
36 void MFileInfo::init(const QString& fileName, QString sgDir, bool isDir,
37  qint64 size)
38 {
40  m_isRemote = false;
41  m_isParentDir = false;
42 
43  if (fileName.startsWith("myth://"))
44  {
45  QUrl qurl(fileName);
46  m_hostName = qurl.host();
47  m_storageGroup = qurl.userName();
48  m_storageGroupDir = std::move(sgDir);
49  m_subDir = qurl.path();
50 
51  if (!qurl.fragment().isEmpty())
52  m_subDir += "#" + qurl.fragment();
53 
54  if (m_subDir.startsWith("/"))
55  m_subDir.remove(0, 1);
56 
57  m_isRemote = true;
58 
59  m_isDir = isDir;
60  m_isFile = !isDir;
61  m_size = size;
62  }
63 
64  if (!fileName.isEmpty())
65  QFileInfo::setFile(fileName);
66 }
67 
69  : QFileInfo(other)
70 {
71  QString sgDir = other.storageGroupDir();
72  bool isDir = other.isDir();
73  qint64 size = other.size();
74  init(other.filePath(), sgDir, isDir, size);
75 }
76 
78 {
79  if (this == &other)
80  return *this;
81 
82  QString sgDir = other.storageGroupDir();
83  bool isDir = other.isDir();
84  qint64 size = other.size();
85  init(other.fileName(), sgDir, isDir, size);
86 
87  return *this;
88 }
89 
90 QString MFileInfo::fileName(void) const
91 {
92  if (m_isRemote)
93  return m_fileName;
94  return QFileInfo::fileName();
95 }
96 
97 QString MFileInfo::filePath(void) const
98 {
99  if (m_isRemote)
100  return m_fileName;
101  return QFileInfo::filePath();
102 }
103 
104 bool MFileInfo::isDir(void) const
105 {
106  if (m_isRemote)
107  return m_isDir;
108  return QFileInfo::isDir();
109 }
110 
111 bool MFileInfo::isFile(void) const
112 {
113  if (m_isRemote)
114  return m_isFile;
115  return QFileInfo::isFile();
116 }
117 
118 bool MFileInfo::isParentDir(void) const
119 {
120  if (m_isRemote)
121  return m_isParentDir;
122  return (QFileInfo::fileName() == "..");
123 }
124 
125 bool MFileInfo::isExecutable(void) const
126 {
127  if (m_isRemote)
128  return false;
129  return QFileInfo::isExecutable();
130 }
131 
132 QString MFileInfo::absoluteFilePath(void) const
133 {
134  if (m_isRemote)
135  return m_fileName;
136  return QFileInfo::absoluteFilePath();
137 }
138 
139 qint64 MFileInfo::size(void) const
140 {
141  if (m_isRemote)
142  return m_size;
143  return QFileInfo::size();
144 }
145 
147 
156  const QString &startPath)
157  : MythScreenType(parent, "mythuifilebrowser")
158 {
159  SetPath(startPath);
160 
161  m_nameFilter.clear();
162  m_nameFilter << "*";
163 
164  m_previewTimer = new QTimer(this);
165  m_previewTimer->setSingleShot(true);
167 }
168 
169 void MythUIFileBrowser::SetPath(const QString &startPath)
170 {
171  if (startPath.startsWith("myth://"))
172  {
173  m_isRemote = true;
174 
175  QUrl qurl(startPath);
176 
177  if (!qurl.path().isEmpty())
178  {
179  // Force browing of remote SG's to start at their root
181  0,
182  "",
183  qurl.userName());
184 
185  }
186  else
187  {
188  m_baseDirectory = startPath;
189 
190  if (m_baseDirectory.endsWith("/"))
191  m_baseDirectory.remove(m_baseDirectory.length() - 1, 1);
192  }
193 
194  m_subDirectory = "";
195  m_storageGroupDir = "";
196  }
197  else
198  {
199  m_isRemote = false;
200  m_baseDirectory = "";
201  m_subDirectory = startPath;
202  }
203 }
204 
206 {
207  if (!CopyWindowFromBase("MythFileBrowser", this))
208  return false;
209 
210  m_fileList = dynamic_cast<MythUIButtonList *>(GetChild("filelist"));
211  m_locationEdit = dynamic_cast<MythUITextEdit *>(GetChild("location"));
212  m_okButton = dynamic_cast<MythUIButton *>(GetChild("ok"));
213  m_cancelButton = dynamic_cast<MythUIButton *>(GetChild("cancel"));
214  m_backButton = dynamic_cast<MythUIButton *>(GetChild("back"));
215  m_homeButton = dynamic_cast<MythUIButton *>(GetChild("home"));
216  m_previewImage = dynamic_cast<MythUIImage *>(GetChild("preview"));
217  m_infoText = dynamic_cast<MythUIText *>(GetChild("info"));
218  m_filenameText = dynamic_cast<MythUIText *>(GetChild("filename"));
219  m_fullpathText = dynamic_cast<MythUIText *>(GetChild("fullpath"));
220 
222  {
223  LOG(VB_GENERAL, LOG_ERR, "MythUIFileBrowser: Your theme is missing"
224  " some UI elements! Bailing out.");
225  return false;
226  }
227 
235 
236  if (m_backButton)
238 
239  if (m_homeButton)
241 
242  BuildFocusList();
243  updateFileList();
244 
245  return true;
246 }
247 
248 void MythUIFileBrowser::SetReturnEvent(QObject *retobject,
249  const QString &resultid)
250 {
251  m_retObject = retobject;
252  m_id = resultid;
253 }
254 
256 {
257  if (m_previewImage)
258  m_previewImage->Load();
259 }
260 
262 {
263  if (!item)
264  return;
265 
266  if (m_previewImage)
268 
269  auto finfo = item->GetData().value<MFileInfo>();
270 
271  if (finfo.isParentDir())
272  {
273  if (m_infoText)
274  m_infoText->Reset();
275 
276  if (m_filenameText)
278 
279  if (m_fullpathText)
281  }
282  else
283  {
284  if (IsImage(finfo.suffix()) && m_previewImage)
285  {
286  m_previewImage->SetFilename(finfo.absoluteFilePath());
287  m_previewTimer->start(250ms);
288  }
289 
290  if (m_infoText)
291  m_infoText->SetText(FormatSize(finfo.size()));
292 
293  if (m_filenameText)
294  m_filenameText->SetText(finfo.fileName());
295 
296  if (m_fullpathText)
297  m_fullpathText->SetText(finfo.absoluteFilePath());
298  }
299 }
300 
302 {
303  if (!item)
304  return;
305 
306  auto finfo = item->GetData().value<MFileInfo>();
307 
308  if (finfo.isFile())
309  {
310  if (m_retObject)
311  {
312  auto *dce = new DialogCompletionEvent(m_id, 0, finfo.filePath(),
313  item->GetData());
314  QCoreApplication::postEvent(m_retObject, dce);
315  }
316 
317  Close();
318  return;
319  }
320 
321  if (!finfo.isDir())
322  return;
323 
324  if (finfo.isParentDir())
325  {
326  backPressed();
327  }
328  else
329  {
330  if (finfo.isRemote())
331  {
332  m_subDirectory = finfo.subDir();
333  m_storageGroupDir = finfo.storageGroupDir();
334  }
335  else
336  {
337  m_subDirectory = finfo.filePath();
338  m_storageGroupDir = "";
339  }
340  }
341 
342  updateFileList();
343 }
344 
345 bool MythUIFileBrowser::IsImage(QString extension)
346 {
347  if (extension.isEmpty())
348  return false;
349 
350  extension = extension.toLower();
351 
352  QList<QByteArray> formats = QImageReader::supportedImageFormats();
353 
354  return formats.contains(extension.toLatin1());
355 }
356 
358 {
359  QString newPath = m_locationEdit->GetText();
360 
361  SetPath(newPath);
362 
363  updateFileList();
364 }
365 
367 {
368  if (m_isRemote)
369  {
371 
372  if (m_subDirectory.startsWith(m_baseDirectory))
373  {
374  m_subDirectory.remove(0, m_baseDirectory.length());
375 
376  if (m_subDirectory.startsWith("/"))
377  m_subDirectory.remove(0, 1);
378  }
379 
381  }
382  else
383  {
384  // move up one directory
385  int pos = m_subDirectory.lastIndexOf('/');
386 
387  if (pos > 0)
388  m_subDirectory = m_subDirectory.left(pos);
389  else
390  m_subDirectory = "/";
391  }
392 
393  updateFileList();
394 }
395 
397 {
398  if (m_isRemote)
399  {
400  m_subDirectory = "";
401  m_storageGroupDir = "";
402  }
403  else
404  {
405  m_subDirectory = qEnvironmentVariable("HOME");
406  }
407 
408  updateFileList();
409 }
410 
412 {
414 
415  if (m_retObject)
416  {
417  QString selectedPath = m_locationEdit->GetText();
418  QVariant vData;
419  if (item != nullptr)
420  vData = item->GetData();
421  auto *dce = new DialogCompletionEvent(m_id, 0, selectedPath,
422  vData);
423  QCoreApplication::postEvent(m_retObject, dce);
424  }
425 
426  Close();
427 }
428 
430 {
431  Close();
432 }
433 
435 {
436  m_fileList->Reset();
437 
438  if (m_isRemote)
440  else
442 }
443 
445 {
446  QStringList sgdirlist;
447  QString sgdir;
448  QStringList slist;
449 
450  if (!m_baseDirectory.endsWith("/"))
451  m_baseDirectory.append("/");
452 
453  QString dirURL = QString("%1%2").arg(m_baseDirectory, m_subDirectory);
454 
455  if (!GetRemoteFileList(m_baseDirectory, sgdir, sgdirlist))
456  {
457  LOG(VB_GENERAL, LOG_ERR, "GetRemoteFileList failed to get "
458  "Storage Group dirs");
459  return;
460  }
461 
462  if ((sgdirlist.size() == 1) &&
463  (sgdirlist[0].startsWith("sgdir::")))
464  {
465  QStringList tokens = sgdirlist[0].split("::");
466 
467  m_storageGroupDir = tokens[1];
468  }
469 
470  if (!GetRemoteFileList(dirURL, m_storageGroupDir, slist))
471  {
472  LOG(VB_GENERAL, LOG_ERR,
473  QString("GetRemoteFileList failed for '%1' in '%2' SG dir")
474  .arg(dirURL, m_storageGroupDir));
475  return;
476  }
477 
478  m_locationEdit->SetText(dirURL);
479 
480  QString displayName;
481  QString dataName;
482  QString type;
483 
484  if ((sgdirlist.size() > 1 && !m_storageGroupDir.isEmpty()) ||
485  (!m_subDirectory.isEmpty()))
486  {
487  displayName = tr("Parent");
488  type = "upfolder";
489 
491 
492  if (!m_subDirectory.isEmpty())
493  {
494  m_parentDir += "/" + m_subDirectory;
495 
496  int pos = m_parentDir.lastIndexOf('/');
497 
498  if (pos > 0)
499  m_parentDir = m_parentDir.left(pos);
500  }
501 
502 
505 
506  if (m_subDirectory.isEmpty() && m_parentDir == m_baseDirectory)
507  {
508  finfo.setSGDir("");
509  m_parentSGDir = "";
510  }
511 
512  auto *item = new MythUIButtonListItem(m_fileList, displayName,
513  QVariant::fromValue(finfo));
514 
515  item->SetText(QString("0"), "filesize");
516  item->SetText(m_parentDir, "fullpath");
517  item->DisplayState(type, "nodetype");
518 
519  if (m_backButton)
520  m_backButton->SetEnabled(true);
521  }
522  else
523  {
524  if (m_backButton)
525  m_backButton->SetEnabled(false);
526  }
527 
528  for (const auto & line : qAsConst(slist))
529  {
530  QStringList tokens = line.split("::");
531 
532  if (tokens.size() < 2)
533  {
534  LOG(VB_GENERAL, LOG_ERR, QString("failed to parse '%1'.").arg(line));
535  continue;
536  }
537 
538  displayName = tokens[1];
539 
540  if (tokens[0] == "sgdir")
541  dataName = m_baseDirectory;
542  else if (m_subDirectory.isEmpty())
543  {
544  dataName = QString("%1%2").arg(m_baseDirectory, displayName);
545  }
546  else
547  {
548  dataName = QString("%1%2/%3")
549  .arg(m_baseDirectory, m_subDirectory, displayName);
550  }
551 
552  MFileInfo finfo(dataName, m_storageGroupDir);
553 
554  if ((tokens[0] == "dir") &&
555  ((m_typeFilter & (QDir::Dirs | QDir::AllDirs)) != 0))
556  {
557  type = "folder";
558  finfo.setIsDir(true);
560  finfo.setSize(0);
561  }
562  else if ((tokens[0] == "sgdir") &&
563  ((m_typeFilter & (QDir::Dirs | QDir::AllDirs)) != 0))
564  {
565  type = "folder";
566  finfo.setIsDir(true);
567  finfo.setSGDir(displayName);
568  finfo.setSize(0);
569  }
570  else if ((tokens[0] == "file") &&
571  ((m_typeFilter & QDir::Files) != 0))
572  {
573  finfo.setIsDir(false);
574  finfo.setSize(tokens[2].toInt());
575 
576  if (IsImage(finfo.suffix()))
577  type = "image";
578  else
579  type = "file";
580  }
581  else
582  {
583  // unknown type or filtered out
584  continue;
585  }
586 
587  auto *item = new MythUIButtonListItem(m_fileList, displayName,
588  QVariant::fromValue(finfo));
589 
590  if (finfo.size())
591  item->SetText(FormatSize(finfo.size()), "filesize");
592 
593  if (type == "image")
594  item->SetImage(dataName);
595 
596  item->SetText(dataName, "fullpath");
597  item->DisplayState(type, "nodetype");
598  }
599 }
600 
602 {
603  QDir d;
604 
605  d.setPath(m_subDirectory);
606  d.setNameFilters(m_nameFilter);
607  d.setFilter(m_typeFilter);
608  d.setSorting(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase);
609 
610  if (!d.exists())
611  {
612  LOG(VB_GENERAL, LOG_ERR,
613  "MythUIFileBrowser: current directory does not exist!");
614  m_locationEdit->SetText("/");
615  m_subDirectory = "/";
616  d.setPath("/");
617  }
618 
619  QFileInfoList list = d.entryInfoList();
620  bool showBackButton = false;
621 
622  if (list.isEmpty())
623  {
624  auto *item = new MythUIButtonListItem(m_fileList,
625  tr("Parent Directory"));
626  item->DisplayState("upfolder", "nodetype");
627  }
628  else
629  {
630  for (const auto & fi : qAsConst(list))
631  {
632  MFileInfo finfo(fi.filePath());
633 
634  if (finfo.fileName() == ".")
635  continue;
636 
637  QString displayName = finfo.fileName();
638  QString type;
639 
640  if (displayName == "..")
641  {
642  if (m_subDirectory.endsWith("/"))
643  continue;
644 
645  displayName = tr("Parent");
646  type = "upfolder";
647  showBackButton = true;
648  }
649  else if (finfo.isDir())
650  {
651  type = "folder";
652  }
653  else if (finfo.isExecutable())
654  {
655  type = "executable";
656  }
657  else if (finfo.isFile())
658  {
659  type = "file";
660  }
661 
662  auto *item = new MythUIButtonListItem(m_fileList, displayName,
663  QVariant::fromValue(finfo));
664 
665  if (IsImage(finfo.suffix()))
666  {
667  item->SetImage(finfo.absoluteFilePath());
668  type = "image";
669  }
670 
671  item->SetText(FormatSize(finfo.size()), "filesize");
672  item->SetText(finfo.absoluteFilePath(), "fullpath");
673  item->DisplayState(type, "nodetype");
674  }
675  }
676 
677  if (m_backButton)
678  m_backButton->SetEnabled(showBackButton);
679 
681 }
682 
683 QString MythUIFileBrowser::FormatSize(int64_t size)
684 {
685  QString filesize("%L1 %2");
686 
687  if (size < 1000000)
688  filesize = filesize.arg((double)size / 1000.0, 0, 'f', 0).arg("KB");
689  else if (size < 1000000000)
690  filesize = filesize.arg((double)size / 1000000.0, 0, 'f', 1).arg("MB");
691  else
692  filesize = filesize.arg((double)size / 1000000000.0, 0, 'f', 1).arg("GB");
693 
694  return filesize;
695 }
696 
697 bool MythUIFileBrowser::GetRemoteFileList(const QString &url,
698  const QString &sgDir,
699  QStringList &list)
700 {
701  QUrl qurl(url);
702  QString storageGroup = qurl.userName();
703 
704  list.clear();
705 
706  if (storageGroup.isEmpty())
707  storageGroup = "Default";
708 
709  list << "QUERY_SG_GETFILELIST";
710  list << qurl.host();
711  list << storageGroup;
712 
713  QString path = sgDir + qurl.path();
714 
715  if (!qurl.fragment().isEmpty())
716  path += "#" + qurl.fragment();
717 
718  list << path;
719  list << "0";
720 
721  bool ok = gCoreContext->SendReceiveStringList(list);
722 
723  if ((list.size() == 1) && (list[0] == "EMPTY LIST"))
724  list.clear();
725 
726  return ok;
727 
728 }
729 
730 /* vim: set expandtab tabstop=4 shiftwidth=4: */
MythUIFileBrowser::MythUIFileBrowser
MythUIFileBrowser(MythScreenStack *parent, const QString &startPath)
Browse a local filesystem or remote Storage Group Returns the selected file. Includes previews of ima...
Definition: mythuifilebrowser.cpp:155
MythUIButton::Clicked
void Clicked()
MFileInfo::m_isDir
bool m_isDir
Definition: mythuifilebrowser.h:61
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
MFileInfo::absoluteFilePath
QString absoluteFilePath(void) const
Definition: mythuifilebrowser.cpp:132
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
mythuitext.h
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
MFileInfo::m_subDir
QString m_subDir
Definition: mythuifilebrowser.h:69
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:83
MFileInfo::m_storageGroup
QString m_storageGroup
Definition: mythuifilebrowser.h:66
MythUIFileBrowser::updateFileList
void updateFileList(void)
Definition: mythuifilebrowser.cpp:434
MFileInfo::m_size
qint64 m_size
Definition: mythuifilebrowser.h:71
MythCoreContext::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Definition: mythcorecontext.cpp:1383
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
MythUIFileBrowser::m_previewImage
MythUIImage * m_previewImage
Definition: mythuifilebrowser.h:135
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:968
MythUIFileBrowser::backPressed
void backPressed(void)
Definition: mythuifilebrowser.cpp:366
MythUIFileBrowser::m_homeButton
MythUIButton * m_homeButton
Definition: mythuifilebrowser.h:134
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
MythUIFileBrowser::m_locationEdit
MythUITextEdit * m_locationEdit
Definition: mythuifilebrowser.h:130
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MythUIFileBrowser::m_cancelButton
MythUIButton * m_cancelButton
Definition: mythuifilebrowser.h:132
MFileInfo::init
void init(const QString &fileName="", QString sgDir="", bool isDir=false, qint64 size=0)
Definition: mythuifilebrowser.cpp:36
MythUIFileBrowser::m_nameFilter
QStringList m_nameFilter
Definition: mythuifilebrowser.h:127
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:32
MFileInfo::setIsDir
void setIsDir(bool isDir)
Definition: mythuifilebrowser.h:48
MythUIFileBrowser::FormatSize
static QString FormatSize(int64_t size)
Definition: mythuifilebrowser.cpp:683
MythUIFileBrowser::SetReturnEvent
void SetReturnEvent(QObject *retobject, const QString &resultid)
Definition: mythuifilebrowser.cpp:248
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythuistatetype.h
MFileInfo::operator=
MFileInfo & operator=(const MFileInfo &other)
Definition: mythuifilebrowser.cpp:77
MythUIFileBrowser::PathSelected
void PathSelected(MythUIButtonListItem *item)
Definition: mythuifilebrowser.cpp:261
MythUIFileBrowser::m_fullpathText
MythUIText * m_fullpathText
Definition: mythuifilebrowser.h:138
MythUIFileBrowser::m_okButton
MythUIButton * m_okButton
Definition: mythuifilebrowser.h:131
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:47
MFileInfo::size
qint64 size(void) const
Definition: mythuifilebrowser.cpp:139
MythUIFileBrowser::Create
bool Create(void) override
Definition: mythuifilebrowser.cpp:205
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:645
MFileInfo::m_fileName
QString m_fileName
Definition: mythuifilebrowser.h:68
MythUIFileBrowser::m_filenameText
MythUIText * m_filenameText
Definition: mythuifilebrowser.h:137
mythuibuttonlist.h
mythuiimage.h
MFileInfo::fileName
QString fileName(void) const
Definition: mythuifilebrowser.cpp:90
mythuiutils.h
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
MFileInfo::m_isFile
bool m_isFile
Definition: mythuifilebrowser.h:62
MythUIFileBrowser::cancelPressed
void cancelPressed(void)
Definition: mythuifilebrowser.cpp:429
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:215
MythUIFileBrowser::editLostFocus
void editLostFocus(void)
Definition: mythuifilebrowser.cpp:357
MythUIFileBrowser::m_backButton
MythUIButton * m_backButton
Definition: mythuifilebrowser.h:133
mythfontproperties.h
MFileInfo::m_hostName
QString m_hostName
Definition: mythuifilebrowser.h:65
mythlogging.h
MythUIFileBrowser::PathClicked
void PathClicked(MythUIButtonListItem *item)
Definition: mythuifilebrowser.cpp:301
MythCoreContext::GenMythURL
static QString GenMythURL(const QString &host=QString(), int port=0, QString path=QString(), const QString &storageGroup=QString())
Definition: mythcorecontext.cpp:784
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
MFileInfo::isExecutable
bool isExecutable(void) const
Definition: mythuifilebrowser.cpp:125
MythUIFileBrowser::OKPressed
void OKPressed(void)
Definition: mythuifilebrowser.cpp:411
MFileInfo::setSize
void setSize(qint64 size)
Definition: mythuifilebrowser.h:47
MythUIFileBrowser::m_previewTimer
QTimer * m_previewTimer
Definition: mythuifilebrowser.h:116
MFileInfo::setSGDir
void setSGDir(QString sgDir)
Definition: mythuifilebrowser.h:51
MFileInfo::m_storageGroupDir
QString m_storageGroupDir
Definition: mythuifilebrowser.h:67
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:205
formats
const std::array< const std::string, 8 > formats
Definition: vbilut.cpp:189
MythUIFileBrowser::m_infoText
MythUIText * m_infoText
Definition: mythuifilebrowser.h:136
MythUIFileBrowser::m_fileList
MythUIButtonList * m_fileList
Definition: mythuifilebrowser.h:129
XMLParseBase::CopyWindowFromBase
static bool CopyWindowFromBase(const QString &windowname, MythScreenType *win)
Definition: xmlparsebase.cpp:916
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
MythUIFileBrowser::m_retObject
QObject * m_retObject
Definition: mythuifilebrowser.h:140
MythUIFileBrowser::LoadPreview
void LoadPreview(void)
Definition: mythuifilebrowser.cpp:255
MythUIFileBrowser::updateRemoteFileList
void updateRemoteFileList(void)
Definition: mythuifilebrowser.cpp:444
MythUIType::SetEnabled
void SetEnabled(bool enable)
Definition: mythuitype.cpp:1109
mythuifilebrowser.h
MythUIFileBrowser::m_parentSGDir
QString m_parentSGDir
Definition: mythuifilebrowser.h:122
MFileInfo::filePath
QString filePath(void) const
Definition: mythuifilebrowser.cpp:97
MythUIFileBrowser::m_id
QString m_id
Definition: mythuifilebrowser.h:141
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3587
MythUIFileBrowser::homePressed
void homePressed(void)
Definition: mythuifilebrowser.cpp:396
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MFileInfo::isFile
bool isFile(void) const
Definition: mythuifilebrowser.cpp:111
MythUIFileBrowser::m_parentDir
QString m_parentDir
Definition: mythuifilebrowser.h:121
MythUIFileBrowser::m_isRemote
bool m_isRemote
Definition: mythuifilebrowser.h:114
MythUIFileBrowser::m_subDirectory
QString m_subDirectory
Definition: mythuifilebrowser.h:119
MythUIFileBrowser::updateLocalFileList
void updateLocalFileList(void)
Definition: mythuifilebrowser.cpp:601
MythUIFileBrowser::IsImage
static bool IsImage(QString extension)
Definition: mythuifilebrowser.cpp:345
MFileInfo::storageGroupDir
QString storageGroupDir(void) const
Definition: mythuifilebrowser.h:55
MythUIFileBrowser::m_baseDirectory
QString m_baseDirectory
Definition: mythuifilebrowser.h:118
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
mythcorecontext.h
MFileInfo::m_isParentDir
bool m_isParentDir
Definition: mythuifilebrowser.h:63
MFileInfo::isParentDir
bool isParentDir(void) const
Definition: mythuifilebrowser.cpp:118
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
MythUIFileBrowser::m_storageGroupDir
QString m_storageGroupDir
Definition: mythuifilebrowser.h:120
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:114
mythuibutton.h
MythUIFileBrowser::GetRemoteFileList
static bool GetRemoteFileList(const QString &url, const QString &sgDir, QStringList &list)
Definition: mythuifilebrowser.cpp:697
MFileInfo::isDir
bool isDir(void) const
Definition: mythuifilebrowser.cpp:104
MythUIFileBrowser::SetPath
void SetPath(const QString &startPath)
Definition: mythuifilebrowser.cpp:169
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:676
MythUIType::LosingFocus
void LosingFocus()
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
MFileInfo::m_isRemote
bool m_isRemote
Definition: mythuifilebrowser.h:60
mythmainwindow.h
MythUIFileBrowser::m_typeFilter
QDir::Filters m_typeFilter
Definition: mythuifilebrowser.h:124
MFileInfo
Definition: mythuifilebrowser.h:23
MFileInfo::MFileInfo
MFileInfo(const QString &fileName="", QString sgDir="", bool isDir=false, qint64 size=0)
Definition: mythuifilebrowser.cpp:31