Overview
| Comment: | [lo] launch lexical editor from context menu |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | lo |
| Files: | files | file ages | folders |
| SHA3-256: |
616a21e49f1463e7d42c8ce77614a465 |
| User & Date: | olr on 2020-11-02 15:07:53 |
| Other Links: | manifest | tags |
Context
|
2020-11-03
| ||
| 12:35 | [fr] ajustements check-in: 3cffdae3b0 user: olr tags: trunk, fr | |
|
2020-11-02
| ||
| 15:07 | [lo] launch lexical editor from context menu check-in: 616a21e49f user: olr tags: trunk, lo | |
| 14:49 | [fr] ajustements check-in: e83a01147e user: olr tags: trunk, fr | |
Changes
Modified gc_lang/fr/oxt/AppLauncher.py from [b4674c5ea1] to [7f07846793].
| ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + + - - + + - + - + - + - - + + - - - + + + + - - + + + + + + + - - + + - - + + - - + + - - + + |
import uno
from com.sun.star.task import XJobExecutor
import helpers
xDesktop = None
xLEDialog = None # dialog for Lexicon Editor
class AppLauncher (unohelper.Base, XJobExecutor):
def __init__ (self, ctx):
self.ctx = ctx
# In this extension, French is default language.
# It is assumed that those who need to use the French dictionaries understand French and may not understand English.
xSettings = helpers.getConfigSetting("/org.openoffice.Setup/L10N", False)
sLocale = xSettings.getByName("ooLocale") # Note: look at ooSetupSystemLocale value?
self.sLang = sLocale[0:2]
# XJobExecutor
def trigger (self, sCmd):
global xLEDialog
try:
if sCmd == "About":
import About
|
| ︙ |
Modified gc_lang/fr/oxt/ContextMenu/ContextMenu.py from [172f2404b4] to [c17c3b29b1].
| ︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + |
def __init__ (self, ctx):
self.ctx = ctx
def notifyContextMenuExecute (self, xEvent):
sWord = self._getWord()
try:
lWordAndMorph = oSpellChecker.analyze(sWord)
|
| ︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | + |
xCursor.gotoEndOfWord(True)
except:
traceback.print_exc()
return xCursor.String.strip('.')
class JobExecutor (XJob, unohelper.Base):
def __init__ (self, ctx):
self.ctx = ctx
global xDesktop
global oSpellChecker
try:
if not xDesktop:
xDesktop = self.ctx.getServiceManager().createInstanceWithContext('com.sun.star.frame.Desktop', self.ctx)
|
| ︙ |
Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [afc37335be] to [828f4f365e].
| ︙ | |||
68 69 70 71 72 73 74 75 76 77 78 79 80 81 | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + |
def __init__ (self, ctx):
self.ctx = ctx
self.xSvMgr = self.ctx.ServiceManager
self.xDesktop = self.xSvMgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.ctx)
self.xDocument = self.xDesktop.getCurrentComponent()
self.xContainer = None
self.xDialog = None
self.bClosed = False
self.oPersonalDicJSON = None
# data
self.sLemma = ""
self.lGeneratedFlex = []
# options node
self.xSettingNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", True)
self.xOptionNode = self.xSettingNode.getByName("o_fr")
|
| ︙ | |||
106 107 108 109 110 111 112 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + |
setattr(xCol, k, w)
xColumnModel.addColumn(xCol)
for k, w in kwargs.items():
setattr(xGridModel, k, w)
self.xDialog.insertByName(name, xGridModel)
return xGridModel
|
| ︙ | |||
159 160 161 162 163 164 165 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - + |
self.xDateDic = self._addWidget("save_date", 'FixedText', nXB+85, nY0+2, 75, nHeight, Label = self.dUI.get("void", "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000088)
self.xNumDic = self._addWidget("num_of_entries2", 'FixedText', nXC+70, nY0+2, 45, nHeight, Label = "0", FontDescriptor = xFDSubTitle, TextColor = 0x000088)
self.xImport = self._addWidget('import_button', 'Button', self.xDialog.Width-90, nY0, 40, 12, Label = self.dUI.get('import_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
self.xExport = self._addWidget('export_button', 'Button', self.xDialog.Width-45, nY0, 40, 12, Label = self.dUI.get('export_button', "#err"), FontDescriptor = xFDSubTitle, TextColor = 0x000055)
#### Add word
self._addWidget("add_section", 'FixedLine', nX1, nY1, 170, nHeight, Label = self.dUI.get("add_section", "#err"), FontDescriptor = xFDTitle)
|
| ︙ | |||
297 298 299 300 301 302 303 304 305 306 307 308 309 310 | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | + + + |
self.xContainer.getControl(sName).addKeyListener(self)
def _createActionListeners (self, lNames, sAction):
for sName in lNames:
self.xContainer.getControl(sName).addActionListener(self)
self.xContainer.getControl(sName).setActionCommand(sAction)
def newEntry (self, sWord):
self.xLemma.Text = sWord
# XActionListener
def actionPerformed (self, xActionEvent):
try:
if xActionEvent.ActionCommand == "Update":
self.updateGenWords()
elif xActionEvent.ActionCommand == "SearchWords":
self.launchSearchWords()
|
| ︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | + |
elif xActionEvent.ActionCommand == "Import":
self.importDictionary()
elif xActionEvent.ActionCommand == "Export":
self.exportDictionary()
elif xActionEvent.ActionCommand == 'Info':
pass
elif xActionEvent.ActionCommand == "Close":
self.bClosed = True
self.xContainer.dispose() # Non modal dialog
#self.xContainer.endExecute() # Modal dialog
except:
traceback.print_exc()
# XTopWindowListener (useful for non modal dialog only)
def windowOpened (self, xEvent):
|
| ︙ |