+2003-06-04 Dani Carbonell <bocata@panete.net>
+
+ * src/commands.h (show_stop_button, show_start_button): new functions.
+
+ * src/commands.c: changed the button order.
+ (make_menus): hide the stop button just after the toolbar has been created.
+ (show_stop_button): new function, it will hide the start button,
+ and show the stop one.
+ (show_start_button): new function, it will show the start button,
+ and hide the stop one.
+
+ * src/tetrinet.c (tetrinet_inmessage): show / hide the toolbar
+ buttons when required.
+
2003-06-03 Jordi Mallach <jordi@sindominio.net>
* gtetrinet.desktop.in: change value of Terminal from 0 to false to
GNOMEUIINFO_ITEM_DATA(N_("Disconnect"), N_("Disconnect from the current server"), disconnect_command, NULL, disconnect_xpm),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_DATA(N_("Start game"), N_("Start a new game"), start_command, NULL, play_xpm),
- GNOMEUIINFO_ITEM_DATA(N_("Pause game"), N_("Pause the game"), pause_command, NULL, pause_xpm),
GNOMEUIINFO_ITEM_DATA(N_("End game"), N_("End the current game"), end_command, NULL, stop_xpm),
+ GNOMEUIINFO_ITEM_DATA(N_("Pause game"), N_("Pause the game"), pause_command, NULL, pause_xpm),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_DATA(N_("Change team"), N_("Change your current team name"), team_command, NULL, team24_xpm),
#ifdef ENABLE_DETACH
gnome_app_create_menus (app, menubar);
gnome_app_create_toolbar (app, toolbar);
+ gtk_widget_hide (toolbar[4].widget);
}
/* callbacks */
void start_command (void)
{
- char buf[22];
- g_snprintf (buf, sizeof(buf), "%i %i", 1, playernum);
- client_outmessage (OUT_STARTGAME, buf);
+ char buf[22];
+
+ g_snprintf (buf, sizeof(buf), "%i %i", 1, playernum);
+ client_outmessage (OUT_STARTGAME, buf);
+}
+
+void show_stop_button (void)
+{
+ gtk_widget_hide (toolbar[3].widget);
+ gtk_widget_show (toolbar[4].widget);
+}
+
+void show_start_button (void)
+{
+ gtk_widget_hide (toolbar[4].widget);
+ gtk_widget_show (toolbar[3].widget);
}
void end_command (void)
{
- char buf[22];
- g_snprintf (buf, sizeof(buf), "%i %i", 0, playernum);
- client_outmessage (OUT_STARTGAME, buf);
+ char buf[22];
+
+ g_snprintf (buf, sizeof(buf), "%i %i", 0, playernum);
+ client_outmessage (OUT_STARTGAME, buf);
}
void pause_command (void)
{
- char buf[22];
- g_snprintf (buf, sizeof(buf), "%i %i", paused?0:1, playernum);
- client_outmessage (OUT_PAUSE, buf);
+ char buf[22];
+
+ g_snprintf (buf, sizeof(buf), "%i %i", paused?0:1, playernum);
+ client_outmessage (OUT_PAUSE, buf);
}
void preferences_command (void)
list_issued = 0;
up_chan_list_source = g_timeout_add (30000, (GSourceFunc) partyline_update_channel_list, NULL);
partyline_joining_channel ("");
+ show_start_button ();
break;
case IN_DISCONNECT:
if (!connected) {
commands_checkstate ();
partyline_fmt (_("%c*** The game has %cstarted"),
TETRI_TB_C_BRIGHT_RED, TETRI_TB_BOLD);
+ show_stop_button ();
/* switch to playerfields when game starts */
show_fields_page ();
}
commands_checkstate ();
partyline_fmt(_("%c*** The game is %cin progress"),
TETRI_TB_C_BRIGHT_RED, TETRI_TB_BOLD);;
+ show_stop_button ();
}
break;
case IN_PAUSE:
commands_checkstate ();
partyline_fmt (_("%c*** The game has %cended"),
TETRI_TB_C_BRIGHT_RED, TETRI_TB_BOLD);
+ show_start_button ();
/* go back to partyline when game ends */
show_partyline_page ();
break;