eric6/WebBrowser/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationDialog.py

changeset 7268
a28338eaf694
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7267:aedc309827c7 7268:a28338eaf694
12 from PyQt5.QtGui import QDesktopServices 12 from PyQt5.QtGui import QDesktopServices
13 from PyQt5.QtWidgets import QDialog, QListWidgetItem 13 from PyQt5.QtWidgets import QDialog, QListWidgetItem
14 14
15 from E5Gui import E5MessageBox 15 from E5Gui import E5MessageBox
16 16
17 from .Ui_GreaseMonkeyConfigurationDialog import \ 17 from .Ui_GreaseMonkeyConfigurationDialog import (
18 Ui_GreaseMonkeyConfigurationDialog 18 Ui_GreaseMonkeyConfigurationDialog
19 )
19 20
20 import UI.PixmapCache 21 import UI.PixmapCache
21 22
22 23
23 class GreaseMonkeyConfigurationDialog( 24 class GreaseMonkeyConfigurationDialog(
79 80
80 @param item reference to the double clicked item (QListWidgetItem) 81 @param item reference to the double clicked item (QListWidgetItem)
81 """ 82 """
82 script = self.__getScript(item) 83 script = self.__getScript(item)
83 if script is not None: 84 if script is not None:
84 from .GreaseMonkeyConfigurationScriptInfoDialog import \ 85 from .GreaseMonkeyConfigurationScriptInfoDialog import (
85 GreaseMonkeyConfigurationScriptInfoDialog 86 GreaseMonkeyConfigurationScriptInfoDialog
87 )
86 infoDlg = GreaseMonkeyConfigurationScriptInfoDialog(script, self) 88 infoDlg = GreaseMonkeyConfigurationScriptInfoDialog(script, self)
87 infoDlg.exec_() 89 infoDlg.exec_()
88 90
89 def __loadScripts(self): 91 def __loadScripts(self):
90 """ 92 """
120 topItem = self.scriptsList.item(row) 122 topItem = self.scriptsList.item(row)
121 bottomItem = self.scriptsList.item(row + 1) 123 bottomItem = self.scriptsList.item(row + 1)
122 if topItem is None or bottomItem is None: 124 if topItem is None or bottomItem is None:
123 continue 125 continue
124 126
125 if topItem.checkState() == Qt.Unchecked and \ 127 if (
126 bottomItem.checkState == Qt.Checked: 128 topItem.checkState() == Qt.Unchecked and
129 bottomItem.checkState == Qt.Checked
130 ):
127 itm = self.scriptsList.takeItem(row + 1) 131 itm = self.scriptsList.takeItem(row + 1)
128 self.scriptsList.insertItem(row, itm) 132 self.scriptsList.insertItem(row, itm)
129 itemMoved = True 133 itemMoved = True
130 134
131 def __getScript(self, itm): 135 def __getScript(self, itm):

eric ide

mercurial