Go to the documentation of this file.
49 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
108 msg = tr(
"This is the command that will be used to show the web browser. "
109 "Use 'Internal' to use the built in web browser'. "
110 "%ZOOM% and %URL% will be replaced with the zoom level and URL list.");
114 msg = tr(
"This is the default text size that will be used. Valid values "
115 "for the Internal browser are from 0.3 to 5.0 with 1.0 being "
116 "normal size less than 1 is smaller and greater than 1 is "
117 "larger than normal size.");
121 msg = tr(
"If checked this will enable browser plugins if the 'Internal' "
122 "browser is being used.");
126 msg = tr(
"Exit without saving settings");
130 msg = tr(
"Save settings and Exit");
152 "Use the 'Add Bookmark' menu option to add new bookmarks"));
156 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
210 QString group = item->
GetText();
220 item2->SetText(site->
m_name,
"name");
221 item2->SetText(site->
m_url,
"url");
223 item2->DisplayState(
"yes",
"homepage");
224 item2->SetData(QVariant::fromValue(site));
233 auto selected = [](
auto *site){
return site && site->m_selected; };
245 for (
int i = 0; i < actions.size() && !handled; i++)
248 const QString&
action = actions[i];
253 QString label = tr(
"Actions");
289 else if (
action ==
"INFO")
301 site->m_selected =
true;
307 site->m_selected =
false;
311 else if (
action ==
"DELETE")
315 else if (
action ==
"EDIT")
352 urls.append(site->m_url);
354 if (cmd.toLower() ==
"internal")
359 if (urls[0].startsWith(
"mythflash://"))
364 if (mythbrowser->
Create())
376 cmd.replace(
"%ZOOM%", zoom);
377 cmd.replace(
"%URL%", urls.join(
" "));
379 cmd.replace(
"&",
"\\&");
380 cmd.replace(
";",
"\\;");
398 if (!item || !item->
GetData().isValid())
400 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
401 "Asked to edit a non existent bookmark!");
407 LOG(VB_GENERAL, LOG_ERR,
"BookmarkManager: Something is wrong. "
408 "Existing bookmark is invalid!");
423 if (editor->Create())
444 if (item && item->
GetData().isValid())
459 auto *config =
new BrowserConfig(mainStack,
"browserconfig");
461 if (config->Create())
472 if (item && item->
GetData().isValid())
498 QString message = tr(
"Are you sure you want to delete the selected bookmark?");
502 if (dialog->Create())
517 QString category =
"";
542 QString message = tr(
"Are you sure you want to delete the marked bookmarks?");
546 if (dialog->Create())
562 if (site && site->m_selected)
588 if (item && item->
GetData().isValid())
599 for (
const auto *site : std::as_const(
m_siteList))
601 if (site && site->m_selected)
602 urls.append(site->m_url);
605 if (cmd.toLower() ==
"internal")
609 auto *mythbrowser =
new MythBrowser(mainStack, urls);
611 if (mythbrowser->Create())
623 cmd.replace(
"%ZOOM%", zoom);
624 cmd.replace(
"%URL%", urls.join(
" "));
626 cmd.replace(
"&",
"\\&");
627 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)