56 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'browser'");
64 QString favIcon =
"mb_default_favicon.png";
69 QImage image(favIcon);
76 auto *page =
new WebPage(
this, browser);
82 page->SetActive(
true);
119 for (
int x = 1; x <
m_urlList.size(); x++)
138 QString message = tr(
"Enter URL");
143 if (dialog->Create())
152 QString name = QString(
"browser%1").arg(
m_browserList.size() + 1);
154 name.toLatin1().constData());
157 QString newUrl = url;
159 if (newUrl.isEmpty())
160 newUrl =
"http://www.google.com";
162 if (!newUrl.startsWith(
"http://") && !newUrl.startsWith(
"https://") &&
163 !newUrl.startsWith(
"file:/") )
164 newUrl.prepend(
"http://");
165 page->getBrowser()->LoadPage(QUrl::fromEncoded(newUrl.toLocal8Bit()));
167 page->SetActive(
false);
223 if (!sUrl.startsWith(
"http://") && !sUrl.startsWith(
"https://") &&
224 !sUrl.startsWith(
"file:/") )
225 sUrl.prepend(
"http://");
259 true, mainStack,
"bookmarkeditor");
262 if (editor->Create())
270 item->
SetText(tr(
"Loading..."));
327 for (
int i = 0; i < actions.size() && !handled; i++)
330 const QString&
action = actions[i];
337 QString label = tr(
"Actions");
365 else if (
action ==
"INFO")
372 else if (
action ==
"ESCAPE")
379 else if (
action ==
"PREVTAB")
385 else if (
action ==
"NEXTTAB")
388 if (pos < m_pageList->GetCount() - 1)
391 else if (
action ==
"DELETE")
Site category, name and URL edit screen.
void slotLoadFinished(bool OK)
MythUIText * m_statusText
void slotLoadProgress(int progress)
MythBrowser(MythScreenStack *parent, QStringList &urlList)
QString m_defaultSaveFilename
MythImage * m_defaultFavIcon
void slotStatusBarMessage(const QString &text)
MythUIButton * m_exitButton
MythUIButton * m_forwardButton
MythUIButton * m_backButton
void slotTabLosingFocus(void)
MythUIWebBrowser * activeBrowser(void)
MythUIButtonList * m_pageList
void slotLoadStarted(void)
void slotTabSelected(MythUIButtonListItem *item)
void slotOpenURL(const QString &url)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void slotAddBookmark(void)
MythUIProgressBar * m_progressBar
void slotTitleChanged(const QString &title)
void switchTab(int newTab)
QList< WebPage * > m_browserList
MythDialogBox * m_menuPopup
bool Create(void) override
void slotEnterURL(void) const
Basic menu dialog, message and a list of options.
void AddButton(const QString &title)
void SetReturnEvent(QObject *retobject, const QString &resultid)
bool Create(void) override
void Assign(const QImage &img)
int DecrRef(void) override
Decrements reference count and deletes on 0.
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
MythScreenStack * GetScreenStack() const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
Dialog prompting the user to enter a text string.
virtual void SetText(const QString &text)
void SetEnabled(bool enable)
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
void LoadPage(const QUrl &url)
Loads the specified url and displays it.
void ZoomIn(void)
Increase the text size.
void Back(void)
Got backward in page history.
void ZoomOut(void)
Decrease the text size.
QUrl GetUrl(void)
Gets the current page's url.
void Forward(void)
Got forward in page history.
void loadProgress(int progress)
void loadFinished(bool OK)
void statusBarMessage(const QString &text)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythPainter * GetMythPainter(void)
MythMainWindow * GetMythMainWindow(void)
MythUIHelper * GetMythUI()
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)