Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py

changeset 3008
7848489bcb92
parent 2453
e0b775cb733b
child 3034
7ce719013078
child 3057
10516539f238
equal deleted inserted replaced
3007:bad2e89047e7 3008:7848489bcb92
2 2
3 # Copyright (c) 2010 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2010 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Mercurial Options Dialog for a new project from the repository. 7 Module implementing the Mercurial 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 pyqtSlot, QDir 13 from PyQt4.QtCore import pyqtSlot, QDir
22 import Preferences 23 import Preferences
23 24
24 25
25 class HgNewProjectOptionsDialog(QDialog, Ui_HgNewProjectOptionsDialog): 26 class HgNewProjectOptionsDialog(QDialog, Ui_HgNewProjectOptionsDialog):
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 75
72 @pyqtSlot() 76 @pyqtSlot()
73 def on_projectDirButton_clicked(self): 77 def on_projectDirButton_clicked(self):
74 """ 78 """
75 Private slot to display a directory selection dialog. 79 Private slot to display a directory selection dialog.
79 self.trUtf8("Select Project Directory"), 83 self.trUtf8("Select Project Directory"),
80 self.vcsProjectDirEdit.text(), 84 self.vcsProjectDirEdit.text(),
81 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 85 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
82 86
83 if directory: 87 if directory:
84 self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory)) 88 self.vcsProjectDirEdit.setText(
89 Utilities.toNativeSeparators(directory))
85 90
86 @pyqtSlot(str) 91 @pyqtSlot(str)
87 def on_protocolCombo_activated(self, protocol): 92 def on_protocolCombo_activated(self, protocol):
88 """ 93 """
89 Private slot to switch the status of the directory selection button. 94 Private slot to switch the status of the directory selection button.

eric ide

mercurial