78 |
79 |
79 def addFeed(self, urlString, title, icon): |
80 def addFeed(self, urlString, title, icon): |
80 """ |
81 """ |
81 Public method to add a feed. |
82 Public method to add a feed. |
82 |
83 |
83 @param urlString URL of the feed (string) |
84 @param urlString URL of the feed |
84 @param title title of the feed (string) |
85 @type str |
85 @param icon icon for the feed (QIcon) |
86 @param title title of the feed |
86 @return flag indicating a successful addition of the feed (boolean) |
87 @type str |
|
88 @param icon icon for the feed |
|
89 @type QIcon |
|
90 @return flag indicating a successful addition of the feed |
|
91 @rtype bool |
87 """ |
92 """ |
88 if urlString == "": |
93 if urlString == "": |
89 return False |
94 return False |
90 |
95 |
91 if not self.__loaded: |
96 if not self.__loaded: |
108 def __addFeedItem(self, feed): |
113 def __addFeedItem(self, feed): |
109 """ |
114 """ |
110 Private slot to add a top level feed item. |
115 Private slot to add a top level feed item. |
111 |
116 |
112 @param feed tuple containing feed info (URL, title, icon) |
117 @param feed tuple containing feed info (URL, title, icon) |
113 (string, string, QIcon) |
118 @type tuple of (str, str, QIcon) |
114 """ |
119 """ |
115 itm = QTreeWidgetItem(self.feedsTree, [feed[1]]) |
120 itm = QTreeWidgetItem(self.feedsTree, [feed[1]]) |
116 itm.setIcon(0, feed[2]) |
121 itm.setIcon(0, feed[2]) |
117 itm.setData(0, FeedsManager.UrlStringRole, feed[0]) |
122 itm.setData(0, FeedsManager.UrlStringRole, feed[0]) |
118 |
123 |
252 |
257 |
253 def __reloadFeed(self, itm): |
258 def __reloadFeed(self, itm): |
254 """ |
259 """ |
255 Private method to reload the given feed. |
260 Private method to reload the given feed. |
256 |
261 |
257 @param itm feed item to be reloaded (QTreeWidgetItem) |
262 @param itm feed item to be reloaded |
|
263 @type QTreeWidgetItem |
258 """ |
264 """ |
259 urlString = itm.data(0, FeedsManager.UrlStringRole) |
265 urlString = itm.data(0, FeedsManager.UrlStringRole) |
260 if urlString == "": |
266 if urlString == "": |
261 return |
267 return |
262 |
268 |
371 @pyqtSlot(QTreeWidgetItem, int) |
378 @pyqtSlot(QTreeWidgetItem, int) |
372 def __itemActivated(self, itm, column): |
379 def __itemActivated(self, itm, column): |
373 """ |
380 """ |
374 Private slot to handle the activation of an item. |
381 Private slot to handle the activation of an item. |
375 |
382 |
376 @param itm reference to the activated item (QTreeWidgetItem) |
383 @param itm reference to the activated item |
377 @param column column of the activation (integer) |
384 @type QTreeWidgetItem |
|
385 @param column column of the activation |
|
386 @type int |
378 """ |
387 """ |
379 if self.feedsTree.indexOfTopLevelItem(itm) != -1: |
388 if self.feedsTree.indexOfTopLevelItem(itm) != -1: |
380 return |
389 return |
381 |
390 |
382 if QApplication.keyboardModifiers() & Qt.KeyboardModifier.ControlModifier: |
391 if QApplication.keyboardModifiers() & Qt.KeyboardModifier.ControlModifier: |