Ticket #2161: 0001-Changed-symbols-on-the-calculate-activity-button.-Ti.patch

File 0001-Changed-symbols-on-the-calculate-activity-button.-Ti.patch, 2.9 KB (added by ishan, 14 years ago)
  • calculate.py

    From 39ba0fe60e6123be18a3270f4c2224790f422244 Mon Sep 17 00:00:00 2001
    From: Ishan Bansal <ishan@seeta.in>
    Date: Fri, 1 Oct 2010 00:44:44 +0530
    Subject: [PATCH v3] Changed symbols on the calculate activity button. (Ticket #2161)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    New symbols "×", "÷" and "=" (instead of "*","/" and "Enter" respectively)
    variable equ_sym added to translate '=') defined for the in order to give a
    calculator look to activity.
    ---
     calculate.py |    1 +
     layout.py    |    3 ++-
     mathlib.py   |   13 +++++++++----
     3 files changed, 12 insertions(+), 5 deletions(-)
    
    v1->v2 : Symbol for "x" changed to "×"and bug description changed.
    v2->v3 : Code added to translate '=' as being done for other symbols.
    
    diff --git a/calculate.py b/calculate.py
    index bda756c..d49f1f6 100644
    a b class Calculate(ShareableActivity): 
    317317
    318318        self.KEYMAP['multiply'] = self.ml.mul_sym
    319319        self.KEYMAP['divide'] = self.ml.div_sym
     320        self.KEYMAP['equal'] = self.ml.equ_sym
    320321
    321322        self.clipboard = gtk.Clipboard()
    322323        self.select_reason = self.SELECT_SELECT
  • layout.py

    diff --git a/layout.py b/layout.py
    index d439a3a..b53efc1 100644
    a b class CalcLayout: 
    4747
    4848        mul_sym = self._parent.ml.mul_sym
    4949        div_sym = self._parent.ml.div_sym
     50        equ_sym = self._parent.ml.equ_sym
    5051
    5152        self.button_data = [
    5253# [x, y, width, label, bgcol, cb]
    class CalcLayout: 
    7475            [4, 2, 1, div_sym, self.col_gray3, lambda w: self._parent.add_text(div_sym)],
    7576            [5, 2, 1, ')', self.col_gray3, lambda w: self._parent.add_text(')')],
    7677
    77             [3, 3, 3, _('Enter'), self.col_gray1, lambda w: self._parent.process()],
     78            [3, 3, 3, equ_sym, self.col_gray1, lambda w: self._parent.process()],
    7879        ]
    7980
    8081    def create_dialog(self):
  • mathlib.py

    diff --git a/mathlib.py b/mathlib.py
    index b9bce1e..d0fabc8 100644
    a b class MathLib: 
    7878        if self.fraction_sep == "" or self.fraction_sep == None:
    7979            self.fraction_sep = "."
    8080
    81         # TRANS: multiplication symbol (default: '*')
     81        # TRANS: multiplication symbol (default: '×')
    8282        self.mul_sym = _('mul_sym')
    8383        if len(self.mul_sym) == 0 or len(self.mul_sym) > 3:
    84             self.mul_sym = '*'
     84            self.mul_sym = '×'
    8585
    86         # TRANS: division symbol (default: '/')
     86        # TRANS: division symbol (default: '÷')
    8787        self.div_sym = _('div_sym')
    8888        if len(self.div_sym) == 0 or len(self.div_sym) > 3:
    89             self.div_sym = '/'
     89            self.div_sym = '÷'
     90
     91        # TRANS: equal symbol (default: '=')
     92        self.equ_sym = _('equ_sym')
     93        if len(self.equ_sym) == 0 or len(self.equ_sym) > 3:
     94            self.equ_sym = '='
    9095
    9196    def set_format_type(self, fmt, digit_limit=9):
    9297        self.format_type = fmt