Go to the documentation of this file.
5 #include <QApplication>
10 #include <libmythbase/mythversion.h>
22 const QString & ,
const QString & ,
int ,
23 int ,
const QString & , std::chrono::minutes ,
24 const QString & ,
const QString & ,
bool )
28 LOG(VB_GENERAL, LOG_ERR,
"MythBrowser: handleMedia got empty url!");
32 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
33 QStringList urls = url.split(
" ", QString::SkipEmptyParts);
35 QStringList urls = url.split(
" ", Qt::SkipEmptyParts);
40 if (urls[0].startsWith(
"mythflash://"))
43 if (flashplayer->Create())
50 auto *mythbrowser =
new MythBrowser(mainStack, urls);
52 if (!directory.isEmpty())
53 mythbrowser->setDefaultSaveDirectory(directory);
56 mythbrowser->setDefaultSaveFilename(
filename);
58 if (mythbrowser->Create())
83 if (!query.
exec(
"SELECT url FROM `websites` WHERE `homepage` = true;"))
84 LOG(VB_GENERAL, LOG_ERR,
"Error loading homepage from DB");
89 handleMedia( query.
value(0).toString(),
"",
"",
"",
"", 0, 0,
"", 0min,
"",
"",
false);
94 QString message =
"No homepage was specified.\n"
95 "If required you can do this in the bookmark manager";
102 if (okPopup->Create())
109 REG_KEY(
"Browser",
"NEXTTAB", QT_TRANSLATE_NOOP(
"MythControls",
110 "Move to next browser tab"),
"P");
111 REG_KEY(
"Browser",
"PREVTAB", QT_TRANSLATE_NOOP(
"MythControls",
112 "Move to previous browser tab"),
"");
114 REG_JUMP(
"Bookmarks", QT_TRANSLATE_NOOP(
"MythControls",
116 REG_JUMP(
"Homepage", QT_TRANSLATE_NOOP(
"MythControls",
126 MYTH_BINARY_VERSION))
165 auto *config =
new BrowserConfig(mainStack,
"browserconfig");
167 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="")