[gnome-calculator] Patch to add support for --mode



commit 56c9e3e31be5c9eabc5687fd9d15de6d8ff850cd
Author: Moo <eldmannen+gnome gmail com>
Date:   Sun Apr 19 11:14:00 2015 +0000

    Patch to add support for --mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748135

 src/gnome-calculator.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 1ebbbb6..27182b3 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -18,6 +18,7 @@ public class Calculator : Gtk.Application
     private static string equation_string = null;
 
     private const OptionEntry[] option_entries = {
+        { "mode", 'm', 0, OptionArg.STRING, null, N_("Start in given mode"), "mode" },
         { "solve", 's', 0, OptionArg.STRING, null, N_("Solve given equation"), "equation" },
         { "equation", 'e', 0, OptionArg.STRING, ref equation_string, N_("Start with given equation"), 
"equation"},
         { "version", 'v', 0, OptionArg.NONE, null, N_("Show release version"), null },
@@ -114,6 +115,11 @@ public class Calculator : Gtk.Application
                     window.equation.solve ();
             }
         }
+        if (options.contains ("mode"))
+        {
+            var button_mode = (string) options.lookup_value ("mode", VariantType.STRING);
+            window.buttons.mode = button_mode;
+        }
     }
 
     protected override void shutdown ()


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