eric6/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8149
3fefc0c430f2
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
41 self.__vcs = vcs 41 self.__vcs = vcs
42 42
43 vcsUrlHistory = self.__vcs.getPlugin().getPreferences( 43 vcsUrlHistory = self.__vcs.getPlugin().getPreferences(
44 "RepositoryUrlHistory") 44 "RepositoryUrlHistory")
45 self.vcsUrlPicker.setMode(E5PathPickerModes.DirectoryMode) 45 self.vcsUrlPicker.setMode(E5PathPickerModes.DirectoryMode)
46 self.vcsUrlPicker.setInsertPolicy(QComboBox.InsertAtTop) 46 self.vcsUrlPicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop)
47 self.vcsUrlPicker.setSizeAdjustPolicy( 47 self.vcsUrlPicker.setSizeAdjustPolicy(
48 QComboBox.AdjustToMinimumContentsLength) 48 QComboBox.SizeAdjustPolicy.AdjustToContents)
49 self.vcsUrlPicker.setPathsList(vcsUrlHistory) 49 self.vcsUrlPicker.setPathsList(vcsUrlHistory)
50 self.vcsUrlClearHistoryButton.setIcon( 50 self.vcsUrlClearHistoryButton.setIcon(
51 UI.PixmapCache.getIcon("editDelete")) 51 UI.PixmapCache.getIcon("editDelete"))
52 self.vcsUrlPicker.setText("") 52 self.vcsUrlPicker.setText("")
53 53
64 self.lfNoteLabel.setVisible( 64 self.lfNoteLabel.setVisible(
65 self.__vcs.isExtensionActive("largefiles")) 65 self.__vcs.isExtensionActive("largefiles"))
66 self.largeCheckBox.setVisible( 66 self.largeCheckBox.setVisible(
67 self.__vcs.isExtensionActive("largefiles")) 67 self.__vcs.isExtensionActive("largefiles"))
68 68
69 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 69 self.buttonBox.button(
70 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
70 71
71 msh = self.minimumSizeHint() 72 msh = self.minimumSizeHint()
72 self.resize(max(self.width(), msh.width()), msh.height()) 73 self.resize(max(self.width(), msh.width()), msh.height())
73 74
74 @pyqtSlot(str) 75 @pyqtSlot(str)
76 """ 77 """
77 Private slot to handle a change of the project directory. 78 Private slot to handle a change of the project directory.
78 79
79 @param txt name of the project directory (string) 80 @param txt name of the project directory (string)
80 """ 81 """
81 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( 82 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
82 bool(txt) and 83 bool(txt) and
83 Utilities.fromNativeSeparators(txt) not in self.__initPaths) 84 Utilities.fromNativeSeparators(txt) not in self.__initPaths)
84 85
85 @pyqtSlot(str) 86 @pyqtSlot(str)
86 def on_vcsUrlPicker_textChanged(self, txt): 87 def on_vcsUrlPicker_textChanged(self, txt):
89 90
90 @param txt current text of the line edit (string) 91 @param txt current text of the line edit (string)
91 """ 92 """
92 url = QUrl.fromUserInput(txt) 93 url = QUrl.fromUserInput(txt)
93 enable = url.isValid() and url.scheme() in ConfigHgSchemes 94 enable = url.isValid() and url.scheme() in ConfigHgSchemes
94 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 95 self.buttonBox.button(
96 QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
95 97
96 self.vcsUrlPicker.setPickerEnabled(url.scheme() == "file" or 98 self.vcsUrlPicker.setPickerEnabled(url.scheme() == "file" or
97 len(txt) == 0) 99 len(txt) == 0)
98 100
99 @pyqtSlot() 101 @pyqtSlot()
117 """ 119 """
118 self.__saveHistory() 120 self.__saveHistory()
119 121
120 url = QUrl.fromUserInput(self.vcsUrlPicker.text().replace("\\", "/")) 122 url = QUrl.fromUserInput(self.vcsUrlPicker.text().replace("\\", "/"))
121 vcsdatadict = { 123 vcsdatadict = {
122 "url": url.toString(QUrl.None_), 124 "url": url.toString(QUrl.UrlFormattingOption.None_),
123 "revision": self.vcsRevisionEdit.text(), 125 "revision": self.vcsRevisionEdit.text(),
124 "largefiles": self.largeCheckBox.isChecked(), 126 "largefiles": self.largeCheckBox.isChecked(),
125 } 127 }
126 return (self.vcsProjectDirPicker.text(), vcsdatadict) 128 return (self.vcsProjectDirPicker.text(), vcsdatadict)
127 129

eric ide

mercurial