MythTV master
backendselect.h
Go to the documentation of this file.
1#ifndef BACKENDSELECT_H
2#define BACKENDSELECT_H
3
4#include <QMutex>
5#include <QString>
6
7// MythTV
10
11class QEventLoop;
13class MythUIButton;
14
15class DatabaseParams;
16
17using ItemMap = QMap <QString, DeviceLocation*>;
18
27{
28 Q_OBJECT
29
30 public:
31 enum Decision : std::int8_t
32 {
36 };
37 static Decision Prompt(DatabaseParams *dbParams, const QString& config_filename);
38
40 QString config_filename, bool exitOnFinish = false);
41 ~BackendSelection() override;
42
43 bool Create(void) override; // MythScreenType
44 void Close(void) override; // MythScreenType
45 void customEvent(QEvent *event) override; // QObject
46
47 protected slots:
48 void Accept(void);
49 void Accept(MythUIButtonListItem *item);
50 void Manual(void);
51 void Cancel(void);
52
53 private:
54 void Load(void) override; // MythScreenType
55 void Init(void) override; // MythScreenType
57 void AddItem(DeviceLocation *dev);
58 void RemoveItem(const QString& USN);
59 bool TryDBfromURL(const QString &error, const QString& URL);
60 void PromptForPassword(void);
62
67
72
73 QString m_pinCode;
74 QString m_usn;
75
76 QMutex m_mutex;
77
79 QEventLoop *m_loop {nullptr};
80};
81
83
84#endif // BACKENDSELECT_H
QMap< QString, DeviceLocation * > ItemMap
Definition: backendselect.h:17
Classes to Prompt user for a master backend.
Definition: backendselect.h:27
void CloseWithDecision(Decision d)
QString m_configFilename
Definition: backendselect.h:64
MythUIButton * m_cancelButton
Definition: backendselect.h:71
void PromptForPassword(void)
void RemoveItem(const QString &USN)
void Manual(void)
Linked to 'Configure Manually' button.
MythUIButton * m_manualButton
Definition: backendselect.h:69
MythUIButton * m_saveButton
Definition: backendselect.h:70
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
bool Create(void) override
bool TryDBfromURL(const QString &error, const QString &URL)
void AddItem(DeviceLocation *dev)
void Cancel(void)
Linked to 'Cancel' button.
MythUIButtonList * m_backendList
Definition: backendselect.h:68
void customEvent(QEvent *event) override
BackendSelection(MythScreenStack *parent, DatabaseParams *params, QString config_filename, bool exitOnFinish=false)
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
~BackendSelection() override
QEventLoop * m_loop
Definition: backendselect.h:79
Decision m_backendDecision
Definition: backendselect.h:78
bool ConnectBackend(DeviceLocation *dev)
Attempt UPnP connection to a backend device, get its DB details.
DatabaseParams * m_dbParams
Definition: backendselect.h:63
void Close(void) override
static Decision Prompt(DatabaseParams *dbParams, const QString &config_filename)
Structure containing the basic Database parameters.
Definition: mythdbparams.h:11
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
static const iso6937table * d
Q_DECLARE_METATYPE(std::chrono::seconds)
def error(message)
Definition: smolt.py:409