Go to the documentation of this file.
3 #include <QApplication>
12 #include "libmythbase/mythversion.h"
23 #if CONFIG_SYSTEMD_NOTIFY
24 #include <systemd/sd-daemon.h>
25 static inline void mw_sd_notify(
const char *str) { sd_notify(0, str); };
32 REG_KEY(
"Welcome",
"STARTXTERM", QT_TRANSLATE_NOOP(
"MythControls",
33 "Open an Xterm window"),
"F12");
34 REG_KEY(
"Welcome",
"SHOWSETTINGS", QT_TRANSLATE_NOOP(
"MythControls",
35 "Show Mythshutdown settings"),
"F11");
36 REG_KEY(
"Welcome",
"STARTSETUP", QT_TRANSLATE_NOOP(
"MythControls",
37 "Start Mythtv-Setup"),
"");
40 int main(
int argc,
char **argv)
42 bool bShowSettings =
false;
64 QApplication a(argc, argv);
86 LOG(VB_GENERAL, LOG_ERR,
87 "mythwelcome: Could not initialize MythContext. Exiting.");
96 LOG(VB_GENERAL, LOG_ERR,
97 "mythwelcome: Could not open the database. Exiting.");
130 bool ok = screen->
Create();
139 {
if (!_screen) block.quit(); });
MythScreenStack * GetMainStack()
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
void Init(bool MayReInit=true)
static void ParseGeometryOverride(const QString &Geometry)
Parse an X11 style command line geometry string.
MythCommFlagCommandLineParser cmdline
Startup context for MythTV.
virtual bool Create(void)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
int main(int argc, char **argv)
static void ConfigureQtGUI(int SwapInterval, const MythCommandLineParser &CmdLine)
Shared static initialisation code for all MythTV GUI applications.
void DisableIdleTimer(bool DisableIdle=true)
Disable the idle timeout timer.
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
@ GENERIC_EXIT_OK
Exited with no error.
void topScreenChanged(MythScreenType *screen)
static bool testDBConnection()
Checks DB connection + login (login info via Mythcontext)
void DestroyMythMainWindow(void)
static void PrintVersion(void)
Print application version information.
void PrintHelp(void) const
Print command line option help.
void ApplySettingsOverride(void)
Apply all overrides to the global context.
static void Init(QObject *parent=nullptr)
QString toString(const QString &key) const
Returns stored QVariant as a QString, falling to default if not provided.
static void SetupLCD(void)
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
static void mw_sd_notify(const char *)
MythMainWindow * GetMythMainWindow(void)
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
static void initKeys(void)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static constexpr const char * MYTH_APPNAME_MYTHWELCOME
MythContext * gContext
This global variable contains the MythContext instance for the application.
bool Init(bool gui=true, bool promptForBackend=false, bool disableAutoDiscovery=false, bool ignoreDB=false)
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.