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 <
libmythui/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
: std::uint8_t
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
archiveutil.h
FileSelector
Definition:
fileselector.h:40
FileSelector::m_filemask
QString m_filemask
Definition:
fileselector.h:78
FileSelector::m_okButton
MythUIButton * m_okButton
Definition:
fileselector.h:89
FileSelector::updateScrollArrows
void updateScrollArrows(void)
FileSelector::getSelected
QString getSelected(void)
Definition:
fileselector.cpp:176
FileSelector::updateSelectedList
void updateSelectedList(void)
Definition:
fileselector.cpp:325
FileSelector::m_fileButtonList
MythUIButtonList * m_fileButtonList
Definition:
fileselector.h:87
FileSelector::cancelPressed
void cancelPressed(void)
Definition:
fileselector.cpp:316
FileSelector::m_curDirectory
QString m_curDirectory
Definition:
fileselector.h:79
FileSelector::m_titleText
MythUIText * m_titleText
Definition:
fileselector.h:86
FileSelector::haveResult
void haveResult(QString filename)
FileSelector::backPressed
void backPressed(void)
Definition:
fileselector.cpp:187
FileSelector::homePressed
void homePressed(void)
Definition:
fileselector.cpp:199
FileSelector::m_selectedList
QStringList m_selectedList
Definition:
fileselector.h:81
FileSelector::haveResult
void haveResult(bool ok)
FileSelector::m_homeButton
MythUIButton * m_homeButton
Definition:
fileselector.h:92
FileSelector::OKPressed
void OKPressed(void)
Definition:
fileselector.cpp:206
FileSelector::wireUpTheme
void wireUpTheme(void)
FileSelector::m_selectorType
FSTYPE m_selectorType
Definition:
fileselector.h:77
FileSelector::m_locationEdit
MythUITextEdit * m_locationEdit
Definition:
fileselector.h:88
FileSelector::updateFileList
void updateFileList(void)
Definition:
fileselector.cpp:347
FileSelector::FileSelector
FileSelector(MythScreenStack *parent, QList< ArchiveItem * > *archiveList, FSTYPE type, QString startDir, QString filemask)
Definition:
fileselector.h:44
FileSelector::Create
bool Create(void) override
Definition:
fileselector.cpp:34
FileSelector::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition:
fileselector.cpp:95
FileSelector::locationEditLostFocus
void locationEditLostFocus(void)
Definition:
fileselector.cpp:181
FileSelector::itemClicked
void itemClicked(MythUIButtonListItem *item)
Definition:
fileselector.cpp:124
FileSelector::m_archiveList
QList< ArchiveItem * > * m_archiveList
Definition:
fileselector.h:82
FileSelector::updateWidgets
void updateWidgets(void)
FileSelector::m_fileData
QList< FileData * > m_fileData
Definition:
fileselector.h:80
FileSelector::~FileSelector
~FileSelector() override
Definition:
fileselector.cpp:28
FileSelector::m_backButton
MythUIButton * m_backButton
Definition:
fileselector.h:91
FileSelector::m_cancelButton
MythUIButton * m_cancelButton
Definition:
fileselector.h:90
MythScreenStack
Definition:
mythscreenstack.h:17
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition:
mythscreentype.h:46
MythUIButtonListItem
Definition:
mythuibuttonlist.h:43
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition:
mythuibuttonlist.h:193
MythUIButton
A single button widget.
Definition:
mythuibutton.h:22
MythUITextEdit
A text entry and edit widget.
Definition:
mythuitextedit.h:35
MythUIText
All purpose text widget, displays a text string.
Definition:
mythuitext.h:29
FSTYPE
FSTYPE
Definition:
fileselector.h:27
FSTYPE_FILELIST
@ FSTYPE_FILELIST
Definition:
fileselector.h:28
FSTYPE_DIRECTORY
@ FSTYPE_DIRECTORY
Definition:
fileselector.h:30
FSTYPE_FILE
@ FSTYPE_FILE
Definition:
fileselector.h:29
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(std::chrono::seconds)
mythscreentype.h
build_compdb.filename
filename
Definition:
build_compdb.py:21
hardwareprofile.getLink.type
type
Definition:
getLink.py:56
std
STL namespace.
FileData
Definition:
fileselector.h:19
FileData::filename
QString filename
Definition:
fileselector.h:22
FileData::directory
bool directory
Definition:
fileselector.h:20
FileData::selected
bool selected
Definition:
fileselector.h:21
FileData::size
int64_t size
Definition:
fileselector.h:23
Generated on Wed Oct 29 2025 03:15:59 for MythTV by
1.9.4