eric6/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
34 @param vcs reference to the vcs object 34 @param vcs reference to the vcs object
35 @param parent parent widget (QWidget) 35 @param parent parent widget (QWidget)
36 """ 36 """
37 super(SvnChangeListsDialog, self).__init__(parent) 37 super(SvnChangeListsDialog, self).__init__(parent)
38 self.setupUi(self) 38 self.setupUi(self)
39 self.setWindowFlags(Qt.Window) 39 self.setWindowFlags(Qt.WindowType.Window)
40 40
41 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 41 self.buttonBox.button(
42 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 42 QDialogButtonBox.StandardButton.Close).setEnabled(False)
43 self.buttonBox.button(
44 QDialogButtonBox.StandardButton.Cancel).setDefault(True)
43 45
44 self.vcs = vcs 46 self.vcs = vcs
45 47
46 self.process = QProcess() 48 self.process = QProcess()
47 self.process.finished.connect(self.__procFinished) 49 self.process.finished.connect(self.__procFinished)
128 Private slot called when the process finished or the user pressed 130 Private slot called when the process finished or the user pressed
129 the button. 131 the button.
130 """ 132 """
131 if ( 133 if (
132 self.process is not None and 134 self.process is not None and
133 self.process.state() != QProcess.NotRunning 135 self.process.state() != QProcess.ProcessState.NotRunning
134 ): 136 ):
135 self.process.terminate() 137 self.process.terminate()
136 QTimer.singleShot(2000, self.process.kill) 138 QTimer.singleShot(2000, self.process.kill)
137 self.process.waitForFinished(3000) 139 self.process.waitForFinished(3000)
138 140
139 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 141 self.buttonBox.button(
140 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) 142 QDialogButtonBox.StandardButton.Close).setEnabled(True)
141 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 143 self.buttonBox.button(
144 QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
145 self.buttonBox.button(
146 QDialogButtonBox.StandardButton.Close).setDefault(True)
142 147
143 self.inputGroup.setEnabled(False) 148 self.inputGroup.setEnabled(False)
144 self.inputGroup.hide() 149 self.inputGroup.hide()
145 150
146 if len(self.changeListsDict) == 0: 151 if len(self.changeListsDict) == 0:
147 self.changeLists.addItem(self.tr("No changelists found")) 152 self.changeLists.addItem(self.tr("No changelists found"))
148 self.buttonBox.button(QDialogButtonBox.Close).setFocus( 153 self.buttonBox.button(
149 Qt.OtherFocusReason) 154 QDialogButtonBox.StandardButton.Close).setFocus(
155 Qt.FocusReason.OtherFocusReason)
150 else: 156 else:
151 self.changeLists.addItems(sorted(self.changeListsDict.keys())) 157 self.changeLists.addItems(sorted(self.changeListsDict.keys()))
152 self.changeLists.setCurrentRow(0) 158 self.changeLists.setCurrentRow(0)
153 self.changeLists.setFocus(Qt.OtherFocusReason) 159 self.changeLists.setFocus(Qt.FocusReason.OtherFocusReason)
154 160
155 def on_buttonBox_clicked(self, button): 161 def on_buttonBox_clicked(self, button):
156 """ 162 """
157 Private slot called by a button of the button box clicked. 163 Private slot called by a button of the button box clicked.
158 164
159 @param button button that was clicked (QAbstractButton) 165 @param button button that was clicked (QAbstractButton)
160 """ 166 """
161 if button == self.buttonBox.button(QDialogButtonBox.Close): 167 if button == self.buttonBox.button(
168 QDialogButtonBox.StandardButton.Close
169 ):
162 self.close() 170 self.close()
163 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): 171 elif button == self.buttonBox.button(
172 QDialogButtonBox.StandardButton.Cancel
173 ):
164 self.__finish() 174 self.__finish()
165 175
166 def __procFinished(self, exitCode, exitStatus): 176 def __procFinished(self, exitCode, exitStatus):
167 """ 177 """
168 Private slot connected to the finished signal. 178 Private slot connected to the finished signal.
178 188
179 It reads the output of the process, formats it and inserts it into 189 It reads the output of the process, formats it and inserts it into
180 the contents pane. 190 the contents pane.
181 """ 191 """
182 if self.process is not None: 192 if self.process is not None:
183 self.process.setReadChannel(QProcess.StandardOutput) 193 self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput)
184 194
185 while self.process.canReadLine(): 195 while self.process.canReadLine():
186 s = str(self.process.readLine(), 196 s = str(self.process.readLine(),
187 Preferences.getSystem("IOEncoding"), 197 Preferences.getSystem("IOEncoding"),
188 'replace') 198 'replace')
234 Private slot to handle the password checkbox toggled. 244 Private slot to handle the password checkbox toggled.
235 245
236 @param isOn flag indicating the status of the check box (boolean) 246 @param isOn flag indicating the status of the check box (boolean)
237 """ 247 """
238 if isOn: 248 if isOn:
239 self.input.setEchoMode(QLineEdit.Password) 249 self.input.setEchoMode(QLineEdit.EchoMode.Password)
240 else: 250 else:
241 self.input.setEchoMode(QLineEdit.Normal) 251 self.input.setEchoMode(QLineEdit.EchoMode.Normal)
242 252
243 @pyqtSlot() 253 @pyqtSlot()
244 def on_sendButton_clicked(self): 254 def on_sendButton_clicked(self):
245 """ 255 """
246 Private slot to send the input to the subversion process. 256 Private slot to send the input to the subversion process.

eric ide

mercurial