[gnome-calculator/wip/mpc: 3/5] Change complex-enabled depending on the mode



commit c74608c9e977f28bb6578e3047662b8fe55fe39f
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Thu Jan 21 16:04:51 2016 +0000

    Change complex-enabled depending on the mode
    
    Disable complex numbers in basic, programming and financial modes. This
    needs more work to clear the imaginary part of the last answer.

 src/math-window.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/math-window.vala b/src/math-window.vala
index c5e5ba8..7197076 100644
--- a/src/math-window.vala
+++ b/src/math-window.vala
@@ -82,26 +82,31 @@ public class MathWindow : Gtk.ApplicationWindow
         case ButtonMode.BASIC:
             mode_label.label = _("Basic Mode");
             action.set_state (new Variant.string ("basic"));
+            Number.complex_enabled = false;
             break;
 
         case ButtonMode.ADVANCED:
             mode_label.label = _("Advanced Mode");
             action.set_state (new Variant.string ("advanced"));
+            Number.complex_enabled = true;
             break;
 
         case ButtonMode.FINANCIAL:
             mode_label.label = _("Financial Mode");
             action.set_state (new Variant.string ("financial"));
+            Number.complex_enabled = false;
             break;
 
         case ButtonMode.PROGRAMMING:
             mode_label.label = _("Programming Mode");
             action.set_state (new Variant.string ("programming"));
+            Number.complex_enabled = false;
             break;
 
         case ButtonMode.KEYBOARD:
             mode_label.label = _("Keyboard Mode");
             action.set_state (new Variant.string ("keyboard"));
+            Number.complex_enabled = true;
             break;
         }
 


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