eric6/Plugins/VcsPlugins/vcsPySvn/SvnPropListDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
38 super(SvnPropListDialog, self).__init__(parent) 38 super(SvnPropListDialog, self).__init__(parent)
39 self.setupUi(self) 39 self.setupUi(self)
40 SvnDialogMixin.__init__(self) 40 SvnDialogMixin.__init__(self)
41 41
42 self.refreshButton = self.buttonBox.addButton( 42 self.refreshButton = self.buttonBox.addButton(
43 self.tr("Refresh"), QDialogButtonBox.ActionRole) 43 self.tr("Refresh"), QDialogButtonBox.ButtonRole.ActionRole)
44 self.refreshButton.setToolTip( 44 self.refreshButton.setToolTip(
45 self.tr("Press to refresh the properties display")) 45 self.tr("Press to refresh the properties display"))
46 self.refreshButton.setEnabled(False) 46 self.refreshButton.setEnabled(False)
47 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 47 self.buttonBox.button(
48 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 48 QDialogButtonBox.StandardButton.Close).setEnabled(False)
49 self.buttonBox.button(
50 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
49 51
50 self.vcs = vcs 52 self.vcs = vcs
51 53
52 self.propsList.headerItem().setText(self.propsList.columnCount(), "") 54 self.propsList.headerItem().setText(self.propsList.columnCount(), "")
53 self.propsList.header().setSortIndicator(0, Qt.AscendingOrder) 55 self.propsList.header().setSortIndicator(
56 0, Qt.SortOrder.AscendingOrder)
54 57
55 self.client = self.vcs.getClient() 58 self.client = self.vcs.getClient()
56 self.client.callback_cancel = self._clientCancelCallback 59 self.client.callback_cancel = self._clientCancelCallback
57 self.client.callback_get_login = self._clientLoginCallback 60 self.client.callback_get_login = self._clientLoginCallback
58 self.client.callback_ssl_server_trust_prompt = ( 61 self.client.callback_ssl_server_trust_prompt = (
69 72
70 def __resizeColumns(self): 73 def __resizeColumns(self):
71 """ 74 """
72 Private method to resize the list columns. 75 Private method to resize the list columns.
73 """ 76 """
74 self.propsList.header().resizeSections(QHeaderView.ResizeToContents) 77 self.propsList.header().resizeSections(
78 QHeaderView.ResizeMode.ResizeToContents)
75 self.propsList.header().setStretchLastSection(True) 79 self.propsList.header().setStretchLastSection(True)
76 80
77 def __generateItem(self, path, propName, propValue): 81 def __generateItem(self, path, propName, propValue):
78 """ 82 """
79 Private method to generate a properties item in the properties list. 83 Private method to generate a properties item in the properties list.
96 self.propsList.clear() 100 self.propsList.clear()
97 101
98 self.__args = fn 102 self.__args = fn
99 self.__recursive = recursive 103 self.__recursive = recursive
100 104
101 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 105 self.buttonBox.button(
102 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True) 106 QDialogButtonBox.StandardButton.Close).setEnabled(False)
103 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 107 self.buttonBox.button(
108 QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
109 self.buttonBox.button(
110 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
104 self.refreshButton.setEnabled(False) 111 self.refreshButton.setEnabled(False)
105 112
106 QApplication.processEvents() 113 QApplication.processEvents()
107 self.propsFound = False 114 self.propsFound = False
108 if isinstance(fn, list): 115 if isinstance(fn, list):
145 self.__generateItem("", self.tr("None"), "") 152 self.__generateItem("", self.tr("None"), "")
146 153
147 self.__resort() 154 self.__resort()
148 self.__resizeColumns() 155 self.__resizeColumns()
149 156
150 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 157 self.buttonBox.button(
151 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) 158 QDialogButtonBox.StandardButton.Close).setEnabled(True)
152 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 159 self.buttonBox.button(
160 QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
161 self.buttonBox.button(
162 QDialogButtonBox.StandardButton.Close).setDefault(True)
153 163
154 self.refreshButton.setEnabled(True) 164 self.refreshButton.setEnabled(True)
155 165
156 self._cancel() 166 self._cancel()
157 167
159 """ 169 """
160 Private slot called by a button of the button box clicked. 170 Private slot called by a button of the button box clicked.
161 171
162 @param button button that was clicked (QAbstractButton) 172 @param button button that was clicked (QAbstractButton)
163 """ 173 """
164 if button == self.buttonBox.button(QDialogButtonBox.Close): 174 if button == self.buttonBox.button(
175 QDialogButtonBox.StandardButton.Close
176 ):
165 self.close() 177 self.close()
166 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): 178 elif button == self.buttonBox.button(
179 QDialogButtonBox.StandardButton.Cancel
180 ):
167 self.__finish() 181 self.__finish()
168 elif button == self.refreshButton: 182 elif button == self.refreshButton:
169 self.on_refreshButton_clicked() 183 self.on_refreshButton_clicked()
170 184
171 @pyqtSlot() 185 @pyqtSlot()

eric ide

mercurial