Go to the documentation of this file.
50 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
109 msg = tr(
"This is the command that will be used to show the web browser. "
110 "Use 'Internal' to use the built in web browser'. "
111 "%ZOOM% and %URL% will be replaced with the zoom level and URL list.");
115 msg = tr(
"This is the default text size that will be used. Valid values "
116 "for the Internal browser are from 0.3 to 5.0 with 1.0 being "
117 "normal size less than 1 is smaller and greater than 1 is "
118 "larger than normal size.");
122 msg = tr(
"If checked this will enable browser plugins if the 'Internal' "
123 "browser is being used.");
127 msg = tr(
"Exit without saving settings");
131 msg = tr(
"Save settings and Exit");
153 "Use the 'Add Bookmark' menu option to add new bookmarks"));
157 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
211 QString group = item->
GetText();
221 item2->SetText(site->
m_name,
"name");
222 item2->SetText(site->
m_url,
"url");
224 item2->DisplayState(
"yes",
"homepage");
225 item2->SetData(QVariant::fromValue(site));
234 auto selected = [](
auto *site){
return site && site->m_selected; };
246 for (
int i = 0; i < actions.size() && !handled; i++)
249 const QString&
action = actions[i];
254 QString label = tr(
"Actions");
290 else if (
action ==
"INFO")
302 site->m_selected =
true;
308 site->m_selected =
false;
312 else if (
action ==
"DELETE")
316 else if (
action ==
"EDIT")
353 urls.append(site->m_url);
355 if (cmd.toLower() ==
"internal")
360 if (urls[0].startsWith(
"mythflash://"))
365 if (mythbrowser->
Create())
377 cmd.replace(
"%ZOOM%", zoom);
378 cmd.replace(
"%URL%", urls.join(
" "));
380 cmd.replace(
"&",
"\\&");
381 cmd.replace(
";",
"\\;");
399 if (!item || !item->
GetData().isValid())
401 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
402 "Asked to edit a non existent bookmark!");
408 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
409 "Existing bookmark is invalid!");
424 if (editor->Create())
445 if (item && item->
GetData().isValid())
460 auto *config =
new BrowserConfig(mainStack,
"browserconfig");
462 if (config->Create())
473 if (item && item->
GetData().isValid())
499 QString message = tr(
"Are you sure you want to delete the selected bookmark?");
503 if (dialog->Create())
518 QString category =
"";
543 QString message = tr(
"Are you sure you want to delete the marked bookmarks?");
547 if (dialog->Create())
563 if (site && site->m_selected)
589 if (item && item->
GetData().isValid())
600 for (
const auto *site : std::as_const(
m_siteList))
602 if (site && site->m_selected)
603 urls.append(site->m_url);
606 if (cmd.toLower() ==
"internal")
610 auto *mythbrowser =
new MythBrowser(mainStack, urls);
612 if (mythbrowser->Create())
624 cmd.replace(
"%ZOOM%", zoom);
625 cmd.replace(
"%URL%", urls.join(
" "));
627 cmd.replace(
"&",
"\\&");
628 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.
static eu8 clamp(eu8 value, eu8 low, eu8 high)
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)