Go to the documentation of this file.
48 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
110 msg = tr(
"This is the command that will be used to show the web browser. "
111 "Use 'Internal' to use the built in web browser'. "
112 "%ZOOM% and %URL% will be replaced with the zoom level and URL list.");
116 msg = tr(
"This is the default text size that will be used. Valid values "
117 "for the Internal browser are from 0.3 to 5.0 with 1.0 being "
118 "normal size less than 1 is smaller and greater than 1 is "
119 "larger than normal size.");
123 msg = tr(
"If checked this will enable browser plugins if the 'Internal' "
124 "browser is being used.");
128 msg = tr(
"Exit without saving settings");
132 msg = tr(
"Save settings and Exit");
154 "Use the 'Add Bookmark' menu option to add new bookmarks"));
158 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
212 QString group = item->
GetText();
222 item2->SetText(site->
m_name,
"name");
223 item2->SetText(site->
m_url,
"url");
225 item2->DisplayState(
"yes",
"homepage");
226 item2->SetData(QVariant::fromValue(site));
235 auto selected = [](
auto *site){
return site && site->m_selected; };
247 for (
int i = 0; i < actions.size() && !handled; i++)
250 QString
action = actions[i];
255 QString label = tr(
"Actions");
291 else if (
action ==
"INFO")
303 site->m_selected =
true;
309 site->m_selected =
false;
313 else if (
action ==
"DELETE")
315 else if (
action ==
"EDIT")
350 urls.append(site->m_url);
352 if (cmd.toLower() ==
"internal")
357 if (urls[0].startsWith(
"mythflash://"))
362 if (mythbrowser->
Create())
372 cmd.replace(
"%ZOOM%", zoom);
373 cmd.replace(
"%URL%", urls.join(
" "));
375 cmd.replace(
"&",
"\\&");
376 cmd.replace(
";",
"\\;");
394 if (!item || !item->
GetData().isValid())
396 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
397 "Asked to edit a non existent bookmark!");
403 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
404 "Existing bookmark is invalid!");
419 if (editor->Create())
440 if (item && item->
GetData().isValid())
455 auto *config =
new BrowserConfig(mainStack,
"browserconfig");
457 if (config->Create())
468 if (item && item->
GetData().isValid())
494 QString message = tr(
"Are you sure you want to delete the selected bookmark?");
498 if (dialog->Create())
513 QString category =
"";
538 QString message = tr(
"Are you sure you want to delete the marked bookmarks?");
542 if (dialog->Create())
558 if (site && site->m_selected)
584 if (item && item->
GetData().isValid())
597 if (site && site->m_selected)
598 urls.append(site->m_url);
601 if (cmd.toLower() ==
"internal")
605 auto *mythbrowser =
new MythBrowser(mainStack, urls);
607 if (mythbrowser->Create())
617 cmd.replace(
"%ZOOM%", zoom);
618 cmd.replace(
"%URL%", urls.join(
" "));
620 cmd.replace(
"&",
"\\&");
621 cmd.replace(
";",
"\\;");
MythUITextEdit * m_zoomEdit
void slotDoDeleteMarked(bool doDelete)
MythScreenStack * GetMainStack()
MythUIButtonList * m_groupList
void SetReturnEvent(QObject *retobject, const QString &resultid)
MythUITextEdit * m_commandEdit
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
void slotDeleteCurrent(void)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool UpdateHomepageInDB(Bookmark *site)
virtual bool Create(void)
void slotEditDialogExited(void)
bool RemoveFromDB(Bookmark *site)
A text entry and edit widget.
MythUIText * m_messageText
MythUIButton * m_cancelButton
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
QString GetText(void) const
void slotDoDeleteCurrent(bool doDelete)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
void slotDeleteMarked(void)
void slotClearMarked(void)
MythUIType * GetFocusWidget(void) const
void SetText(const QString &text, bool moveCursor=true)
void slotSetHomepage(void)
static void slotSettings(void)
Site category, name and URL edit screen.
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
QList< Bookmark * > m_siteList
bool SetFocusWidget(MythUIType *widget=nullptr)
void AddButton(const QString &title)
Basic menu dialog, message and a list of options.
bool Create(void) override
void slotAddBookmark(void)
void BuildFocusList(void)
void slotBrowserClosed(void)
bool ResetHomepageFromDB()
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
int GetNumSetting(const QString &key, int defaultval=0)
MythDialogBox * m_menuPopup
bool Create(void) override
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool Create(void) override
Dialog asking for user confirmation. Ok and optional Cancel button.
void SetCheckState(MythUIStateType::StateType state)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
~BookmarkManager() override
uint GetMarkedCount(void)
void slotShowMarked(void)
void ReloadBookmarks(void)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
MythUIButtonList * m_bookmarkList
void slotShowCurrent(void)
@ kMSDontDisableDrawing
avoid disabling UI drawing
void UpdateGroupList(void)
void SaveSetting(const QString &key, int newValue)
void slotGroupSelected(MythUIButtonListItem *item)
void AllowInput(bool Allow)
MythUIStateType::StateType GetCheckState() const
int GetSiteList(QList< Bookmark * > &siteList)
void ShowEditDialog(bool edit)
MythUICheckBox * m_enablePluginsCheck
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythUIText * m_descriptionText
void slotFocusChanged(void)
MythUIButton * m_okButton
void slotEditBookmark(void)
QString GetSetting(const QString &key, const QString &defaultval="")
void slotBookmarkClicked(MythUIButtonListItem *item)