Helpviewer/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationDialog.py

changeset 3002
6ffc581f00f1
parent 2954
bf0215fe12d1
child 3020
542e97d4ecb3
child 3057
10516539f238
equal deleted inserted replaced
3001:3674ff5fa8f8 3002:6ffc581f00f1
10 from PyQt4.QtCore import pyqtSlot, Qt, QUrl 10 from PyQt4.QtCore import pyqtSlot, Qt, QUrl
11 from PyQt4.QtGui import QDialog, QListWidgetItem, QDesktopServices 11 from PyQt4.QtGui import QDialog, QListWidgetItem, QDesktopServices
12 12
13 from E5Gui import E5MessageBox 13 from E5Gui import E5MessageBox
14 14
15 from .Ui_GreaseMonkeyConfigurationDialog import Ui_GreaseMonkeyConfigurationDialog 15 from .Ui_GreaseMonkeyConfigurationDialog import \
16 Ui_GreaseMonkeyConfigurationDialog
16 17
17 import UI.PixmapCache 18 import UI.PixmapCache
18 19
19 20
20 class GreaseMonkeyConfigurationDialog(QDialog, Ui_GreaseMonkeyConfigurationDialog): 21 class GreaseMonkeyConfigurationDialog(
22 QDialog, Ui_GreaseMonkeyConfigurationDialog):
21 """ 23 """
22 Class implementing the GreaseMonkey scripts configuration dialog. 24 Class implementing the GreaseMonkey scripts configuration dialog.
23 """ 25 """
24 ScriptVersionRole = Qt.UserRole 26 ScriptVersionRole = Qt.UserRole
25 ScriptDescriptionRole = Qt.UserRole + 1 27 ScriptDescriptionRole = Qt.UserRole + 1
33 @param parent reference to the parent widget (QWidget) 35 @param parent reference to the parent widget (QWidget)
34 """ 36 """
35 super().__init__(parent) 37 super().__init__(parent)
36 self.setupUi(self) 38 self.setupUi(self)
37 39
38 self.iconLabel.setPixmap(UI.PixmapCache.getPixmap("greaseMonkey48.png")) 40 self.iconLabel.setPixmap(
41 UI.PixmapCache.getPixmap("greaseMonkey48.png"))
39 42
40 self.__manager = manager 43 self.__manager = manager
41 44
42 self.__loadScripts() 45 self.__loadScripts()
43 46
47 @pyqtSlot() 50 @pyqtSlot()
48 def on_openDirectoryButton_clicked(self): 51 def on_openDirectoryButton_clicked(self):
49 """ 52 """
50 Private slot to open the GreaseMonkey scripts directory. 53 Private slot to open the GreaseMonkey scripts directory.
51 """ 54 """
52 QDesktopServices.openUrl(QUrl.fromLocalFile(self.__manager.scriptsDirectory())) 55 QDesktopServices.openUrl(
56 QUrl.fromLocalFile(self.__manager.scriptsDirectory()))
53 57
54 @pyqtSlot(str) 58 @pyqtSlot(str)
55 def on_downloadLabel_linkActivated(self, link): 59 def on_downloadLabel_linkActivated(self, link):
56 """ 60 """
57 Private slot to open the userscript.org web site. 61 Private slot to open the userscript.org web site.
137 if script is None: 141 if script is None:
138 return 142 return
139 143
140 removeIt = E5MessageBox.yesNo(self, 144 removeIt = E5MessageBox.yesNo(self,
141 self.trUtf8("Remove Script"), 145 self.trUtf8("Remove Script"),
142 self.trUtf8("""<p>Are you sure you want to remove <b>{0}</b>?</p>""") 146 self.trUtf8(
147 """<p>Are you sure you want to remove <b>{0}</b>?</p>""")
143 .format(script.name())) 148 .format(script.name()))
144 if removeIt and self.__manager.removeScript(script): 149 if removeIt and self.__manager.removeScript(script):
145 self.scriptsList.takeItem(self.scriptsList.row(itm)) 150 self.scriptsList.takeItem(self.scriptsList.row(itm))
146 del itm 151 del itm
147 152

eric ide

mercurial