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);
160  connect(m_previewTimer, SIGNAL(timeout()), SLOT(LoadPreview()));
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 
222  connect(m_fileList, SIGNAL(itemClicked(MythUIButtonListItem *)),
224  connect(m_fileList, SIGNAL(itemSelected(MythUIButtonListItem *)),
226  connect(m_locationEdit, SIGNAL(LosingFocus()), SLOT(editLostFocus()));
227  connect(m_okButton, SIGNAL(Clicked()), SLOT(OKPressed()));
228  connect(m_cancelButton, SIGNAL(Clicked()), SLOT(cancelPressed()));
229 
230  if (m_backButton)
231  connect(m_backButton, SIGNAL(Clicked()), SLOT(backPressed()));
232 
233  if (m_homeButton)
234  connect(m_homeButton, SIGNAL(Clicked()), SLOT(homePressed()));
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  QStringList::const_iterator it = slist.begin();
523 
524  while (it != slist.end())
525  {
526  QStringList tokens = (*it).split("::");
527 
528  if (tokens.size() < 2)
529  {
530  LOG(VB_GENERAL, LOG_ERR, QString("failed to parse '%1'.").arg(*it));
531  ++it;
532  continue;
533  }
534 
535  displayName = tokens[1];
536 
537  if (tokens[0] == "sgdir")
538  dataName = m_baseDirectory;
539  else if (m_subDirectory.isEmpty())
540  {
541  dataName = QString("%1%2").arg(m_baseDirectory)
542  .arg(displayName);
543  }
544  else
545  {
546  dataName = QString("%1%2/%3").arg(m_baseDirectory)
547  .arg(m_subDirectory).arg(displayName);
548  }
549 
550  MFileInfo finfo(dataName, m_storageGroupDir);
551 
552  if ((tokens[0] == "dir") &&
553  ((m_typeFilter & (QDir::Dirs | QDir::AllDirs)) != 0))
554  {
555  type = "folder";
556  finfo.setIsDir(true);
558  finfo.setSize(0);
559  }
560  else if ((tokens[0] == "sgdir") &&
561  ((m_typeFilter & (QDir::Dirs | QDir::AllDirs)) != 0))
562  {
563  type = "folder";
564  finfo.setIsDir(true);
565  finfo.setSGDir(displayName);
566  finfo.setSize(0);
567  }
568  else if ((tokens[0] == "file") &&
569  ((m_typeFilter & QDir::Files) != 0))
570  {
571  finfo.setIsDir(false);
572  finfo.setSize(tokens[2].toInt());
573 
574  if (IsImage(finfo.suffix()))
575  type = "image";
576  else
577  type = "file";
578  }
579  else
580  {
581  // unknown type or filtered out
582  ++it;
583  continue;
584  }
585 
586  auto *item = new MythUIButtonListItem(m_fileList, displayName,
587  QVariant::fromValue(finfo));
588 
589  if (finfo.size())
590  item->SetText(FormatSize(finfo.size()), "filesize");
591 
592  if (type == "image")
593  item->SetImage(dataName);
594 
595  item->SetText(dataName, "fullpath");
596  item->DisplayState(type, "nodetype");
597 
598  ++it;
599  }
600 }
601 
603 {
604  QDir d;
605 
606  d.setPath(m_subDirectory);
607  d.setNameFilters(m_nameFilter);
608  d.setFilter(m_typeFilter);
609  d.setSorting(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase);
610 
611  if (!d.exists())
612  {
613  LOG(VB_GENERAL, LOG_ERR,
614  "MythUIFileBrowser: current directory does not exist!");
615  m_locationEdit->SetText("/");
616  m_subDirectory = "/";
617  d.setPath("/");
618  }
619 
620  QFileInfoList list = d.entryInfoList();
621  bool showBackButton = false;
622 
623  if (list.isEmpty())
624  {
625  auto *item = new MythUIButtonListItem(m_fileList,
626  tr("Parent Directory"));
627  item->DisplayState("upfolder", "nodetype");
628  }
629  else
630  {
631  QFileInfoList::const_iterator it = list.begin();
632 
633  while (it != list.end())
634  {
635  const QFileInfo *fi = &(*it);
636  MFileInfo finfo(fi->filePath());
637 
638  if (finfo.fileName() == ".")
639  {
640  ++it;
641  continue;
642  }
643 
644  QString displayName = finfo.fileName();
645  QString type;
646 
647  if (displayName == "..")
648  {
649  if (m_subDirectory.endsWith("/"))
650  {
651  ++it;
652  continue;
653  }
654 
655  displayName = tr("Parent");
656  type = "upfolder";
657  showBackButton = true;
658  }
659  else if (finfo.isDir())
660  {
661  type = "folder";
662  }
663  else if (finfo.isExecutable())
664  {
665  type = "executable";
666  }
667  else if (finfo.isFile())
668  {
669  type = "file";
670  }
671 
672  auto *item = new MythUIButtonListItem(m_fileList, displayName,
673  QVariant::fromValue(finfo));
674 
675  if (IsImage(finfo.suffix()))
676  {
677  item->SetImage(finfo.absoluteFilePath());
678  type = "image";
679  }
680 
681  item->SetText(FormatSize(finfo.size()), "filesize");
682  item->SetText(finfo.absoluteFilePath(), "fullpath");
683  item->DisplayState(type, "nodetype");
684 
685  ++it;
686  }
687  }
688 
689  if (m_backButton)
690  m_backButton->SetEnabled(showBackButton);
691 
693 }
694 
695 QString MythUIFileBrowser::FormatSize(int64_t size)
696 {
697  QString filesize("%L1 %2");
698 
699  if (size < 1000000)
700  filesize = filesize.arg((double)size / 1000.0, 0, 'f', 0).arg("KB");
701  else if (size < 1000000000)
702  filesize = filesize.arg((double)size / 1000000.0, 0, 'f', 1).arg("MB");
703  else
704  filesize = filesize.arg((double)size / 1000000000.0, 0, 'f', 1).arg("GB");
705 
706  return filesize;
707 }
708 
709 bool MythUIFileBrowser::GetRemoteFileList(const QString &url,
710  const QString &sgDir,
711  QStringList &list)
712 {
713  QUrl qurl(url);
714  QString storageGroup = qurl.userName();
715 
716  list.clear();
717 
718  if (storageGroup.isEmpty())
719  storageGroup = "Default";
720 
721  list << "QUERY_SG_GETFILELIST";
722  list << qurl.host();
723  list << storageGroup;
724 
725  QString path = sgDir + qurl.path();
726 
727  if (!qurl.fragment().isEmpty())
728  path += "#" + qurl.fragment();
729 
730  list << path;
731  list << "0";
732 
733  bool ok = gCoreContext->SendReceiveStringList(list);
734 
735  if ((list.size() == 1) && (list[0] == "EMPTY LIST"))
736  list.clear();
737 
738  return ok;
739 
740 }
741 
742 /* 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:149
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:97
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:83
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:1352
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:130
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:967
d
static const uint16_t * d
Definition: iso6937tables.cpp:1025
MythUIFileBrowser::backPressed
void backPressed(void)
Definition: mythuifilebrowser.cpp:360
MythUIFileBrowser::m_homeButton
MythUIButton * m_homeButton
Definition: mythuifilebrowser.h:138
MythUIFileBrowser::m_locationEdit
MythUITextEdit * m_locationEdit
Definition: mythuifilebrowser.h:134
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
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:32
MFileInfo::setIsDir
void setIsDir(bool isDir)
Definition: mythuifilebrowser.h:52
MythUIFileBrowser::FormatSize
static QString FormatSize(int64_t size)
Definition: mythuifilebrowser.cpp:695
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:44
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:644
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:27
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:763
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:917
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
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:1102
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:3588
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:57
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:602
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:28
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:41
setFile
fileInfo setFile(videoFile)
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
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:113
mythuibutton.h
MythUIFileBrowser::GetRemoteFileList
static bool GetRemoteFileList(const QString &url, const QString &sgDir, QStringList &list)
Definition: mythuifilebrowser.cpp:709
MFileInfo::isDir
bool isDir(void) const
Definition: mythuifilebrowser.cpp:98
MythUIFileBrowser::SetPath
void SetPath(const QString &startPath)
Definition: mythuifilebrowser.cpp:163
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:675
MythUIType::LosingFocus
void LosingFocus()
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:143
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:27
MFileInfo::MFileInfo
MFileInfo(const QString &fileName="", QString sgDir="", bool isDir=false, qint64 size=0)
Definition: mythuifilebrowser.cpp:25