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  explicit BrowserConfig(MythScreenStack *parent, const char *name = nullptr)
40  : MythScreenType(parent, name) {}
41  ~BrowserConfig() override = default;
42 
43  bool Create(void) override; // MythScreenType
44  bool keyPressEvent(QKeyEvent *event) 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) {}
69  ~BookmarkManager() override;
70 
71  bool Create(void) override; // MythScreenType
72  bool keyPressEvent(QKeyEvent *event) 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  static 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
BrowserConfig::m_zoomEdit
MythUITextEdit * m_zoomEdit
Definition: bookmarkmanager.h:48
BookmarkManager::slotDoDeleteMarked
void slotDoDeleteMarked(bool doDelete)
Definition: bookmarkmanager.cpp:555
BookmarkManager::m_groupList
MythUIButtonList * m_groupList
Definition: bookmarkmanager.h:104
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
BrowserConfig::m_commandEdit
MythUITextEdit * m_commandEdit
Definition: bookmarkmanager.h:47
doDelete
bool doDelete
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:635
BrowserConfig::m_titleText
MythUIText * m_titleText
Definition: bookmarkmanager.h:51
BookmarkManager::m_savedBookmark
Bookmark m_savedBookmark
Definition: bookmarkmanager.h:101
BookmarkManager::slotDeleteCurrent
void slotDeleteCurrent(void)
Definition: bookmarkmanager.cpp:493
BookmarkManager::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: bookmarkmanager.cpp:247
MythScreenStack
Definition: mythscreenstack.h:16
BookmarkManager::slotEditDialogExited
void slotEditDialogExited(void)
Definition: bookmarkmanager.cpp:429
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:33
slots
unsigned int slots[4]
Definition: element.cpp:38
BookmarkManager::m_messageText
MythUIText * m_messageText
Definition: bookmarkmanager.h:105
BrowserConfig::m_cancelButton
MythUIButton * m_cancelButton
Definition: bookmarkmanager.h:55
BookmarkManager::BookmarkManager
BookmarkManager(MythScreenStack *parent, const char *name)
Definition: bookmarkmanager.h:67
Bookmark::m_url
QString m_url
Definition: bookmarkmanager.h:21
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
BookmarkManager::slotDoDeleteCurrent
void slotDoDeleteCurrent(bool doDelete)
Definition: bookmarkmanager.cpp:511
Bookmark::m_isHomepage
bool m_isHomepage
Definition: bookmarkmanager.h:22
BrowserConfig
Definition: bookmarkmanager.h:34
BookmarkManager::slotDeleteMarked
void slotDeleteMarked(void)
Definition: bookmarkmanager.cpp:537
Bookmark::m_sortName
QString m_sortName
Definition: bookmarkmanager.h:20
BookmarkManager::slotClearMarked
void slotClearMarked(void)
Definition: bookmarkmanager.cpp:645
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
BookmarkManager::slotSetHomepage
void slotSetHomepage(void)
Definition: bookmarkmanager.cpp:467
BookmarkManager::slotSettings
static void slotSettings(void)
Definition: bookmarkmanager.cpp:458
BookmarkManager::m_siteList
QList< Bookmark * > m_siteList
Definition: bookmarkmanager.h:99
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
Bookmark::m_selected
bool m_selected
Definition: bookmarkmanager.h:23
BookmarkManager::slotAddBookmark
void slotAddBookmark(void)
Definition: bookmarkmanager.cpp:483
BrowserConfig::BrowserConfig
BrowserConfig(MythScreenStack *parent, const char *name=nullptr)
Definition: bookmarkmanager.h:39
Bookmark::m_category
QString m_category
Definition: bookmarkmanager.h:18
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
Bookmark::Bookmark
Bookmark(void)=default
BookmarkManager::slotBrowserClosed
void slotBrowserClosed(void)
Definition: bookmarkmanager.cpp:638
Bookmark
Definition: bookmarkmanager.h:14
naturalCompare
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
Definition: mythmiscutil.cpp:1032
BrowserConfig::~BrowserConfig
~BrowserConfig() override=default
uint
unsigned int uint
Definition: compat.h:140
BookmarkManager::UpdateURLList
void UpdateURLList(void)
Definition: bookmarkmanager.cpp:202
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:16
BookmarkManager::m_menuPopup
MythDialogBox * m_menuPopup
Definition: bookmarkmanager.h:107
BrowserConfig::Create
bool Create(void) override
Definition: bookmarkmanager.cpp:26
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
BookmarkManager::Create
bool Create(void) override
Definition: bookmarkmanager.cpp:141
mythmiscutil.h
MythBrowser
Definition: mythbrowser.h:18
BookmarkManager::~BookmarkManager
~BookmarkManager() override
Definition: bookmarkmanager.cpp:180
BookmarkManager::GetMarkedCount
uint GetMarkedCount(void)
Definition: bookmarkmanager.cpp:234
BookmarkManager::slotShowMarked
void slotShowMarked(void)
Definition: bookmarkmanager.cpp:584
BookmarkManager::ReloadBookmarks
void ReloadBookmarks(void)
Definition: bookmarkmanager.cpp:434
BrowserConfig::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: bookmarkmanager.cpp:95
BookmarkManager
Definition: bookmarkmanager.h:63
Bookmark::operator==
bool operator==(const Bookmark &b) const
Definition: bookmarkmanager.h:25
BookmarkManager::m_bookmarkList
MythUIButtonList * m_bookmarkList
Definition: bookmarkmanager.h:103
BookmarkManager::slotShowCurrent
void slotShowCurrent(void)
Definition: bookmarkmanager.cpp:577
BookmarkManager::UpdateGroupList
void UpdateGroupList(void)
Definition: bookmarkmanager.cpp:186
BookmarkManager::slotGroupSelected
void slotGroupSelected(MythUIButtonListItem *item)
Definition: bookmarkmanager.cpp:335
Bookmark::m_name
QString m_name
Definition: bookmarkmanager.h:19
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
BookmarkManager::ShowEditDialog
void ShowEditDialog(bool edit)
Definition: bookmarkmanager.cpp:396
BrowserConfig::m_enablePluginsCheck
MythUICheckBox * m_enablePluginsCheck
Definition: bookmarkmanager.h:52
Bookmark::sortByName
static bool sortByName(Bookmark *a, Bookmark *b)
Definition: bookmarkmanager.h:29
BrowserConfig::m_descriptionText
MythUIText * m_descriptionText
Definition: bookmarkmanager.h:50
BrowserConfig::slotFocusChanged
void slotFocusChanged(void)
Definition: bookmarkmanager.cpp:103
BrowserConfig::slotSave
void slotSave(void)
Definition: bookmarkmanager.cpp:78
BrowserConfig::m_okButton
MythUIButton * m_okButton
Definition: bookmarkmanager.h:54
mythscreentype.h
BookmarkManager::slotEditBookmark
void slotEditBookmark(void)
Definition: bookmarkmanager.cpp:488
BookmarkManager::slotBookmarkClicked
void slotBookmarkClicked(MythUIButtonListItem *item)
Definition: bookmarkmanager.cpp:343