[iagno] Print warnings about parameters on primary instance only.



commit 5eadc8048298aa4b08c56e7896fbac09f32dc75c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Mar 13 07:27:34 2015 +0100

    Print warnings about parameters on primary instance only.

 src/iagno.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index acab264..a28bca9 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -117,9 +117,6 @@ public class Iagno : Gtk.Application
         else if (options.contains ("unmute"))
             sound = true;
 
-        if (level != null && level != "1" && level != "2" && level != "3")  // TODO support spellings?
-            stderr.printf ("%s\n", _("Level should be between 1 (easy) and 3 (hard). Settings unchanged."));
-
         if (options.contains ("two-players"))
             two_players = true;
         else if (options.contains ("first"))
@@ -162,8 +159,13 @@ public class Iagno : Gtk.Application
             computer_level = int.parse (level);
             settings.set_int ("computer-level", computer_level);
         }
-        else /* hack, part 3 of 4 */
+        else
+        {
+            if (level != null)
+                stderr.printf ("%s\n", _("Level should be between 1 (easy) and 3 (hard). Settings 
unchanged."));
+            /* hack, part 3 of 4 */
             computer_level = settings.get_int ("computer-level");
+        }
 
         /* UI parts */
         Builder builder = new Builder.from_resource ("/org/gnome/iagno/ui/iagno-screens.ui");


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