Grammalecte  Check-in [f249f05cff]

Overview
Comment:[lo] helpers: get product name and version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: f249f05cffa5596c8235ab2de8d21a594f8d9edb59a5d39cfff6ac4d351b0446
User & Date: olr on 2019-07-17 10:19:15
Other Links: manifest | tags
Context
2019-07-17
10:19
[lo] options dialog: tabs (draft) check-in: f015dc603b user: olr tags: trunk, lo
10:19
[lo] helpers: get product name and version check-in: f249f05cff user: olr tags: trunk, lo
10:17
[fr] ajustements check-in: 9f7cff2068 user: olr tags: trunk, fr
Changes

Modified gc_core/py/oxt/helpers.py from [5f06fa2952] to [c3e413f4e7].

89
90
91
92
93
94
95








89
90
91
92
93
94
95
96
97
98
99
100
101
102
103







+
+
+
+
+
+
+
+
    xDefaultContext = uno.getComponentContext().ServiceManager.DefaultContext
    xPackageInfoProvider = xDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
    sFullPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR")
    if sPath and not sPath.startswith("/"):
        sPath = "/" + sPath
    sFullPath = sFullPath[8:] + sPath
    return os.path.abspath(sFullPath)


def getProductNameAndVersion ():
    "returns tuple of software name and version"
    xSettings = getConfigSetting("org.openoffice.Setup/Product", False)
    sProdName = xSettings.getByName("ooName")
    sVersion = xSettings.getByName("ooSetupVersion")
    return (sProdName, sVersion)

Modified gc_lang/fr/oxt/ContextMenu/ContextMenu.py from [95fd6d10c1] to [f06cffc0e3].

135
136
137
138
139
140
141
142
143
144
145

146
147
148
149
150
151
152
135
136
137
138
139
140
141




142
143
144
145
146
147
148
149







-
-
-
-
+







        except:
            traceback.print_exc()

    def execute (self, args):
        if not args:
            return
        try:
            # what version of the software?
            xSettings = helpers.getConfigSetting("org.openoffice.Setup/Product", False)
            sProdName = xSettings.getByName("ooName")
            sVersion = xSettings.getByName("ooSetupVersion")
            sProdName, sVersion = helpers.getProductNameAndVersion()
            if (sProdName == "LibreOffice" and sVersion < "4") or sProdName == "OpenOffice.org":
                return

            # what event?
            bCorrectEvent = False
            for arg in args:
                if arg.Name == "Environment":