MythTV
master
|
Public Slots | |
void | OnCloseDialog () |
Public Member Functions | |
MythContextPrivate (MythContext *lparent) | |
~MythContextPrivate () 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... | |
void | TempMainWindow (bool languagePrompt=true) |
Setup a minimal themed main window, and prompt for user's language. More... | |
void | EndTempWindow (void) |
bool | LoadDatabaseSettings (void) |
Load database and host settings from XmlConfiguration::k_default_filename, or set some defaults. More... | |
bool | SaveDatabaseParams (const DatabaseParams ¶ms, bool force) |
bool | PromptForDatabaseParams (const QString &error) |
QString | TestDBconnection (bool prompt=true) |
Some quick sanity checks before opening a database connection. More... | |
void | SilenceDBerrors (void) |
Cause MSqlDatabase::OpenDatabase() and MSqlQuery to fail silently. More... | |
void | EnableDBerrors (void) |
void | ResetDatabase (void) const |
Called when the user changes the DB connection settings. More... | |
BackendSelection::Decision | ChooseBackend (const QString &error) |
Search for backends via UPnP, put up a UI for the user to choose one. More... | |
int | UPnPautoconf (std::chrono::milliseconds milliSeconds=2s) |
If there is only a single UPnP backend, use it. More... | |
bool | DefaultUPnP (QString &Error) |
Get the default backend from XmlConfiguration::kDefaultFilename, use UPnP to find it. More... | |
bool | UPnPconnect (const DeviceLocation *backend, const QString &PIN) |
Query a backend via UPnP for its database connection parameters. More... | |
void | ShowGuiStartup (void) |
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 | processEvents (void) |
Public Attributes | |
MythContext * | m_parent {nullptr} |
bool | m_gui {false} |
Should this context use GUI elements? More... | |
QString | m_masterhostname |
master backend hostname More... | |
DatabaseParams | m_dbParams |
Current database host & WOL details. More... | |
QString | m_dbHostCp |
dbHostName backup More... | |
bool | m_disableeventpopup {false} |
MythUIHelper * | m_ui {nullptr} |
MythContextSlotHandler * | m_sh {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) |
void | ShowVersionMismatchPopup (uint remote_version) |
Private Attributes | |
MythConfirmationDialog * | m_mbeVersionPopup {nullptr} |
int | m_registration {-1} |
QDateTime | m_lastCheck |
QTcpSocket * | m_socket {nullptr} |
Friends | |
class | MythContextSlotHandler |
Definition at line 97 of file mythcontext.cpp.
|
explicit |
Definition at line 271 of file mythcontext.cpp.
|
override |
Definition at line 279 of file mythcontext.cpp.
bool MythContextPrivate::Init | ( | bool | gui, |
bool | promptForBackend, | ||
bool | disableAutoDiscovery, | ||
bool | ignoreDB | ||
) |
Definition at line 362 of file mythcontext.cpp.
Referenced by MythContext::Init().
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 439 of file mythcontext.cpp.
Referenced by Init().
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 ChooseBackend(), MythContext::Init(), Init(), PromptForDatabaseParams(), and ShowGuiStartup().
void MythContextPrivate::EndTempWindow | ( | void | ) |
Definition at line 327 of file mythcontext.cpp.
Referenced by ChooseBackend(), Init(), and PromptForDatabaseParams().
bool MythContextPrivate::LoadDatabaseSettings | ( | void | ) |
Load database and host settings from XmlConfiguration::k_default_filename, or set some defaults.
Definition at line 566 of file mythcontext.cpp.
Referenced by FindDatabase().
bool MythContextPrivate::SaveDatabaseParams | ( | const DatabaseParams & | params, |
bool | force | ||
) |
Definition at line 660 of file mythcontext.cpp.
Referenced by FindDatabase(), and MythContext::SaveDatabaseParams().
bool MythContextPrivate::PromptForDatabaseParams | ( | const QString & | error | ) |
Definition at line 725 of file mythcontext.cpp.
Referenced by FindDatabase().
Some quick sanity checks before opening a database connection.
Definition at line 820 of file mythcontext.cpp.
Referenced by FindDatabase().
void MythContextPrivate::SilenceDBerrors | ( | void | ) |
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 1114 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams(), TempMainWindow(), and TestDBconnection().
void MythContextPrivate::EnableDBerrors | ( | void | ) |
Definition at line 1129 of file mythcontext.cpp.
Referenced by EndTempWindow(), FindDatabase(), PromptForDatabaseParams(), and TestDBconnection().
void MythContextPrivate::ResetDatabase | ( | void | ) | const |
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 1153 of file mythcontext.cpp.
Referenced by FindDatabase(), SaveDatabaseParams(), and TestDBconnection().
BackendSelection::Decision MythContextPrivate::ChooseBackend | ( | const QString & | error | ) |
Search for backends via UPnP, put up a UI for the user to choose one.
Definition at line 1163 of file mythcontext.cpp.
Referenced by FindDatabase().
int MythContextPrivate::UPnPautoconf | ( | std::chrono::milliseconds | milliSeconds = 2s | ) |
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 1191 of file mythcontext.cpp.
Referenced by FindDatabase().
bool MythContextPrivate::DefaultUPnP | ( | QString & | Error | ) |
Get the default backend from XmlConfiguration::kDefaultFilename, use UPnP to find it.
Sets a string if there any connection problems
Definition at line 1262 of file mythcontext.cpp.
Referenced by FindDatabase().
bool MythContextPrivate::UPnPconnect | ( | const DeviceLocation * | backend, |
const QString & | PIN | ||
) |
Query a backend via UPnP for its database connection parameters.
Definition at line 1343 of file mythcontext.cpp.
Referenced by DefaultUPnP(), and UPnPautoconf().
void MythContextPrivate::ShowGuiStartup | ( | void | ) |
Definition at line 1080 of file mythcontext.cpp.
Referenced by TestDBconnection().
bool MythContextPrivate::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.
Referenced by TestDBconnection().
|
static |
Definition at line 1493 of file mythcontext.cpp.
Referenced by ShowGuiStartup(), and TestDBconnection().
|
overrideprotected |
Definition at line 1386 of file mythcontext.cpp.
|
protected |
Definition at line 1416 of file mythcontext.cpp.
Referenced by event().
|
protected |
Definition at line 1450 of file mythcontext.cpp.
Referenced by event().
|
protected |
Definition at line 1466 of file mythcontext.cpp.
Referenced by event().
|
slot |
|
friend |
Definition at line 99 of file mythcontext.cpp.
MythContext* MythContextPrivate::m_parent {nullptr} |
Definition at line 144 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams().
Should this context use GUI elements?
Definition at line 147 of file mythcontext.cpp.
Referenced by FindDatabase(), MythContext::Init(), Init(), PromptForDatabaseParams(), MythContext::saveSettingsCache(), ShowGuiStartup(), and TestDBconnection().
QString MythContextPrivate::m_masterhostname |
master backend hostname
Definition at line 149 of file mythcontext.cpp.
DatabaseParams MythContextPrivate::m_dbParams |
Current database host & WOL details.
Definition at line 151 of file mythcontext.cpp.
Referenced by ChooseBackend(), EnableDBerrors(), FindDatabase(), LoadDatabaseSettings(), PromptForDatabaseParams(), ResetDatabase(), SaveDatabaseParams(), SilenceDBerrors(), TestDBconnection(), and UPnPconnect().
QString MythContextPrivate::m_dbHostCp |
dbHostName backup
Definition at line 152 of file mythcontext.cpp.
Referenced by EnableDBerrors(), SilenceDBerrors(), and TestDBconnection().
Definition at line 154 of file mythcontext.cpp.
Referenced by event(), and MythContext::SetDisableEventPopup().
MythUIHelper* MythContextPrivate::m_ui {nullptr} |
Definition at line 156 of file mythcontext.cpp.
Referenced by Init(), ShowConnectionFailurePopup(), ShowVersionMismatchPopup(), and ~MythContextPrivate().
MythContextSlotHandler* MythContextPrivate::m_sh {nullptr} |
Definition at line 157 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams(), ShowVersionMismatchPopup(), and ~MythContextPrivate().
GUIStartup* MythContextPrivate::m_guiStartup {nullptr} |
Definition at line 158 of file mythcontext.cpp.
Referenced by checkPort(), EndTempWindow(), FindDatabase(), Init(), ShowGuiStartup(), and TestDBconnection().
QEventLoop* MythContextPrivate::m_loop {nullptr} |
Definition at line 159 of file mythcontext.cpp.
Referenced by MythContextSlotHandler::OnCloseDialog(), PromptForDatabaseParams(), ShowGuiStartup(), TestDBconnection(), and ~MythContextPrivate().
Definition at line 160 of file mythcontext.cpp.
Referenced by Init(), MythContext::MythContext(), and TestDBconnection().
GUISettingsCache MythContextPrivate::m_GUISettingsCache |
Definition at line 162 of file mythcontext.cpp.
Referenced by Init(), and MythContext::saveSettingsCache().
|
private |
Definition at line 165 of file mythcontext.cpp.
Referenced by ShowVersionMismatchPopup(), and MythContextSlotHandler::VersionMismatchPopupClosed().
|
private |
Definition at line 166 of file mythcontext.cpp.
Referenced by event(), HideConnectionFailurePopup(), ShowConnectionFailurePopup(), and ~MythContextPrivate().
|
private |
Definition at line 167 of file mythcontext.cpp.
Referenced by HideConnectionFailurePopup(), and ShowConnectionFailurePopup().
|
private |
Definition at line 168 of file mythcontext.cpp.