[gcalctool/gnome-2-26] Keep settings (show zeroes, thousands separator etc) when changing modes (Robert Ancell, Bug #580398



commit cb4481e24a98588e8bb464d1923eb30f3707c23b
Author: Robert Ancell <robert ancell gmail com>
Date:   Sun May 17 14:40:56 2009 +1000

    Keep settings (show zeroes, thousands separator etc) when changing modes (Robert Ancell, Bug #580398)
---
 ChangeLog       |    1 +
 gcalctool/gtk.c |   15 ++++++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fe3e54d..5544c13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@ gcalctool change history.
     * Remove negative sign from numbers rounded to zero.  This is only a partial fix as
       the error value is still visible in scientific notation (Robert Ancell, Bug #560802)
     * Support odd roots of negative numbers (Robert Ancell, Bug #576973)
+    * Keep settings (show zeroes, thousands separator etc) when changing modes (Robert Ancell, Bug #580398)
 
 2009-04-20 Robert Ancell <robert ancell gmail com>
 
diff --git a/gcalctool/gtk.c b/gcalctool/gtk.c
index b091a07..16fc004 100644
--- a/gcalctool/gtk.c
+++ b/gcalctool/gtk.c
@@ -894,11 +894,16 @@ ui_set_mode(ModeType mode)
     if (X.mode != mode) {
         X.mode = mode;
 
-        ui_set_base(DEC);
-        ui_set_numeric_mode(FIX);
-        do_button(FN_SET_ACCURACY, DEFAULT_ACCURACY);
-        ui_set_show_thousands_separator(FALSE);
-        ui_set_show_trailing_zeroes(FALSE);
+        // FIXME: These should affect display but not the actual UI settings
+        if (mode != PROGRAMMING)
+            ui_set_base(DEC);
+        if (mode != SCIENTIFIC) {
+            ui_set_numeric_mode(FIX);
+            do_button(FN_SET_ACCURACY, DEFAULT_ACCURACY);
+        }
+        if (mode == BASIC)
+            ui_set_show_trailing_zeroes(FALSE);
+
         ui_make_registers();
     }
     



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