Grammalecte  Check-in [f249f05cff]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

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 2019-07-17 10:19:15
Context
2019-07-17
10:19
[lo] options dialog: tabs (draft) check-in: f015dc603b user: olr tags: lo, trunk
10:19
[lo] helpers: get product name and version check-in: f249f05cff user: olr tags: lo, trunk
10:17
[fr] ajustements check-in: 9f7cff2068 user: olr tags: fr, trunk
Changes

Changes to gc_core/py/oxt/helpers.py.

89
90
91
92
93
94
95








    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)















>
>
>
>
>
>
>
>
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)

Changes to gc_lang/fr/oxt/ContextMenu/ContextMenu.py.

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
        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")
            if (sProdName == "LibreOffice" and sVersion < "4") or sProdName == "OpenOffice.org":
                return

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







|
<
<
<







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:
            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":