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
17
18// mytharchive
19#include "fileselector.h"
20
22{
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
42class MythUIText;
43class MythUIButton;
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
72};
73
75{
76 Q_OBJECT
77
78 public:
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 using INSlot = void (ImportNative::*)(const QString&);
108 void showList(const QString &caption, QString &value, INSlot slot);
109
110 QString m_xmlFile;
113
114 QStringList m_searchList;
115
119
124
129
134
138
140};
141
142#endif
MythUIText * m_progSubtitle
Definition: importnative.h:70
bool Create(void) override
void cancelPressed(void)
ArchiveFileSelector(MythScreenStack *parent)
MythUIText * m_progStartTime
Definition: importnative.h:71
void itemSelected(MythUIButtonListItem *item)
~ArchiveFileSelector(void) override
FileDetails m_details
Definition: importnative.h:64
MythUIText * m_progTitle
Definition: importnative.h:69
MythUIButton * m_nextButton
Definition: importnative.h:67
MythUIButton * m_prevButton
Definition: importnative.h:68
void fillSearchList(const QString &field)
MythUIText * m_localChanNameText
Definition: importnative.h:127
void searchChanID(void)
MythUIButton * m_finishButton
Definition: importnative.h:135
~ImportNative() override=default
void prevPressed()
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void showList(const QString &caption, QString &value, INSlot slot)
MythUIText * m_callsignText
Definition: importnative.h:123
MythUIButton * m_searchChanNoButton
Definition: importnative.h:131
void searchCallsign(void)
MythUIText * m_progDescriptionText
Definition: importnative.h:118
QString m_xmlFile
Definition: importnative.h:110
void finishedPressed()
MythScreenType * m_previousScreen
Definition: importnative.h:112
MythUIButton * m_searchChanIDButton
Definition: importnative.h:130
bool m_isValidXMLSelected
Definition: importnative.h:139
bool Create(void) override
void findChannelMatch(const QString &chanid, const QString &chanNo, const QString &name, const QString &callsign)
MythUIButton * m_cancelButton
Definition: importnative.h:137
ImportNative(MythScreenStack *parent, MythScreenType *previousScreen, QString xmlFile, FileDetails details)
Definition: importnative.h:79
MythUIText * m_localCallsignText
Definition: importnative.h:128
void gotCallsign(const QString &value)
void(ImportNative::*)(const QString &) INSlot
Definition: importnative.h:107
MythUIText * m_chanIDText
Definition: importnative.h:120
void gotChanID(const QString &value)
MythUIText * m_chanNoText
Definition: importnative.h:121
MythUIText * m_progTitleText
Definition: importnative.h:116
MythUIText * m_chanNameText
Definition: importnative.h:122
MythUIButton * m_searchCallsignButton
Definition: importnative.h:133
void searchName(void)
void gotName(const QString &value)
void cancelPressed()
MythUIText * m_localChanIDText
Definition: importnative.h:125
MythUIText * m_localChanNoText
Definition: importnative.h:126
MythUIButton * m_prevButton
Definition: importnative.h:136
QStringList m_searchList
Definition: importnative.h:114
void gotChanNo(const QString &value)
MythUIText * m_progDateTimeText
Definition: importnative.h:117
MythUIButton * m_searchChanNameButton
Definition: importnative.h:132
void searchChanNo(void)
FileDetails m_details
Definition: importnative.h:111
Screen in which all other widgets are contained and rendered.
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
STL namespace.
QString chanID
Definition: importnative.h:35
QString title
Definition: importnative.h:31
QString chanNo
Definition: importnative.h:36
QString callsign
Definition: importnative.h:38
QString chanName
Definition: importnative.h:37
QDateTime startTime
Definition: importnative.h:33
QString subtitle
Definition: importnative.h:32
QString description
Definition: importnative.h:34
int64_t size
Definition: importnative.h:26
bool directory
Definition: importnative.h:23
QString filename
Definition: importnative.h:25
bool selected
Definition: importnative.h:24