commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue-forms/src/uidrivers/gtk2 MenuBar.py ToolBa...


From: Jan Ischebeck
Subject: gnue-forms/src/uidrivers/gtk2 MenuBar.py ToolBa...
Date: Thu, 09 Oct 2003 18:21:35 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-forms
Branch:         
Changes by:     Jan Ischebeck <address@hidden>  03/10/09 18:21:35

Modified files:
        src/uidrivers/gtk2: MenuBar.py ToolBar.py 
        src/uidrivers/gtk2/widgets: _base.py entry.py 

Log message:
        - replace decode with unicode in gtk2 uidriver
        - use 'textEncoding' setting instead of iso8859-1 for Menu and
        Toolbar-Labels

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/MenuBar.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/ToolBar.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/widgets/_base.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/widgets/entry.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: gnue-forms/src/uidrivers/gtk2/MenuBar.py
diff -c gnue-forms/src/uidrivers/gtk2/MenuBar.py:1.2 
gnue-forms/src/uidrivers/gtk2/MenuBar.py:1.3
*** gnue-forms/src/uidrivers/gtk2/MenuBar.py:1.2        Mon May 19 20:06:35 2003
--- gnue-forms/src/uidrivers/gtk2/MenuBar.py    Thu Oct  9 18:21:35 2003
***************
*** 44,53 ****
      return menu
  
    def correctLabel(self,label):
!     ## TODO: replace  iso8859 by correct encoding
!     return string.replace(label.decode('iso8859-1'),'&','_')
      
- 
    # Add a (sub)menu
    def addMenu(self, name, parent):
      menuitem = gtk.MenuItem(self.correctLabel(name))
--- 44,53 ----
      return menu
  
    def correctLabel(self,label):
!     # TODO: remove decode step, when gettext translations are send
!     # in unicode instead of local encoding
!     return string.replace(unicode(label,gConfigForms('textEncoding')),'&','_')
      
    # Add a (sub)menu
    def addMenu(self, name, parent):
      menuitem = gtk.MenuItem(self.correctLabel(name))
Index: gnue-forms/src/uidrivers/gtk2/ToolBar.py
diff -c gnue-forms/src/uidrivers/gtk2/ToolBar.py:1.2 
gnue-forms/src/uidrivers/gtk2/ToolBar.py:1.3
*** gnue-forms/src/uidrivers/gtk2/ToolBar.py:1.2        Mon May 19 20:06:35 2003
--- gnue-forms/src/uidrivers/gtk2/ToolBar.py    Thu Oct  9 18:21:35 2003
***************
*** 59,65 ****
  
      # TODO: try to use stock items for basic functions (load/save...)
      
!     label = name.decode('iso8859-1') # FIXME: load encoding from some other 
place
      iconloc = userAction.getIconLocation(size="24x24")
  
      # Set the action icon if available
--- 59,67 ----
  
      # TODO: try to use stock items for basic functions (load/save...)
      
!     # TODO: remove decode step, when gettext translations are send
!     # in unicode instead of local encoding
!     label = unicode(name,gConfigForms('textEncoding')) 
      iconloc = userAction.getIconLocation(size="24x24")
  
      # Set the action icon if available
Index: gnue-forms/src/uidrivers/gtk2/widgets/_base.py
diff -c gnue-forms/src/uidrivers/gtk2/widgets/_base.py:1.6 
gnue-forms/src/uidrivers/gtk2/widgets/_base.py:1.7
*** gnue-forms/src/uidrivers/gtk2/widgets/_base.py:1.6  Fri Sep  5 15:33:59 2003
--- gnue-forms/src/uidrivers/gtk2/widgets/_base.py      Thu Oct  9 18:21:35 2003
***************
*** 123,129 ****
  
    def setValue(self, value, index=0, enabled=1):
      # fix for 0.5.1 (Unicode is not internal encoding)
!     #value = value.decode(gConfigForms('textEncoding'))
      
      widget = self.widgets[index]
      
--- 123,129 ----
  
    def setValue(self, value, index=0, enabled=1):
      # fix for 0.5.1 (Unicode is not internal encoding)
!     value = unicode(value,gConfigForms('textEncoding'))
      
      widget = self.widgets[index]
      
Index: gnue-forms/src/uidrivers/gtk2/widgets/entry.py
diff -c gnue-forms/src/uidrivers/gtk2/widgets/entry.py:1.7 
gnue-forms/src/uidrivers/gtk2/widgets/entry.py:1.8
*** gnue-forms/src/uidrivers/gtk2/widgets/entry.py:1.7  Fri Sep  5 15:33:59 2003
--- gnue-forms/src/uidrivers/gtk2/widgets/entry.py      Thu Oct  9 18:21:35 2003
***************
*** 161,168 ****
      #       this should be passed with the event
  
      # Compatibility layer for 0.5.1
!     #text = newtext.decode('utf-8')    
!     text = newtext.decode('utf-8').encode(gConfigForms('textEncoding'))
      
      action = events.Event('requestKEYPRESS', text, text=text,
                            code=0, _form=object._form)
--- 161,168 ----
      #       this should be passed with the event
  
      # Compatibility layer for 0.5.1
!     #text = unicode(newtext,'utf-8')    
!     text = unicode(newtext,'utf-8').encode(gConfigForms('textEncoding'))
      
      action = events.Event('requestKEYPRESS', text, text=text,
                            code=0, _form=object._form)
***************
*** 320,327 ****
      object._displayHandler.cursor = textiter.get_offset()
  
      # Compatibility layer for 0.5.1
!     #text = newtext.decode('utf-8')    
!     text = newtext.decode('utf-8').encode(gConfigForms('textEncoding'))
      
      action = events.Event('requestKEYPRESS', text, text=text,
                            code=0, _form=object._form)
--- 320,327 ----
      object._displayHandler.cursor = textiter.get_offset()
  
      # Compatibility layer for 0.5.1
!     #text = unicode(newtext,'utf-8')    
!     text = unicode(newtext,'utf-8').encode(gConfigForms('textEncoding'))
      
      action = events.Event('requestKEYPRESS', text, text=text,
                            code=0, _form=object._form)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]