9 """ |
9 """ |
10 |
10 |
11 from PyQt6.QtCore import QUrl, pyqtSlot |
11 from PyQt6.QtCore import QUrl, pyqtSlot |
12 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox |
12 from PyQt6.QtWidgets import QComboBox, QDialog, QDialogButtonBox |
13 |
13 |
14 from eric7 import Preferences, Utilities |
14 from eric7 import Preferences |
15 from eric7.EricGui import EricPixmapCache |
15 from eric7.EricGui import EricPixmapCache |
16 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
16 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
|
17 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities |
17 |
18 |
18 from .Config import ConfigHgSchemes |
19 from .Config import ConfigHgSchemes |
19 from .Ui_HgNewProjectOptionsDialog import Ui_HgNewProjectOptionsDialog |
20 from .Ui_HgNewProjectOptionsDialog import Ui_HgNewProjectOptionsDialog |
20 |
21 |
21 |
22 |
47 ) |
48 ) |
48 self.vcsUrlPicker.setPathsList(vcsUrlHistory) |
49 self.vcsUrlPicker.setPathsList(vcsUrlHistory) |
49 self.vcsUrlClearHistoryButton.setIcon(EricPixmapCache.getIcon("editDelete")) |
50 self.vcsUrlClearHistoryButton.setIcon(EricPixmapCache.getIcon("editDelete")) |
50 self.vcsUrlPicker.setText("") |
51 self.vcsUrlPicker.setText("") |
51 |
52 |
52 ipath = Preferences.getMultiProject("Workspace") or Utilities.getHomeDir() |
53 ipath = Preferences.getMultiProject("Workspace") or OSUtilities.getHomeDir() |
53 self.__initPaths = [ |
54 self.__initPaths = [ |
54 Utilities.fromNativeSeparators(ipath), |
55 FileSystemUtilities.fromNativeSeparators(ipath), |
55 Utilities.fromNativeSeparators(ipath) + "/", |
56 FileSystemUtilities.fromNativeSeparators(ipath) + "/", |
56 ] |
57 ] |
57 self.vcsProjectDirPicker.setText(self.__initPaths[0]) |
58 self.vcsProjectDirPicker.setText(self.__initPaths[0]) |
58 |
59 |
59 self.lfNoteLabel.setVisible(self.__vcs.isExtensionActive("largefiles")) |
60 self.lfNoteLabel.setVisible(self.__vcs.isExtensionActive("largefiles")) |
60 self.largeCheckBox.setVisible(self.__vcs.isExtensionActive("largefiles")) |
61 self.largeCheckBox.setVisible(self.__vcs.isExtensionActive("largefiles")) |
70 Private slot to handle a change of the project directory. |
71 Private slot to handle a change of the project directory. |
71 |
72 |
72 @param txt name of the project directory (string) |
73 @param txt name of the project directory (string) |
73 """ |
74 """ |
74 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
75 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
75 bool(txt) and Utilities.fromNativeSeparators(txt) not in self.__initPaths |
76 bool(txt) |
|
77 and FileSystemUtilities.fromNativeSeparators(txt) not in self.__initPaths |
76 ) |
78 ) |
77 |
79 |
78 @pyqtSlot(str) |
80 @pyqtSlot(str) |
79 def on_vcsUrlPicker_textChanged(self, txt): |
81 def on_vcsUrlPicker_textChanged(self, txt): |
80 """ |
82 """ |