MCPcopy Create free account
hub / github.com/EasyIME/PIME / applyConfig

Method applyConfig

python/input_methods/chewing/chewing_ime.py:120–156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118 self.applyConfig()
119
120 def applyConfig(self):
121 cfg = chewingConfig # globally shared config object
122 self.configVersion = cfg.getVersion()
123 chewingContext = self.chewingContext
124
125 # 按下 Ctrl+ 數字加入游標"前方"的詞 (或是後方)
126 chewingContext.set_addPhraseDirection(cfg.addPhraseForward)
127
128 # 選字後自動把游標往後移一個字
129 chewingContext.set_autoShiftCur(cfg.advanceAfterSelection)
130
131 # 每頁顯示幾個候選字
132 chewingContext.set_candPerPage(cfg.candPerPage)
133
134 # 按下 ESC 鍵清除正在編輯的字
135 chewingContext.set_escCleanAllBuf(cfg.escCleanAllBuf)
136
137 # 鍵盤 layout 種類
138 chewingContext.set_KBType(cfg.keyboardLayout)
139
140 # Space 鍵行為
141 chewingContext.set_spaceAsSelection(cfg.spaceKeyAction)
142
143 # 設定 UI 外觀
144 self.customizeUI(candFontName='MingLiu',
145 candFontSize=cfg.fontSize,
146 candPerRow=cfg.candPerRow,
147 candUseCursor=not(cfg.leftRightAction and cfg.upDownAction))
148
149 # 設定是否啟用自動學習功能
150 self.setAutoLearn(cfg.autoLearn)
151
152 # 設定選字按鍵 (123456..., asdf.... 等)
153 self.setSelKeys(cfg.getSelKeys())
154
155 # 轉換輸出成簡體中文?
156 self.setOutputSimplifiedChinese(cfg.outputSimpChinese)
157
158 # 初始化新酷音輸入法引擎
159 def initChewingContext(self):

Callers 2

checkConfigChangeMethod · 0.95
initChewingContextMethod · 0.95

Calls 6

setAutoLearnMethod · 0.95
setSelKeysMethod · 0.95
customizeUIMethod · 0.80
getVersionMethod · 0.45
getSelKeysMethod · 0.45

Tested by

no test coverage detected