19 from .Ui_SvnOptionsDialog import Ui_SvnOptionsDialog |
19 from .Ui_SvnOptionsDialog import Ui_SvnOptionsDialog |
20 from .Config import ConfigSvnProtocols |
20 from .Config import ConfigSvnProtocols |
21 |
21 |
22 import Utilities |
22 import Utilities |
23 |
23 |
|
24 |
24 class SvnOptionsDialog(QDialog, Ui_SvnOptionsDialog): |
25 class SvnOptionsDialog(QDialog, Ui_SvnOptionsDialog): |
25 """ |
26 """ |
26 Class implementing a dialog to enter options used to start a project in the |
27 Class implementing a dialog to enter options used to start a project in the |
27 repository. |
28 repository. |
28 """ |
29 """ |
29 def __init__(self, vcs, project, parent = None): |
30 def __init__(self, vcs, project, parent=None): |
30 """ |
31 """ |
31 Constructor |
32 Constructor |
32 |
33 |
33 @param vcs reference to the version control object |
34 @param vcs reference to the version control object |
34 @param project reference to the project object |
35 @param project reference to the project object |
66 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
67 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
67 |
68 |
68 if directory: |
69 if directory: |
69 self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) |
70 self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) |
70 else: |
71 else: |
71 dlg = SvnRepoBrowserDialog(self.vcs, mode = "select", parent = self) |
72 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) |
72 dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) |
73 dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) |
73 if dlg.exec_() == QDialog.Accepted: |
74 if dlg.exec_() == QDialog.Accepted: |
74 url = dlg.getSelectedUrl() |
75 url = dlg.getSelectedUrl() |
75 if url: |
76 if url: |
76 protocol = url.split("://")[0] |
77 protocol = url.split("://")[0] |
103 scheme = self.protocolCombo.currentText() |
104 scheme = self.protocolCombo.currentText() |
104 url = self.vcsUrlEdit.text() |
105 url = self.vcsUrlEdit.text() |
105 if scheme == "file://" and url[0] not in ["\\", "/"]: |
106 if scheme == "file://" and url[0] not in ["\\", "/"]: |
106 url = "/{0}".format(url) |
107 url = "/{0}".format(url) |
107 vcsdatadict = { |
108 vcsdatadict = { |
108 "url" : '{0}{1}'.format(scheme, url), |
109 "url": '{0}{1}'.format(scheme, url), |
109 "message" : self.vcsLogEdit.text(), |
110 "message": self.vcsLogEdit.text(), |
110 "standardLayout" : self.layoutCheckBox.isChecked(), |
111 "standardLayout": self.layoutCheckBox.isChecked(), |
111 } |
112 } |
112 return vcsdatadict |
113 return vcsdatadict |