VCS/ProjectHelper.py

changeset 3345
071afe8be2a1
parent 3302
e92f0dd51979
child 3349
2a034a7f1f54
equal deleted inserted replaced
3343:f7a6d271bb40 3345:071afe8be2a1
9 9
10 import os 10 import os
11 import shutil 11 import shutil
12 import copy 12 import copy
13 13
14 from PyQt4.QtCore import QDir, QFileInfo, QObject 14 from PyQt4.QtCore import pyqtSlot, QDir, QFileInfo, QObject
15 from PyQt4.QtGui import QDialog, QInputDialog 15 from PyQt4.QtGui import QDialog, QInputDialog
16 16
17 from E5Gui.E5Action import E5Action 17 from E5Gui.E5Action import E5Action
18 from E5Gui import E5MessageBox 18 from E5Gui import E5MessageBox
19 from E5Gui.E5Application import e5App 19 from E5Gui.E5Application import e5App
71 self.vcsNewAct.setWhatsThis(self.tr( 71 self.vcsNewAct.setWhatsThis(self.tr(
72 """<b>New from repository</b>""" 72 """<b>New from repository</b>"""
73 """<p>This creates a new local project from the VCS""" 73 """<p>This creates a new local project from the VCS"""
74 """ repository.</p>""" 74 """ repository.</p>"""
75 )) 75 ))
76 self.vcsNewAct.triggered[()].connect(self._vcsCheckout) 76 self.vcsNewAct.triggered.connect(self._vcsCheckout)
77 self.actions.append(self.vcsNewAct) 77 self.actions.append(self.vcsNewAct)
78 78
79 self.vcsExportAct = E5Action( 79 self.vcsExportAct = E5Action(
80 self.tr('Export from repository'), 80 self.tr('Export from repository'),
81 self.tr('&Export from repository...'), 81 self.tr('&Export from repository...'),
85 )) 85 ))
86 self.vcsExportAct.setWhatsThis(self.tr( 86 self.vcsExportAct.setWhatsThis(self.tr(
87 """<b>Export from repository</b>""" 87 """<b>Export from repository</b>"""
88 """<p>This exports a project from the repository.</p>""" 88 """<p>This exports a project from the repository.</p>"""
89 )) 89 ))
90 self.vcsExportAct.triggered[()].connect(self._vcsExport) 90 self.vcsExportAct.triggered.connect(self._vcsExport)
91 self.actions.append(self.vcsExportAct) 91 self.actions.append(self.vcsExportAct)
92 92
93 self.vcsAddAct = E5Action( 93 self.vcsAddAct = E5Action(
94 self.tr('Add to repository'), 94 self.tr('Add to repository'),
95 self.tr('&Add to repository...'), 95 self.tr('&Add to repository...'),
100 self.vcsAddAct.setWhatsThis(self.tr( 100 self.vcsAddAct.setWhatsThis(self.tr(
101 """<b>Add to repository</b>""" 101 """<b>Add to repository</b>"""
102 """<p>This adds (imports) the local project to the VCS""" 102 """<p>This adds (imports) the local project to the VCS"""
103 """ repository.</p>""" 103 """ repository.</p>"""
104 )) 104 ))
105 self.vcsAddAct.triggered[()].connect(self._vcsImport) 105 self.vcsAddAct.triggered.connect(self._vcsImport)
106 self.actions.append(self.vcsAddAct) 106 self.actions.append(self.vcsAddAct)
107 107
108 def initMenu(self, menu): 108 def initMenu(self, menu):
109 """ 109 """
110 Public method to generate the VCS menu. 110 Public method to generate the VCS menu.
123 """ 123 """
124 Public slot called before the vcs menu is shown. 124 Public slot called before the vcs menu is shown.
125 """ 125 """
126 if self.vcsAddAct: 126 if self.vcsAddAct:
127 self.vcsAddAct.setEnabled(self.project.isOpen()) 127 self.vcsAddAct.setEnabled(self.project.isOpen())
128 128
129 @pyqtSlot()
129 def _vcsCheckout(self, export=False): 130 def _vcsCheckout(self, export=False):
130 """ 131 """
131 Protected slot used to create a local project from the repository. 132 Protected slot used to create a local project from the repository.
132 133
133 @param export flag indicating whether an export or a checkout 134 @param export flag indicating whether an export or a checkout

eric ide

mercurial