Plugins/VcsPlugins/vcsGit/GitNewProjectOptionsDialog.py

changeset 6707
30f0ac20df50
parent 6703
31b0306f0ecc
equal deleted inserted replaced
6703:31b0306f0ecc 6707:30f0ac20df50
116 116
117 @param txt current text of the combo box 117 @param txt current text of the combo box
118 @type str 118 @type str
119 """ 119 """
120 enable = False 120 enable = False
121 vcsUrlEnable = False
121 122
122 if txt: 123 if txt:
123 url = QUrl.fromUserInput(txt) 124 url = QUrl.fromUserInput(txt)
124 if url.isValid(): 125 if url.isValid():
125 if url.scheme() in ConfigGitSchemes: 126 if url.scheme() in ConfigGitSchemes:
126 enable = True 127 enable = True
128 vcsUrlEnable = url.scheme() == "file"
127 elif ':' in txt: 129 elif ':' in txt:
128 # assume scp like repository URL 130 # assume scp like repository URL
129 enable = True 131 enable = True
132 else:
133 vcsUrlEnable = True
130 134
131 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 135 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
132 136 self.vcsUrlButton.setEnabled(vcsUrlEnable)
133 self.vcsUrlButton.setEnabled(url.scheme() == "file" or len(txt) == 0)
134 137
135 @pyqtSlot() 138 @pyqtSlot()
136 def on_vcsUrlClearHistoryButton_clicked(self): 139 def on_vcsUrlClearHistoryButton_clicked(self):
137 """ 140 """
138 Private slot to clear the history of entered repository URLs. 141 Private slot to clear the history of entered repository URLs.
150 @return a tuple of a string (project directory) and a dictionary 153 @return a tuple of a string (project directory) and a dictionary
151 containing the data entered. 154 containing the data entered.
152 """ 155 """
153 self.__saveHistory() 156 self.__saveHistory()
154 157
155 url = QUrl.fromUserInput(
156 self.vcsUrlCombo.currentText().replace("\\", "/"))
157 vcsdatadict = { 158 vcsdatadict = {
158 "url": url.toString(QUrl.None_), 159 "url": self.vcsUrlCombo.currentText().replace("\\", "/"),
159 } 160 }
160 return (self.vcsProjectDirEdit.text(), vcsdatadict) 161 return (self.vcsProjectDirEdit.text(), vcsdatadict)
161 162
162 def __saveHistory(self): 163 def __saveHistory(self):
163 """ 164 """

eric ide

mercurial