MythTV master
|
Public Slots | |
void | OnCloseDialog () const |
void | VersionMismatchPopupClosed () |
Public Member Functions | |
Impl () | |
~Impl () override | |
bool | Init (bool gui, bool promptForBackend, bool disableAutoDiscovery, bool ignoreDB) |
bool | FindDatabase (bool prompt, bool noAutodetect) |
Get database connection settings and test connectivity. More... | |
bool | FindDatabaseChoose (bool loaded, bool manualSelect, bool autoSelect) |
Helper function for getting database connection settings and test connectivity. More... | |
void | TempMainWindow () |
Setup a minimal themed main window, and prompt for user's language. More... | |
void | EndTempWindow () |
bool | PromptForDatabaseParams (const QString &error) |
QString | TestDBconnection (bool prompt=true) |
Some quick sanity checks before opening a database connection. More... | |
void | SilenceDBerrors () |
Cause MSqlDatabase::OpenDatabase() and MSqlQuery to fail silently. More... | |
void | EnableDBerrors () const |
BackendSelection::Decision | ChooseBackend (const QString &error) |
Search for backends via UPnP, put up a UI for the user to choose one. More... | |
void | ShowGuiStartup () |
bool | checkPort (QString &host, int port, std::chrono::seconds timeLimit) const |
Check if a port is open and sort out the link-local scope. More... | |
Static Public Member Functions | |
static void | LanguagePrompt () |
static bool | LoadDatabaseSettings () |
Load database and host settings from XmlConfiguration::k_default_filename, or set some defaults. More... | |
static QString | setLocalHostName (QString hostname) |
static void | ResetDatabase (const DatabaseParams &dbParams) |
Called when the user changes the DB connection settings. More... | |
static int | UPnPautoconf (std::chrono::milliseconds milliSeconds=2s) |
If there is only a single UPnP backend, use it. More... | |
static bool | DefaultUPnP (QString &Error) |
Get the default backend from XmlConfiguration::kDefaultFilename, use UPnP to find it. More... | |
static bool | UPnPconnect (const DeviceLocation *backend, const QString &PIN) |
Query a backend via UPnP for its database connection parameters. More... | |
static void | processEvents () |
Public Attributes | |
bool | m_gui {false} |
Should this context use GUI elements? More... | |
QString | m_masterhostname |
master backend hostname More... | |
QString | m_dbHostCp |
dbHostName backup More... | |
bool | m_disableeventpopup {false} |
MythUIHelper * | m_ui {nullptr} |
GUIStartup * | m_guiStartup {nullptr} |
QEventLoop * | m_loop {nullptr} |
bool | m_needsBackend {false} |
GUISettingsCache | m_GUISettingsCache |
Protected Member Functions | |
bool | event (QEvent *) override |
void | ShowConnectionFailurePopup (bool persistent) |
void | HideConnectionFailurePopup () |
void | ShowVersionMismatchPopup (uint remote_version) |
Private Attributes | |
MythConfirmationDialog * | m_mbeVersionPopup {nullptr} |
int | m_registration {-1} |
QDateTime | m_lastCheck |
Definition at line 102 of file mythcontext.cpp.
|
explicit |
Definition at line 275 of file mythcontext.cpp.
|
override |
Definition at line 281 of file mythcontext.cpp.
bool MythContext::Impl::checkPort | ( | QString & | host, |
int | port, | ||
std::chrono::seconds | timeLimit | ||
) | const |
Check if a port is open and sort out the link-local scope.
host | Host or IP address. Will be updated with link-local scope if needed. |
port | Port number to check. |
timeLimit | Limit in seconds for testing. |
Definition at line 353 of file mythcontext.cpp.
BackendSelection::Decision MythContext::Impl::ChooseBackend | ( | const QString & | error | ) |
Search for backends via UPnP, put up a UI for the user to choose one.
Definition at line 1134 of file mythcontext.cpp.
|
static |
Get the default backend from XmlConfiguration::kDefaultFilename, use UPnP to find it.
Sets a string if there any connection problems
Definition at line 1235 of file mythcontext.cpp.
void MythContext::Impl::EnableDBerrors | ( | ) | const |
Definition at line 1098 of file mythcontext.cpp.
void MythContext::Impl::EndTempWindow | ( | ) |
Definition at line 320 of file mythcontext.cpp.
|
overrideprotected |
Definition at line 1361 of file mythcontext.cpp.
Get database connection settings and test connectivity.
Can use UPnP AutoDiscovery to locate backends, and get their DB settings. The user can force the AutoDiscovery chooser with the –prompt argument, and disable it by using the –disable-autodiscovery argument. There is also an autoconfigure function, which counts the backends, and if there is exactly one, uses it as above.
Despite its name, the disable argument currently only disables the chooser. If set, autoconfigure will still be attempted in some situations.
Definition at line 544 of file mythcontext.cpp.
Helper function for getting database connection settings and test connectivity.
Return true if a database connection was found, false otherwise
Definition at line 431 of file mythcontext.cpp.
|
protected |
Definition at line 1425 of file mythcontext.cpp.
bool MythContext::Impl::Init | ( | bool | gui, |
bool | promptForBackend, | ||
bool | disableAutoDiscovery, | ||
bool | ignoreDB | ||
) |
Definition at line 362 of file mythcontext.cpp.
Referenced by MythContext::Init().
|
static |
Definition at line 337 of file mythcontext.cpp.
|
static |
Load database and host settings from XmlConfiguration::k_default_filename, or set some defaults.
Definition at line 580 of file mythcontext.cpp.
|
slot |
Definition at line 677 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams().
|
static |
Definition at line 1468 of file mythcontext.cpp.
bool MythContext::Impl::PromptForDatabaseParams | ( | const QString & | error | ) |
Definition at line 690 of file mythcontext.cpp.
|
static |
Called when the user changes the DB connection settings.
The current DB connections may be invalid (e.g. wrong password), or the user may have changed to a different database host. Either way, any current connections need to be closed so that the new connection can be attempted.
Any cached settings also need to be cleared, so that they can be re-read from the new database
Definition at line 1123 of file mythcontext.cpp.
|
static |
Definition at line 612 of file mythcontext.cpp.
|
protected |
Definition at line 1391 of file mythcontext.cpp.
void MythContext::Impl::ShowGuiStartup | ( | ) |
Definition at line 1047 of file mythcontext.cpp.
|
protected |
Definition at line 1441 of file mythcontext.cpp.
void MythContext::Impl::SilenceDBerrors | ( | ) |
Cause MSqlDatabase::OpenDatabase() and MSqlQuery to fail silently.
This is used when the DB host address is bad, is non-routable, the passwords are bad, or the DB has some other problem.
It prevents hundreds of long TCP/IP timeouts or DB connect errors.
Definition at line 1081 of file mythcontext.cpp.
void MythContext::Impl::TempMainWindow | ( | ) |
Setup a minimal themed main window, and prompt for user's language.
Used for warnings before the database is opened, or bootstrapping pages. After using the window, call EndTempWindow().
Definition at line 304 of file mythcontext.cpp.
Referenced by MythContext::Init().
Some quick sanity checks before opening a database connection.
Definition at line 786 of file mythcontext.cpp.
|
static |
If there is only a single UPnP backend, use it.
This does not prompt for PIN entry. If the backend requires one, it will fail, and the caller needs to put up a UI to ask for one.
Definition at line 1164 of file mythcontext.cpp.
|
static |
Query a backend via UPnP for its database connection parameters.
Definition at line 1316 of file mythcontext.cpp.
|
slot |
Definition at line 1551 of file mythcontext.cpp.
Referenced by ShowVersionMismatchPopup().
QString MythContext::Impl::m_dbHostCp |
dbHostName backup
Definition at line 158 of file mythcontext.cpp.
Definition at line 160 of file mythcontext.cpp.
Referenced by MythContext::SetDisableEventPopup().
Should this context use GUI elements?
Definition at line 154 of file mythcontext.cpp.
Referenced by MythContext::Init(), MythContext::saveSettingsCache(), and MythContext::~MythContext().
GUISettingsCache MythContext::Impl::m_GUISettingsCache |
Definition at line 167 of file mythcontext.cpp.
Referenced by MythContext::saveSettingsCache().
GUIStartup* MythContext::Impl::m_guiStartup {nullptr} |
Definition at line 163 of file mythcontext.cpp.
|
private |
Definition at line 172 of file mythcontext.cpp.
QEventLoop* MythContext::Impl::m_loop {nullptr} |
Definition at line 164 of file mythcontext.cpp.
QString MythContext::Impl::m_masterhostname |
master backend hostname
Definition at line 156 of file mythcontext.cpp.
|
private |
Definition at line 170 of file mythcontext.cpp.
Definition at line 165 of file mythcontext.cpp.
Referenced by MythContext::MythContext().
|
private |
Definition at line 171 of file mythcontext.cpp.
MythUIHelper* MythContext::Impl::m_ui {nullptr} |
Definition at line 162 of file mythcontext.cpp.