src/eric7/WebBrowser/Feeds/FeedsManager.py

branch
eric7
changeset 10436
f6881d10e995
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
44 44
45 def __init__(self, parent=None): 45 def __init__(self, parent=None):
46 """ 46 """
47 Constructor 47 Constructor
48 48
49 @param parent reference to the parent widget (QWidget) 49 @param parent reference to the parent widget
50 @type QWidget
50 """ 51 """
51 super().__init__(parent) 52 super().__init__(parent)
52 self.setupUi(self) 53 self.setupUi(self)
53 self.setWindowFlags(Qt.WindowType.Window) 54 self.setWindowFlags(Qt.WindowType.Window)
54 55
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
331 337
332 def __customContextMenuRequested(self, pos): # noqa: U100 338 def __customContextMenuRequested(self, pos): # noqa: U100
333 """ 339 """
334 Private slot to handle the context menu request for the feeds tree. 340 Private slot to handle the context menu request for the feeds tree.
335 341
336 @param pos position the context menu was requested (QPoint) 342 @param pos position the context menu was requested
343 @type QPoint
337 """ 344 """
338 itm = self.feedsTree.currentItem() 345 itm = self.feedsTree.currentItem()
339 if itm is None: 346 if itm is None:
340 return 347 return
341 348
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:

eric ide

mercurial