|
MythTV
0.26-pre
|
Public Member Functions | |
| MythContextPrivate (MythContext *lparent) | |
| ~MythContextPrivate () | |
| bool | Init (const bool gui, const bool prompt, const bool noPrompt, const bool ignoreDB) |
| bool | FindDatabase (const bool prompt, const bool noPrompt) |
| Get database connection settings and test connectivity. | |
| void | TempMainWindow (bool languagePrompt=true) |
| Setup a minimal themed main window, and prompt for user's language. | |
| void | EndTempWindow (void) |
| bool | LoadDatabaseSettings (void) |
| Load database and host settings from config.xml, or set some defaults. | |
| bool | SaveDatabaseParams (const DatabaseParams ¶ms, bool force) |
| bool | PromptForDatabaseParams (const QString &error) |
| QString | TestDBconnection (void) |
| Some quick sanity checks before opening a database connection. | |
| void | SilenceDBerrors (void) |
| Cause MSqlDatabase::OpenDatabase() and MSqlQuery to fail silently. | |
| void | EnableDBerrors (void) |
| void | ResetDatabase (void) |
| Called when the user changes the DB connection settings. | |
| int | ChooseBackend (const QString &error) |
| Search for backends via UPnP, put up a UI for the user to choose one. | |
| int | UPnPautoconf (const int milliSeconds=2000) |
| If there is only a single UPnP backend, use it. | |
| bool | DefaultUPnP (QString &error) |
| Get the default backend from config.xml, use UPnP to find it. | |
| bool | UPnPconnect (const DeviceLocation *device, const QString &PIN) |
| Query a backend via UPnP for its database connection parameters. | |
Public Attributes | |
| MythContext * | parent |
| bool | m_gui |
| Should this context use GUI elements? | |
| QString | m_masterhostname |
| master backend hostname | |
| DatabaseParams | m_DBparams |
| Current database host & WOL details. | |
| QString | m_DBhostCp |
| dbHostName backup | |
| Configuration * | m_pConfig |
| bool | disableeventpopup |
| bool | disablelibrarypopup |
| MythPluginManager * | pluginmanager |
| MythUIHelper * | m_ui |
| MythContextSlotHandler * | m_sh |
Protected Member Functions | |
| bool | event (QEvent *) |
| void | ShowConnectionFailurePopup (bool persistent) |
| void | HideConnectionFailurePopup (void) |
| void | ConnectFailurePopupClosed (void) |
| void | ShowVersionMismatchPopup (uint remoteVersion) |
| void | VersionMismatchPopupClosed (void) |
Private Attributes | |
| MythConfirmationDialog * | MBEconnectPopup |
| MythConfirmationDialog * | MBEversionPopup |
Friends | |
| class | MythContextSlotHandler |
Definition at line 51 of file mythcontext.cpp.
| MythContextPrivate::MythContextPrivate | ( | MythContext * | lparent | ) |
Definition at line 202 of file mythcontext.cpp.
Definition at line 217 of file mythcontext.cpp.
| bool MythContextPrivate::Init | ( | const bool | gui, |
| const bool | prompt, | ||
| const bool | noPrompt, | ||
| const bool | ignoreDB | ||
| ) |
Definition at line 269 of file mythcontext.cpp.
Referenced by MythContext::Init().
| bool MythContextPrivate::FindDatabase | ( | const bool | prompt, |
| const bool | noPrompt | ||
| ) |
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 330 of file mythcontext.cpp.
Referenced by Init().
| void MythContextPrivate::TempMainWindow | ( | bool | languagePrompt = true | ) |
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 237 of file mythcontext.cpp.
Referenced by ChooseBackend(), MythContext::Init(), Init(), and PromptForDatabaseParams().
Definition at line 262 of file mythcontext.cpp.
Referenced by ChooseBackend(), Init(), and PromptForDatabaseParams().
Load database and host settings from config.xml, or set some defaults.
Definition at line 435 of file mythcontext.cpp.
Referenced by FindDatabase().
| bool MythContextPrivate::SaveDatabaseParams | ( | const DatabaseParams & | params, |
| bool | force | ||
| ) |
Definition at line 505 of file mythcontext.cpp.
Referenced by FindDatabase(), and MythContext::SaveDatabaseParams().
| bool MythContextPrivate::PromptForDatabaseParams | ( | const QString & | error | ) |
Definition at line 559 of file mythcontext.cpp.
Referenced by FindDatabase().
| QString MythContextPrivate::TestDBconnection | ( | void | ) |
Some quick sanity checks before opening a database connection.
Definition at line 639 of file mythcontext.cpp.
Referenced by FindDatabase().
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 716 of file mythcontext.cpp.
Referenced by TempMainWindow(), and TestDBconnection().
Definition at line 731 of file mythcontext.cpp.
Referenced by EndTempWindow(), and FindDatabase().
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 755 of file mythcontext.cpp.
Referenced by FindDatabase(), SaveDatabaseParams(), and TestDBconnection().
| int MythContextPrivate::ChooseBackend | ( | const QString & | error | ) |
Search for backends via UPnP, put up a UI for the user to choose one.
Definition at line 765 of file mythcontext.cpp.
Referenced by FindDatabase().
| int MythContextPrivate::UPnPautoconf | ( | const int | milliSeconds = 2000 | ) |
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 792 of file mythcontext.cpp.
Referenced by FindDatabase().
| bool MythContextPrivate::DefaultUPnP | ( | QString & | error | ) |
Get the default backend from config.xml, use UPnP to find it.
Sets a string if there any connection problems
Definition at line 860 of file mythcontext.cpp.
Referenced by FindDatabase().
| bool MythContextPrivate::UPnPconnect | ( | const DeviceLocation * | device, |
| const QString & | PIN | ||
| ) |
Query a backend via UPnP for its database connection parameters.
Definition at line 932 of file mythcontext.cpp.
Referenced by DefaultUPnP(), and UPnPautoconf().
| bool MythContextPrivate::event | ( | QEvent * | e | ) | [protected] |
Definition at line 975 of file mythcontext.cpp.
| void MythContextPrivate::ShowConnectionFailurePopup | ( | bool | persistent | ) | [protected] |
Definition at line 997 of file mythcontext.cpp.
Referenced by event().
| void MythContextPrivate::HideConnectionFailurePopup | ( | void | ) | [protected] |
Definition at line 1019 of file mythcontext.cpp.
Referenced by event().
| void MythContextPrivate::ConnectFailurePopupClosed | ( | void | ) | [protected] |
Referenced by ShowConnectionFailurePopup().
| void MythContextPrivate::ShowVersionMismatchPopup | ( | uint | remoteVersion | ) | [protected] |
Definition at line 1028 of file mythcontext.cpp.
Referenced by event().
| void MythContextPrivate::VersionMismatchPopupClosed | ( | void | ) | [protected] |
Referenced by ShowVersionMismatchPopup().
friend class MythContextSlotHandler [friend] |
Definition at line 53 of file mythcontext.cpp.
Definition at line 92 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams().
Should this context use GUI elements?
Definition at line 94 of file mythcontext.cpp.
Referenced by FindDatabase(), Init(), and PromptForDatabaseParams().
master backend hostname
Definition at line 96 of file mythcontext.cpp.
Current database host & WOL details.
Definition at line 98 of file mythcontext.cpp.
Referenced by ChooseBackend(), EnableDBerrors(), FindDatabase(), MythContext::GetDatabaseParams(), LoadDatabaseSettings(), ResetDatabase(), SaveDatabaseParams(), SilenceDBerrors(), TestDBconnection(), and UPnPconnect().
| QString MythContextPrivate::m_DBhostCp |
dbHostName backup
Definition at line 99 of file mythcontext.cpp.
Referenced by EnableDBerrors(), PromptForDatabaseParams(), and SilenceDBerrors().
Definition at line 101 of file mythcontext.cpp.
Referenced by ChooseBackend(), DefaultUPnP(), Init(), LoadDatabaseSettings(), SaveDatabaseParams(), and ~MythContextPrivate().
Definition at line 103 of file mythcontext.cpp.
Referenced by event(), and MythContext::SetDisableEventPopup().
Definition at line 104 of file mythcontext.cpp.
Referenced by MythContext::SetDisableLibraryPopup(), and MythContext::TestPopupVersion().
Definition at line 106 of file mythcontext.cpp.
Referenced by MythContext::getPluginManager(), and MythContext::SetPluginManager().
Definition at line 108 of file mythcontext.cpp.
Referenced by Init(), ShowConnectionFailurePopup(), ShowVersionMismatchPopup(), and ~MythContextPrivate().
Definition at line 109 of file mythcontext.cpp.
Referenced by ShowConnectionFailurePopup(), ShowVersionMismatchPopup(), and ~MythContextPrivate().
Definition at line 112 of file mythcontext.cpp.
Referenced by MythContextSlotHandler::ConnectFailurePopupClosed(), HideConnectionFailurePopup(), and ShowConnectionFailurePopup().
Definition at line 113 of file mythcontext.cpp.
Referenced by ShowVersionMismatchPopup(), and MythContextSlotHandler::VersionMismatchPopupClosed().
1.7.6.1