Wed, 07 Dec 2022 13:08:40 +0100
Added missing code to load the translations.
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:
0
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:
0
diff
changeset
|
2 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
3 | # Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
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:
0
diff
changeset
|
6 | """ |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
7 | Module implementing a plugin to add support for CORBA development. |
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:
0
diff
changeset
|
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:
0
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:
0
diff
changeset
|
10 | 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:
0
diff
changeset
|
11 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
12 | from PyQt6.QtCore import QCoreApplication, QObject, QTranslator |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
13 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
14 | from eric7 import Globals, Preferences |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
15 | from eric7.EricWidgets import EricMessageBox |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
16 | from eric7.EricWidgets.EricApplication import ericApp |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
17 | from ExtensionCorba.ProjectInterfacesBrowser import ProjectInterfacesBrowser |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
18 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
19 | # Start-Of-Header |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
20 | name = "Corba Extension Plugin" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
21 | author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
22 | autoactivate = 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:
0
diff
changeset
|
23 | deactivateable = True |
6
dbc40938587e
Added missing code to load the translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
24 | version = "10.0.1" |
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:
0
diff
changeset
|
25 | className = "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:
0
diff
changeset
|
26 | packageName = "ExtensionCorba" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
27 | shortDescription = "Support for the development of CORBA projects" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
28 | longDescription = ( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
29 | "This plugin adds support for the development of CORBA related projects." |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
31 | needsRestart = 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:
0
diff
changeset
|
32 | pyqtApi = 2 |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
33 | # End-Of-Header |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
34 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
35 | 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:
0
diff
changeset
|
36 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
37 | corbaExtensionPluginObject = 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:
0
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:
0
diff
changeset
|
39 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
40 | def exeDisplayData(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
42 | Module function to support the display of some executable info. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
43 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
44 | @return dictionary containing the data to query the presence of |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
45 | the executable |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
46 | @rtype dict |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
47 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
48 | global corbaExtensionPluginObject |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
49 | |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
50 | if corbaExtensionPluginObject is None: |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
51 | data = { |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
52 | "programEntry": False, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
53 | "header": QCoreApplication.translate( |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
54 | "CorbaExtensionPlugin", "CORBA IDL Compiler" |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
55 | ), |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
56 | "text": QCoreApplication.translate( |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
57 | "CorbaExtensionPlugin", "CORBA Support plugin is not activated" |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
58 | ), |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
59 | "version": QCoreApplication.translate("CorbaExtensionPlugin", "(inactive)"), |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
60 | } |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
61 | else: |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
62 | exe = corbaExtensionPluginObject.getPreferences("omniidl") |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
63 | if not exe: |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
64 | exe = "omniidl" |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
65 | if Globals.isWindowsPlatform(): |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
66 | exe += ".exe" |
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:
0
diff
changeset
|
67 | |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
68 | data = { |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
69 | "programEntry": True, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
70 | "header": QCoreApplication.translate( |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
71 | "CorbaExtensionPlugin", "CORBA IDL Compiler" |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
72 | ), |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
73 | "exe": exe, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
74 | "versionCommand": "-V", |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
75 | "versionStartsWith": "omniidl", |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
76 | "versionRe": "", |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
77 | "versionPosition": -1, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
78 | "version": "", |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
79 | "versionCleanup": None, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
80 | "exeModule": None, |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
81 | } |
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:
0
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:
0
diff
changeset
|
83 | return data |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
84 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
85 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
86 | def getConfigData(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
87 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
88 | Module function returning data as required by 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:
0
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:
0
diff
changeset
|
90 | @return dictionary containing the relevant data |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
91 | @rtype dict |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
92 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
93 | 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:
0
diff
changeset
|
94 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
95 | 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:
0
diff
changeset
|
96 | "corbaPage": [ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
97 | QCoreApplication.translate("CorbaExtensionPlugin", "CORBA"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
98 | os.path.join( |
2
68c017d640b0
Fixed a few issues detected during testing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
99 | "ExtensionCorba", "icons", "preferences-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:
0
diff
changeset
|
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:
0
diff
changeset
|
101 | createCorbaPage, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
102 | 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:
0
diff
changeset
|
103 | 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:
0
diff
changeset
|
104 | ], |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
105 | } |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
106 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
108 | def createCorbaPage(configDlg): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
110 | Module function to create the CORBA configuration page. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
111 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
112 | @param configDlg reference to 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:
0
diff
changeset
|
113 | @type ConfigurationWidget |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
114 | @return reference to the configuration page |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
115 | @rtype CorbaPage |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
116 | """ |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
117 | from ExtensionCorba.ConfigurationPage.CorbaPage import CorbaPage |
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:
0
diff
changeset
|
118 | |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
119 | global corbaExtensionPluginObject |
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:
0
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:
0
diff
changeset
|
121 | page = CorbaPage(corbaExtensionPluginObject) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
122 | return page |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
123 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
124 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
125 | def prepareUninstall(): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
126 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
127 | Module function to prepare for an un-installation. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
128 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
129 | Preferences.getSettings().remove(CorbaExtensionPlugin.PreferencesKey) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
130 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
132 | class CorbaExtensionPlugin(QObject): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
133 | """ |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
134 | Class implementing a plugin to add support for CORBA development. |
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:
0
diff
changeset
|
135 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
136 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
137 | PreferencesKey = "Corba" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
138 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
139 | def __init__(self, ui): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
140 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
141 | 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:
0
diff
changeset
|
142 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
143 | @param ui reference to the user interface 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:
0
diff
changeset
|
144 | @type UI.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:
0
diff
changeset
|
145 | """ |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
146 | super().__init__(ui) |
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:
0
diff
changeset
|
147 | self.__ui = ui |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
148 | self.__initialize() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
149 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
150 | self.__defaults = { |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
151 | "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:
0
diff
changeset
|
152 | } |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
153 | |
6
dbc40938587e
Added missing code to load the translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
154 | self.__translator = None |
dbc40938587e
Added missing code to load the translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
155 | self.__loadTranslator() |
dbc40938587e
Added missing code to load the translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4
diff
changeset
|
156 | |
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:
0
diff
changeset
|
157 | def __initialize(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:
0
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:
0
diff
changeset
|
159 | Private slot to (re)initialize the plugin. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
160 | """ |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
161 | global corbaExtensionPluginObject |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
162 | corbaExtensionPluginObject = None |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
163 | |
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:
0
diff
changeset
|
164 | self.__browser = 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:
0
diff
changeset
|
165 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
166 | def activate(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:
0
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:
0
diff
changeset
|
168 | Public method to activate this plug-in. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
169 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
170 | @return tuple of None and activation status |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
171 | @rtype bool |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
172 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
173 | global error, corbaExtensionPluginObject |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
174 | error = "" # clear previous 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:
0
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:
0
diff
changeset
|
176 | if self.__ui.versionIsNewer("22.12"): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
177 | corbaExtensionPluginObject = 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:
0
diff
changeset
|
178 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
179 | self.__browser = ProjectInterfacesBrowser(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:
0
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:
0
diff
changeset
|
181 | return None, 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:
0
diff
changeset
|
182 | 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:
0
diff
changeset
|
183 | EricMessageBox.warning( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
184 | self.__ui, |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
185 | self.tr("CORBA Extension"), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
186 | 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:
0
diff
changeset
|
187 | "The CORBA extension cannot be activated because it requires eric7" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
188 | " 23.1 or newer." |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
189 | ), |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
191 | error = 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:
0
diff
changeset
|
192 | "The CORBA extension cannot be activated because it requires eric7" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
193 | " 23.1 or newer." |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
194 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
195 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
196 | return None, 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:
0
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:
0
diff
changeset
|
198 | 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:
0
diff
changeset
|
199 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
200 | Public method to deactivate this plug-in. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
201 | """ |
2
68c017d640b0
Fixed a few issues detected during testing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
202 | self.__browser.deactivate() |
68c017d640b0
Fixed a few issues detected during testing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1
diff
changeset
|
203 | |
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:
0
diff
changeset
|
204 | self.__initialize() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
206 | def __loadTranslator(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:
0
diff
changeset
|
207 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
208 | Private method to load the translation 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:
0
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:
0
diff
changeset
|
210 | if self.__ui 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:
0
diff
changeset
|
211 | loc = self.__ui.getLocale() |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
212 | if loc and loc != "C": |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
213 | locale_dir = 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:
0
diff
changeset
|
214 | os.path.dirname(__file__), "ExtensionCorba", "i18n" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
215 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
216 | translation = "corba_{0}".format(loc) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
217 | translator = QTranslator(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:
0
diff
changeset
|
218 | loaded = translator.load(translation, locale_dir) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
219 | if loaded: |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
220 | self.__translator = translator |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
221 | ericApp().installTranslator(self.__translator) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
222 | 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:
0
diff
changeset
|
223 | print( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
224 | "Warning: translation file '{0}' could not be" |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
225 | " loaded.".format(translation) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
226 | ) |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
227 | print("Using default.") |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
229 | def getPreferences(self, key): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
230 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
231 | Public method to retrieve the various settings values. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
232 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
233 | @param key the key of the value to get |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
234 | @type 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:
0
diff
changeset
|
235 | @return the requested setting value |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
236 | @rtype any |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
237 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
238 | return Preferences.Prefs.settings.value( |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
239 | self.PreferencesKey + "/" + key, self.__defaults[key] |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
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:
0
diff
changeset
|
241 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
242 | def setPreferences(self, key, value): |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
243 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
244 | Public method to store the various settings values. |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
245 | |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
246 | @param key the key of the setting to be set |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
247 | @type 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:
0
diff
changeset
|
248 | @param value the value to be set |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
249 | @type any |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
250 | """ |
d4384e4d7aff
First incarnation of the CORBA IDL support plugin, that was an integral part of eric7 previously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
251 | Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value) |
4
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
252 | |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
253 | |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
254 | # |
ff4fc402f193
Implemented some final changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2
diff
changeset
|
255 | # eflag: noqa = M801 |