src/eric7/WebBrowser/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationDialog.py

branch
eric7
changeset 10436
f6881d10e995
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
28 28
29 def __init__(self, manager, parent=None): 29 def __init__(self, manager, parent=None):
30 """ 30 """
31 Constructor 31 Constructor
32 32
33 @param manager reference to the manager object (GreaseMonkeyManager) 33 @param manager reference to the manager object
34 @param parent reference to the parent widget (QWidget) 34 @type GreaseMonkeyManager
35 @param parent reference to the parent widget
36 @type QWidget
35 """ 37 """
36 super().__init__(parent) 38 super().__init__(parent)
37 self.setupUi(self) 39 self.setupUi(self)
38 self.setWindowFlags(Qt.WindowType.Window) 40 self.setWindowFlags(Qt.WindowType.Window)
39 41
56 @pyqtSlot(str) 58 @pyqtSlot(str)
57 def on_downloadLabel_linkActivated(self, link): 59 def on_downloadLabel_linkActivated(self, link):
58 """ 60 """
59 Private slot to open the greasyfork.org web site. 61 Private slot to open the greasyfork.org web site.
60 62
61 @param link URL (string) 63 @param link URL
64 @type str
62 """ 65 """
63 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow 66 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
64 67
65 if not link or "userscript.org" in link: 68 if not link or "userscript.org" in link:
66 # userscript.org is down, default to Greasy Fork. 69 # userscript.org is down, default to Greasy Fork.
71 @pyqtSlot(QListWidgetItem) 74 @pyqtSlot(QListWidgetItem)
72 def on_scriptsList_itemDoubleClicked(self, item): 75 def on_scriptsList_itemDoubleClicked(self, item):
73 """ 76 """
74 Private slot to show information about the selected script. 77 Private slot to show information about the selected script.
75 78
76 @param item reference to the double clicked item (QListWidgetItem) 79 @param item reference to the double clicked item
80 @type QListWidgetItem
77 """ 81 """
78 from .GreaseMonkeyConfigurationScriptInfoDialog import ( 82 from .GreaseMonkeyConfigurationScriptInfoDialog import (
79 GreaseMonkeyConfigurationScriptInfoDialog, 83 GreaseMonkeyConfigurationScriptInfoDialog,
80 ) 84 )
81 85
131 135
132 def __getScript(self, itm): 136 def __getScript(self, itm):
133 """ 137 """
134 Private method to get the script for the given item. 138 Private method to get the script for the given item.
135 139
136 @param itm item to get script for (QListWidgetItem) 140 @param itm item to get script for
137 @return reference to the script object (GreaseMonkeyScript) 141 @type QListWidgetItem
142 @return reference to the script object
143 @rtype GreaseMonkeyScript
138 """ 144 """
139 if itm is None: 145 if itm is None:
140 return None 146 return None
141 147
142 script = itm.data(GreaseMonkeyConfigurationDialog.ScriptRole) 148 script = itm.data(GreaseMonkeyConfigurationDialog.ScriptRole)
144 150
145 def __removeItem(self, itm): 151 def __removeItem(self, itm):
146 """ 152 """
147 Private slot to remove a script item. 153 Private slot to remove a script item.
148 154
149 @param itm item to be removed (QListWidgetItem) 155 @param itm item to be removed
156 @type QListWidgetItem
150 """ 157 """
151 script = self.__getScript(itm) 158 script = self.__getScript(itm)
152 if script is None: 159 if script is None:
153 return 160 return
154 161
165 172
166 def __itemChanged(self, itm): 173 def __itemChanged(self, itm):
167 """ 174 """
168 Private slot to handle changes of a script item. 175 Private slot to handle changes of a script item.
169 176
170 @param itm changed item (QListWidgetItem) 177 @param itm changed item
178 @type QListWidgetItem
171 """ 179 """
172 script = self.__getScript(itm) 180 script = self.__getScript(itm)
173 if script is None: 181 if script is None:
174 return 182 return
175 183

eric ide

mercurial