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

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

    89     89       xDefaultContext = uno.getComponentContext().ServiceManager.DefaultContext
    90     90       xPackageInfoProvider = xDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
    91     91       sFullPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR")
    92     92       if sPath and not sPath.startswith("/"):
    93     93           sPath = "/" + sPath
    94     94       sFullPath = sFullPath[8:] + sPath
    95     95       return os.path.abspath(sFullPath)
           96  +
           97  +
           98  +def getProductNameAndVersion ():
           99  +    "returns tuple of software name and version"
          100  +    xSettings = getConfigSetting("org.openoffice.Setup/Product", False)
          101  +    sProdName = xSettings.getByName("ooName")
          102  +    sVersion = xSettings.getByName("ooSetupVersion")
          103  +    return (sProdName, sVersion)

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

   135    135           except:
   136    136               traceback.print_exc()
   137    137   
   138    138       def execute (self, args):
   139    139           if not args:
   140    140               return
   141    141           try:
   142         -            # what version of the software?
   143         -            xSettings = helpers.getConfigSetting("org.openoffice.Setup/Product", False)
   144         -            sProdName = xSettings.getByName("ooName")
   145         -            sVersion = xSettings.getByName("ooSetupVersion")
          142  +            sProdName, sVersion = helpers.getProductNameAndVersion()
   146    143               if (sProdName == "LibreOffice" and sVersion < "4") or sProdName == "OpenOffice.org":
   147    144                   return
   148    145   
   149    146               # what event?
   150    147               bCorrectEvent = False
   151    148               for arg in args:
   152    149                   if arg.Name == "Environment":