Mon, 11 Dec 2023 10:55:39 +0100
- Added context menu entries to show the directory path of an item in an external file manager.
- Added an entry to the background context menu to show the project directory in an external file manager.
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
32
cab6795a8df6
Updated copyright for 2023.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
19
diff
changeset
|
3 | # Copyright (c) 2002 - 2023 Detlev Offenbach <detlev@die-offenbachs.de> |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the a class used to display the interfaces (IDL) part |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | of the project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import contextlib |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | import glob |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | import os |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | from PyQt6.QtCore import QProcess, QThread, pyqtSignal |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | from PyQt6.QtWidgets import QApplication, QDialog, QMenu |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
19
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
18 | from eric7 import Preferences |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | from eric7.EricGui import EricPixmapCache |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
20 | from eric7.EricWidgets import EricMessageBox, EricPathPickerDialog |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | from eric7.EricWidgets.EricApplication import ericApp |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
22 | from eric7.EricWidgets.EricPathPickerDialog import EricPathPickerModes |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | from eric7.EricWidgets.EricProgressDialog import EricProgressDialog |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | from eric7.Project.FileCategoryRepositoryItem import FileCategoryRepositoryItem |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | from eric7.Project.ProjectBaseBrowser import ProjectBaseBrowser |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | from eric7.Project.ProjectBrowserModel import ( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | ProjectBrowserDirectoryItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | ProjectBrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | ProjectBrowserSimpleDirectoryItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | from eric7.Project.ProjectBrowserRepositoryItem import ProjectBrowserRepositoryItem |
19
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
32 | from eric7.SystemUtilities import FileSystemUtilities, OSUtilities |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | from eric7.UI.BrowserModel import ( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | BrowserClassAttributeItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | BrowserClassItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | BrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | BrowserMethodItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | from eric7.UI.NotificationWidget import NotificationTypes |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | class ProjectInterfacesBrowser(ProjectBaseBrowser): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | A class used to display the interfaces (IDL) part of the project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | @signal appendStdout(str) emitted after something was received from |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | a QProcess on stdout |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | @signal appendStderr(str) emitted after something was received from |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | a QProcess on stderr |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | @signal showMenu(str, QMenu) emitted when a menu is about to be shown. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | The name of the menu and a reference to the menu are given. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | appendStdout = pyqtSignal(str) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | appendStderr = pyqtSignal(str) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | showMenu = pyqtSignal(str, QMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | FileFilter = "idl" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | def __init__(self, plugin, parent=None): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | Constructor |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | @param plugin reference to the plugin object |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | @type CorbaExtensionPlugin |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | @param parent parent widget of this browser |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | @type QWidget |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | project = ericApp().getObject("Project") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | projectBrowser = ericApp().getObject("ProjectBrowser") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | self.omniidl = plugin.getPreferences("omniidl") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | if self.omniidl == "": |
19
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
75 | self.omniidl = ( |
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
76 | "omniidl.exe" if OSUtilities.isWindowsPlatform() else "omniidl" |
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
77 | ) |
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
78 | if not FileSystemUtilities.isinpath(self.omniidl): |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | self.omniidl = None |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | ProjectBaseBrowser.__init__(self, project, self.FileFilter, parent) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | self.selectedItemsFilter = [ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | ProjectBrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | ProjectBrowserSimpleDirectoryItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | ] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
88 | self.setWindowTitle(self.tr("CORBA IDL")) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | self.setWhatsThis( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | self.tr( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | """<b>Project IDL Browser</b>""" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
93 | """<p>This allows to easily see all CORBA IDL files contained in the""" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | """ current project. Several actions can be executed via the context""" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | """ menu.</p>""" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | # Add the file category handled by the browser. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | project.addFileCategory( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | "INTERFACES", |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | FileCategoryRepositoryItem( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
103 | fileCategoryFilterTemplate=self.tr("CORBA IDL Files ({0})"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | fileCategoryUserString=self.tr("CORBA IDL Files"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | fileCategoryTyeString=self.tr("IDL Files"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | fileCategoryExtensions=["*.idl"], |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
107 | ), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
108 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | # Add the project browser type to the browser type repository. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | projectBrowser.addTypedProjectBrowser( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | "interfaces", |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | ProjectBrowserRepositoryItem( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | projectBrowser=self, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | projectBrowserUserString=self.tr("CORBA IDL Browser"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | priority=50, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
117 | fileCategory="INTERFACES", |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
118 | fileFilter=self.FileFilter, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
119 | getIcon=self.getIcon, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | ), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | # Connect signals of Project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | project.prepareRepopulateItem.connect(self._prepareRepopulateItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | project.completeRepopulateItem.connect(self._completeRepopulateItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | project.projectClosed.connect(self._projectClosed) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
127 | project.projectOpened.connect(self._projectOpened) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | project.newProject.connect(self._newProject) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | project.reinitVCS.connect(self._initMenusAndVcs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | project.projectPropertiesChanged.connect(self._initMenusAndVcs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | # Connect signals of ProjectBrowser. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | projectBrowser.preferencesChanged.connect(self.handlePreferencesChanged) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | # Connect some of our own signals. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | self.appendStderr.connect(projectBrowser.appendStderr) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | self.appendStdout.connect(projectBrowser.appendStdout) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | self.closeSourceWindow.connect(projectBrowser.closeSourceWindow) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | self.sourceFile[str].connect(projectBrowser.sourceFile[str]) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | self.sourceFile[str, int].connect(projectBrowser.sourceFile[str, int]) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | def deactivate(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | Public method to deactivate the browser. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | project = ericApp().getObject("Project") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | projectBrowser = ericApp().getObject("ProjectBrowser") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | # Disconnect some of our own signals. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
150 | self.appendStderr.disconnect(projectBrowser.appendStderr) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
151 | self.appendStdout.disconnect(projectBrowser.appendStdout) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
152 | self.closeSourceWindow.disconnect(projectBrowser.closeSourceWindow) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
153 | self.sourceFile[str].disconnect(projectBrowser.sourceFile[str]) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | self.sourceFile[str, int].disconnect(projectBrowser.sourceFile[str, int]) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | # Disconnect signals of ProjectBrowser. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | projectBrowser.preferencesChanged.disconnect(self.handlePreferencesChanged) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | # Disconnect signals of Project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | project.prepareRepopulateItem.disconnect(self._prepareRepopulateItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
161 | project.completeRepopulateItem.disconnect(self._completeRepopulateItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
162 | project.projectClosed.disconnect(self._projectClosed) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | project.projectOpened.disconnect(self._projectOpened) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | project.newProject.disconnect(self._newProject) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | project.reinitVCS.disconnect(self._initMenusAndVcs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
166 | project.projectPropertiesChanged.disconnect(self._initMenusAndVcs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
167 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
168 | # Remove the project browser type from the browser type repository. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
169 | projectBrowser.removeTypedProjectBrowser("interfaces") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
171 | # Remove the file category handled by the browser. |
2
68c017d640b0
Fixed a few issues detected during testing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
172 | project.removeFileCategory("INTERFACES") |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
173 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | def getIcon(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | Public method to get an icon for the project browser. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | @return icon for the browser |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | @rtype QIcon |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | iconSuffix = "dark" if ericApp().usesDarkPalette() else "light" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
182 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | return EricPixmapCache.getIcon( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | os.path.join( |
12
58b645cde6e3
Moved the IDL class browser to this plugin.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10
diff
changeset
|
185 | os.path.dirname(__file__), "icons", "corba-{0}".format(iconSuffix) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | def _createPopupMenus(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | Protected overloaded method to generate the popup menu. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
192 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | self.menuActions = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
194 | self.multiMenuActions = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | self.dirMenuActions = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | self.dirMultiMenuActions = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | self.sourceMenu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | self.tr("Compile interface"), self.__compileInterface |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
202 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | self.tr("Compile all interfaces"), self.__compileAllInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | self.sourceMenu.addAction(self.tr("Open"), self._openItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | act = self.sourceMenu.addAction(self.tr("Rename file"), self._renameFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | self.menuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | act = self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | self.tr("Remove from project"), self._removeFile |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | self.menuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | act = self.sourceMenu.addAction(self.tr("Delete"), self.__deleteFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | self.menuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | self.sourceMenu.addAction( |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
223 | self.tr("New interface file..."), self.__addNewInterfaceFile |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
224 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
225 | self.sourceMenu.addSeparator() |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
226 | self.sourceMenu.addAction( |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | self.tr("Add interfaces..."), self.__addInterfaceFiles |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | self.tr("Add interfaces directory..."), self.__addInterfacesDirectory |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | self.sourceMenu.addSeparator() |
46
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
233 | with contextlib.suppress(AttributeError): |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
234 | # eric7 > 23.12 |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
235 | self.sourceMenu.addAction( |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
236 | self.tr("Show in File Manager"), self._showInFileManager |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
237 | ) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
238 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
239 | self.tr("Copy Path to Clipboard"), self._copyToClipboard |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
240 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
241 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | self.tr("Expand all directories"), self._expandAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
245 | self.sourceMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | self.tr("Collapse all directories"), self._collapseAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | ) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
248 | self.sourceMenu.addAction(self.tr("Collapse all files"), self._collapseAllFiles) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | self.sourceMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | self.sourceMenu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | self.sourceMenu.addAction(self.tr("Configure CORBA..."), self.__configureCorba) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | self.menu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | self.menu.addAction(self.tr("Compile interface"), self.__compileInterface) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
256 | self.menu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | self.tr("Compile all interfaces"), self.__compileAllInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | self.menu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | self.menu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | self.menu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | self.menu.addAction(self.tr("Open"), self._openItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | self.menu.addSeparator() |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
266 | self.menu.addAction( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
267 | self.tr("New interface file..."), self.__addNewInterfaceFile |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
268 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
269 | self.menu.addSeparator() |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | self.menu.addAction(self.tr("Add interfaces..."), self.__addInterfaceFiles) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | self.menu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | self.tr("Add interfaces directory..."), self.__addInterfacesDirectory |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | self.menu.addSeparator() |
46
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
275 | with contextlib.suppress(AttributeError): |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
276 | # eric7 > 23.12 |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
277 | self.menu.addAction( |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
278 | self.tr("Show in File Manager"), self._showInFileManager |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
279 | ) |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
280 | self.menu.addSeparator() |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | self.menu.addAction(self.tr("Expand all directories"), self._expandAllDirs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | self.menu.addAction(self.tr("Collapse all directories"), self._collapseAllDirs) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
283 | self.menu.addAction(self.tr("Collapse all files"), self._collapseAllFiles) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
284 | self.menu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
285 | self.menu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | self.menu.addAction(self.tr("Configure CORBA..."), self.__configureCorba) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
287 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
288 | self.backMenu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
290 | self.backMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
291 | self.tr("Compile all interfaces"), self.__compileAllInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
292 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
293 | self.backMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
294 | self.backMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
295 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
296 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
297 | self.backMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
298 | self.backMenu.addAction( |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
299 | self.tr("New interface file..."), self.__addNewInterfaceFile |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
300 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
301 | self.backMenu.addSeparator() |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
302 | self.backMenu.addAction( |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
303 | self.tr("Add interfaces..."), lambda: self.project.addFiles("INTERFACES") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
305 | self.backMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | self.tr("Add interfaces directory..."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
307 | lambda: self.project.addDirectory("INTERFACES"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
308 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
309 | self.backMenu.addSeparator() |
46
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
310 | with contextlib.suppress(AttributeError): |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
311 | # eric7 > 23.12 |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
312 | self.backMenu.addAction( |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
313 | self.tr("Show in File Manager"), self._showProjectInFileManager |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
314 | ) |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
315 | self.backMenu.addSeparator() |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
316 | self.backMenu.addAction(self.tr("Expand all directories"), self._expandAllDirs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
317 | self.backMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
318 | self.tr("Collapse all directories"), self._collapseAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
319 | ) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
320 | self.backMenu.addAction(self.tr("Collapse all files"), self._collapseAllFiles) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
321 | self.backMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
322 | self.backMenu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
323 | self.backMenu.addAction(self.tr("Configure CORBA..."), self.__configureCorba) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
324 | self.backMenu.setEnabled(False) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
325 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
326 | # create the menu for multiple selected files |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
327 | self.multiMenu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
328 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
329 | self.multiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
330 | self.tr("Compile interfaces"), self.__compileSelectedInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
331 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
332 | self.multiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
333 | self.multiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
334 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
335 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
336 | self.multiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
337 | self.multiMenu.addAction(self.tr("Open"), self._openItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
338 | self.multiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
339 | act = self.multiMenu.addAction(self.tr("Remove from project"), self._removeFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
340 | self.multiMenuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
341 | act = self.multiMenu.addAction(self.tr("Delete"), self.__deleteFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
342 | self.multiMenuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | self.multiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | self.multiMenu.addAction(self.tr("Expand all directories"), self._expandAllDirs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
345 | self.multiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | self.tr("Collapse all directories"), self._collapseAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
347 | ) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
348 | self.multiMenu.addAction(self.tr("Collapse all files"), self._collapseAllFiles) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
349 | self.multiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | self.multiMenu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
351 | self.multiMenu.addAction(self.tr("Configure CORBA..."), self.__configureCorba) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
352 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
353 | self.dirMenu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | self.dirMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
356 | self.tr("Compile all interfaces"), self.__compileAllInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
358 | self.dirMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
359 | self.dirMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
360 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
361 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
362 | self.dirMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
363 | act = self.dirMenu.addAction(self.tr("Remove from project"), self._removeFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
364 | self.dirMenuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
365 | act = self.dirMenu.addAction(self.tr("Delete"), self._deleteDirectory) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
366 | self.dirMenuActions.append(act) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
367 | self.dirMenu.addSeparator() |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
368 | self.dirMenu.addAction( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
369 | self.tr("New interface file..."), self.__addNewInterfaceFile |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
370 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
371 | self.dirMenu.addSeparator() |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
372 | self.dirMenu.addAction(self.tr("Add interfaces..."), self.__addInterfaceFiles) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
373 | self.dirMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
374 | self.tr("Add interfaces directory..."), self.__addInterfacesDirectory |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
375 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
376 | self.dirMenu.addSeparator() |
46
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
377 | with contextlib.suppress(AttributeError): |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
378 | # eric7 > 23.12 |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
379 | self.dirMenu.addAction( |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
380 | self.tr("Show in File Manager"), self._showInFileManager |
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
381 | ) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
382 | self.dirMenu.addAction(self.tr("Copy Path to Clipboard"), self._copyToClipboard) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
383 | self.dirMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
384 | self.dirMenu.addAction(self.tr("Expand all directories"), self._expandAllDirs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
385 | self.dirMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
386 | self.tr("Collapse all directories"), self._collapseAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
387 | ) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
388 | self.dirMenu.addAction(self.tr("Collapse all files"), self._collapseAllFiles) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
389 | self.dirMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
390 | self.dirMenu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
391 | self.dirMenu.addAction(self.tr("Configure CORBA..."), self.__configureCorba) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
392 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
393 | self.dirMultiMenu = QMenu(self) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
394 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
395 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
396 | self.tr("Compile all interfaces"), self.__compileAllInterfaces |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
397 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
398 | self.dirMultiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
399 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
400 | self.tr("Configure IDL compiler"), self.__configureIdlCompiler |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
401 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
402 | self.dirMultiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
403 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
404 | self.tr("Add interfaces..."), lambda: self.project.addFiles("INTERFACES") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
405 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
406 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
407 | self.tr("Add interfaces directory..."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
408 | lambda: self.project.addDirectory("INTERFACES"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
409 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
410 | self.dirMultiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
411 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
412 | self.tr("Expand all directories"), self._expandAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
413 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
414 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
415 | self.tr("Collapse all directories"), self._collapseAllDirs |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
416 | ) |
10
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
417 | self.dirMultiMenu.addAction( |
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
418 | self.tr("Collapse all files"), self._collapseAllFiles |
c88be5019d60
Added a `Collapse all files` entry to the context menus.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
419 | ) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
420 | self.dirMultiMenu.addSeparator() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
421 | self.dirMultiMenu.addAction(self.tr("Configure..."), self._configure) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
422 | self.dirMultiMenu.addAction( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
423 | self.tr("Configure CORBA..."), self.__configureCorba |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
424 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
425 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
426 | self.sourceMenu.aboutToShow.connect(self.__showContextMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
427 | self.multiMenu.aboutToShow.connect(self.__showContextMenuMulti) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
428 | self.dirMenu.aboutToShow.connect(self.__showContextMenuDir) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
429 | self.dirMultiMenu.aboutToShow.connect(self.__showContextMenuDirMulti) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
430 | self.backMenu.aboutToShow.connect(self.__showContextMenuBack) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
431 | self.mainMenu = self.sourceMenu |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
432 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
433 | def _contextMenuRequested(self, coord): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
434 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
435 | Protected slot to show the context menu. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
436 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
437 | @param coord the position of the mouse pointer (QPoint) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
438 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
439 | if not self.project.isOpen(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
440 | return |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
441 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
442 | with contextlib.suppress(Exception): # secok |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
443 | categories = self.getSelectedItemsCountCategorized( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
444 | [ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
445 | ProjectBrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
446 | BrowserClassItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
447 | BrowserMethodItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
448 | ProjectBrowserSimpleDirectoryItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
449 | ] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
450 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
451 | cnt = categories["sum"] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
452 | if cnt <= 1: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
453 | index = self.indexAt(coord) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
454 | if index.isValid(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
455 | self._selectSingleItem(index) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
456 | categories = self.getSelectedItemsCountCategorized( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
457 | [ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
458 | ProjectBrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
459 | BrowserClassItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
460 | BrowserMethodItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
461 | ProjectBrowserSimpleDirectoryItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
462 | ] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
463 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
464 | cnt = categories["sum"] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
465 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
466 | bfcnt = categories[str(ProjectBrowserFileItem)] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
467 | cmcnt = ( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
468 | categories[str(BrowserClassItem)] + categories[str(BrowserMethodItem)] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
469 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
470 | sdcnt = categories[str(ProjectBrowserSimpleDirectoryItem)] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
471 | if cnt > 1 and cnt == bfcnt: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
472 | self.multiMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
473 | elif cnt > 1 and cnt == sdcnt: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
474 | self.dirMultiMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
475 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
476 | index = self.indexAt(coord) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
477 | if cnt == 1 and index.isValid(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
478 | if bfcnt == 1 or cmcnt == 1: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
479 | itm = self.model().item(index) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
480 | if isinstance(itm, ProjectBrowserFileItem): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
481 | self.sourceMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
482 | elif isinstance(itm, (BrowserClassItem, BrowserMethodItem)): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
483 | self.menu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
484 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
485 | self.backMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
486 | elif sdcnt == 1: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
487 | self.dirMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
488 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
489 | self.backMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
490 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
491 | self.backMenu.popup(self.mapToGlobal(coord)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
492 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
493 | def __showContextMenu(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
494 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
495 | Private slot called by the menu aboutToShow signal. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
496 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
497 | ProjectBaseBrowser._showContextMenu(self, self.menu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
498 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
499 | self.showMenu.emit("Main", self.menu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
500 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
501 | def __showContextMenuMulti(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
502 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
503 | Private slot called by the multiMenu aboutToShow signal. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
504 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
505 | ProjectBaseBrowser._showContextMenuMulti(self, self.multiMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
506 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
507 | self.showMenu.emit("MainMulti", self.multiMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
508 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
509 | def __showContextMenuDir(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
510 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
511 | Private slot called by the dirMenu aboutToShow signal. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
512 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
513 | ProjectBaseBrowser._showContextMenuDir(self, self.dirMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
514 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
515 | self.showMenu.emit("MainDir", self.dirMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
516 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
517 | def __showContextMenuDirMulti(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
518 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
519 | Private slot called by the dirMultiMenu aboutToShow signal. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
520 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
521 | ProjectBaseBrowser._showContextMenuDirMulti(self, self.dirMultiMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
522 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
523 | self.showMenu.emit("MainDirMulti", self.dirMultiMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
524 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
525 | def __showContextMenuBack(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
526 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
527 | Private slot called by the backMenu aboutToShow signal. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
528 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
529 | ProjectBaseBrowser._showContextMenuBack(self, self.backMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
530 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
531 | self.showMenu.emit("MainBack", self.backMenu) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
532 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
533 | def _openItem(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
534 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
535 | Protected slot to handle the open popup menu entry. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
536 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
537 | itmList = self.getSelectedItems( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
538 | [ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
539 | BrowserFileItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
540 | BrowserClassItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
541 | BrowserMethodItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
542 | BrowserClassAttributeItem, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
543 | ] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
544 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
545 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
546 | for itm in itmList: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
547 | if isinstance(itm, BrowserFileItem): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
548 | self.sourceFile[str].emit(itm.fileName()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
549 | elif isinstance(itm, BrowserClassItem): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
550 | self.sourceFile[str, int].emit(itm.fileName(), itm.classObject().lineno) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
551 | elif isinstance(itm, BrowserMethodItem): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
552 | self.sourceFile[str, int].emit( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
553 | itm.fileName(), itm.functionObject().lineno |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
554 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
555 | elif isinstance(itm, BrowserClassAttributeItem): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
556 | self.sourceFile[str, int].emit( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
557 | itm.fileName(), itm.attributeObject().lineno |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
558 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
559 | |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
560 | def __addNewInterfaceFile(self): |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
561 | """ |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
562 | Private method to add a new interface file to the project. |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
563 | """ |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
564 | itm = self.model().item(self.currentIndex()) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
565 | if isinstance( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
566 | itm, (ProjectBrowserFileItem, BrowserClassItem, BrowserMethodItem) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
567 | ): |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
568 | dn = os.path.dirname(itm.fileName()) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
569 | elif isinstance( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
570 | itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
571 | ): |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
572 | dn = itm.dirName() |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
573 | else: |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
574 | dn = "" |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
575 | |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
576 | filename, ok = EricPathPickerDialog.getStrPath( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
577 | self, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
578 | self.tr("New interface file"), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
579 | self.tr("Enter the path of the new interface file:"), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
580 | mode=EricPathPickerModes.SAVE_FILE_ENSURE_EXTENSION_MODE, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
581 | strPath=dn, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
582 | defaultDirectory=dn, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
583 | filters=self.project.getFileCategoryFilters( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
584 | categories=["INTERFACES"], withAll=False |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
585 | ), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
586 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
587 | if ok: |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
588 | if not os.path.splitext(filename)[1]: |
38
aefce8f68439
Corrected a code style issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
37
diff
changeset
|
589 | filename += ".idl" |
37
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
590 | |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
591 | if os.path.exists(filename): |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
592 | EricMessageBox.critical( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
593 | self, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
594 | self.tr("New interface file"), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
595 | self.tr( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
596 | "<p>The file <b>{0}</b> already exists. The action will be" |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
597 | " aborted.</p>" |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
598 | ).format(filename), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
599 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
600 | return |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
601 | |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
602 | try: |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
603 | with open(filename, "w") as f: |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
604 | f.write("// {0}\n".format(self.project.getRelativePath(filename))) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
605 | except OSError as err: |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
606 | EricMessageBox.critical( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
607 | self, |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
608 | self.tr("New interface file"), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
609 | self.tr( |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
610 | "<p>The file <b>{0}</b> could not be created. Aborting...</p>" |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
611 | "<p>Reason: {1}</p>" |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
612 | ).format(filename, str(err)), |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
613 | ) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
614 | return |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
615 | |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
616 | self.project.appendFile(filename) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
617 | self.sourceFile[str].emit(filename) |
79e453012ab9
Added the context menu action "New interface file..." to give a more concise way to create a new interface file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
33
diff
changeset
|
618 | |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
619 | def __addInterfaceFiles(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
620 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
621 | Private method to add interface files to the project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
622 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
623 | itm = self.model().item(self.currentIndex()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
624 | if isinstance( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
625 | itm, (ProjectBrowserFileItem, BrowserClassItem, BrowserMethodItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
626 | ): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
627 | dn = os.path.dirname(itm.fileName()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
628 | elif isinstance( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
629 | itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
630 | ): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
631 | dn = itm.dirName() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
632 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
633 | dn = None |
33
782792ab98fb
Fixed an issue related to adding files and directories to a project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
32
diff
changeset
|
634 | self.project.addFiles("INTERFACES", dn) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
635 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
636 | def __addInterfacesDirectory(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
637 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
638 | Private method to add interface files of a directory to the project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
639 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
640 | itm = self.model().item(self.currentIndex()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
641 | if isinstance( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
642 | itm, (ProjectBrowserFileItem, BrowserClassItem, BrowserMethodItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
643 | ): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
644 | dn = os.path.dirname(itm.fileName()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
645 | elif isinstance( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
646 | itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
647 | ): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
648 | dn = itm.dirName() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
649 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
650 | dn = None |
33
782792ab98fb
Fixed an issue related to adding files and directories to a project.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
32
diff
changeset
|
651 | self.project.addDirectory("INTERFACES", dn) |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
652 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
653 | def __deleteFile(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
654 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
655 | Private method to delete files from the project. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
656 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
657 | itmList = self.getSelectedItems() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
658 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
659 | files = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
660 | fullNames = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
661 | for itm in itmList: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
662 | fn2 = itm.fileName() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
663 | fullNames.append(fn2) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
664 | fn = self.project.getRelativePath(fn2) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
665 | files.append(fn) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
666 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
667 | dlg = DeleteFilesConfirmationDialog( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
668 | self.parent(), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
669 | self.tr("Delete interfaces"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
670 | self.tr( |
46
bd9f89d3bf8b
- Added context menu entries to show the directory path of an item in an external file manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
38
diff
changeset
|
671 | "Do you really want to delete these interfaces from the project?" |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
672 | ), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
673 | files, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
674 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
675 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
676 | if dlg.exec() == QDialog.DialogCode.Accepted: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
677 | for fn2, fn in zip(fullNames, files): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
678 | self.closeSourceWindow.emit(fn2) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
679 | self.project.deleteFile(fn) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
680 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
681 | ########################################################################### |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
682 | ## Methods to handle the various compile commands |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
683 | ########################################################################### |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
684 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
685 | def __readStdout(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
686 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
687 | Private slot to handle the readyReadStandardOutput signal of the |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
688 | omniidl process. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
689 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
690 | if self.compileProc is None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
691 | return |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
692 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
693 | ioEncoding = Preferences.getSystem("IOEncoding") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
694 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
695 | self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
696 | while self.compileProc and self.compileProc.canReadLine(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
697 | s = "omniidl: " |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
698 | output = str(self.compileProc.readLine(), ioEncoding, "replace") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
699 | s += output |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
700 | self.appendStdout.emit(s) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
701 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
702 | def __readStderr(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
703 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
704 | Private slot to handle the readyReadStandardError signal of the |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
705 | omniidl process. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
706 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
707 | if self.compileProc is None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
708 | return |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
709 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
710 | ioEncoding = Preferences.getSystem("IOEncoding") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
711 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
712 | self.compileProc.setReadChannel(QProcess.ProcessChannel.StandardError) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
713 | while self.compileProc and self.compileProc.canReadLine(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
714 | s = "omniidl: " |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
715 | error = str(self.compileProc.readLine(), ioEncoding, "replace") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
716 | s += error |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
717 | self.appendStderr.emit(s) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
718 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
719 | def __compileIDLDone(self, exitCode, exitStatus): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
720 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
721 | Private slot to handle the finished signal of the omniidl process. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
722 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
723 | @param exitCode exit code of the process (integer) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
724 | @param exitStatus exit status of the process (QProcess.ExitStatus) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
725 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
726 | pixmapSuffix = "dark" if ericApp().usesDarkPalette() else "light" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
727 | pixmap = EricPixmapCache.getPixmap( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
728 | os.path.join( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
729 | os.path.dirname(__file__), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
730 | "icons", |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
731 | "corba48-{0}".format(pixmapSuffix), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
732 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
733 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
734 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
735 | self.compileRunning = False |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
736 | ui = ericApp().getObject("UserInterface") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
737 | if exitStatus == QProcess.ExitStatus.NormalExit and exitCode == 0: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
738 | path = os.path.dirname(self.idlFile) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
739 | poaList = glob.glob(os.path.join(path, "*__POA")) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
740 | npoaList = [f.replace("__POA", "") for f in poaList] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
741 | fileList = glob.glob(os.path.join(path, "*_idl.py")) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
742 | for directory in poaList + npoaList: |
19
c2156196748a
Changed some import statements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
12
diff
changeset
|
743 | fileList += FileSystemUtilities.direntries(directory, True, "*.py") |
1
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
744 | for file in fileList: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
745 | self.project.appendFile(file) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
746 | ui.showNotification( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
747 | pixmap, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
748 | self.tr("Interface Compilation"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
749 | self.tr("The compilation of the interface file was successful."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
750 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
751 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
752 | ui.showNotification( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
753 | pixmap, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
754 | self.tr("Interface Compilation"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
755 | self.tr("The compilation of the interface file failed."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
756 | kind=NotificationTypes.CRITICAL, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
757 | timeout=0, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
758 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
759 | self.compileProc = None |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
760 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
761 | def __compileIDL(self, fn, noDialog=False, progress=None): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
762 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
763 | Private method to compile a .idl file to python. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
764 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
765 | @param fn filename of the .idl file to be compiled (string) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
766 | @param noDialog flag indicating silent operations (boolean) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
767 | @param progress reference to the progress dialog (EricProgressDialog) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
768 | @return reference to the compile process (QProcess) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
769 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
770 | params = self.project.getProjectData(dataKey="IDLPARAMS") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
771 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
772 | self.compileProc = QProcess() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
773 | args = [] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
774 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
775 | args.append("-bpython") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
776 | args.append("-I.") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
777 | for directory in params["IncludeDirs"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
778 | args.append( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
779 | "-I{0}".format(self.project.getAbsoluteUniversalPath(directory)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
780 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
781 | for name in params["DefinedNames"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
782 | args.append("-D{0}".format(name)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
783 | for name in params["UndefinedNames"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
784 | args.append("-U{0}".format(name)) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
785 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
786 | fn = self.project.getAbsoluteUniversalPath(fn) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
787 | self.idlFile = fn |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
788 | args.append("-C{0}".format(os.path.dirname(fn))) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
789 | args.append(fn) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
790 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
791 | self.compileProc.finished.connect(self.__compileIDLDone) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
792 | self.compileProc.readyReadStandardOutput.connect(self.__readStdout) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
793 | self.compileProc.readyReadStandardError.connect(self.__readStderr) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
794 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
795 | self.noDialog = noDialog |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
796 | self.compileProc.start(self.omniidl, args) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
797 | procStarted = self.compileProc.waitForStarted(5000) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
798 | if procStarted: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
799 | self.compileRunning = True |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
800 | return self.compileProc |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
801 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
802 | self.compileRunning = False |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
803 | if progress is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
804 | progress.cancel() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
805 | EricMessageBox.critical( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
806 | self, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
807 | self.tr("Process Generation Error"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
808 | self.tr( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
809 | "<p>Could not start {0}.<br>" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
810 | "Ensure that it is in the search path.</p>" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
811 | ).format(self.omniidl), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
812 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
813 | return None |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
814 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
815 | def __compileInterface(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
816 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
817 | Private method to compile an interface to python. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
818 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
819 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
820 | itm = self.model().item(self.currentIndex()) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
821 | fn2 = itm.fileName() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
822 | fn = self.project.getRelativePath(fn2) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
823 | self.__compileIDL(fn) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
824 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
825 | def __compileAllInterfaces(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
826 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
827 | Private method to compile all interfaces to python. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
828 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
829 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
830 | numIDLs = len(self.project.getProjectData(dataKey="INTERFACES")) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
831 | progress = EricProgressDialog( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
832 | self.tr("Compiling interfaces..."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
833 | self.tr("Abort"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
834 | 0, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
835 | numIDLs, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
836 | self.tr("%v/%m Interfaces"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
837 | self, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
838 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
839 | progress.setModal(True) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
840 | progress.setMinimumDuration(0) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
841 | progress.setWindowTitle(self.tr("Interfaces")) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
842 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
843 | for prog, fn in enumerate( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
844 | self.project.getProjectData(dataKey="INTERFACES") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
845 | ): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
846 | progress.setValue(prog) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
847 | if progress.wasCanceled(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
848 | break |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
849 | proc = self.__compileIDL(fn, True, progress) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
850 | if proc is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
851 | while proc.state() == QProcess.ProcessState.Running: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
852 | QThread.msleep(100) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
853 | QApplication.processEvents() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
854 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
855 | break |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
856 | progress.setValue(numIDLs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
857 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
858 | def __compileSelectedInterfaces(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
859 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
860 | Private method to compile selected interfaces to python. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
861 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
862 | if self.omniidl is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
863 | items = self.getSelectedItems() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
864 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
865 | files = [self.project.getRelativePath(itm.fileName()) for itm in items] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
866 | numIDLs = len(files) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
867 | progress = EricProgressDialog( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
868 | self.tr("Compiling interfaces..."), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
869 | self.tr("Abort"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
870 | 0, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
871 | numIDLs, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
872 | self.tr("%v/%m Interfaces"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
873 | self, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
874 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
875 | progress.setModal(True) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
876 | progress.setMinimumDuration(0) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
877 | progress.setWindowTitle(self.tr("Interfaces")) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
878 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
879 | for prog, fn in enumerate(files): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
880 | progress.setValue(prog) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
881 | if progress.wasCanceled(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
882 | break |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
883 | proc = self.__compileIDL(fn, True, progress) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
884 | if proc is not None: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
885 | while proc.state() == QProcess.ProcessState.Running: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
886 | QThread.msleep(100) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
887 | QApplication.processEvents() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
888 | else: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
889 | break |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
890 | progress.setValue(numIDLs) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
891 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
892 | def __configureIdlCompiler(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
893 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
894 | Private method to show a dialog to configure some options for the |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
895 | IDL compiler. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
896 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
897 | from .IdlCompilerOptionsDialog import IdlCompilerOptionsDialog |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
898 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
899 | params = self.project.getProjectData(dataKey="IDLPARAMS") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
900 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
901 | dlg = IdlCompilerOptionsDialog( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
902 | params["IncludeDirs"][:], |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
903 | params["DefinedNames"][:], |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
904 | params["UndefinedNames"][:], |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
905 | self.project, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
906 | self, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
907 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
908 | if dlg.exec() == QDialog.DialogCode.Accepted: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
909 | include, defined, undefined = dlg.getData() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
910 | if include != params["IncludeDirs"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
911 | params["IncludeDirs"] = include[:] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
912 | self.project.setDirty(True) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
913 | if defined != params["DefinedNames"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
914 | params["DefinedNames"] = defined[:] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
915 | self.project.setDirty(True) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
916 | if undefined != params["UndefinedNames"]: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
917 | params["UndefinedNames"] = undefined[:] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
918 | self.project.setDirty(True) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
919 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
920 | def __configureCorba(self): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
921 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
922 | Private method to open the configuration dialog. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
923 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
924 | ericApp().getObject("UserInterface").showPreferences("corbaPage") |