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 
71 };
72 
74 {
75  Q_OBJECT
76 
77  public:
79  const QString &xmlFile, FileDetails details);
80  ~ImportNative();
81 
82  bool Create(void) override; // MythScreenType
83  bool keyPressEvent(QKeyEvent *e) override; // MythScreenType
84 
85  private slots:
86  void finishedPressed();
87  void prevPressed();
88  void cancelPressed();
89  void searchChanID(void);
90  void searchChanNo(void);
91  void searchName(void);
92  void searchCallsign(void);
93  void gotChanID(QString value);
94  void gotChanNo(QString value);
95  void gotName(QString value);
96  void gotCallsign(QString value);
97 
98  private:
99  void findChannelMatch(const QString &chanid, const QString &chanNo,
100  const QString &name, const QString &callsign);
101  void fillSearchList(const QString &field);
102  void showList(const QString &caption, QString &value, const char *slot);
103 
104  QString m_xmlFile;
107 
108  QStringList m_searchList;
109 
113 
118 
123 
128 
132 
134 };
135 
136 #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:131
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:121
QString m_xmlFile
Definition: importnative.h:104
void gotCallsign(QString value)
FileDetails m_details
Definition: importnative.h:63
void gotChanNo(QString value)
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:116
MythUIText * m_progDateTime_text
Definition: importnative.h:111
FileDetails m_details
Definition: importnative.h:105
MythUIText * m_localChanID_text
Definition: importnative.h:119
MythUIButton * m_nextButton
Definition: importnative.h:66
MythUIText * m_localCallsign_text
Definition: importnative.h:122
int64_t size
Definition: importnative.h:25
MythUIButton * m_searchCallsign_button
Definition: importnative.h:127
void cancelPressed(void)
MythScreenType * m_previousScreen
Definition: importnative.h:106
MythUIText * m_progTitle
Definition: importnative.h:68
ImportNative(MythScreenStack *parent, MythScreenType *m_previousScreen, const QString &xmlFile, FileDetails details)
MythUIButton * m_prevButton
Definition: importnative.h:67
QString description
Definition: importnative.h:33
void gotName(QString value)
bool Create(void) override
QString filename
Definition: importnative.h:24
void gotChanID(QString value)
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:117
MythUIText * m_progTitle_text
Definition: importnative.h:110
MythUIText * m_chanNo_text
Definition: importnative.h:115
bool selected
Definition: importnative.h:23
MythUIButton * m_searchChanID_button
Definition: importnative.h:124
void searchChanNo(void)
MythUIText * m_progDescription_text
Definition: importnative.h:112
void cancelPressed()
void fillSearchList(const QString &field)
const char * name
Definition: ParseText.cpp:339
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
MythUIButton * m_finishButton
Definition: importnative.h:129
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:125
MythUIButton * m_prevButton
Definition: importnative.h:130
QString callsign
Definition: importnative.h:37
bool m_isValidXMLSelected
Definition: importnative.h:133
QString subtitle
Definition: importnative.h:31
QString chanName
Definition: importnative.h:36
void searchName(void)
MythUIButton * m_searchChanName_button
Definition: importnative.h:126
QString chanID
Definition: importnative.h:34
Screen in which all other widgets are contained and rendered.
void prevPressed()
MythUIText * m_localChanNo_text
Definition: importnative.h:120
void itemSelected(MythUIButtonListItem *item)
QString chanNo
Definition: importnative.h:35
MythUIText * m_chanID_text
Definition: importnative.h:114
QStringList m_searchList
Definition: importnative.h:108