summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-11-17 15:38:05 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-11-24 14:12:30 +0100
commit7041d5c5b035007f09f092d15b40aae4731803a6 (patch)
tree0bdf006cbe204b0be53f64078b86a0dbf7ccbdb4 /scripts
parent08aa7d9149bea918386a3dc4475e130bfe93917e (diff)
Update conext menu code to handle Spelling Popup
* Use unique IDs for sub menus. * Handle uno command's parameter. * When there is any parameter, we use the menu text. * Avoid to enable FontDialog on other conext menus * Introduce the command ".uno:None" to indicate that the menu item can't be executed. * Whitelisted spelling context menu's uno commands. * Add a black list in unocommands.py to list those uno commands which have no text in xcu file. In this case, we can use the text sent in the menu structure. Change-Id: Ie84fcb7d6c7a2f4cd50c666dbcd8c77cf42731de Reviewed-on: https://gerrit.libreoffice.org/83606 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/unocommands.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/unocommands.py b/scripts/unocommands.py
index e4dc45ef4..59aa19d84 100755
--- a/scripts/unocommands.py
+++ b/scripts/unocommands.py
@@ -86,6 +86,7 @@ def extractMenuCommands(path):
# Extract all the uno commands we are using in the Online context menu
def extractContextCommands(path):
+ commandsToIgnore = ["FontDialogForParagraph"]
commands = []
# extract from the comments whitelist
@@ -114,6 +115,7 @@ def extractContextCommands(path):
if line.find("_UNO(") >= 0:
commands += commandFromMenuLine(line)
+ commands = [command for command in commands if command not in commandsToIgnore]
# may the list unique
return set(commands)
@@ -242,6 +244,10 @@ window._UNO = function(string, component, isContext) {
\t\t}
\t}
+\treturn this.removeAccessKey(text);
+}
+
+window.removeAccessKey = function(text) {
\t// Remove access key markers from translated strings
\t// 1. access key in parenthesis in case of non-latin scripts
\ttext = text.replace(/\(~[A-Za-z]\)/, '');