Go to the documentation of this file.
5 #include <QApplication>
11 #include <libmythbase/mythversion.h>
23 const QString & ,
const QString & ,
int ,
24 int ,
const QString & , std::chrono::minutes ,
25 const QString & ,
const QString & ,
bool )
29 LOG(VB_GENERAL, LOG_ERR,
"MythBrowser: handleMedia got empty url!");
33 QStringList urls = url.split(
" ", Qt::SkipEmptyParts);
37 if (urls[0].startsWith(
"mythflash://"))
40 if (flashplayer->Create())
47 auto *mythbrowser =
new MythBrowser(mainStack, urls);
49 if (!directory.isEmpty())
50 mythbrowser->setDefaultSaveDirectory(directory);
53 mythbrowser->setDefaultSaveFilename(
filename);
55 if (mythbrowser->Create())
80 if (!query.
exec(
"SELECT url FROM `websites` WHERE `homepage` = true;"))
81 LOG(VB_GENERAL, LOG_ERR,
"Error loading homepage from DB");
86 handleMedia( query.
value(0).toString(),
"",
"",
"",
"", 0, 0,
"", 0min,
"",
"",
false);
91 QString message =
"No homepage was specified.\n"
92 "If required you can do this in the bookmark manager";
99 if (okPopup->Create())
106 REG_KEY(
"Browser",
"NEXTTAB", QT_TRANSLATE_NOOP(
"MythControls",
107 "Move to next browser tab"),
"P,Media Play");
108 REG_KEY(
"Browser",
"PREVTAB", QT_TRANSLATE_NOOP(
"MythControls",
109 "Move to previous browser tab"),
"");
111 REG_JUMP(
"Bookmarks", QT_TRANSLATE_NOOP(
"MythControls",
113 REG_JUMP(
"Homepage", QT_TRANSLATE_NOOP(
"MythControls",
123 MYTH_BINARY_VERSION))
162 auto *config =
new BrowserConfig(mainStack,
"browserconfig");
164 if (config->Create())
static MythSystemLegacyManager * manager
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
MythScreenStack * GetMainStack()
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
bool UpgradeBrowserDatabaseSchema(void)
static void runBookmarkManager()
static void setupKeys(void)
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static bool TestPluginVersion(const QString &name, const QString &libversion, const QString &pluginversion)
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
int mythplugin_config(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int mythplugin_init(const char *libversion)
static int handleMedia(const QString &url, const QString &directory, const QString &filename, const QString &, const QString &, int, int, const QString &, std::chrono::minutes, const QString &, const QString &, bool)
Dialog asking for user confirmation. Ok and optional Cancel button.
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
static void REG_MEDIAPLAYER(const QString &Name, const QString &Desc, MediaPlayCallback Func)
MythMainWindow * GetMythMainWindow(void)
void ActivateSettingsCache(bool activate=true)
MythScreenStack * GetStack(const QString &Stackname)
void SaveSetting(const QString &key, int newValue)
static void runHomepage()
Loads the specified homepage from the database (the name starts with an underscore) and calls handleM...
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
QString GetSetting(const QString &key, const QString &defaultval="")