[gnome-chess/chess-telepathy-networking-support-664946-rebase: 55/64] Dedicate a new setting for storing remote-opponent identifiers



commit 23cd1e275c13d88a482ac907f8ad4a07b489b585
Author: Chandni Verma <chandniverma2112 gmail com>
Date:   Tue Sep 25 18:01:59 2012 +0530

    Dedicate a new setting for storing remote-opponent identifiers

 data/org.gnome.gnome-chess.gschema.xml.in |    7 ++++++-
 src/chess-launcher.vala                   |    9 +++++----
 src/gnome-chess-application.vala          |    2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.gnome-chess.gschema.xml.in b/data/org.gnome.gnome-chess.gschema.xml.in
index 3c2b55a..a480111 100644
--- a/data/org.gnome.gnome-chess.gschema.xml.in
+++ b/data/org.gnome.gnome-chess.gschema.xml.in
@@ -129,7 +129,12 @@
     <key type="s" name="opponent">
       <default>''</default>
       <summary>The opponent player</summary>
-      <description>Can be 'human' (play against another human player), '' (use the first available chess engine), the name of a specific engine to play against or a string uniquely identifying a remote player</description>
+      <description>Can be 'human' (play against another human player), '' (use the first available chess engine) or the name of a specific engine to play against</description>
+    </key>
+    <key type="s" name="remote-opponent">
+      <default>''</default>
+      <summary>Remote player identifier</summary>
+      <description>A string uniquely identifying a remote player that is the contact's identifier in the underlying instant messaging protocol (e.g. XMPP JID) or '' when unset</description>
     </key>
     <key name="difficulty" enum="org.gnome.gnome-chess.Difficulty">
       <default>'easy'</default>
diff --git a/src/chess-launcher.vala b/src/chess-launcher.vala
index b180e44..ac6fd13 100644
--- a/src/chess-launcher.vala
+++ b/src/chess-launcher.vala
@@ -533,12 +533,13 @@ public class ChessLauncher : Gtk.Window
             {
                 contact = GamesContacts.Contact.dup_best_for_action (
                     individual, GamesContacts.ActionType.PLAY_GLCHESS);
-                string opponent;
+                string remote_opponent;
 
-                settings_common.set_string ("opponent", contact.id);
+                settings_common.set_string ("remote-opponent", contact.id);
 
-                opponent = settings_common.get_string ("opponent");
-                debug ("opponent selected: %s\n", opponent);
+                /* cross-check */
+                remote_opponent = settings_common.get_string ("remote-opponent");
+                debug ("remote-opponent selected: %s\n", remote_opponent);
 
                 show_game_options ();
             }
diff --git a/src/gnome-chess-application.vala b/src/gnome-chess-application.vala
index a1f299d..aec0658 100644
--- a/src/gnome-chess-application.vala
+++ b/src/gnome-chess-application.vala
@@ -1575,7 +1575,7 @@ public class Application : Gtk.Application
         string opponent_type = settings_common.get_string ("opponent-type");
         if (opponent_type == "remote-player")
         {
-            string contact_id = settings_common.get_string ("opponent");
+            string contact_id = settings_common.get_string ("remote-opponent");
             debug ("Opponent type selected: %s", opponent_type);
             debug ("Contact-id: %s", contact_id);
             debug ("Requested a chess channel to %s. gnome-chess-channel-handler takes charge. Now quitting", contact_id);



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