eric6/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8151
8c1445825e7b
child 8218
7c09585bd960
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
62 ] 62 ]
63 self.vcsProjectDirPicker.setText(self.__initPaths[0]) 63 self.vcsProjectDirPicker.setText(self.__initPaths[0])
64 64
65 self.resize(self.width(), self.minimumSizeHint().height()) 65 self.resize(self.width(), self.minimumSizeHint().height())
66 66
67 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 67 self.buttonBox.button(
68 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
68 69
69 msh = self.minimumSizeHint() 70 msh = self.minimumSizeHint()
70 self.resize(max(self.width(), msh.width()), msh.height()) 71 self.resize(max(self.width(), msh.width()), msh.height())
71 72
72 @pyqtSlot(str) 73 @pyqtSlot(str)
74 """ 75 """
75 Private slot to handle a change of the project directory. 76 Private slot to handle a change of the project directory.
76 77
77 @param txt name of the project directory (string) 78 @param txt name of the project directory (string)
78 """ 79 """
79 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled( 80 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(
80 bool(txt) and 81 bool(txt) and
81 Utilities.fromNativeSeparators(txt) not in self.__initPaths) 82 Utilities.fromNativeSeparators(txt) not in self.__initPaths)
82 83
83 def on_vcsUrlPicker_pickerButtonClicked(self): 84 def on_vcsUrlPicker_pickerButtonClicked(self):
84 """ 85 """
86 """ 87 """
87 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog 88 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
88 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) 89 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
89 dlg.start( 90 dlg.start(
90 self.protocolCombo.currentText() + self.vcsUrlPicker.text()) 91 self.protocolCombo.currentText() + self.vcsUrlPicker.text())
91 if dlg.exec() == QDialog.Accepted: 92 if dlg.exec() == QDialog.DialogCode.Accepted:
92 url = dlg.getSelectedUrl() 93 url = dlg.getSelectedUrl()
93 if url: 94 if url:
94 protocol = url.split("://")[0] 95 protocol = url.split("://")[0]
95 path = url.split("://")[1] 96 path = url.split("://")[1]
96 self.protocolCombo.setCurrentIndex( 97 self.protocolCombo.setCurrentIndex(
106 self.vcsTagLabel.setEnabled(checked) 107 self.vcsTagLabel.setEnabled(checked)
107 self.vcsTagEdit.setEnabled(checked) 108 self.vcsTagEdit.setEnabled(checked)
108 if not checked: 109 if not checked:
109 self.vcsTagEdit.clear() 110 self.vcsTagEdit.clear()
110 111
111 @pyqtSlot(str) 112 @pyqtSlot(int)
112 def on_protocolCombo_activated(self, protocol): 113 def on_protocolCombo_activated(self, index):
113 """ 114 """
114 Private slot to switch the status of the directory selection button. 115 Private slot to switch the status of the directory selection button.
115 116
116 @param protocol selected protocol (string) 117 @param index index of the selected entry
118 @type int
117 """ 119 """
120 protocol = self.protocolCombo.itemText(index)
118 if protocol == "file://": 121 if protocol == "file://":
119 self.networkPath = self.vcsUrlPicker.text() 122 self.networkPath = self.vcsUrlPicker.text()
120 self.vcsUrlPicker.setText(self.localPath) 123 self.vcsUrlPicker.setText(self.localPath)
121 self.vcsUrlLabel.setText(self.tr("Pat&h:")) 124 self.vcsUrlLabel.setText(self.tr("Pat&h:"))
122 self.localProtocol = True 125 self.localProtocol = True
135 Private slot to handle changes of the URL. 138 Private slot to handle changes of the URL.
136 139
137 @param txt current text of the line edit (string) 140 @param txt current text of the line edit (string)
138 """ 141 """
139 enable = "://" not in txt 142 enable = "://" not in txt
140 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 143 self.buttonBox.button(
144 QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
141 145
142 def getData(self): 146 def getData(self):
143 """ 147 """
144 Public slot to retrieve the data entered into the dialog. 148 Public slot to retrieve the data entered into the dialog.
145 149

eric ide

mercurial