Grammalecte  Check-in [12122e00cc]

Overview
Comment:[lo] context menu: space cleaning
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | lo
Files: files | file ages | folders
SHA3-256: 12122e00ccac7992c299a1c75be4f02b538f7ce2e65436e060582770f67b55f7
User & Date: olr on 2019-05-26 06:55:13
Other Links: manifest | tags
Context
2019-05-26
08:04
[core] gc engine: full analysis update check-in: 32abadc585 user: olr tags: core, trunk
06:55
[lo] context menu: space cleaning check-in: 12122e00cc user: olr tags: lo, trunk
06:53
[fr] pt: ajustements check-in: 23efc65abc user: olr tags: fr, trunk
Changes

Modified gc_lang/fr/oxt/ContextMenu/ContextMenu.py from [03a78a32c7] to [84e566480c].

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
165
166
167
168
169
170
171
172
173
174
175
                        xSubMenuContainer = xContextMenu.createInstance("com.sun.star.ui.ActionTriggerContainer")
                        for j, s in enumerate(lMorph):
                            self._addItemToContextMenu(xSubMenuContainer, j, "ActionTrigger", Text=s, CommandURL="service:net.grammalecte.AppLauncher?None")
                        # create root menu entry
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text=sRoot, SubContainer=xSubMenuContainer)
                    else:
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text="# erreur : {}".format(item))
                
                # Links to Conjugueur
                if aVerb:
                    i = self._addItemToContextMenu(xContextMenu, i, "ActionTriggerSeparator", SeparatorType=nUnoConstantLine)
                    for sVerb in aVerb:
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text="Conjuguer “{}”…".format(sVerb),
                                                       CommandURL="service:net.grammalecte.AppLauncher?CJ/"+sVerb)

................................................................................
                    oSpellChecker = oGC.getSpellChecker()
                else:
                    oSpellChecker = SpellChecker("${lang}", "fr-allvars.bdic")
            if not oLexicographe:
                oLexicographe = lxg.Lexicographe(oSpellChecker)
        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":
                    for v in arg.Value:
                        if v.Name == "EnvType" and v.Value == "DOCUMENTEVENT":
                            bCorrectEvent = True
................................................................................
                if model.supportsService("com.sun.star.text.TextDocument"):
                    xController = model.getCurrentController()
                    if xController:
                        xController.registerContextMenuInterceptor(MyContextMenuInterceptor(self.ctx))
                        #print("OFF")
        except:
            traceback.print_exc()
        

g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(JobExecutor, "grammalecte.ContextMenuHandler", ("grammalecte.ContextMenuHandler",),)







|







 







|










|







 







|



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
165
166
167
168
169
170
171
172
173
174
175
                        xSubMenuContainer = xContextMenu.createInstance("com.sun.star.ui.ActionTriggerContainer")
                        for j, s in enumerate(lMorph):
                            self._addItemToContextMenu(xSubMenuContainer, j, "ActionTrigger", Text=s, CommandURL="service:net.grammalecte.AppLauncher?None")
                        # create root menu entry
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text=sRoot, SubContainer=xSubMenuContainer)
                    else:
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text="# erreur : {}".format(item))

                # Links to Conjugueur
                if aVerb:
                    i = self._addItemToContextMenu(xContextMenu, i, "ActionTriggerSeparator", SeparatorType=nUnoConstantLine)
                    for sVerb in aVerb:
                        i = self._addItemToContextMenu(xContextMenu, i, "ActionTrigger", Text="Conjuguer “{}”…".format(sVerb),
                                                       CommandURL="service:net.grammalecte.AppLauncher?CJ/"+sVerb)

................................................................................
                    oSpellChecker = oGC.getSpellChecker()
                else:
                    oSpellChecker = SpellChecker("${lang}", "fr-allvars.bdic")
            if not oLexicographe:
                oLexicographe = lxg.Lexicographe(oSpellChecker)
        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":
                    for v in arg.Value:
                        if v.Name == "EnvType" and v.Value == "DOCUMENTEVENT":
                            bCorrectEvent = True
................................................................................
                if model.supportsService("com.sun.star.text.TextDocument"):
                    xController = model.getCurrentController()
                    if xController:
                        xController.registerContextMenuInterceptor(MyContextMenuInterceptor(self.ctx))
                        #print("OFF")
        except:
            traceback.print_exc()


g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(JobExecutor, "grammalecte.ContextMenuHandler", ("grammalecte.ContextMenuHandler",),)