MythTV master
backendselect.h
Go to the documentation of this file.
1#ifndef BACKENDSELECT_H
2#define BACKENDSELECT_H
3
4#include <QChar> // Fix Qt6 GCC SFINAE warning
5#include <QMutex>
6#include <QString>
7
8// MythTV
11
12class QEventLoop;
14class MythUIButton;
15
16class DatabaseParams;
17
18using ItemMap = QMap <QString, DeviceLocation*>;
19
28{
29 Q_OBJECT
30
31 public:
32 enum Decision : std::int8_t
33 {
37 };
38 static Decision Prompt(DatabaseParams *dbParams, const QString& config_filename);
39
41 QString config_filename, bool exitOnFinish = false);
42 ~BackendSelection() override;
43
44 bool Create(void) override; // MythScreenType
45 void Close(void) override; // MythScreenType
46
47 protected:
48 void customEvent(QEvent *event) override; // QObject
49 void Load(void) override; // MythScreenType
50 void Init(void) override; // MythScreenType
51
52 protected slots:
53 void Accept(void);
54 void Accept(MythUIButtonListItem *item);
55 void Manual(void);
56 void Cancel(void);
57
58 private:
60 void AddItem(DeviceLocation *dev);
61 void RemoveItem(const QString& USN);
62 bool TryDBfromURL(const QString &error, const QString& URL);
63 void PromptForPassword(void);
65
70
75
76 QString m_pinCode;
77 QString m_usn;
78
79 QMutex m_mutex;
80
82 QEventLoop *m_loop {nullptr};
83};
84
86
87#endif // BACKENDSELECT_H
QMap< QString, DeviceLocation * > ItemMap
Definition: backendselect.h:18
Classes to Prompt user for a master backend.
Definition: backendselect.h:28
void CloseWithDecision(Decision d)
QString m_configFilename
Definition: backendselect.h:67
MythUIButton * m_cancelButton
Definition: backendselect.h:74
void PromptForPassword(void)
void RemoveItem(const QString &USN)
void Manual(void)
Linked to 'Configure Manually' button.
MythUIButton * m_manualButton
Definition: backendselect.h:72
MythUIButton * m_saveButton
Definition: backendselect.h:73
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:71
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:82
Decision m_backendDecision
Definition: backendselect.h:81
bool ConnectBackend(DeviceLocation *dev)
Attempt UPnP connection to a backend device, get its DB details.
DatabaseParams * m_dbParams
Definition: backendselect.h:66
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