Skip to content

Instantly share code, notes, and snippets.

@mrkschan
Created October 14, 2010 14:43
Show Gist options
  • Save mrkschan/626277 to your computer and use it in GitHub Desktop.
Save mrkschan/626277 to your computer and use it in GitHub Desktop.
62c62
< self._config_section = "engine/Table/%s" % self._name.replace(' ','_')
---
> self._config_section = "engine/Table/%s" % self._name
83c83
< # self._cursor: the caret position in preedit phrases
---
> # self._cursor: the caret position in preedit phrases
103,106c103,107
< self._chinese_mode = self._config.get_value (
< self._config_section,
< "ChineseMode",
< self.get_chinese_mode())
---
> #self._chinese_mode = self._config.get_value (
> # self._config_section,
> # "ChineseMode",
> # self.get_chinese_mode())
> self._chinese_mode = 1
131c132
<
---
>
149c150
<
---
>
162c163
<
---
>
169c170
<
---
>
174c175
<
---
>
219c220
<
---
>
232c233
<
---
>
251c252
<
---
>
264c265
<
---
>
273c274
<
---
>
317c318
<
---
>
325c326
< _candi = u'###' + self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ] + u'###'
---
> _candi = u'###' + self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ] + u'###'
343c344
< return _candi
---
> return _candi
359c360
< _candi =self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ]
---
> _candi =self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ]
362c363
< self._caret += len( _candi )
---
> self._caret += len( _candi )
364c365
<
---
>
383c384
<
---
>
420c421
<
---
>
536c537
<
---
>
578c579
< self._chars[0].pop()
---
> self._chars[0].pop()
594c595
< else:
---
> else:
606,607c607,608
<
< return True
---
>
> return True
625c626
<
---
>
646c647
< aux_string = u''.join (self._chars[0])
---
> aux_string = u''.join (self._chars[0])
654a656
> aux_string = self._zi+u': '
670c672
<
---
>
679c681
<
---
>
688c690
<
---
>
697c699
<
---
>
736c738
<
---
>
748c750
<
---
>
771c773
<
---
>
790c792
<
---
>
803c805
< # we have invalid input, so do not commit
---
> # we have invalid input, so do not commit
815c817
<
---
>
826c828
<
---
>
842c844
< self.db = db
---
> self.db = db
845c847
<
---
>
878c880
<
---
>
881c883
<
---
>
884,885c886,887
< self._config_section = "engine/Table/%s" % self._name.replace(' ', '_')
<
---
> self._config_section = "engine/Table/%s" % self._name
>
903,904c905,906
< self._config.get_value (self._config_section,
< "TabDefFullWidthLetter",
---
> self._config.get_value (self._config_section,
> "TabDefFullWidthLetter",
911,913c913,915
< self._config.get_value (self._config_section,
< "TabDefFullWidthPunct",
< self.db.get_ime_property('def_full_width_punct').lower() == u'true' )
---
> self._config.get_value (self._config_section,
> "TabDefFullWidthPunct",
> False)
932c934
< # "org.ibus.table.SpeedMeter")
---
> # "org.ibus.table.SpeedMeter")
944c946
< #self._editor._onechar = False
---
> #self._editor._onechar = False
947c949
<
---
>
977c979
<
---
>
1007c1009
<
---
>
1011c1013
<
---
>
1023,1024c1025,1026
< self._auto_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'acommit.svg' ) )
< self._auto_commit_property.set_tooltip ( _(u'Switch to normal commit mode, which use space to commit') )
---
> self._auto_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'acommit.svg' ) )
> self._auto_commit_property.set_tooltip ( _(u'Switch to normal commit mode, which use space to commit') )
1026,1027c1028,1029
< self._auto_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'ncommit.svg' ) )
< self._auto_commit_property.set_tooltip ( _(u'Switch to direct commit mode') )
---
> self._auto_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'ncommit.svg' ) )
> self._auto_commit_property.set_tooltip ( _(u'Switch to direct commit mode') )
1032,1033c1034,1035
< 'sc-mode.svg' ) )
< self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese mode') )
---
> 'sc-mode.svg' ) )
> self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese mode') )
1036,1037c1038,1039
< 'tc-mode.svg' ) )
< self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese first Big Charset Mode') )
---
> 'tc-mode.svg' ) )
> self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese first Big Charset Mode') )
1040,1041c1042,1043
< 'scb-mode.svg' ) )
< self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese first Big Charset Mode') )
---
> 'scb-mode.svg' ) )
> self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese first Big Charset Mode') )
1044,1045c1046,1047
< 'tcb-mode.svg' ) )
< self._cmode_property.set_tooltip ( _(u'Switch to Big Charset Mode') )
---
> 'tcb-mode.svg' ) )
> self._cmode_property.set_tooltip ( _(u'Switch to Big Charset Mode') )
1048,1049c1050,1051
< 'cb-mode.svg' ) )
< self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese Mode') )
---
> 'cb-mode.svg' ) )
> self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese Mode') )
1053c1055
<
---
>
1106,1107c1108,1109
< # at last invoke default method
<
---
> # at last invoke default method
>
1144c1146
<
---
>
1162c1164
< self.update_lookup_table ( self._editor.get_lookup_table(), True, True )
---
> self.update_lookup_table ( self._editor.get_lookup_table(), True, True )
1176c1178
<
---
>
1218c1220
<
---
>
1220c1222
<
---
>
1222c1224
<
---
>
1230c1232
<
---
>
1255c1257
<
---
>
1260c1262
<
---
>
1268c1270
<
---
>
1279c1281
<
---
>
1282c1284
< # we ignore all hotkeys here
---
> # we ignore all hotkeys here
1285c1287
<
---
>
1294,1297c1296,1297
<
< # then, the key code is a letter or digit
< if self._full_width_letter[self._mode]:
< # in full width letter mode
---
>
> if self._full_width_letter[self._mode]: # if key code is a letter or digit
1301,1302c1301,1303
< return False
<
---
> self.commit_string (c)
> return True
>
1305c1306
<
---
>
1312c1313
<
---
>
1320c1321
< # process commit to preedit
---
> # process commit to preedit
1325c1326
<
---
>
1334c1335
<
---
>
1339c1340
<
---
>
1348c1349
<
---
>
1358,1364c1359,1360
< #self.commit_string (cond_letter_translate (unichr (key.code)))
< # little hack to make ibus to input space in gvim :)
< if self._full_width_letter [self._mode]:
< self.commit_string (cond_letter_translate (unichr (key.code)))
< return True
< else:
< return False
---
> self.commit_string (cond_letter_translate (unichr (key.code)))
> return True
1378c1374
<
---
>
1383c1379
<
---
>
1388c1384
<
---
>
1393c1389
<
---
>
1398c1394
<
---
>
1403c1399
<
---
>
1408c1404
<
---
>
1413c1409
<
---
>
1418c1414
<
---
>
1423c1419
<
---
>
1428c1424
<
---
>
1478c1474
<
---
>
1506a1503
>
1509c1506
<
---
>
1521c1518
<
---
>
1536c1533
<
---
>
1543,1544d1539
< # we need to take care of the py_mode here :)
< py_mode = self._editor._py_mode
1546,1547d1540
< if py_mode:
< self._refresh_properties ()
1552d1544
<
1555c1547
<
---
>
1569c1561
<
---
>
1612c1604
<
---
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment