]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
merged the connect and disconnect buttons
authorDaniel Carbonell Fraj <bocata@src.gnome.org>
Sat, 14 Jun 2003 14:29:23 +0000 (14:29 +0000)
committerDaniel Carbonell Fraj <bocata@src.gnome.org>
Sat, 14 Jun 2003 14:29:23 +0000 (14:29 +0000)
ChangeLog
src/commands.c
src/commands.h
src/tetrinet.c

index 91749d3d0225e6c1bad2a5af2f4535d699dd7e8e..a6ba13b4f0e4f6cd087dfa6da954477ce40233d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-06-14  Dani Carbonell  <bocata@panete.net>
+
+       * src/commands.c (show_connect_button, show_disconnect_button):
+       new functions, to show and hide the connect button in the toolbar.
+       (make_menus): hide the disconnect button at startup.
+
+       * src/commands.h (show_disconnect_button, show_disconnect_button):
+       new functions.
+
+       * src/tetrinet.c (tetrinet_inmessage): added logic to show and
+       hide the connect/disconnect buttons.
+
 2003-06-13  Dani Carbonell  <bocata@panete.net>
 
        * src/tetrinet.c (tetrinet_key): fixed this keypress signal
index d38fb3487a29f39a4be6b4eb6d3cb8fab5648976..93f970151b238cf75586329b0e13c4a06f349c7f 100644 (file)
@@ -114,6 +114,7 @@ void make_menus (GnomeApp *app)
 
   gnome_app_create_toolbar (app, toolbar);
   gtk_widget_hide (toolbar[4].widget);
+  gtk_widget_hide (toolbar[1].widget);
 }
 
 /* callbacks */
@@ -148,6 +149,18 @@ void start_command (void)
   client_outmessage (OUT_STARTGAME, buf);
 }
 
+void show_connect_button (void)
+{
+  gtk_widget_hide (toolbar[1].widget);
+  gtk_widget_show (toolbar[0].widget);
+}
+
+void show_disconnect_button (void)
+{
+  gtk_widget_hide (toolbar[0].widget);
+  gtk_widget_show (toolbar[1].widget);
+}
+
 void show_stop_button (void)
 {
   gtk_widget_hide (toolbar[3].widget);
index b4f98df104907fa038ce8da946be669b0e9bb9a3..0aee2fd88ecb63dff6e2de12bc44e4ae4f800981 100644 (file)
@@ -16,5 +16,7 @@ void preferences_command (void);
 void about_command (void);
 void show_start_button (void);
 void show_stop_button (void);
+void show_connect_button (void);
+void show_disconnect_button (void);
 
 void commands_checkstate (void);
index 50edb728506431d692234ad576c3b7235ce3fb5c..48c1384d2c3ae343b11dfd2f8d3ef1c71002d596 100644 (file)
@@ -187,6 +187,7 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data)
         up_chan_list_source = g_timeout_add (30000, (GSourceFunc) partyline_update_channel_list, NULL);
         partyline_joining_channel ("");
         show_start_button ();
+        show_disconnect_button ();
         break;
     case IN_DISCONNECT:
         if (!connected) {
@@ -214,6 +215,7 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data)
                        TETRI_TB_C_DARK_GREEN, TETRI_TB_BOLD);
         partyline_clear_list_channel ();
         partyline_joining_channel (NULL);
+        show_connect_button ();
         break;
     case IN_CONNECTERROR:
     connecterror:
@@ -231,6 +233,7 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data)
             gtk_dialog_run (GTK_DIALOG(dialog));
             gtk_widget_destroy (dialog);
             g_free (data_utf8);
+            show_connect_button ();
         }
         break;
     case IN_PLAYERNUM: