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 eric7 import Preferences, Utilities |
16 from eric7 import Preferences |
17 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
17 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
|
18 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities |
18 |
19 |
19 from .Config import ConfigSvnProtocols |
20 from .Config import ConfigSvnProtocols |
20 from .Ui_SvnNewProjectOptionsDialog import Ui_SvnNewProjectOptionsDialog |
21 from .Ui_SvnNewProjectOptionsDialog import Ui_SvnNewProjectOptionsDialog |
21 |
22 |
22 |
23 |
39 self.vcsProjectDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
40 self.vcsProjectDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
40 self.vcsUrlPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
41 self.vcsUrlPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) |
41 |
42 |
42 self.protocolCombo.addItems(ConfigSvnProtocols) |
43 self.protocolCombo.addItems(ConfigSvnProtocols) |
43 |
44 |
44 hd = Utilities.toNativeSeparators(QDir.homePath()) |
45 hd = FileSystemUtilities.toNativeSeparators(QDir.homePath()) |
45 hd = os.path.join(hd, "subversionroot") |
46 hd = os.path.join(hd, "subversionroot") |
46 self.vcsUrlPicker.setText(hd) |
47 self.vcsUrlPicker.setText(hd) |
47 |
48 |
48 self.vcs = vcs |
49 self.vcs = vcs |
49 |
50 |
50 self.localPath = hd |
51 self.localPath = hd |
51 self.networkPath = "localhost/" |
52 self.networkPath = "localhost/" |
52 self.localProtocol = True |
53 self.localProtocol = True |
53 |
54 |
54 ipath = Preferences.getMultiProject("Workspace") or Utilities.getHomeDir() |
55 ipath = Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |
55 self.__initPaths = [ |
56 self.__initPaths = [ |
56 Utilities.fromNativeSeparators(ipath), |
57 FileSystemUtilities.fromNativeSeparators(ipath), |
57 Utilities.fromNativeSeparators(ipath) + "/", |
58 FileSystemUtilities.fromNativeSeparators(ipath) + "/", |
58 ] |
59 ] |
59 self.vcsProjectDirPicker.setText(self.__initPaths[0]) |
60 self.vcsProjectDirPicker.setText(self.__initPaths[0]) |
60 |
61 |
61 self.resize(self.width(), self.minimumSizeHint().height()) |
62 self.resize(self.width(), self.minimumSizeHint().height()) |
62 |
63 |
71 Private slot to handle a change of the project directory. |
72 Private slot to handle a change of the project directory. |
72 |
73 |
73 @param txt name of the project directory (string) |
74 @param txt name of the project directory (string) |
74 """ |
75 """ |
75 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
76 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
76 bool(txt) and Utilities.fromNativeSeparators(txt) not in self.__initPaths |
77 bool(txt) |
|
78 and FileSystemUtilities.fromNativeSeparators(txt) not in self.__initPaths |
77 ) |
79 ) |
78 |
80 |
79 @pyqtSlot() |
81 @pyqtSlot() |
80 def on_vcsUrlPicker_pickerButtonClicked(self): |
82 def on_vcsUrlPicker_pickerButtonClicked(self): |
81 """ |
83 """ |