[gcalctool/vala] Fix whitespace



commit 3cdda77f672fc01e2e07fabb64bbd8bc8f6b2875
Author: Robert Ancell <robert ancell canonical com>
Date:   Sat Oct 13 10:07:21 2012 +1300

    Fix whitespace

 src/math-buttons.vala |   40 +++++++++++++++++-----------------------
 1 files changed, 17 insertions(+), 23 deletions(-)
---
diff --git a/src/math-buttons.vala b/src/math-buttons.vala
index a00e108..ed539c8 100644
--- a/src/math-buttons.vala
+++ b/src/math-buttons.vala
@@ -31,7 +31,7 @@ public class MathButtons : Gtk.Box
             _mode = value;
 
             if (mode == ButtonMode.PROGRAMMING)
-                equation.number_base = programming_base;
+                equation.number_base = _programming_base;
             else
                 equation.number_base = 10;
 
@@ -50,7 +50,7 @@ public class MathButtons : Gtk.Box
             }
         }
     }
-    private int programming_base = 10;
+    private int _programming_base = 10;
 
     private MathConverter converter;
 
@@ -199,7 +199,7 @@ public class MathButtons : Gtk.Box
         int value;
         model.get (iter, 1, out value, -1);
 
-        set_programming_base (value);
+        programming_base = value;
     }
 
     private void base_changed_cb ()
@@ -207,7 +207,7 @@ public class MathButtons : Gtk.Box
         if (mode != ButtonMode.PROGRAMMING)
             return;
 
-        programming_base = equation.number_base;
+        _programming_base = equation.number_base;
 
         var model = base_combo.get_model ();
         Gtk.TreeIter iter;
@@ -678,26 +678,20 @@ public class MathButtons : Gtk.Box
             panel.show ();
     }
 
-    public void set_programming_base (int number_base)
+    public int programming_base
     {
-        if (number_base == programming_base)
-            return;
-
-        programming_base = number_base;
-        notify_property ("programming-base");
-
-        if (mode == ButtonMode.PROGRAMMING)
-            equation.number_base = number_base;
-    }
+        get { return _programming_base; }
+        set
+        {
+            if (_programming_base == value)
+                return;
 
-    public int get_programming_base ()
-    {
-        return programming_base;
-    }
+            _programming_base = value;
+            notify_property ("programming-base");
 
-    private void shift_cb (Gtk.Widget widget)
-    {
-        equation.shift (widget.get_data<int> ("shiftcount"));
+            if (mode == ButtonMode.PROGRAMMING)
+                equation.number_base = value;
+        }
     }
 
     private void popup_button_menu (Gtk.Button button, Gtk.Menu menu)
@@ -758,7 +752,7 @@ public class MathButtons : Gtk.Box
                 item.set_data<int> ("shiftcount", i);
                 item.add (label);
                 shift_left_menu.append (item);
-                item.activate.connect (shift_cb);
+                item.activate.connect ((widget) => { equation.shift (widget.get_data<int> ("shiftcount")); });
 
                 label.show ();
                 item.show ();
@@ -795,7 +789,7 @@ public class MathButtons : Gtk.Box
                 item.set_data<int> ("shiftcount", -i);
                 item.add (label);
                 shift_right_menu.append (item);
-                item.activate.connect (shift_cb);
+                item.activate.connect ((widget) => { equation.shift (widget.get_data<int> ("shiftcount")); });
 
                 label.show ();
                 item.show ();



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