eric6/PluginManager/PluginInfoDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
25 @param pluginManager reference to the plugin manager object 25 @param pluginManager reference to the plugin manager object
26 @param parent parent of this dialog (QWidget) 26 @param parent parent of this dialog (QWidget)
27 """ 27 """
28 super(PluginInfoDialog, self).__init__(parent) 28 super(PluginInfoDialog, self).__init__(parent)
29 self.setupUi(self) 29 self.setupUi(self)
30 self.setWindowFlags(Qt.Window) 30 self.setWindowFlags(Qt.WindowType.Window)
31 31
32 self.pm = pluginManager 32 self.pm = pluginManager
33 33
34 self.__autoActivateColumn = 3 34 self.__autoActivateColumn = 3
35 self.__activeColumn = 4 35 self.__activeColumn = 4
36 36
37 self.pluginList.headerItem().setText(self.pluginList.columnCount(), "") 37 self.pluginList.headerItem().setText(self.pluginList.columnCount(), "")
38 38
39 # populate the list 39 # populate the list
40 self.__populateList() 40 self.__populateList()
41 self.pluginList.sortByColumn(0, Qt.AscendingOrder) 41 self.pluginList.sortByColumn(0, Qt.SortOrder.AscendingOrder)
42 42
43 self.__menu = QMenu(self) 43 self.__menu = QMenu(self)
44 self.__menu.addAction(self.tr('Show details'), self.__showDetails) 44 self.__menu.addAction(self.tr('Show details'), self.__showDetails)
45 self.__activateAct = self.__menu.addAction( 45 self.__activateAct = self.__menu.addAction(
46 self.tr('Activate'), self.__activatePlugin) 46 self.tr('Activate'), self.__activatePlugin)
47 self.__deactivateAct = self.__menu.addAction( 47 self.__deactivateAct = self.__menu.addAction(
48 self.tr('Deactivate'), self.__deactivatePlugin) 48 self.tr('Deactivate'), self.__deactivatePlugin)
49 self.pluginList.setContextMenuPolicy(Qt.CustomContextMenu) 49 self.pluginList.setContextMenuPolicy(
50 Qt.ContextMenuPolicy.CustomContextMenu)
50 self.pluginList.customContextMenuRequested.connect( 51 self.pluginList.customContextMenuRequested.connect(
51 self.__showContextMenu) 52 self.__showContextMenu)
52 53
53 def __populateList(self): 54 def __populateList(self):
54 """ 55 """
79 ] 80 ]
80 itm = QTreeWidgetItem(self.pluginList, infoList) 81 itm = QTreeWidgetItem(self.pluginList, infoList)
81 if info["error"]: 82 if info["error"]:
82 # plugin error 83 # plugin error
83 for col in range(self.pluginList.columnCount()): 84 for col in range(self.pluginList.columnCount()):
84 itm.setForeground(col, QBrush(Qt.red)) 85 itm.setForeground(col, QBrush(Qt.GlobalColor.red))
85 itm.setTextAlignment(self.__autoActivateColumn, Qt.AlignHCenter) 86 itm.setTextAlignment(self.__autoActivateColumn,
86 itm.setTextAlignment(self.__activeColumn, Qt.AlignHCenter) 87 Qt.AlignmentFlag.AlignHCenter)
88 itm.setTextAlignment(self.__activeColumn,
89 Qt.AlignmentFlag.AlignHCenter)
87 90
88 self.pluginList.header().resizeSections(QHeaderView.ResizeToContents) 91 self.pluginList.header().resizeSections(
92 QHeaderView.ResizeMode.ResizeToContents)
89 self.pluginList.header().setStretchLastSection(True) 93 self.pluginList.header().setStretchLastSection(True)
90 94
91 def __showContextMenu(self, coord): 95 def __showContextMenu(self, coord):
92 """ 96 """
93 Private slot to show the context menu of the listview. 97 Private slot to show the context menu of the listview.

eric ide

mercurial