Logo Search packages:      
Sourcecode: ibus-table version File versions  Download package

def table::tabengine::_refresh_properties (   self  )  [private]

Method used to update properties

Definition at line 917 of file table.py.

00917                                   :
        '''Method used to update 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-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._direct_commit:
            self._direct_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'dcommit.svg' ) ) 
            self._direct_commit_property.set_tooltip ( _(u'Switch to normal commit mode, which use space to commit') ) 
        else:
            self._direct_commit_property.set_icon ( u'%s%s' % (self._icon_dir, 'ncommit.svg' ) ) 
            self._direct_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):


Generated by  Doxygen 1.6.0   Back to index