MythTV  master
bookmarkmanager.h
Go to the documentation of this file.
1 #ifndef BOOKMARKMANAGER_H
2 #define BOOKMARKMANAGER_H
3 
4 // MythTV
7 
8 class MythBrowser;
9 class MythDialogBox;
10 
11 class Bookmark
12 {
13  public:
14  Bookmark(void) = default;
15 
16  QString m_category;
17  QString m_name;
18  QString m_sortName;
19  QString m_url;
20  bool m_isHomepage {false};
21  bool m_selected {false};
22 
23  inline bool operator == (const Bookmark &b) const
24  {
25  return m_category == b.m_category && m_name == b.m_name && m_url == b.m_url;
26  }
27  static inline bool sortByName(Bookmark *a, Bookmark *b)
28  { return StringUtil::naturalCompare(a->m_sortName, b->m_sortName) < 0; }
29 };
30 
32 {
33  Q_OBJECT
34 
35  public:
36 
37  explicit BrowserConfig(MythScreenStack *parent, const char *name = nullptr)
38  : MythScreenType(parent, name) {}
39  ~BrowserConfig() override = default;
40 
41  bool Create(void) override; // MythScreenType
42  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
43 
44  private:
47 
49  MythUIText *m_titleText {nullptr};
51 
54 
55  private slots:
56  void slotSave(void);
57  void slotFocusChanged(void);
58 };
59 
61 {
62  Q_OBJECT
63 
64  public:
65  BookmarkManager(MythScreenStack *parent, const char *name)
66  : MythScreenType(parent, name) {}
67  ~BookmarkManager() override;
68 
69  bool Create(void) override; // MythScreenType
70  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
71 
72  private slots:
75  void slotEditDialogExited(void);
76  void slotDoDeleteCurrent(bool doDelete);
77  void slotDoDeleteMarked(bool doDelete);
78  void slotBrowserClosed(void);
79 
80  static void slotSettings(void);
81  void slotSetHomepage(void);
82  void slotAddBookmark(void);
83  void slotEditBookmark(void);
84  void slotDeleteCurrent(void);
85  void slotDeleteMarked(void);
86  void slotShowCurrent(void);
87  void slotShowMarked(void);
88  void slotClearMarked(void);
89 
90  private:
91  uint GetMarkedCount(void);
92  void UpdateGroupList(void);
93  void UpdateURLList(void);
94  void ShowEditDialog(bool edit);
95  void ReloadBookmarks(void);
96 
97  QList<Bookmark*> m_siteList;
98 
100 
104 
106 };
107 
109 
110 #endif
BrowserConfig::m_zoomEdit
MythUITextEdit * m_zoomEdit
Definition: bookmarkmanager.h:46
BookmarkManager::slotDoDeleteMarked
void slotDoDeleteMarked(bool doDelete)
Definition: bookmarkmanager.cpp:549
BookmarkManager::m_groupList
MythUIButtonList * m_groupList
Definition: bookmarkmanager.h:102
BrowserConfig::m_commandEdit
MythUITextEdit * m_commandEdit
Definition: bookmarkmanager.h:45
BrowserConfig::m_titleText
MythUIText * m_titleText
Definition: bookmarkmanager.h:49
BookmarkManager::m_savedBookmark
Bookmark m_savedBookmark
Definition: bookmarkmanager.h:99
BookmarkManager::slotDeleteCurrent
void slotDeleteCurrent(void)
Definition: bookmarkmanager.cpp:487
BookmarkManager::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: bookmarkmanager.cpp:239
MythScreenStack
Definition: mythscreenstack.h:16
BookmarkManager::slotEditDialogExited
void slotEditDialogExited(void)
Definition: bookmarkmanager.cpp:423
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:34
BookmarkManager::m_messageText
MythUIText * m_messageText
Definition: bookmarkmanager.h:103
BrowserConfig::m_cancelButton
MythUIButton * m_cancelButton
Definition: bookmarkmanager.h:53
BookmarkManager::BookmarkManager
BookmarkManager(MythScreenStack *parent, const char *name)
Definition: bookmarkmanager.h:65
Bookmark::m_url
QString m_url
Definition: bookmarkmanager.h:19
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
BookmarkManager::slotDoDeleteCurrent
void slotDoDeleteCurrent(bool doDelete)
Definition: bookmarkmanager.cpp:505
Bookmark::m_isHomepage
bool m_isHomepage
Definition: bookmarkmanager.h:20
BrowserConfig
Definition: bookmarkmanager.h:31
BookmarkManager::slotDeleteMarked
void slotDeleteMarked(void)
Definition: bookmarkmanager.cpp:531
Bookmark::m_sortName
QString m_sortName
Definition: bookmarkmanager.h:18
BookmarkManager::slotClearMarked
void slotClearMarked(void)
Definition: bookmarkmanager.cpp:640
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(StandardSetting *)
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
BookmarkManager::slotSetHomepage
void slotSetHomepage(void)
Definition: bookmarkmanager.cpp:461
BookmarkManager::slotSettings
static void slotSettings(void)
Definition: bookmarkmanager.cpp:452
BookmarkManager::m_siteList
QList< Bookmark * > m_siteList
Definition: bookmarkmanager.h:97
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
Bookmark::m_selected
bool m_selected
Definition: bookmarkmanager.h:21
BookmarkManager::slotAddBookmark
void slotAddBookmark(void)
Definition: bookmarkmanager.cpp:477
BrowserConfig::BrowserConfig
BrowserConfig(MythScreenStack *parent, const char *name=nullptr)
Definition: bookmarkmanager.h:37
StringUtil::naturalCompare
MBASE_PUBLIC int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
This method chops the input a and b into pieces of digits and non-digits (a1.05 becomes a | 1 | .
Definition: stringutil.cpp:160
Bookmark::m_category
QString m_category
Definition: bookmarkmanager.h:16
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
stringutil.h
Bookmark::Bookmark
Bookmark(void)=default
BookmarkManager::slotBrowserClosed
void slotBrowserClosed(void)
Definition: bookmarkmanager.cpp:633
Bookmark
Definition: bookmarkmanager.h:11
BrowserConfig::~BrowserConfig
~BrowserConfig() override=default
uint
unsigned int uint
Definition: compat.h:79
BookmarkManager::UpdateURLList
void UpdateURLList(void)
Definition: bookmarkmanager.cpp:201
MythUICheckBox
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
Definition: mythuicheckbox.h:15
BookmarkManager::m_menuPopup
MythDialogBox * m_menuPopup
Definition: bookmarkmanager.h:105
BrowserConfig::Create
bool Create(void) override
Definition: bookmarkmanager.cpp:25
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
BookmarkManager::Create
bool Create(void) override
Definition: bookmarkmanager.cpp:140
MythBrowser
Definition: mythbrowser.h:18
BookmarkManager::~BookmarkManager
~BookmarkManager() override
Definition: bookmarkmanager.cpp:179
BookmarkManager::GetMarkedCount
uint GetMarkedCount(void)
Definition: bookmarkmanager.cpp:233
BookmarkManager::slotShowMarked
void slotShowMarked(void)
Definition: bookmarkmanager.cpp:578
BookmarkManager::ReloadBookmarks
void ReloadBookmarks(void)
Definition: bookmarkmanager.cpp:428
BrowserConfig::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: bookmarkmanager.cpp:94
BookmarkManager
Definition: bookmarkmanager.h:60
Bookmark::operator==
bool operator==(const Bookmark &b) const
Definition: bookmarkmanager.h:23
BookmarkManager::m_bookmarkList
MythUIButtonList * m_bookmarkList
Definition: bookmarkmanager.h:101
BookmarkManager::slotShowCurrent
void slotShowCurrent(void)
Definition: bookmarkmanager.cpp:571
BookmarkManager::UpdateGroupList
void UpdateGroupList(void)
Definition: bookmarkmanager.cpp:185
BookmarkManager::slotGroupSelected
void slotGroupSelected(MythUIButtonListItem *item)
Definition: bookmarkmanager.cpp:327
Bookmark::m_name
QString m_name
Definition: bookmarkmanager.h:17
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:191
BookmarkManager::ShowEditDialog
void ShowEditDialog(bool edit)
Definition: bookmarkmanager.cpp:388
BrowserConfig::m_enablePluginsCheck
MythUICheckBox * m_enablePluginsCheck
Definition: bookmarkmanager.h:50
Bookmark::sortByName
static bool sortByName(Bookmark *a, Bookmark *b)
Definition: bookmarkmanager.h:27
BrowserConfig::m_descriptionText
MythUIText * m_descriptionText
Definition: bookmarkmanager.h:48
BrowserConfig::slotFocusChanged
void slotFocusChanged(void)
Definition: bookmarkmanager.cpp:102
BrowserConfig::slotSave
void slotSave(void)
Definition: bookmarkmanager.cpp:77
BrowserConfig::m_okButton
MythUIButton * m_okButton
Definition: bookmarkmanager.h:52
mythscreentype.h
BookmarkManager::slotEditBookmark
void slotEditBookmark(void)
Definition: bookmarkmanager.cpp:482
BookmarkManager::slotBookmarkClicked
void slotBookmarkClicked(MythUIButtonListItem *item)
Definition: bookmarkmanager.cpp:335