11 import os |
11 import os |
12 |
12 |
13 from PyQt6.QtCore import QDir, pyqtSlot |
13 from PyQt6.QtCore import QDir, pyqtSlot |
14 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
14 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
15 |
15 |
16 from E5Gui.E5PathPicker import E5PathPickerModes |
16 from E5Gui.EricPathPicker import EricPathPickerModes |
17 |
17 |
18 from .Ui_SvnNewProjectOptionsDialog import Ui_SvnNewProjectOptionsDialog |
18 from .Ui_SvnNewProjectOptionsDialog import Ui_SvnNewProjectOptionsDialog |
19 from .Config import ConfigSvnProtocols |
19 from .Config import ConfigSvnProtocols |
20 |
20 |
21 import Utilities |
21 import Utilities |
35 @param parent parent widget (QWidget) |
35 @param parent parent widget (QWidget) |
36 """ |
36 """ |
37 super().__init__(parent) |
37 super().__init__(parent) |
38 self.setupUi(self) |
38 self.setupUi(self) |
39 |
39 |
40 self.vcsProjectDirPicker.setMode(E5PathPickerModes.DIRECTORY_MODE) |
40 self.vcsProjectDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
41 self.vcsUrlPicker.setMode(E5PathPickerModes.DIRECTORY_MODE) |
41 self.vcsUrlPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
42 |
42 |
43 self.protocolCombo.addItems(ConfigSvnProtocols) |
43 self.protocolCombo.addItems(ConfigSvnProtocols) |
44 |
44 |
45 hd = Utilities.toNativeSeparators(QDir.homePath()) |
45 hd = Utilities.toNativeSeparators(QDir.homePath()) |
46 hd = os.path.join(hd, 'subversionroot') |
46 hd = os.path.join(hd, 'subversionroot') |
122 if protocol == "file://": |
122 if protocol == "file://": |
123 self.networkPath = self.vcsUrlPicker.text() |
123 self.networkPath = self.vcsUrlPicker.text() |
124 self.vcsUrlPicker.setText(self.localPath) |
124 self.vcsUrlPicker.setText(self.localPath) |
125 self.vcsUrlLabel.setText(self.tr("Pat&h:")) |
125 self.vcsUrlLabel.setText(self.tr("Pat&h:")) |
126 self.localProtocol = True |
126 self.localProtocol = True |
127 self.vcsUrlPicker.setMode(E5PathPickerModes.DIRECTORY_MODE) |
127 self.vcsUrlPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
128 else: |
128 else: |
129 if self.localProtocol: |
129 if self.localProtocol: |
130 self.localPath = self.vcsUrlPicker.text() |
130 self.localPath = self.vcsUrlPicker.text() |
131 self.vcsUrlPicker.setText(self.networkPath) |
131 self.vcsUrlPicker.setText(self.networkPath) |
132 self.vcsUrlLabel.setText(self.tr("&URL:")) |
132 self.vcsUrlLabel.setText(self.tr("&URL:")) |
133 self.localProtocol = False |
133 self.localProtocol = False |
134 self.vcsUrlPicker.setMode(E5PathPickerModes.CUSTOM_MODE) |
134 self.vcsUrlPicker.setMode(EricPathPickerModes.CUSTOM_MODE) |
135 |
135 |
136 @pyqtSlot(str) |
136 @pyqtSlot(str) |
137 def on_vcsUrlPicker_textChanged(self, txt): |
137 def on_vcsUrlPicker_textChanged(self, txt): |
138 """ |
138 """ |
139 Private slot to handle changes of the URL. |
139 Private slot to handle changes of the URL. |