60 def initActions(self): |
60 def initActions(self): |
61 """ |
61 """ |
62 Public method to generate the action objects. |
62 Public method to generate the action objects. |
63 """ |
63 """ |
64 self.vcsNewAct = E5Action( |
64 self.vcsNewAct = E5Action( |
65 self.trUtf8('New from repository'), |
65 self.tr('New from repository'), |
66 self.trUtf8('&New from repository...'), |
66 self.tr('&New from repository...'), |
67 0, 0, self, 'vcs_new') |
67 0, 0, self, 'vcs_new') |
68 self.vcsNewAct.setStatusTip(self.trUtf8( |
68 self.vcsNewAct.setStatusTip(self.tr( |
69 'Create a new project from the VCS repository' |
69 'Create a new project from the VCS repository' |
70 )) |
70 )) |
71 self.vcsNewAct.setWhatsThis(self.trUtf8( |
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.trUtf8('Export from repository'), |
80 self.tr('Export from repository'), |
81 self.trUtf8('&Export from repository...'), |
81 self.tr('&Export from repository...'), |
82 0, 0, self, 'vcs_export') |
82 0, 0, self, 'vcs_export') |
83 self.vcsExportAct.setStatusTip(self.trUtf8( |
83 self.vcsExportAct.setStatusTip(self.tr( |
84 'Export a project from the repository' |
84 'Export a project from the repository' |
85 )) |
85 )) |
86 self.vcsExportAct.setWhatsThis(self.trUtf8( |
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.trUtf8('Add to repository'), |
94 self.tr('Add to repository'), |
95 self.trUtf8('&Add to repository...'), |
95 self.tr('&Add to repository...'), |
96 0, 0, self, 'vcs_add') |
96 0, 0, self, 'vcs_add') |
97 self.vcsAddAct.setStatusTip(self.trUtf8( |
97 self.vcsAddAct.setStatusTip(self.tr( |
98 'Add the local project to the VCS repository' |
98 'Add the local project to the VCS repository' |
99 )) |
99 )) |
100 self.vcsAddAct.setWhatsThis(self.trUtf8( |
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) |
170 self.project.pdata["VCS"] = [vcsSystem] |
170 self.project.pdata["VCS"] = [vcsSystem] |
171 self.project.vcs = self.project.initVCS(vcsSystem) |
171 self.project.vcs = self.project.initVCS(vcsSystem) |
172 # edit VCS command options |
172 # edit VCS command options |
173 vcores = E5MessageBox.yesNo( |
173 vcores = E5MessageBox.yesNo( |
174 self.parent(), |
174 self.parent(), |
175 self.trUtf8("New Project"), |
175 self.tr("New Project"), |
176 self.trUtf8( |
176 self.tr( |
177 """Would you like to edit the VCS command options?""")) |
177 """Would you like to edit the VCS command options?""")) |
178 if vcores: |
178 if vcores: |
179 from .CommandOptionsDialog import VcsCommandOptionsDialog |
179 from .CommandOptionsDialog import VcsCommandOptionsDialog |
180 codlg = VcsCommandOptionsDialog(self.project.vcs) |
180 codlg = VcsCommandOptionsDialog(self.project.vcs) |
181 if codlg.exec_() == QDialog.Accepted: |
181 if codlg.exec_() == QDialog.Accepted: |
215 self.project.newProject.emit() |
215 self.project.newProject.emit() |
216 else: |
216 else: |
217 pfilenamelist = d.entryList(filters) |
217 pfilenamelist = d.entryList(filters) |
218 pfilename, ok = QInputDialog.getItem( |
218 pfilename, ok = QInputDialog.getItem( |
219 None, |
219 None, |
220 self.trUtf8("New project from repository"), |
220 self.tr("New project from repository"), |
221 self.trUtf8("Select a project file to open."), |
221 self.tr("Select a project file to open."), |
222 pfilenamelist, 0, False) |
222 pfilenamelist, 0, False) |
223 if ok: |
223 if ok: |
224 self.project.openProject( |
224 self.project.openProject( |
225 QFileInfo(d, pfilename).absoluteFilePath()) |
225 QFileInfo(d, pfilename).absoluteFilePath()) |
226 self.project.newProject.emit() |
226 self.project.newProject.emit() |
262 self.project.saveProject() |
262 self.project.saveProject() |
263 self.project.openProject(self.project.pfile) |
263 self.project.openProject(self.project.pfile) |
264 if not export: |
264 if not export: |
265 res = E5MessageBox.yesNo( |
265 res = E5MessageBox.yesNo( |
266 self.parent(), |
266 self.parent(), |
267 self.trUtf8( |
267 self.tr( |
268 "New project from repository"), |
268 "New project from repository"), |
269 self.trUtf8( |
269 self.tr( |
270 "Shall the project file be added" |
270 "Shall the project file be added" |
271 " to the repository?"), |
271 " to the repository?"), |
272 yesDefault=True) |
272 yesDefault=True) |
273 if res: |
273 if res: |
274 self.project.vcs.vcsAdd( |
274 self.project.vcs.vcsAdd( |
275 self.project.pfile) |
275 self.project.pfile) |
276 else: |
276 else: |
277 E5MessageBox.critical( |
277 E5MessageBox.critical( |
278 self.parent(), |
278 self.parent(), |
279 self.trUtf8("New project from repository"), |
279 self.tr("New project from repository"), |
280 self.trUtf8( |
280 self.tr( |
281 """The project could not be retrieved from""" |
281 """The project could not be retrieved from""" |
282 """ the repository.""")) |
282 """ the repository.""")) |
283 self.project.pdata["VCS"] = ['None'] |
283 self.project.pdata["VCS"] = ['None'] |
284 self.project.vcs = self.project.initVCS() |
284 self.project.vcs = self.project.initVCS() |
285 else: |
285 else: |
350 if vcsdlg.exec_() == QDialog.Accepted: |
350 if vcsdlg.exec_() == QDialog.Accepted: |
351 vcsDataDict = vcsdlg.getData() |
351 vcsDataDict = vcsdlg.getData() |
352 # edit VCS command options |
352 # edit VCS command options |
353 vcores = E5MessageBox.yesNo( |
353 vcores = E5MessageBox.yesNo( |
354 self.parent(), |
354 self.parent(), |
355 self.trUtf8("Import Project"), |
355 self.tr("Import Project"), |
356 self.trUtf8( |
356 self.tr( |
357 """Would you like to edit the VCS command options?""")) |
357 """Would you like to edit the VCS command options?""")) |
358 if vcores: |
358 if vcores: |
359 from .CommandOptionsDialog import VcsCommandOptionsDialog |
359 from .CommandOptionsDialog import VcsCommandOptionsDialog |
360 codlg = VcsCommandOptionsDialog(self.project.vcs) |
360 codlg = VcsCommandOptionsDialog(self.project.vcs) |
361 if codlg.exec_() == QDialog.Accepted: |
361 if codlg.exec_() == QDialog.Accepted: |