35 @param text text to be shown by the label (string) |
35 @param text text to be shown by the label (string) |
36 @param parent parent widget (QWidget) |
36 @param parent parent widget (QWidget) |
37 """ |
37 """ |
38 super(SvnDialog, self).__init__(parent) |
38 super(SvnDialog, self).__init__(parent) |
39 self.setupUi(self) |
39 self.setupUi(self) |
40 self.setWindowFlags(Qt.Window) |
40 self.setWindowFlags(Qt.WindowType.Window) |
41 |
41 |
42 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) |
42 self.buttonBox.button( |
43 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
43 QDialogButtonBox.StandardButton.Close).setEnabled(False) |
|
44 self.buttonBox.button( |
|
45 QDialogButtonBox.StandardButton.Cancel).setDefault(True) |
44 |
46 |
45 self.process = None |
47 self.process = None |
46 self.username = '' |
48 self.username = '' |
47 self.password = '' |
49 self.password = '' |
48 |
50 |
53 Private slot called when the process finished or the user pressed the |
55 Private slot called when the process finished or the user pressed the |
54 button. |
56 button. |
55 """ |
57 """ |
56 if ( |
58 if ( |
57 self.process is not None and |
59 self.process is not None and |
58 self.process.state() != QProcess.NotRunning |
60 self.process.state() != QProcess.ProcessState.NotRunning |
59 ): |
61 ): |
60 self.process.terminate() |
62 self.process.terminate() |
61 QTimer.singleShot(2000, self.process.kill) |
63 QTimer.singleShot(2000, self.process.kill) |
62 self.process.waitForFinished(3000) |
64 self.process.waitForFinished(3000) |
63 |
65 |
64 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
66 self.buttonBox.button( |
65 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
67 QDialogButtonBox.StandardButton.Close).setEnabled(True) |
66 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
68 self.buttonBox.button( |
|
69 QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
|
70 self.buttonBox.button( |
|
71 QDialogButtonBox.StandardButton.Close).setDefault(True) |
67 |
72 |
68 self.inputGroup.setEnabled(False) |
73 self.inputGroup.setEnabled(False) |
69 self.inputGroup.hide() |
74 self.inputGroup.hide() |
70 |
75 |
71 self.process = None |
76 self.process = None |
72 |
77 |
73 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
78 self.buttonBox.button( |
74 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
79 QDialogButtonBox.StandardButton.Close).setEnabled(True) |
75 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
80 self.buttonBox.button( |
76 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
81 QDialogButtonBox.StandardButton.Cancel).setEnabled(False) |
77 Qt.OtherFocusReason) |
82 self.buttonBox.button( |
|
83 QDialogButtonBox.StandardButton.Close).setDefault(True) |
|
84 self.buttonBox.button( |
|
85 QDialogButtonBox.StandardButton.Close).setFocus( |
|
86 Qt.FocusReason.OtherFocusReason) |
78 |
87 |
79 if ( |
88 if ( |
80 Preferences.getVCS("AutoClose") and |
89 Preferences.getVCS("AutoClose") and |
81 self.normal and |
90 self.normal and |
82 self.errors.toPlainText() == "" |
91 self.errors.toPlainText() == "" |
87 """ |
96 """ |
88 Private slot called by a button of the button box clicked. |
97 Private slot called by a button of the button box clicked. |
89 |
98 |
90 @param button button that was clicked (QAbstractButton) |
99 @param button button that was clicked (QAbstractButton) |
91 """ |
100 """ |
92 if button == self.buttonBox.button(QDialogButtonBox.Close): |
101 if button == self.buttonBox.button( |
|
102 QDialogButtonBox.StandardButton.Close |
|
103 ): |
93 self.close() |
104 self.close() |
94 elif button == self.buttonBox.button(QDialogButtonBox.Cancel): |
105 elif button == self.buttonBox.button( |
|
106 QDialogButtonBox.StandardButton.Cancel |
|
107 ): |
95 self.__finish() |
108 self.__finish() |
96 |
109 |
97 def __procFinished(self, exitCode, exitStatus): |
110 def __procFinished(self, exitCode, exitStatus): |
98 """ |
111 """ |
99 Private slot connected to the finished signal. |
112 Private slot connected to the finished signal. |
100 |
113 |
101 @param exitCode exit code of the process (integer) |
114 @param exitCode exit code of the process (integer) |
102 @param exitStatus exit status of the process (QProcess.ExitStatus) |
115 @param exitStatus exit status of the process (QProcess.ExitStatus) |
103 """ |
116 """ |
104 self.normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0) |
117 self.normal = ( |
|
118 exitStatus == QProcess.ExitStatus.NormalExit and |
|
119 exitCode == 0 |
|
120 ) |
105 self.__finish() |
121 self.__finish() |
106 |
122 |
107 def startProcess(self, args, workingDir=None, setLanguage=False): |
123 def startProcess(self, args, workingDir=None, setLanguage=False): |
108 """ |
124 """ |
109 Public slot used to start the process. |
125 Public slot used to start the process. |
216 Private slot to handle the password checkbox toggled. |
232 Private slot to handle the password checkbox toggled. |
217 |
233 |
218 @param isOn flag indicating the status of the check box (boolean) |
234 @param isOn flag indicating the status of the check box (boolean) |
219 """ |
235 """ |
220 if isOn: |
236 if isOn: |
221 self.input.setEchoMode(QLineEdit.Password) |
237 self.input.setEchoMode(QLineEdit.EchoMode.Password) |
222 else: |
238 else: |
223 self.input.setEchoMode(QLineEdit.Normal) |
239 self.input.setEchoMode(QLineEdit.EchoMode.Normal) |
224 |
240 |
225 @pyqtSlot() |
241 @pyqtSlot() |
226 def on_sendButton_clicked(self): |
242 def on_sendButton_clicked(self): |
227 """ |
243 """ |
228 Private slot to send the input to the subversion process. |
244 Private slot to send the input to the subversion process. |