src/eric7/WebBrowser/Download/DownloadManagerButton.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
18 18
19 class DownloadManagerButton(EricToolButton): 19 class DownloadManagerButton(EricToolButton):
20 """ 20 """
21 Class implementing a tool button for the download manager. 21 Class implementing a tool button for the download manager.
22 """ 22 """
23
23 def __init__(self, parent=None): 24 def __init__(self, parent=None):
24 """ 25 """
25 Constructor 26 Constructor
26 27
27 @param parent reference to the parent widget 28 @param parent reference to the parent widget
28 @type QWidget 29 @type QWidget
29 """ 30 """
30 super().__init__(parent) 31 super().__init__(parent)
31 32
32 self.__manager = WebBrowserWindow.downloadManager() 33 self.__manager = WebBrowserWindow.downloadManager()
33 34
34 self.setObjectName("navigation_download_manager_button") 35 self.setObjectName("navigation_download_manager_button")
35 self.setIcon(UI.PixmapCache.getIcon("downloads")) 36 self.setIcon(UI.PixmapCache.getIcon("downloads"))
36 self.setToolTip(self.tr("Open Download Manager")) 37 self.setToolTip(self.tr("Open Download Manager"))
37 self.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) 38 self.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly)
38 self.setFocusPolicy(Qt.FocusPolicy.NoFocus) 39 self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
39 self.setAutoRaise(True) 40 self.setAutoRaise(True)
40 41
41 self.clicked.connect(self.__buttonClicked) 42 self.clicked.connect(self.__buttonClicked)
42 self.__manager.downloadsCountChanged.connect(self.__updateState) 43 self.__manager.downloadsCountChanged.connect(self.__updateState)
43 44
44 self.__updateState() 45 self.__updateState()
45 46
46 @pyqtSlot() 47 @pyqtSlot()
47 def __buttonClicked(self): 48 def __buttonClicked(self):
48 """ 49 """
49 Private slot handling a user clicking the button. 50 Private slot handling a user clicking the button.
50 """ 51 """
51 self.__manager.show() 52 self.__manager.show()
52 53
53 @pyqtSlot() 54 @pyqtSlot()
54 def __updateState(self): 55 def __updateState(self):
55 """ 56 """
56 Private slot to update the button state. 57 Private slot to update the button state.
57 """ 58 """

eric ide

mercurial