-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.
</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>
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);
static GtkWidget *passwordlabel, *teamnamelabel;
static GtkWidget *originalradio, *tetrifastradio;
static GSList *gametypegroup;
-static int oldgamemode;
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;
}
}
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),