[ibus-indic-table/f15] Fixed bug-750727.patch
anish
anishpatil at fedoraproject.org
Mon Dec 5 12:32:09 UTC 2011
commit c2bdc29310d332a68e3aeb8223b47ee02d4737d7
Author: anish <anish.developer at gmail.com>
Date: Mon Dec 5 18:03:35 2011 +0530
Fixed bug-750727.patch
bug-750727.patch | 373 +++++++++++++++++++++++++++++++++++++++++++++++++
ibus-indic-table.spec | 7 +-
2 files changed, 379 insertions(+), 1 deletions(-)
---
diff --git a/bug-750727.patch b/bug-750727.patch
new file mode 100644
index 0000000..9c2cd8c
--- /dev/null
+++ b/bug-750727.patch
@@ -0,0 +1,373 @@
+Only in ibus-indic-table-1.3.1/engine: factory.pyc
+diff -rup ibus-indic-table-old/engine/indic_table.py ibus-indic-table-1.3.1/engine/indic_table.py
+--- ibus-indic-table-old/engine/indic_table.py 2011-12-05 17:21:23.242237261 +0530
++++ ibus-indic-table-1.3.1/engine/indic_table.py 2011-12-05 17:24:40.987241774 +0530
+@@ -345,13 +345,33 @@ class editor(object):
+ _p_index = 8
+ else:
+ _p_index = self.get_index ('phrase')
+- _candi = u'###' + self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ] + u'###'
++ if self._is_inscript:
++ ins_str = ''
++ _ic = self.get_input_chars ()
++ for ch in _ic:
++ if ch in self._ins_keys:
++ ins_str += self._ins_keys[ch]
++ else:
++ ins_str += ch
++ _candi = ins_str
++ else:
++ _candi = u'###' + self._candidates[0][ int (self._lookup_table.get_cursor_pos() ) ][ _p_index ] + u'###'
+ else:
+- input_chars = self.get_input_chars ()
+- if input_chars:
+- _candi = u''.join( ['###'] + map( str, input_chars) + ['###'] )
++ if self._is_inscript:
++ ins_str = ''
++ _ic = self.get_input_chars ()
++ for ch in _ic:
++ if ch in self._ins_keys:
++ ins_str += self._ins_keys[ch]
++ else:
++ ins_str += ch
++ _candi = ins_str
+ else:
+- _candi = u''
++ input_chars = self.get_input_chars ()
++ if input_chars:
++ _candi = u''.join( ['###'] + map( str, input_chars) + ['###'] )
++ else:
++ _candi = u''
+ if self._strings:
+ res = u''
+ _cursor = self._cursor[0]
+@@ -864,7 +884,10 @@ class editor(object):
+ return (KeyProcessResult,whethercommit,commitstring)'''
+ if self._chars[1]:
+ # we have invalid input, so do not commit
+- return (False,u'')
++ if self._is_inscript:
++ pass
++ else:
++ return (False,u'')
+ if self._t_chars :
+ _ic = self.get_strings ()
+ if _ic:
+@@ -886,7 +909,14 @@ class editor(object):
+ istr = self.get_all_input_strings ()
+ self.commit_to_preedit ()
+ pstr = self.get_preedit_strings ()
+- #print "istr: ",istr
++ if self._is_inscript:
++ if not pstr:
++ for ch in istr:
++ if ch in self._ins_keys:
++ pstr += self._ins_keys[ch]
++ else:
++ pstr += ch
++
+ self.clear()
+ return (True,pstr,istr)
+ else:
+@@ -1043,7 +1073,6 @@ class tabengine (ibus.EngineBase):
+ def _init_properties (self):
+ self.properties= ibus.PropList ()
+ self._status_property = ibus.Property(u'status')
+-# self._help_property = ibus.Property(u'help')
+ # if self.db._is_chinese:
+ # self._cmode_property = ibus.Property(u'cmode')
+ # self._letter_property = ibus.Property(u'letter')
+@@ -1052,7 +1081,6 @@ class tabengine (ibus.EngineBase):
+ # self._onechar_property = ibus.Property(u'onechar')
+ # self._auto_commit_property = ibus.Property(u'acommit')
+ for prop in (self._status_property,
+-# self._help_property
+ # self._letter_property,
+ # self._punct_property,
+ # self._py_property,
+@@ -1063,20 +1091,85 @@ class tabengine (ibus.EngineBase):
+ self.properties.append(prop)
+ # if self.db._is_chinese:
+ # self.properties.insert( 1, self._cmode_property )
+- self.register_properties (self.properties)
+-# self.register_properties (self._status_property)
+-# self.register_properties (self._help_property)
+- self._refresh_properties ()
++ # self.register_properties (self.properties)
++ self.register_properties (self._status_property)
++ # self._refresh_properties ()
+
+ def _refresh_properties (self):
+ '''Method used to update properties'''
+- self._status_property.set_icon( u'%s%s' % (self._icon_dir, 'ibus-indic-table.svg') )
+- self._status_property.set_label( self._status )
+-# self._help_property.set_icon( u'%s%s' % (self._icon_dir, 'ibus-indic-table.svg') )
+-# self._help_property.set_label( "Help" )
+- # use buildin method to update properties :)
+- map (self.update_property, self.properties)
++ # taken and modified from PinYin.py :)
++ if self._mode == 1: # refresh mode
++ if self._status == u'CN':
++ self._status_property.set_icon( u'%s%s' % (self._icon_dir, 'chinese.svg') )
++ self._status_property.set_label( _(u'CN') )
++ else:
++ self._status_property.set_icon( u'%s%s' % (self._icon_dir, 'ibus-indic-table.svg') )
++ self._status_property.set_label( self._status )
++ self._status_property.set_tooltip ( _(u'Switch to English mode') )
++ else:
++ self._status_property.set_icon( u'%s%s' % (self._icon_dir, 'english.svg') )
++ self._status_property.set_label( _(u'EN') )
++ self._status_property.set_tooltip ( _(u'Switch to Table mode') )
++
++ if self._full_width_letter[self._mode]:
++ self._letter_property.set_icon ( u'%s%s' % (self._icon_dir, 'full-letter.svg') )
++ self._letter_property.set_tooltip ( _(u'Switch to half letter') )
++ else:
++ self._letter_property.set_icon ( u'%s%s' % (self._icon_dir, 'half-letter.svg') )
++ self._letter_property.set_tooltip ( _(u'Switch to full letter') )
++
++ if self._full_width_punct[self._mode]:
++ self._punct_property.set_icon ( u'%s%s' % (self._icon_dir, 'full-punct.svg') )
++ self._punct_property.set_tooltip ( _( u'Switch to half punction' ) )
++ else:
++ self._punct_property.set_icon ( u'%s%s' % (self._icon_dir,'half-punct.svg' ) )
++ self._punct_property.set_tooltip ( _( u'Switch to full punction' ) )
++
++ if self._editor._py_mode:
++ self._py_property.set_icon ( u'%s%s' % (self._icon_dir, 'py-mode.svg' ) )
++ self._py_property.set_tooltip ( _(u'Switch to Table mode') )
++
++ else:
++ self._py_property.set_icon ( u'%s%s' % (self._icon_dir, 'tab-mode.svg' ) )
++ self._py_property.set_tooltip ( _(u'Switch to PinYin mode') )
++
++ if self._editor._onechar:
++ self._onechar_property.set_icon ( u'%s%s' % (self._icon_dir, 'onechar.svg' ))
++ self._onechar_property.set_tooltip ( _(u'Switch to phrase mode') )
++ else:
++ self._onechar_property.set_icon ( u'%s%s' % (self._icon_dir, 'phrase.svg' ))
++ self._onechar_property.set_tooltip ( _(u'Switch to single char mode') )
++ if self._auto_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') )
++ else:
++ 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') )
++ # the chinese_mode:
++ if self.db._is_chinese:
++ if self._editor._chinese_mode == 0:
++ self._cmode_property.set_icon ( u'%s%s' % (self._icon_dir,\
++ 'sc-mode.svg' ) )
++ self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese mode') )
++ elif self._editor._chinese_mode == 1:
++ self._cmode_property.set_icon ( u'%s%s' % (self._icon_dir,\
++ 'tc-mode.svg' ) )
++ self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese first Big Charset Mode') )
++ elif self._editor._chinese_mode == 2:
++ self._cmode_property.set_icon ( u'%s%s' % (self._icon_dir,\
++ 'scb-mode.svg' ) )
++ self._cmode_property.set_tooltip ( _(u'Switch to Traditional Chinese first Big Charset Mode') )
++ elif self._editor._chinese_mode == 3:
++ self._cmode_property.set_icon ( u'%s%s' % (self._icon_dir,\
++ 'tcb-mode.svg' ) )
++ self._cmode_property.set_tooltip ( _(u'Switch to Big Charset Mode') )
++ elif self._editor._chinese_mode == 4:
++ self._cmode_property.set_icon ( u'%s%s' % (self._icon_dir,\
++ 'cb-mode.svg' ) )
++ self._cmode_property.set_tooltip ( _(u'Switch to Simplify Chinese Mode') )
+
++ # use buildin method to update properties :)
++ map (self.update_property, self.properties)
+
+ def _change_mode (self):
+ '''Shift input mode, TAB -> EN -> TAB
+@@ -1084,24 +1177,53 @@ class tabengine (ibus.EngineBase):
+ self._mode = int (not self._mode)
+ self.reset ()
+ self._update_ui ()
+-
+
+ def property_activate (self, property,prop_state = ibus.PROP_STATE_UNCHECKED):
+-# '''Shift property'''
+-# if property == u"status":
+-# self._change_mode ()
+-# self._refresh_properties ()
++ '''Shift property'''
++ if property == u"status":
++ self._change_mode ()
++ elif property == u'py_mode' and self._ime_py:
++ self._editor.r_shift ()
++ elif property == u'onechar':
++ self._editor._onechar = not self._editor._onechar
++ self._config.set_value( self._config_section,
++ "OneChar",
++ self._editor._onechar)
++
++ elif property == u'acommit':
++ self._auto_commit = not self._auto_commit
++ self._config.set_value( self._config_section,
++ "AutoCommit",
++ self._auto_commit)
++ elif property == u'letter':
++ self._full_width_letter [self._mode] = not self._full_width_letter [self._mode]
++ if self._mode:
++ self._config.set_value( self._config_section,
++ "TabDefFullWidthLetter",
++ self._full_width_letter [self._mode])
++ else:
++ self._config.set_value( self._config_section,
++ "EnDefFullWidthLetter",
++ self._full_width_letter [self._mode])
++
++ elif property == u'punct':
++ self._full_width_punct [self._mode] = not self._full_width_punct [self._mode]
++ if self._mode:
++ self._config.set_value( self._config_section,
++ "TabDefFullWidthPunct",
++ self._full_width_punct [self._mode])
++ else:
++ self._config.set_value( self._config_section,
++ "EnDefFullWidthPunct",
++ self._full_width_punct [self._mode])
++ elif property == u'cmode':
++ self._editor.change_chinese_mode()
++ self.reset()
++ self._refresh_properties ()
+ # elif property == "setup":
+ # Need implementation
+ # self.start_helper ("96c07b6f-0c3d-4403-ab57-908dd9b8d513")
+ # at last invoke default method
+-# if property == u"help":
+-# try:
+-# h = Help("help me out")
+-# except:
+-# print "Help not found"
+- pass
+-
+
+ def _update_preedit (self):
+ '''Update Preedit String in UI'''
+@@ -1271,22 +1393,22 @@ class tabengine (ibus.EngineBase):
+ return True
+
+ # Match full half letter mode switch hotkey
+-# if self._match_hotkey (key, keysyms.space, modifier.SHIFT_MASK):
+-# self.property_activate ("letter")
+-# return True
++ if self._match_hotkey (key, keysyms.space, modifier.SHIFT_MASK):
++ self.property_activate ("letter")
++ return True
+
+ # Match full half punct mode switch hotkey
+-# if self._match_hotkey (key, keysyms.period, modifier.CONTROL_MASK):
+-# self.property_activate ("punct")
+-# return True
++ if self._match_hotkey (key, keysyms.period, modifier.CONTROL_MASK):
++ self.property_activate ("punct")
++ return True
+
+ # we ignore all hotkeys
+- if key.mask & modifier.ALT_MASK:
+- return False
++# if key.mask & modifier.ALT_MASK:
++# return False
+
+ # Ignore key release event
+- if key.mask & modifier.RELEASE_MASK:
+- return True
++# if key.mask & modifier.RELEASE_MASK:
++# return True
+
+ if self._mode:
+ return self._table_mode_process_key_event (key)
+@@ -1345,18 +1467,18 @@ class tabengine (ibus.EngineBase):
+ return res
+
+ # Match single char mode switch hotkey
+-# if self._match_hotkey (key, keysyms.comma, modifier.CONTROL_MASK):
+-# self.property_activate ( u"onechar" )
+-# return True
++ if self._match_hotkey (key, keysyms.comma, modifier.CONTROL_MASK):
++ self.property_activate ( u"onechar" )
++ return True
+ # Match direct commit mode switch hotkey
+-# if self._match_hotkey (key, keysyms.slash, modifier.CONTROL_MASK):
+-# self.property_activate ( u"acommit" )
+-# return True
++ if self._match_hotkey (key, keysyms.slash, modifier.CONTROL_MASK):
++ self.property_activate ( u"acommit" )
++ return True
+
+ # Match Chinese mode shift
+-# if self._match_hotkey (key, keysyms.semicolon, modifier.CONTROL_MASK):
+-# self.property_activate ( u"cmode" )
+-# return True
++ if self._match_hotkey (key, keysyms.semicolon, modifier.CONTROL_MASK):
++ self.property_activate ( u"cmode" )
++ return True
+
+ # Match speedmeter shift
+ #if self._match_hotkey (key, keysyms.apostrophe, modifier.CONTROL_MASK):
+Only in ibus-indic-table-1.3.1/engine: indic_table.py~
+Only in ibus-indic-table-1.3.1/engine: indic_table.pyc
+Only in ibus-indic-table-1.3.1/engine: indic_table.py.orig
+diff -rup ibus-indic-table-old/engine/main.py ibus-indic-table-1.3.1/engine/main.py
+--- ibus-indic-table-old/engine/main.py 2011-12-05 17:21:23.242237261 +0530
++++ ibus-indic-table-1.3.1/engine/main.py 2011-12-05 16:15:04.033146467 +0530
+@@ -3,7 +3,6 @@
+ # ibus-indic-table - The Tables engine for IBus
+ #
+ # Copyright (c) 2011-2012 Naveen Kumar <nav007 at gmail.com>
+-# Copyright (c) 2011-2012 Anish Patil <anish.developer at gmail.com>
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+Only in ibus-indic-table-1.3.1/engine: main.py~
+Only in ibus-indic-table-1.3.1/engine: main.py.orig
+diff -rup ibus-indic-table-old/engine/tabcreatedb.py ibus-indic-table-1.3.1/engine/tabcreatedb.py
+--- ibus-indic-table-old/engine/tabcreatedb.py 2011-12-05 17:21:23.242237261 +0530
++++ ibus-indic-table-1.3.1/engine/tabcreatedb.py 2011-12-05 15:59:22.798124989 +0530
+@@ -4,7 +4,6 @@
+ # ibus-indic-table - The Tables engine for IBus
+ #
+ # Copyright (c) 2011-2012 Naveen Kumar <nav007 at gmail.com>
+-# Copyright (c) 2011-2012 Anish Patil <anish.developer at gmail.com>
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+Only in ibus-indic-table-1.3.1/engine: tabcreatedb.py.orig
+Only in ibus-indic-table-1.3.1/engine: tabdict.pyc
+Only in ibus-indic-table-1.3.1/engine: tabsqlitedb.pyc
+diff -rup ibus-indic-table-old/indic-tables/template.txt ibus-indic-table-1.3.1/indic-tables/template.txt
+--- ibus-indic-table-old/indic-tables/template.txt 2011-12-05 17:21:23.249237262 +0530
++++ ibus-indic-table-1.3.1/indic-tables/template.txt 2011-12-05 17:19:22.286234503 +0530
+@@ -147,3 +147,29 @@ BEGIN_DEFINATION_NUMBERS
+ 8 @ ८
+ 9 @ ९
+ END_DEFINATION_NUMBERS
++#### This is for phonetic keys
++BEGIN_DEFINATION_INKEYS
++ a:अ
++ b:ब्
++ c:च्
++ d:द्
++ e:ए
++ f:फ़्
++ g:ग्
++ i:इ
++ j:ज्
++ l:ल्
++ m:म्
++ n:न्
++ o:ओ
++ p:प्
++ q:क़्
++ r:र्
++ s:स्
++ t:त
++ u:उ
++ v:व्
++ w:व्
++ x:x
++ z:ज़्
++END_DEFINATION _INKS
diff --git a/ibus-indic-table.spec b/ibus-indic-table.spec
index 2411751..d5d19e2 100644
--- a/ibus-indic-table.spec
+++ b/ibus-indic-table.spec
@@ -1,6 +1,6 @@
Name: ibus-indic-table
Version: 1.3.1
-Release: 16%{?dist}
+Release: 17%{?dist}
Summary: The Table engine for IBus platform
License: LGPLv2+
Group: System Environment/Libraries
@@ -20,6 +20,7 @@ Patch10: bug-684118-capscase.patch
Patch11: bug-743502.patch
Patch12: bug-750735.patch
Patch13: bug-750730.patch
+Patch14: bug-750727.patch
Requires: ibus
BuildRequires: ibus-devel
BuildArch: noarch
@@ -43,6 +44,7 @@ The Indic Table engine for IBus platform.
%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
%build
%configure --disable-static --disable-additional
@@ -63,6 +65,9 @@ make DESTDIR=${RPM_BUILD_ROOT} NO_INDEX=true install pkgconfigdir=%{_datadir}/pk
%{_datadir}/pkgconfig/%{name}.pc
%changelog
+* Mon Dec 05 2011 Anish Patil <apatil at redhat.com> - 1.3.1-17
+- Fixed th bug-750727.patch
+
* Mon Nov 21 2011 Anish Patil <apatil at redhat.com> - 1.3.1-16
- Fixed th bug-750730.patch
More information about the scm-commits
mailing list