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