Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py

changeset 3009
bf5ae5d7477d
parent 2452
fd1cd8a279db
child 3057
10516539f238
child 3160
209a07d7e401
equal deleted inserted replaced
3008:7848489bcb92 3009:bf5ae5d7477d
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 import os 11 import os
11 12
12 from PyQt4.QtCore import QDir, pyqtSlot 13 from PyQt4.QtCore import QDir, pyqtSlot
22 import Preferences 23 import Preferences
23 24
24 25
25 class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog): 26 class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog):
26 """ 27 """
27 Class implementing the Options Dialog for a new project from the repository. 28 Class implementing the Options Dialog for a new project from the
29 repository.
28 """ 30 """
29 def __init__(self, vcs, parent=None): 31 def __init__(self, vcs, parent=None):
30 """ 32 """
31 Constructor 33 Constructor
32 34
50 self.localPath = hd 52 self.localPath = hd
51 self.networkPath = "localhost/" 53 self.networkPath = "localhost/"
52 self.localProtocol = True 54 self.localProtocol = True
53 55
54 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators( 56 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(
55 Preferences.getMultiProject("Workspace") or Utilities.getHomeDir())) 57 Preferences.getMultiProject("Workspace") or
58 Utilities.getHomeDir()))
56 59
57 @pyqtSlot() 60 @pyqtSlot()
58 def on_vcsUrlButton_clicked(self): 61 def on_vcsUrlButton_clicked(self):
59 """ 62 """
60 Private slot to display a selection dialog. 63 Private slot to display a selection dialog.
65 self.trUtf8("Select Repository-Directory"), 68 self.trUtf8("Select Repository-Directory"),
66 self.vcsUrlEdit.text(), 69 self.vcsUrlEdit.text(),
67 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 70 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
68 71
69 if directory: 72 if directory:
70 self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) 73 self.vcsUrlEdit.setText(
74 Utilities.toNativeSeparators(directory))
71 else: 75 else:
72 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog 76 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
73 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) 77 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
74 dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) 78 dlg.start(
79 self.protocolCombo.currentText() + self.vcsUrlEdit.text())
75 if dlg.exec_() == QDialog.Accepted: 80 if dlg.exec_() == QDialog.Accepted:
76 url = dlg.getSelectedUrl() 81 url = dlg.getSelectedUrl()
77 if url: 82 if url:
78 protocol = url.split("://")[0] 83 protocol = url.split("://")[0]
79 path = url.split("://")[1] 84 path = url.split("://")[1]
91 self.trUtf8("Select Project Directory"), 96 self.trUtf8("Select Project Directory"),
92 self.vcsProjectDirEdit.text(), 97 self.vcsProjectDirEdit.text(),
93 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 98 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
94 99
95 if directory: 100 if directory:
96 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory)) 101 self.vcsProjectDirEdit.setText(
102 Utilities.toNativeSeparators(directory))
97 103
98 def on_layoutCheckBox_toggled(self, checked): 104 def on_layoutCheckBox_toggled(self, checked):
99 """ 105 """
100 Private slot to handle the change of the layout checkbox. 106 Private slot to handle the change of the layout checkbox.
101 107

eric ide

mercurial