60 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'browser'");
68 QString favIcon =
"mb_default_favicon.png";
71 if (QFile::exists(favIcon))
73 QImage image(favIcon);
80 auto *page =
new WebPage(
this, browser);
86 page->SetActive(
true);
88 connect(page, SIGNAL(loadProgress(
int)),
90 connect(page, SIGNAL(statusBarMessage(
const QString&)),
92 connect(page, SIGNAL(loadFinished(
bool)),
123 for (
int x = 1; x <
m_urlList.size(); x++)
142 QString message = tr(
"Enter URL");
147 if (dialog->Create())
150 connect(dialog, SIGNAL(haveResult(QString)),
156 QString name = QString(
"browser%1").arg(
m_browserList.size() + 1);
158 name.toLatin1().constData());
161 QString newUrl = url;
163 if (newUrl.isEmpty())
164 newUrl =
"http://www.google.com";
166 if (!newUrl.startsWith(
"http://") && !newUrl.startsWith(
"https://") &&
167 !newUrl.startsWith(
"file:/") )
168 newUrl.prepend(
"http://");
169 page->getBrowser()->LoadPage(QUrl::fromEncoded(newUrl.toLocal8Bit()));
171 page->SetActive(
false);
173 connect(page, SIGNAL(loadProgress(
int)),
175 connect(page, SIGNAL(statusBarMessage(
const QString&)),
177 connect(page, SIGNAL(loadFinished(
bool)),
227 if (!sUrl.startsWith(
"http://") && !sUrl.startsWith(
"https://") &&
228 !sUrl.startsWith(
"file:/") )
229 sUrl.prepend(
"http://");
263 true, mainStack,
"bookmarkeditor");
266 if (editor->Create())
274 item->
SetText(tr(
"Loading..."));
333 for (
int i = 0; i < actions.size() && !handled; i++)
336 QString
action = actions[i];
343 QString label = tr(
"Actions");
371 else if (
action ==
"INFO")
378 else if (
action ==
"ESCAPE")
382 else if (
action ==
"PREVTAB")
388 else if (
action ==
"NEXTTAB")
391 if (pos < m_pageList->GetCount() - 1)
394 else if (
action ==
"DELETE")
bool keyPressEvent(QKeyEvent *) override
Key event handler.
void slotAddTab(const QString &url="", bool doSwitch=true)
void switchTab(int newTab)
MythScreenStack * GetScreenStack() const
void ZoomOut(void)
Decrease the text size.
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void SetEnabled(bool enable)
void LoadPage(const QUrl &url)
Loads the specified url and displays it.
QUrl GetUrl(void)
Gets the current page's url.
int DecrRef(void) override
Decrements reference count and deletes on 0.
Basic menu dialog, message and a list of options.
MythDialogBox * m_menuPopup
virtual void SetText(const QString &text)
MythPainter * GetMythPainter(void)
MythScreenStack * GetStack(const QString &stackname)
MythScreenStack * GetMainStack()
void Forward(void)
Got forward in page history.
MythBrowser(MythScreenStack *parent, QStringList &urlList)
void slotLoadProgress(int progress)
void BuildFocusList(void)
void slotStatusBarMessage(const QString &text)
MythUIButton * m_forwardButton
void slotTitleChanged(const QString &title)
void AddButton(const QString &title, QVariant data=0, bool newMenu=false, bool setCurrent=false)
void slotTabSelected(MythUIButtonListItem *item)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
bool Create(void) override
void Back(void)
Got backward in page history.
MythUIButton * m_exitButton
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
void slotAddBookmark(void)
MythUIProgressBar * m_progressBar
MythUIButtonList * m_pageList
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
void slotOpenURL(const QString &url)
void slotLoadStarted(void)
MythUIHelper * GetMythUI()
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythUIType * GetFocusWidget(void) const
QString m_defaultSaveFilename
void slotTabLosingFocus(void)
MythMainWindow * GetMythMainWindow(void)
void PauseIdleTimer(bool pause)
Dialog prompting the user to enter a text string.
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
MythImage * m_defaultFavIcon
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
void slotLoadFinished(bool OK)
void SetReturnEvent(QObject *retobject, const QString &resultid)
void ZoomIn(void)
Increase the text size.
bool SetFocusWidget(MythUIType *widget=nullptr)
QList< WebPage * > m_browserList
Site category, name and URL edit screen.
Screen in which all other widgets are contained and rendered.
void Assign(const QImage &img)
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
MythUIButton * m_backButton
MythUIText * m_statusText
MythUIWebBrowser * activeBrowser(void)
bool Create(void) override