Definition at line 178 of file mythcontext.cpp.
Public Member Functions | |
| MythContextPrivate (MythContext *lparent) | |
| ~MythContextPrivate () | |
| bool | Init (const bool gui, UPnp *UPnPclient, const bool prompt, const bool noPrompt) |
| bool | FindDatabase (const bool prompt, const bool noPrompt) |
| Get database connection settings and test connectivity. | |
| bool | IsWideMode () const |
| void | SetWideMode () |
| bool | IsSquareMode () const |
| void | SetSquareMode () |
| void | TempMainWindow (bool languagePrompt=true) |
| Setup a minimal themed main window, and prompt for user's language. | |
| void | EndTempWindow (void) |
| void | GetScreenBounds (void) |
| Get screen size from Qt, respecting for user's multiple screen prefs. | |
| void | StoreGUIsettings (void) |
| Apply any user overrides to the screen geometry. | |
| void | LoadLogSettings (void) |
| void | LoadDatabaseSettings (void) |
| Load database and host settings from mysql.txt, or set some defaults. | |
| bool | LoadSettingsFile (void) |
| Load mysql.txt and parse its values into m_DBparams. | |
| bool | WriteSettingsFile (const DatabaseParams ¶ms, bool overwrite=false) |
| bool | FindSettingsProbs (void) |
| QString | getResponse (const QString &query, const QString &def) |
| int | intResponse (const QString &query, int def) |
| bool | PromptForDatabaseParams (const QString &error) |
| QString | TestDBconnection (void) |
| Some quick sanity checks before opening a database connection. | |
| void | ResetDatabase (void) |
| Called when the user changes the DB connection settings. | |
| bool | InitUPnP (void) |
| void | DeleteUPnP (void) |
| 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. | |
| void | StoreConnectionInfo (void) |
| Try to store the current location of this backend in config.xml. | |
| 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 |
| Settings * | m_settings |
| connection stuff, theme, button style | |
| Settings * | m_qtThemeSettings |
| everything else theme-related | |
| QString | m_installprefix |
| Compile-time RUNPREFIX, or generated from enviroment ($MYTHTVDIR or $cwd). | |
| QString | m_libname |
| Compile-time LIBDIRNAME. | |
| bool | m_gui |
| Should this context use GUI elements? | |
| bool | m_backend |
| Is this host any sort of backend? | |
| bool | m_themeloaded |
| To we have a palette and pixmap to use? | |
| QString | m_menuthemepathname |
| QString | m_themepathname |
| QPixmap * | m_backgroundimage |
| Large or tiled image. | |
| QPalette | m_palette |
| Colour scheme. | |
| int | m_xbase |
| int | m_ybase |
| int | m_height |
| int | m_width |
| int | m_baseWidth |
| int | m_baseHeight |
| QMutex | m_hostnamelock |
| Locking for thread-safe copying of:. | |
| QString | m_localhostname |
| hostname from mysql.txt or gethostname() | |
| DatabaseParams | m_DBparams |
| Current database host & WOL details. | |
| QString | m_DBhostCp |
| dbHostName backup | |
| UPnp * | m_UPnP |
| For automatic backend discover. | |
| XmlConfiguration * | m_XML |
| HttpServer * | m_HTTP |
| QMutex | serverSockLock |
| bool | attemptingToConnect |
| MDBManager | m_dbmanager |
| QMap< QString, QImage > | imageCache |
| QString | language |
| MythMainWindow * | mainWindow |
| float | m_wmult |
| float | m_hmult |
| int | m_screenxbase |
| int | m_screenybase |
| int | m_screenwidth |
| int | m_screenheight |
| int | m_geometry_x |
| int | m_geometry_y |
| int | m_geometry_w |
| int | m_geometry_h |
| QString | themecachedir |
| int | bigfontsize |
| int | mediumfontsize |
| int | smallfontsize |
| MythSocket * | serverSock |
| MythSocket * | eventSock |
| bool | disablelibrarypopup |
| MythPluginManager * | pluginmanager |
| ScreenSaverControl * | screensaver |
| int | m_logenable |
| int | m_logmaxcount |
| int | m_logprintlevel |
| QMap< QString, int > | lastLogCounts |
| QMap< QString, QString > | lastLogStrings |
| bool | screensaverEnabled |
| DisplayRes * | display_res |
| QMutex | m_priv_mutex |
| queue< MythPrivRequest > | m_priv_requests |
| QWaitCondition | m_priv_queued |
| bool | useSettingsCache |
| QMutex | settingsCacheLock |
| QMap< QString, QString > | settingsCache |
| QMap< QString, QString > | overriddenSettings |
| MythContextPrivate::MythContextPrivate | ( | MythContext * | lparent | ) |
Definition at line 314 of file mythcontext.cpp.
| MythContextPrivate::~MythContextPrivate | ( | ) |
Definition at line 370 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 580 of file mythcontext.cpp.
Referenced by Init().
| bool MythContextPrivate::IsWideMode | ( | ) | const [inline] |
Definition at line 188 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), and MythContext::GetThemeSearchPath().
| void MythContextPrivate::SetWideMode | ( | ) | [inline] |
| bool MythContextPrivate::IsSquareMode | ( | ) | const [inline] |
Definition at line 190 of file mythcontext.cpp.
| void MythContextPrivate::SetSquareMode | ( | ) | [inline] |
| 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 401 of file mythcontext.cpp.
Referenced by ChooseBackend(), MythContext::Init(), PromptForDatabaseParams(), and MythContext::PromptForSchemaUpgrade().
| void MythContextPrivate::EndTempWindow | ( | void | ) |
Definition at line 434 of file mythcontext.cpp.
Referenced by ChooseBackend(), PromptForDatabaseParams(), and MythContext::PromptForSchemaUpgrade().
| void MythContextPrivate::GetScreenBounds | ( | void | ) |
Get screen size from Qt, respecting for user's multiple screen prefs.
If the windowing system environment has multiple screens (e.g. Xinerama or Mac OS X), QApplication::desktop()->width() will span all of them, so we usually need to get the geometry of a specific screen.
Definition at line 447 of file mythcontext.cpp.
Referenced by Init(), and MythContext::LoadQtConfig().
| void MythContextPrivate::StoreGUIsettings | ( | void | ) |
Apply any user overrides to the screen geometry.
Definition at line 694 of file mythcontext.cpp.
Referenced by Init(), and MythContext::LoadQtConfig().
| void MythContextPrivate::LoadLogSettings | ( | void | ) |
Definition at line 756 of file mythcontext.cpp.
Referenced by MythContext::LogEntry(), and MythContext::RefreshBackendConfig().
| void MythContextPrivate::LoadDatabaseSettings | ( | void | ) |
Load database and host settings from mysql.txt, or set some defaults.
Definition at line 768 of file mythcontext.cpp.
Referenced by FindDatabase().
| bool MythContextPrivate::LoadSettingsFile | ( | void | ) |
Load mysql.txt and parse its values into m_DBparams.
Definition at line 816 of file mythcontext.cpp.
Referenced by LoadDatabaseSettings().
| bool MythContextPrivate::WriteSettingsFile | ( | const DatabaseParams & | params, | |
| bool | overwrite = false | |||
| ) |
Definition at line 842 of file mythcontext.cpp.
Referenced by ChooseBackend(), and MythContext::SaveDatabaseParams().
| bool MythContextPrivate::FindSettingsProbs | ( | void | ) |
| QString MythContextPrivate::getResponse | ( | const QString & | query, | |
| const QString & | def | |||
| ) |
Definition at line 974 of file mythcontext.cpp.
Referenced by intResponse(), PromptForDatabaseParams(), and MythContext::PromptForSchemaUpgrade().
| int MythContextPrivate::intResponse | ( | const QString & | query, | |
| int | def | |||
| ) |
| bool MythContextPrivate::PromptForDatabaseParams | ( | const QString & | error | ) |
| QString MythContextPrivate::TestDBconnection | ( | void | ) |
Some quick sanity checks before opening a database connection.
Definition at line 1097 of file mythcontext.cpp.
Referenced by FindDatabase().
| void MythContextPrivate::ResetDatabase | ( | void | ) |
Called when the user changes the DB connection settings.
The current DB connections way 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 1181 of file mythcontext.cpp.
Referenced by FindDatabase(), and MythContext::SaveDatabaseParams().
| bool MythContextPrivate::InitUPnP | ( | void | ) |
Definition at line 1188 of file mythcontext.cpp.
Referenced by ChooseBackend(), DefaultUPnP(), and UPnPautoconf().
| void MythContextPrivate::DeleteUPnP | ( | void | ) |
Definition at line 1227 of file mythcontext.cpp.
Referenced by FindDatabase(), InitUPnP(), and ~MythContextPrivate().
| int MythContextPrivate::ChooseBackend | ( | const QString & | error | ) |
Search for backends via UPnP, put up a UI for the user to choose one.
Definition at line 1252 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 1339 of file mythcontext.cpp.
Referenced by FindDatabase().
| void MythContextPrivate::StoreConnectionInfo | ( | void | ) |
Try to store the current location of this backend in config.xml.
This is intended as a last resort for future connections (e.g. Perl scripts, backend not running).
Note that the Save() may fail (e.g. non writable ~/.mythtv)
Definition at line 1320 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 1414 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 1467 of file mythcontext.cpp.
Referenced by DefaultUPnP(), and UPnPautoconf().
Definition at line 222 of file mythcontext.cpp.
Referenced by EndTempWindow(), GetScreenBounds(), LoadLogSettings(), PromptForDatabaseParams(), ResetDatabase(), StoreGUIsettings(), and TempMainWindow().
connection stuff, theme, button style
Definition at line 224 of file mythcontext.cpp.
Referenced by MythContext::GetSetting(), LoadSettingsFile(), MythContext::SetSetting(), TempMainWindow(), and ~MythContextPrivate().
everything else theme-related
Definition at line 225 of file mythcontext.cpp.
Referenced by MythContext::LoadQtConfig(), MythContext::qtconfig(), MythContext::SetPalette(), MythContext::ThemeWidget(), and ~MythContextPrivate().
Compile-time RUNPREFIX, or generated from enviroment ($MYTHTVDIR or $cwd).
Definition at line 227 of file mythcontext.cpp.
Referenced by MythContext::GetInstallPrefix(), MythContext::GetLibraryDir(), MythContext::GetShareDir(), LoadSettingsFile(), and MythContextPrivate().
| QString MythContextPrivate::m_libname |
Compile-time LIBDIRNAME.
Definition at line 229 of file mythcontext.cpp.
Referenced by MythContext::GetLibraryDir().
Should this context use GUI elements?
Definition at line 231 of file mythcontext.cpp.
Referenced by MythContext::ConnectServer(), FindDatabase(), Init(), PromptForDatabaseParams(), and MythContext::PromptForSchemaUpgrade().
Is this host any sort of backend?
Definition at line 232 of file mythcontext.cpp.
Referenced by MythContext::IsBackend(), and MythContext::SetBackend().
To we have a palette and pixmap to use?
Definition at line 234 of file mythcontext.cpp.
Referenced by MythContext::LoadQtConfig(), and MythContext::ThemeWidget().
Definition at line 235 of file mythcontext.cpp.
Referenced by MythContext::GetMenuThemeDir(), and MythContext::LoadQtConfig().
Definition at line 236 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), MythContext::GetThemeDir(), MythContext::LoadQtConfig(), MythContext::LoadScaleImage(), MythContext::LoadScalePixmap(), and MythContext::ThemeWidget().
Large or tiled image.
Definition at line 237 of file mythcontext.cpp.
Referenced by MythContext::LoadQtConfig(), and MythContext::ThemeWidget().
| QPalette MythContextPrivate::m_palette |
Colour scheme.
Definition at line 238 of file mythcontext.cpp.
Referenced by MythContext::ThemeWidget().
Definition at line 243 of file mythcontext.cpp.
Referenced by MythContext::GetScreenBounds(), GetScreenBounds(), and StoreGUIsettings().
Definition at line 243 of file mythcontext.cpp.
Referenced by MythContext::GetScreenBounds(), GetScreenBounds(), and StoreGUIsettings().
Definition at line 244 of file mythcontext.cpp.
Referenced by MythContext::CheckProtoVersion(), MythContext::ConnectServer(), MythContext::GetScreenBounds(), GetScreenBounds(), MythContext::SendReceiveStringList(), and StoreGUIsettings().
Definition at line 244 of file mythcontext.cpp.
Referenced by MythContext::CheckProtoVersion(), MythContext::ConnectServer(), MythContext::GetScreenBounds(), GetScreenBounds(), MythContext::SendReceiveStringList(), and StoreGUIsettings().
Definition at line 247 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), IsSquareMode(), IsWideMode(), MythContext::LoadScaleImage(), MythContext::LoadScalePixmap(), SetSquareMode(), SetWideMode(), and StoreGUIsettings().
Definition at line 247 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), MythContext::LoadScaleImage(), MythContext::LoadScalePixmap(), SetSquareMode(), SetWideMode(), and StoreGUIsettings().
Locking for thread-safe copying of:.
Definition at line 250 of file mythcontext.cpp.
Referenced by MythContext::GetHostName().
hostname from mysql.txt or gethostname()
Definition at line 251 of file mythcontext.cpp.
Referenced by MythContext::ConnectServer(), MythContext::GetHostName(), MythContext::GetSetting(), MythContext::GetSettingOnHost(), LoadDatabaseSettings(), MythContext::LogEntry(), MythContext::SaveSetting(), and TestDBconnection().
Current database host & WOL details.
Definition at line 253 of file mythcontext.cpp.
Referenced by ChooseBackend(), DefaultUPnP(), FindSettingsProbs(), MythContext::GetDatabaseParams(), LoadDatabaseSettings(), LoadSettingsFile(), MythContext::PromptForSchemaUpgrade(), MythContext::SaveDatabaseParams(), StoreConnectionInfo(), TempMainWindow(), TestDBconnection(), and UPnPconnect().
| QString MythContextPrivate::m_DBhostCp |
dbHostName backup
Definition at line 254 of file mythcontext.cpp.
Referenced by PromptForDatabaseParams(), MythContext::PromptForSchemaUpgrade(), TempMainWindow(), and TestDBconnection().
For automatic backend discover.
Definition at line 256 of file mythcontext.cpp.
Referenced by DefaultUPnP(), DeleteUPnP(), Init(), InitUPnP(), and UPnPautoconf().
Definition at line 257 of file mythcontext.cpp.
Referenced by ChooseBackend(), DeleteUPnP(), Init(), InitUPnP(), and StoreConnectionInfo().
Definition at line 260 of file mythcontext.cpp.
Referenced by MythContext::connectionClosed(), MythContext::ConnectServer(), MythContext::GetMasterHostPrefix(), and MythContext::SendReceiveStringList().
Definition at line 263 of file mythcontext.cpp.
Referenced by MythContext::GetDBManager(), and ResetDatabase().
| QMap<QString, QImage> MythContextPrivate::imageCache |
Definition at line 265 of file mythcontext.cpp.
Referenced by MythContext::CacheRemotePixmap(), MythContext::UpdateImageCache(), and ~MythContextPrivate().
| QString MythContextPrivate::language |
Definition at line 267 of file mythcontext.cpp.
Referenced by MythContext::GetLanguageAndVariant(), and MythContext::LoadQtConfig().
Definition at line 269 of file mythcontext.cpp.
Referenced by MythContext::CheckProtoVersion(), ChooseBackend(), MythContext::ConnectServer(), MythContext::GetMainWindow(), MythContext::Init(), PromptForDatabaseParams(), MythContext::PromptForSchemaUpgrade(), MythContext::SendReceiveStringList(), MythContext::SetMainWindow(), and TempMainWindow().
Definition at line 271 of file mythcontext.cpp.
Referenced by MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 271 of file mythcontext.cpp.
Referenced by MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 275 of file mythcontext.cpp.
Referenced by MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 275 of file mythcontext.cpp.
Referenced by MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 276 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), MythContext::ClearOldImageCache(), MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 276 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImages(), MythContext::ClearOldImageCache(), MythContext::GetScreenSettings(), and StoreGUIsettings().
Definition at line 279 of file mythcontext.cpp.
Referenced by GetScreenBounds(), MythContext::ParseGeometryOverride(), and StoreGUIsettings().
Definition at line 279 of file mythcontext.cpp.
Referenced by GetScreenBounds(), MythContext::ParseGeometryOverride(), and StoreGUIsettings().
Definition at line 280 of file mythcontext.cpp.
Referenced by GetScreenBounds(), MythContext::ParseGeometryOverride(), and StoreGUIsettings().
Definition at line 280 of file mythcontext.cpp.
Referenced by GetScreenBounds(), MythContext::ParseGeometryOverride(), and StoreGUIsettings().
Definition at line 282 of file mythcontext.cpp.
Referenced by MythContext::CacheThemeImagesDirectory(), MythContext::ClearOldImageCache(), MythContext::LoadQtConfig(), MythContext::LoadScaleImage(), and MythContext::LoadScalePixmap().
Definition at line 284 of file mythcontext.cpp.
Referenced by MythContext::GetBigFont(), and MythContext::LoadQtConfig().
Definition at line 284 of file mythcontext.cpp.
Referenced by MythContext::GetMediumFont(), and MythContext::LoadQtConfig().
Definition at line 284 of file mythcontext.cpp.
Referenced by MythContext::GetSmallFont(), and MythContext::LoadQtConfig().
Definition at line 286 of file mythcontext.cpp.
Referenced by MythContext::AllowShutdown(), MythContext::BlockShutdown(), MythContext::connectionClosed(), MythContext::ConnectToMasterServer(), MythContext::GetMasterHostPrefix(), MythContext::IsConnectedToMaster(), MythContext::SendReceiveStringList(), and ~MythContextPrivate().
Definition at line 287 of file mythcontext.cpp.
Referenced by MythContext::AllowShutdown(), MythContext::BlockShutdown(), MythContext::connectionClosed(), MythContext::ConnectToMasterServer(), MythContext::readyRead(), and ~MythContextPrivate().
Definition at line 289 of file mythcontext.cpp.
Referenced by MythContext::SetDisableLibraryPopup(), and MythContext::TestPopupVersion().
Definition at line 291 of file mythcontext.cpp.
Referenced by MythContext::getPluginManager(), and MythContext::SetPluginManager().
Definition at line 293 of file mythcontext.cpp.
Referenced by MythContext::DoDisableScreensaver(), MythContext::DoResetScreensaver(), MythContext::DoRestoreScreensaver(), MythContext::GetScreenIsAsleep(), Init(), and ~MythContextPrivate().
Definition at line 295 of file mythcontext.cpp.
Referenced by LoadLogSettings(), and MythContext::LogEntry().
Definition at line 295 of file mythcontext.cpp.
Referenced by LoadLogSettings(), and MythContext::LogEntry().
| QMap<QString,int> MythContextPrivate::lastLogCounts |
| QMap<QString,QString> MythContextPrivate::lastLogStrings |
Definition at line 299 of file mythcontext.cpp.
Referenced by MythContext::DoDisableScreensaver(), MythContext::DoResetScreensaver(), MythContext::DoRestoreScreensaver(), and MythContext::GetScreensaverEnabled().
Definition at line 303 of file mythcontext.cpp.
Referenced by MythContext::addPrivRequest(), MythContext::popPrivRequest(), and MythContext::waitPrivRequest().
Definition at line 304 of file mythcontext.cpp.
Referenced by MythContext::addPrivRequest(), MythContext::popPrivRequest(), and MythContext::waitPrivRequest().
| QWaitCondition MythContextPrivate::m_priv_queued |
Definition at line 305 of file mythcontext.cpp.
Referenced by MythContext::addPrivRequest(), and MythContext::waitPrivRequest().
Definition at line 307 of file mythcontext.cpp.
Referenced by MythContext::ActivateSettingsCache(), MythContext::GetSetting(), and MythContext::GetSettingOnHost().
Definition at line 308 of file mythcontext.cpp.
Referenced by MythContext::ClearSettingsCache(), MythContext::GetSetting(), and MythContext::GetSettingOnHost().
| QMap<QString, QString> MythContextPrivate::settingsCache |
Definition at line 309 of file mythcontext.cpp.
Referenced by MythContext::ClearSettingsCache(), MythContext::GetSetting(), and MythContext::GetSettingOnHost().
| QMap<QString, QString> MythContextPrivate::overriddenSettings |
Definition at line 310 of file mythcontext.cpp.
Referenced by MythContext::GetSetting(), MythContext::GetSettingOnHost(), and MythContext::OverrideSettingForSession().
1.5.5