MythTV  master
importnative.h
Go to the documentation of this file.
1 #ifndef IMPORTNATIVE_H_
2 #define IMPORTNATIVE_H_
3 
4 #include <cstdint>
5 #include <iostream>
6 #include <utility>
7 
8 // qt
9 #include <QDateTime>
10 #include <QKeyEvent>
11 #include <QList>
12 #include <QString>
13 #include <QStringList>
14 
15 // myth
16 #include <mythscreentype.h>
17 
18 // mytharchive
19 #include "fileselector.h"
20 
21 struct FileInfo
22 {
23  bool directory;
24  bool selected;
25  QString filename;
26  int64_t size;
27 };
28 
30 {
31  QString title;
32  QString subtitle;
33  QDateTime startTime;
34  QString description;
35  QString chanID;
36  QString chanNo;
37  QString chanName;
38  QString callsign;
39 };
40 
41 
42 class MythUIText;
43 class MythUIButton;
44 class MythUIButtonList;
46 
48 {
49  Q_OBJECT
50 
51  public:
52  explicit ArchiveFileSelector(MythScreenStack *parent);
53  ~ArchiveFileSelector(void) override;
54 
55  bool Create(void) override; // FileSelector
56 
57  private slots:
58  void nextPressed(void);
59  void prevPressed(void);
60  void cancelPressed(void);
62 
63  private:
65  QString m_xmlFile;
66 
69  MythUIText *m_progTitle {nullptr};
72 };
73 
75 {
76  Q_OBJECT
77 
78  public:
79  ImportNative(MythScreenStack *parent, MythScreenType *previousScreen,
80  QString xmlFile, FileDetails details)
81  : MythScreenType(parent, "ImportNative"),
82  m_xmlFile(std::move(xmlFile)),
83  m_details(std::move(details)),
84  m_previousScreen(previousScreen) {}
85  ~ImportNative() override = default;
86 
87  bool Create(void) override; // MythScreenType
88  bool keyPressEvent(QKeyEvent *e) override; // MythScreenType
89 
90  private slots:
91  void finishedPressed();
92  void prevPressed();
93  void cancelPressed();
94  void searchChanID(void);
95  void searchChanNo(void);
96  void searchName(void);
97  void searchCallsign(void);
98  void gotChanID(const QString& value);
99  void gotChanNo(const QString& value);
100  void gotName(const QString& value);
101  void gotCallsign(const QString& value);
102 
103  private:
104  void findChannelMatch(const QString &chanid, const QString &chanNo,
105  const QString &name, const QString &callsign);
106  void fillSearchList(const QString &field);
107  void showList(const QString &caption, QString &value, const char *slot);
108 
109  QString m_xmlFile;
112 
113  QStringList m_searchList;
114 
118 
123 
128 
133 
137 
138  bool m_isValidXMLSelected {false};
139 };
140 
141 #endif
MythUIText * m_progStartTime
Definition: importnative.h:71
ArchiveFileSelector(MythScreenStack *parent)
void finishedPressed()
unsigned int slots[4]
Definition: element.c:38
MythUIButton * m_cancelButton
Definition: importnative.h:136
void showList(const QString &caption, QString &value, const char *slot)
bool directory
Definition: importnative.h:23
bool Create(void) override
QString m_xmlFile
Definition: importnative.h:109
FileDetails m_details
Definition: importnative.h:64
QDateTime startTime
Definition: importnative.h:33
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
FileDetails m_details
Definition: importnative.h:110
MythUIButton * m_nextButton
Definition: importnative.h:67
int64_t size
Definition: importnative.h:26
MythUIText * m_chanNoText
Definition: importnative.h:120
void cancelPressed(void)
MythScreenType * m_previousScreen
Definition: importnative.h:111
void gotCallsign(const QString &value)
MythUIText * m_progTitle
Definition: importnative.h:69
MythUIText * m_chanIDText
Definition: importnative.h:119
MythUIButton * m_prevButton
Definition: importnative.h:68
QString description
Definition: importnative.h:34
bool Create(void) override
QString filename
Definition: importnative.h:25
void searchCallsign(void)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
MythUIText * m_localCallsignText
Definition: importnative.h:127
void findChannelMatch(const QString &chanid, const QString &chanNo, const QString &name, const QString &callsign)
void gotChanNo(const QString &value)
bool selected
Definition: importnative.h:24
void gotChanID(const QString &value)
MythUIText * m_callsignText
Definition: importnative.h:122
MythUIText * m_progDateTimeText
Definition: importnative.h:116
MythUIText * m_progTitleText
Definition: importnative.h:115
void searchChanNo(void)
void gotName(const QString &value)
void cancelPressed()
MythUIText * m_progDescriptionText
Definition: importnative.h:117
void fillSearchList(const QString &field)
MythUIButton * m_searchChanNoButton
Definition: importnative.h:130
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
MythUIButton * m_finishButton
Definition: importnative.h:134
void searchChanID(void)
QString title
Definition: importnative.h:31
MythUIText * m_progSubtitle
Definition: importnative.h:70
A single button widget.
Definition: mythuibutton.h:21
MythUIButton * m_prevButton
Definition: importnative.h:135
MythUIButton * m_searchChanNameButton
Definition: importnative.h:131
~ImportNative() override=default
MythUIText * m_localChanIDText
Definition: importnative.h:124
QString callsign
Definition: importnative.h:38
bool m_isValidXMLSelected
Definition: importnative.h:138
QString subtitle
Definition: importnative.h:32
QString chanName
Definition: importnative.h:37
void searchName(void)
QString chanID
Definition: importnative.h:35
Screen in which all other widgets are contained and rendered.
MythUIButton * m_searchChanIDButton
Definition: importnative.h:129
MythUIText * m_localChanNoText
Definition: importnative.h:125
void prevPressed()
MythUIText * m_localChanNameText
Definition: importnative.h:126
MythUIButton * m_searchCallsignButton
Definition: importnative.h:132
ImportNative(MythScreenStack *parent, MythScreenType *previousScreen, QString xmlFile, FileDetails details)
Definition: importnative.h:79
void itemSelected(MythUIButtonListItem *item)
QString chanNo
Definition: importnative.h:36
~ArchiveFileSelector(void) override
QStringList m_searchList
Definition: importnative.h:113
MythUIText * m_chanNameText
Definition: importnative.h:121