]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
Patch from Lucas Nussbaum <lucas@lucas-nussbaum.net> to save the last game
authorJordi Mallach <jordi@sindominio.net>
Fri, 3 Nov 2006 13:10:48 +0000 (13:10 +0000)
committerJordi Mallach <jordim@src.gnome.org>
Fri, 3 Nov 2006 13:10:48 +0000 (13:10 +0000)
2006-11-03  Jordi Mallach  <jordi@sindominio.net>

* src/config.c, src/dialogs.c, gtetrinet.schemas.in: Patch from
Lucas Nussbaum <lucas@lucas-nussbaum.net> to save the last
game mode used in GConf.

ChangeLog
gtetrinet.schemas.in
src/config.c
src/dialogs.c

index 0232b397919125d5e72e05e607cfdb6240b1bef5..106c958bcc669d386b5b4106d03929ae12a23bba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2006-11-03  Loïc Minier <lool@dooz.org>
+2006-11-03  Jordi Mallach  <jordi@sindominio.net>
+
+       * src/config.c, src/dialogs.c, gtetrinet.schemas.in: Patch from
+       Lucas Nussbaum <lucas@lucas-nussbaum.net> to save the last
+       game mode used in GConf.
+
+2006-11-03  Loïc Minier  <lool@dooz.org>
 
        * src/config.c: Fix a double free() which causes a crash on
        first start, when theme_dir isn't set. Fixes #114425.
index 2c7e2a03ce2185b3544328920abc07b9bc8cf1d5..6d9e2ac65a9fc4ecc411e917d05a2afcc3c82add 100644 (file)
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/gtetrinet/player/gamemode</key>
+      <applyto>/apps/gtetrinet/player/gamemode</applyto>
+      <owner>gtetrinet</owner>
+      <type>bool</type>
+      <default>0</default>
+      
+      <locale name="C">
+        <short>Tetrinet game mode</short>
+        <long>If set to true, the game mode will be set to Tetrifast.
+        If false, gtetrinet will use the original mode.</long>
+      </locale>
+    </schema>
 
     <schema>
       <key>/schemas/apps/gtetrinet/keys/right</key>
index e6e46c35568dbf7b4613e05a352fd65a80a0ad3b..58abd2829562ee6a8d8e7c84a969588058fbd410 100644 (file)
@@ -236,6 +236,9 @@ void config_loadconfig (void)
         GTET_O_STRCPY(team, p);
         g_free(p);
     }
+        
+    /* get the game mode */
+    gamemode = gconf_client_get_bool (gconf_client, "/apps/gtetrinet/player/gamemode", NULL);
 
     /* get the keys */
     p = gconf_client_get_string (gconf_client, "/apps/gtetrinet/keys/right", NULL);
index bad7d8e9906ad952cace9e600b9aa45b6f7ba6c7..f42b0ffd1ad3d48d14416e431d00819180356893 100644 (file)
@@ -189,7 +189,6 @@ static GtkWidget *serveraddressentry, *nicknameentry, *teamnameentry, *spectator
 static GtkWidget *passwordlabel, *teamnamelabel;
 static GtkWidget *originalradio, *tetrifastradio;
 static GSList *gametypegroup;
-static int oldgamemode;
 
 void connectdialog_button (GtkDialog *dialog, gint button)
 {
@@ -256,11 +255,11 @@ void connectdialog_button (GtkDialog *dialog, gint button)
         gconf_client_set_string (gconf_client, "/apps/gtetrinet/player/team",
                                  gtk_entry_get_text (GTK_ENTRY(gnome_entry_gtk_entry(GNOME_ENTRY(teamnameentry)))),
                                  NULL);
+        gconf_client_set_bool (gconf_client, "/apps/gtetrinet/player/gamemode", gamemode, NULL);
 
         g_free (nick);
         break;
     case GTK_RESPONSE_CANCEL:
-        gamemode = oldgamemode;
         gtk_widget_destroy (connectdialog);
         break;
     }
@@ -317,9 +316,6 @@ void connectdialog_new (void)
     }
     connecting = TRUE;
 
-    /* save some stuff */
-    oldgamemode = gamemode;
-
     /* make dialog that asks for address/nickname */
     connectdialog = gtk_dialog_new_with_buttons (_("Connect to server"),
                                                  GTK_WINDOW (app),