|
70 | 70 | ID_LITTLEDICT = 16 |
71 | 71 | ID_PROVERBDICT = 17 |
72 | 72 | ID_OUTPUT_SIMP_CHINESE = 18 |
| 73 | +ID_USER_PHRASE_EDITOR = 19 |
73 | 74 |
|
74 | 75 |
|
75 | 76 | class ChewingTextService(TextService): |
@@ -561,8 +562,12 @@ def onCommand(self, commandId, commandType): |
561 | 562 | self.toggleLanguageMode() |
562 | 563 | elif commandId == ID_SWITCH_SHAPE and commandType == COMMAND_LEFT_CLICK: # 切換全形/半形 |
563 | 564 | self.toggleShapeMode() |
564 | | - elif commandId == ID_SETTINGS: # 開啟設定工具 |
565 | | - config_tool = '"{0}"'.format(os.path.join(self.curdir, "config_tool.py")) |
| 565 | + elif commandId == ID_SETTINGS or commandId == ID_USER_PHRASE_EDITOR: # 開啟設定工具 or 編輯辭庫 |
| 566 | + if commandId == ID_USER_PHRASE_EDITOR: # 編輯使用者辭庫 |
| 567 | + tool_name = "user_phrase_editor" |
| 568 | + else: # 輸入法設定 |
| 569 | + tool_name = "config_tool" |
| 570 | + config_tool = '"{0}" {1}'.format(os.path.join(self.curdir, "config_tool.py"), tool_name) |
566 | 571 | python_exe = sys.executable # 找到 python 執行檔 |
567 | 572 | # 使用我們自帶的 python runtime exe 執行 config tool |
568 | 573 | # 此處也可以用 subprocess,不過使用 windows API 比較方便 |
@@ -608,7 +613,7 @@ def onMenu(self, buttonId): |
608 | 613 | {"text": "注音及選字選詞錯誤回報 (&P)", "id": ID_DICT_BUGREPORT}, |
609 | 614 | {}, |
610 | 615 | # {"text": "新酷音使用說明 (&H)", "id": ID_CHEWING_HELP}, |
611 | | - # {"text": "編輯使用者詞庫 (&E)", "id": ID_HASHED}, |
| 616 | + {"text": "編輯使用者詞庫 (&E)", "id": ID_USER_PHRASE_EDITOR}, |
612 | 617 | {"text": "設定新酷音輸入法(&C)", "id": ID_SETTINGS}, |
613 | 618 | {}, |
614 | 619 | {"text": "網路辭典 (&D)", "submenu": [ |
|
0 commit comments