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(
";",
"\\;");
int GetSiteList(QList< Bookmark * > &siteList)
bool RemoveFromDB(Bookmark *site)
bool UpdateHomepageInDB(Bookmark *site)
bool ResetHomepageFromDB()
Site category, name and URL edit screen.
void slotDeleteCurrent(void)
bool Create(void) override
void ShowEditDialog(bool edit)
MythUIButtonList * m_bookmarkList
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void slotClearMarked(void)
void ReloadBookmarks(void)
void slotShowMarked(void)
void slotGroupSelected(MythUIButtonListItem *item)
void slotAddBookmark(void)
void slotDoDeleteCurrent(bool doDelete)
MythUIButtonList * m_groupList
void slotEditBookmark(void)
void slotDeleteMarked(void)
void slotShowCurrent(void)
MythDialogBox * m_menuPopup
static void slotSettings(void)
void slotDoDeleteMarked(bool doDelete)
void slotBookmarkClicked(MythUIButtonListItem *item)
~BookmarkManager() override
void slotBrowserClosed(void)
void UpdateGroupList(void)
void slotEditDialogExited(void)
MythUIText * m_messageText
QList< Bookmark * > m_siteList
void slotSetHomepage(void)
uint GetMarkedCount(void)
MythUIButton * m_cancelButton
void slotFocusChanged(void)
bool Create(void) override
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUIButton * m_okButton
MythUITextEdit * m_zoomEdit
MythUIText * m_descriptionText
MythUICheckBox * m_enablePluginsCheck
MythUITextEdit * m_commandEdit
Dialog asking for user confirmation.
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
int GetNumSetting(const QString &key, int defaultval=0)
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
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)
void AllowInput(bool Allow)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
virtual bool Create(void)
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
void SetCheckState(MythUIStateType::StateType state)
MythUIStateType::StateType GetCheckState() const
A text entry and edit widget.
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
All purpose text widget, displays a text string.
virtual void SetText(const QString &text)
virtual void SetVisible(bool visible)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
@ kMSDontDisableDrawing
avoid disabling UI drawing
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
static eu8 clamp(eu8 value, eu8 low, eu8 high)