Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3009
bf5ae5d7477d
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
2 2
3 # Copyright (c) 2002 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2002 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Subversion Options Dialog for a new project from the repository. 7 Module implementing the Subversion Options Dialog for a new project from the
8 repository.
8 """ 9 """
9 10
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 11 from __future__ import unicode_literals # __IGNORE_WARNING__
11 12
12 import os 13 import os
24 import Preferences 25 import Preferences
25 26
26 27
27 class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog): 28 class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog):
28 """ 29 """
29 Class implementing the Options Dialog for a new project from the repository. 30 Class implementing the Options Dialog for a new project from the
31 repository.
30 """ 32 """
31 def __init__(self, vcs, parent=None): 33 def __init__(self, vcs, parent=None):
32 """ 34 """
33 Constructor 35 Constructor
34 36
52 self.localPath = hd 54 self.localPath = hd
53 self.networkPath = "localhost/" 55 self.networkPath = "localhost/"
54 self.localProtocol = True 56 self.localProtocol = True
55 57
56 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators( 58 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(
57 Preferences.getMultiProject("Workspace") or Utilities.getHomeDir())) 59 Preferences.getMultiProject("Workspace") or
60 Utilities.getHomeDir()))
58 61
59 @pyqtSlot() 62 @pyqtSlot()
60 def on_vcsUrlButton_clicked(self): 63 def on_vcsUrlButton_clicked(self):
61 """ 64 """
62 Private slot to display a selection dialog. 65 Private slot to display a selection dialog.
67 self.trUtf8("Select Repository-Directory"), 70 self.trUtf8("Select Repository-Directory"),
68 self.vcsUrlEdit.text(), 71 self.vcsUrlEdit.text(),
69 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 72 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
70 73
71 if directory: 74 if directory:
72 self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) 75 self.vcsUrlEdit.setText(
76 Utilities.toNativeSeparators(directory))
73 else: 77 else:
74 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog 78 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
75 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) 79 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
76 dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) 80 dlg.start(
81 self.protocolCombo.currentText() + self.vcsUrlEdit.text())
77 if dlg.exec_() == QDialog.Accepted: 82 if dlg.exec_() == QDialog.Accepted:
78 url = dlg.getSelectedUrl() 83 url = dlg.getSelectedUrl()
79 if url: 84 if url:
80 protocol = url.split("://")[0] 85 protocol = url.split("://")[0]
81 path = url.split("://")[1] 86 path = url.split("://")[1]
93 self.trUtf8("Select Project Directory"), 98 self.trUtf8("Select Project Directory"),
94 self.vcsProjectDirEdit.text(), 99 self.vcsProjectDirEdit.text(),
95 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 100 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
96 101
97 if directory: 102 if directory:
98 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory)) 103 self.vcsProjectDirEdit.setText(
104 Utilities.toNativeSeparators(directory))
99 105
100 def on_layoutCheckBox_toggled(self, checked): 106 def on_layoutCheckBox_toggled(self, checked):
101 """ 107 """
102 Private slot to handle the change of the layout checkbox. 108 Private slot to handle the change of the layout checkbox.
103 109

eric ide

mercurial