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
46 protected:
47 void customEvent(QEvent *event) override; // QObject
48 void Load(void) override; // MythScreenType
49 void Init(void) override; // MythScreenType
50
51 protected slots:
52 void Accept(void);
53 void Accept(MythUIButtonListItem *item);
54 void Manual(void);
55 void Cancel(void);
56
57 private:
59 void AddItem(DeviceLocation *dev);
60 void RemoveItem(const QString& USN);
61 bool TryDBfromURL(const QString &error, const QString& URL);
62 void PromptForPassword(void);
64
69
74
75 QString m_pinCode;
76 QString m_usn;
77
78 QMutex m_mutex;
79
81 QEventLoop *m_loop {nullptr};
82};
83
85
86#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:66
MythUIButton * m_cancelButton
Definition: backendselect.h:73
void PromptForPassword(void)
void RemoveItem(const QString &USN)
void Manual(void)
Linked to 'Configure Manually' button.
MythUIButton * m_manualButton
Definition: backendselect.h:71
MythUIButton * m_saveButton
Definition: backendselect.h:72
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:70
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:81
Decision m_backendDecision
Definition: backendselect.h:80
bool ConnectBackend(DeviceLocation *dev)
Attempt UPnP connection to a backend device, get its DB details.
DatabaseParams * m_dbParams
Definition: backendselect.h:65
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