MythTV
master
mythplugins
mytharchive
mytharchive
fileselector.h
Go to the documentation of this file.
1
#ifndef FILESELECTOR_H_
2
#define FILESELECTOR_H_
3
4
#include <iostream>
5
#include <utility>
6
7
// qt
8
#include <QKeyEvent>
9
#include <QString>
10
#include <QStringList>
11
12
// myth
13
#include <
mythscreentype.h
>
14
15
// mytharchive
16
#include "
archiveutil.h
"
17
18
struct
FileData
19
{
20
bool
directory
{
false
};
21
bool
selected
{
false
};
22
QString
filename
;
23
int64_t
size
{ 0 };
24
};
25
26
enum
FSTYPE
27
{
28
FSTYPE_FILELIST
= 0,
29
FSTYPE_FILE
= 1,
30
FSTYPE_DIRECTORY
= 2
31
};
32
33
class
MythUIText
;
34
class
MythUITextEdit
;
35
class
MythUIButton
;
36
class
MythUIButtonList
;
37
class
MythUIButtonListItem
;
38
39
class
FileSelector
:
public
MythScreenType
40
{
41
Q_OBJECT
42
43
public
:
44
FileSelector
(
MythScreenStack
*parent, QList<ArchiveItem *> *archiveList,
45
FSTYPE
type
, QString startDir, QString filemask)
46
:
MythScreenType
(parent,
"FileSelector"
),
47
m_selectorType
(
type
),
48
m_filemask
(std::move(filemask)),
49
m_curDirectory
(std::move(startDir)),
50
m_archiveList
(archiveList) {}
51
~FileSelector
()
override
;
52
53
bool
Create
(
void
)
override
;
// MythScreenType
54
bool
keyPressEvent
(QKeyEvent *
e
)
override
;
// MythScreenType
55
56
QString
getSelected
(
void
);
57
58
signals:
59
void
haveResult
(
bool
ok);
// used in FSTYPE_FILELIST mode
60
void
haveResult
(QString
filename
);
// used in FSTYPE_FILE or FSTYPE_DIRECTORY mode
61
62
protected
slots:
63
void
OKPressed
(
void
);
64
void
cancelPressed
(
void
);
65
void
backPressed
(
void
);
66
void
homePressed
(
void
);
67
void
itemClicked
(
MythUIButtonListItem
*item);
68
void
locationEditLostFocus
(
void
);
69
70
protected
:
71
void
updateFileList
(
void
);
72
void
updateSelectedList
(
void
);
73
void
updateWidgets
(
void
);
74
void
wireUpTheme
(
void
);
75
void
updateScrollArrows
(
void
);
76
77
FSTYPE
m_selectorType
;
78
QString
m_filemask
;
79
QString
m_curDirectory
;
80
QList<FileData *>
m_fileData
;
81
QStringList
m_selectedList
;
82
QList<ArchiveItem *> *
m_archiveList
;
83
//
84
// GUI stuff
85
//
86
MythUIText
*
m_titleText
{
nullptr
};
87
MythUIButtonList
*
m_fileButtonList
{
nullptr
};
88
MythUITextEdit
*
m_locationEdit
{
nullptr
};
89
MythUIButton
*
m_okButton
{
nullptr
};
90
MythUIButton
*
m_cancelButton
{
nullptr
};
91
MythUIButton
*
m_backButton
{
nullptr
};
92
MythUIButton
*
m_homeButton
{
nullptr
};
93
};
94
95
Q_DECLARE_METATYPE
(
FileData
*)
96
97
#endif
FSTYPE_FILE
@ FSTYPE_FILE
Definition:
fileselector.h:29
FileData::selected
bool selected
Definition:
fileselector.h:21
e
QDomElement e
Definition:
mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
FileSelector::backPressed
void backPressed(void)
Definition:
fileselector.cpp:188
FileData
Definition:
fileselector.h:18
FileSelector::itemClicked
void itemClicked(MythUIButtonListItem *item)
Definition:
fileselector.cpp:125
FileSelector::Create
bool Create(void) override
Definition:
fileselector.cpp:37
FileSelector::updateScrollArrows
void updateScrollArrows(void)
FileSelector::updateFileList
void updateFileList(void)
Definition:
fileselector.cpp:361
FileSelector::homePressed
void homePressed(void)
Definition:
fileselector.cpp:200
MythScreenStack
Definition:
mythscreenstack.h:15
FileSelector::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition:
fileselector.cpp:98
FileSelector::m_fileData
QList< FileData * > m_fileData
Definition:
fileselector.h:80
MythUITextEdit
A text entry and edit widget.
Definition:
mythuitextedit.h:32
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition:
mythscreentype.h:44
FileSelector::m_backButton
MythUIButton * m_backButton
Definition:
fileselector.h:91
FileSelector::m_titleText
MythUIText * m_titleText
Definition:
fileselector.h:86
FileSelector::getSelected
QString getSelected(void)
Definition:
fileselector.cpp:177
FSTYPE_DIRECTORY
@ FSTYPE_DIRECTORY
Definition:
fileselector.h:30
FileSelector::cancelPressed
void cancelPressed(void)
Definition:
fileselector.cpp:330
FileData::directory
bool directory
Definition:
fileselector.h:20
MythUIButtonListItem
Definition:
mythuibuttonlist.h:27
FileSelector
Definition:
fileselector.h:39
hardwareprofile.getLink.type
type
Definition:
getLink.py:57
archiveutil.h
FileSelector::m_selectedList
QStringList m_selectedList
Definition:
fileselector.h:81
FileSelector::m_filemask
QString m_filemask
Definition:
fileselector.h:78
MythUIButton
A single button widget.
Definition:
mythuibutton.h:21
filename
QString filename
Definition:
mythplugins/mytharchive/mytharchivehelper/main.cpp:637
FileSelector::m_archiveList
QList< ArchiveItem * > * m_archiveList
Definition:
fileselector.h:82
FileSelector::locationEditLostFocus
void locationEditLostFocus(void)
Definition:
fileselector.cpp:182
FileSelector::wireUpTheme
void wireUpTheme(void)
FileSelector::m_locationEdit
MythUITextEdit * m_locationEdit
Definition:
fileselector.h:88
FileSelector::updateSelectedList
void updateSelectedList(void)
Definition:
fileselector.cpp:339
FileSelector::m_okButton
MythUIButton * m_okButton
Definition:
fileselector.h:89
FileSelector::OKPressed
void OKPressed(void)
Definition:
fileselector.cpp:207
FileSelector::~FileSelector
~FileSelector() override
Definition:
fileselector.cpp:31
FileData::filename
QString filename
Definition:
fileselector.h:22
FileSelector::m_selectorType
FSTYPE m_selectorType
Definition:
fileselector.h:77
MythUIText
All purpose text widget, displays a text string.
Definition:
mythuitext.h:30
FileSelector::haveResult
void haveResult(bool ok)
FileData::size
int64_t size
Definition:
fileselector.h:23
FileSelector::FileSelector
FileSelector(MythScreenStack *parent, QList< ArchiveItem * > *archiveList, FSTYPE type, QString startDir, QString filemask)
Definition:
fileselector.h:44
FileSelector::m_curDirectory
QString m_curDirectory
Definition:
fileselector.h:79
FSTYPE
FSTYPE
Definition:
fileselector.h:26
FSTYPE_FILELIST
@ FSTYPE_FILELIST
Definition:
fileselector.h:28
FileSelector::m_homeButton
MythUIButton * m_homeButton
Definition:
fileselector.h:92
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition:
mythuibuttonlist.h:151
FileSelector::m_fileButtonList
MythUIButtonList * m_fileButtonList
Definition:
fileselector.h:87
mythscreentype.h
FileSelector::m_cancelButton
MythUIButton * m_cancelButton
Definition:
fileselector.h:90
FileSelector::updateWidgets
void updateWidgets(void)
Generated on Tue Jan 19 2021 03:17:17 for MythTV by
1.8.17