MythTV  master
bookmarkmanager.h
Go to the documentation of this file.
1 #ifndef BOOKMARKMANAGER_H
2 #define BOOKMARKMANAGER_H
3 
4 // libmythbase
5 #include <mythmiscutil.h>
6 
7 // libmythui
8 #include <mythscreentype.h>
9 
10 class MythBrowser;
11 class MythDialogBox;
12 
13 class Bookmark
14 {
15  public:
16  Bookmark(void) = default;
17 
18  QString m_category;
19  QString m_name;
20  QString m_sortName;
21  QString m_url;
22  bool m_isHomepage {false};
23  bool m_selected {false};
24 
25  inline bool operator == (const Bookmark &b) const
26  {
27  return m_category == b.m_category && m_name == b.m_name && m_url == b.m_url;
28  }
29  static inline bool sortByName(Bookmark *a, Bookmark *b)
30  { return naturalCompare(a->m_sortName, b->m_sortName) < 0; }
31 };
32 
34 {
35  Q_OBJECT
36 
37  public:
38 
39  BrowserConfig(MythScreenStack *parent, const char *name = nullptr)
40  : MythScreenType(parent, name) {}
41  ~BrowserConfig() = default;
42 
43  bool Create(void) override; // MythScreenType
44  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
45 
46  private:
49 
51  MythUIText *m_titleText {nullptr};
53 
56 
57  private slots:
58  void slotSave(void);
59  void slotFocusChanged(void);
60 };
61 
63 {
64  Q_OBJECT
65 
66  public:
67  BookmarkManager(MythScreenStack *parent, const char *name)
68  : MythScreenType(parent, name) {}
70 
71  bool Create(void) override; // MythScreenType
72  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
73 
74  private slots:
77  void slotEditDialogExited(void);
78  void slotDoDeleteCurrent(bool doDelete);
79  void slotDoDeleteMarked(bool doDelete);
80  void slotBrowserClosed(void);
81 
82  void slotSettings(void);
83  void slotSetHomepage(void);
84  void slotAddBookmark(void);
85  void slotEditBookmark(void);
86  void slotDeleteCurrent(void);
87  void slotDeleteMarked(void);
88  void slotShowCurrent(void);
89  void slotShowMarked(void);
90  void slotClearMarked(void);
91 
92  private:
93  uint GetMarkedCount(void);
94  void UpdateGroupList(void);
95  void UpdateURLList(void);
96  void ShowEditDialog(bool edit);
97  void ReloadBookmarks(void);
98 
99  QList<Bookmark*> m_siteList;
100 
102 
106 
108 };
109 
111 
112 #endif
unsigned int slots[4]
Definition: element.c:38
void slotBrowserClosed(void)
MythUIButton * m_okButton
QList< Bookmark * > m_siteList
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythUIText * m_messageText
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
bool m_selected
QString m_name
Basic menu dialog, message and a list of options.
void slotAddBookmark(void)
MythUICheckBox * m_enablePluginsCheck
static bool sortByName(Bookmark *a, Bookmark *b)
MythUIText * m_descriptionText
unsigned int uint
Definition: compat.h:140
Q_DECLARE_METATYPE(GrabberScript *)
void slotBookmarkClicked(MythUIButtonListItem *item)
void UpdateGroupList(void)
MythDialogBox * m_menuPopup
BrowserConfig(MythScreenStack *parent, const char *name=nullptr)
MythUITextEdit * m_commandEdit
void ShowEditDialog(bool edit)
bool operator==(const Bookmark &b) const
void slotDoDeleteCurrent(bool doDelete)
MythUIButtonList * m_groupList
void slotSetHomepage(void)
unsigned char b
Definition: ParseText.cpp:329
bool Create(void) override
A text entry and edit widget.
~BrowserConfig()=default
void slotShowMarked(void)
QString m_sortName
bool keyPressEvent(QKeyEvent *) override
Key event handler.
bool keyPressEvent(QKeyEvent *) override
Key event handler.
void slotDoDeleteMarked(bool doDelete)
MythUIButtonList * m_bookmarkList
void slotShowCurrent(void)
const char * name
Definition: ParseText.cpp:328
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void ReloadBookmarks(void)
void slotGroupSelected(MythUIButtonListItem *item)
void slotFocusChanged(void)
void slotSave(void)
A single button widget.
Definition: mythuibutton.h:21
void slotClearMarked(void)
Bookmark m_savedBookmark
QString m_url
MythUIText * m_titleText
void slotEditDialogExited(void)
void UpdateURLList(void)
bool Create(void) override
void slotDeleteMarked(void)
uint GetMarkedCount(void)
void slotDeleteCurrent(void)
Screen in which all other widgets are contained and rendered.
MythUITextEdit * m_zoomEdit
void slotEditBookmark(void)
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
MythUIButton * m_cancelButton
bool m_isHomepage
void slotSettings(void)
BookmarkManager(MythScreenStack *parent, const char *name)
QString m_category
Bookmark(void)=default