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 
7 // qt
8 #include <QString>
9 #include <QStringList>
10 #include <QKeyEvent>
11 #include <QList>
12 #include <QDateTime>
13 
14 // myth
15 #include <mythscreentype.h>
16 
17 // mytharchive
18 #include "fileselector.h"
19 
20 typedef struct
21 {
22  bool directory;
23  bool selected;
24  QString filename;
25  int64_t size;
26 } FileInfo;
27 
28 typedef struct
29 {
30  QString title;
31  QString subtitle;
32  QDateTime startTime;
33  QString description;
34  QString chanID;
35  QString chanNo;
36  QString chanName;
37  QString callsign;
38 } FileDetails;
39 
40 
41 class MythUIText;
42 class MythUIButton;
43 class MythUIButtonList;
45 
47 {
48  Q_OBJECT
49 
50  public:
51  explicit ArchiveFileSelector(MythScreenStack *parent);
53 
54  bool Create(void) override; // FileSelector
55 
56  private slots:
57  void nextPressed(void);
58  void prevPressed(void);
59  void cancelPressed(void);
61 
62  private:
64  QString m_xmlFile;
65 
68  MythUIText *m_progTitle {nullptr};
71 };
72 
74 {
75  Q_OBJECT
76 
77  public:
78  ImportNative(MythScreenStack *parent, MythScreenType *previousScreen,
79  const QString &xmlFile, FileDetails details)
80  : MythScreenType(parent, "ImportNative"),
81  m_xmlFile(xmlFile),
82  m_details(details),
83  m_previousScreen(previousScreen) {}
84  ~ImportNative() = default;
85 
86  bool Create(void) override; // MythScreenType
87  bool keyPressEvent(QKeyEvent *e) override; // MythScreenType
88 
89  private slots:
90  void finishedPressed();
91  void prevPressed();
92  void cancelPressed();
93  void searchChanID(void);
94  void searchChanNo(void);
95  void searchName(void);
96  void searchCallsign(void);
97  void gotChanID(const QString& value);
98  void gotChanNo(const QString& value);
99  void gotName(const QString& value);
100  void gotCallsign(const QString& value);
101 
102  private:
103  void findChannelMatch(const QString &chanid, const QString &chanNo,
104  const QString &name, const QString &callsign);
105  void fillSearchList(const QString &field);
106  void showList(const QString &caption, QString &value, const char *slot);
107 
108  QString m_xmlFile;
111 
112  QStringList m_searchList;
113 
117 
122 
127 
132 
136 
137  bool m_isValidXMLSelected {false};
138 };
139 
140 #endif
MythUIText * m_progStartTime
Definition: importnative.h:70
ArchiveFileSelector(MythScreenStack *parent)
void finishedPressed()
unsigned int slots[4]
Definition: element.c:38
MythUIButton * m_cancelButton
Definition: importnative.h:135
void showList(const QString &caption, QString &value, const char *slot)
bool directory
Definition: importnative.h:22
bool Create(void) override
MythUIText * m_localChanName_text
Definition: importnative.h:125
QString m_xmlFile
Definition: importnative.h:108
FileDetails m_details
Definition: importnative.h:63
QDateTime startTime
Definition: importnative.h:32
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythUIText * m_chanName_text
Definition: importnative.h:120
MythUIText * m_progDateTime_text
Definition: importnative.h:115
FileDetails m_details
Definition: importnative.h:109
MythUIText * m_localChanID_text
Definition: importnative.h:123
MythUIButton * m_nextButton
Definition: importnative.h:66
MythUIText * m_localCallsign_text
Definition: importnative.h:126
int64_t size
Definition: importnative.h:25
MythUIButton * m_searchCallsign_button
Definition: importnative.h:131
void cancelPressed(void)
MythScreenType * m_previousScreen
Definition: importnative.h:110
void gotCallsign(const QString &value)
MythUIText * m_progTitle
Definition: importnative.h:68
MythUIButton * m_prevButton
Definition: importnative.h:67
QString description
Definition: importnative.h:33
bool Create(void) override
QString filename
Definition: importnative.h:24
void searchCallsign(void)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void findChannelMatch(const QString &chanid, const QString &chanNo, const QString &name, const QString &callsign)
MythUIText * m_callsign_text
Definition: importnative.h:121
void gotChanNo(const QString &value)
MythUIText * m_progTitle_text
Definition: importnative.h:114
MythUIText * m_chanNo_text
Definition: importnative.h:119
bool selected
Definition: importnative.h:23
MythUIButton * m_searchChanID_button
Definition: importnative.h:128
void gotChanID(const QString &value)
void searchChanNo(void)
MythUIText * m_progDescription_text
Definition: importnative.h:116
void gotName(const QString &value)
void cancelPressed()
void fillSearchList(const QString &field)
const char * name
Definition: ParseText.cpp:328
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
MythUIButton * m_finishButton
Definition: importnative.h:133
void searchChanID(void)
QString title
Definition: importnative.h:30
MythUIText * m_progSubtitle
Definition: importnative.h:69
A single button widget.
Definition: mythuibutton.h:21
MythUIButton * m_searchChanNo_button
Definition: importnative.h:129
MythUIButton * m_prevButton
Definition: importnative.h:134
ImportNative(MythScreenStack *parent, MythScreenType *previousScreen, const QString &xmlFile, FileDetails details)
Definition: importnative.h:78
QString callsign
Definition: importnative.h:37
bool m_isValidXMLSelected
Definition: importnative.h:137
QString subtitle
Definition: importnative.h:31
QString chanName
Definition: importnative.h:36
void searchName(void)
MythUIButton * m_searchChanName_button
Definition: importnative.h:130
QString chanID
Definition: importnative.h:34
Screen in which all other widgets are contained and rendered.
void prevPressed()
~ImportNative()=default
MythUIText * m_localChanNo_text
Definition: importnative.h:124
void itemSelected(MythUIButtonListItem *item)
QString chanNo
Definition: importnative.h:35
MythUIText * m_chanID_text
Definition: importnative.h:118
QStringList m_searchList
Definition: importnative.h:112