[gnome-games] Really remove ggz support from gnect



commit d10d49765b4d975d1b0fec41aa0e1fef73ae45cf
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Sun Jul 24 07:02:32 2011 -0400

    Really remove ggz support from gnect
    
    Despite ggz support being removed in 2009, it actually wasn't
    completely removed, resulting in a useless Game>Network Game menu
    button.
    
    This fixes https://bugzilla.gnome.org/show_bug.cgi?id=621037

 gnect/help/C/gnect.xml         |   14 +----
 gnect/help/C/network-games.xml |    1 -
 gnect/help/Makefile.am         |    1 -
 gnect/src/main.c               |  111 ++++------------------------------------
 gnect/src/main.h               |    2 -
 5 files changed, 13 insertions(+), 116 deletions(-)
---
diff --git a/gnect/help/C/gnect.xml b/gnect/help/C/gnect.xml
index 9f011f3..2211b58 100644
--- a/gnect/help/C/gnect.xml
+++ b/gnect/help/C/gnect.xml
@@ -3,7 +3,6 @@
         "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";
 [
   <!ENTITY legal SYSTEM "legal.xml">
-  <!ENTITY NETWORKGAMES SYSTEM "network-games.xml"> 
   <!ENTITY appversion "2.12">
   <!ENTITY manrevision "2.8">
   <!ENTITY date "September 2004">
@@ -135,8 +134,8 @@
     </para>
 
    <para>
-     &appname; also features <link linkend="network-games">multiplayer</link> support with two 
-     human players in hotseat or network mode.
+     &appname; also features multiplayer support with two 
+     human players in hotseat mode.
    </para>
 
 
@@ -430,15 +429,6 @@
   </sect1>
 
 
-<!-- ============= Network games  ===============================================
- This doc is common to gnome-games. The file is pulled in from gnibbles directory
- as a SVN symlink, and included here. Therefore translators only have to translate 
- the network stuff once, instead of one time for each game. 
- ================================ -->
-
- &NETWORKGAMES;
-
-
   <!-- ===== Bugs ============================================== -->
 
 
diff --git a/gnect/help/Makefile.am b/gnect/help/Makefile.am
index e92c251..c30a054 100644
--- a/gnect/help/Makefile.am
+++ b/gnect/help/Makefile.am
@@ -5,7 +5,6 @@ DOC_LINGUAS = ca cs da de el en_GB es eu fi fr it oc sl sr sr latin sv zh_CN
 DOC_MODULE = gnect
 
 DOC_ENTITIES = \
-	network-games.xml \
 	legal.xml
 
 DOC_FIGURES = \
diff --git a/gnect/src/main.c b/gnect/src/main.c
index 71b82c7..25e58d1 100644
--- a/gnect/src/main.c
+++ b/gnect/src/main.c
@@ -56,7 +56,6 @@ GtkWidget *notebook;
 GtkWidget *drawarea;
 GtkWidget *statusbar;
 GtkWidget *scorebox = NULL;
-GtkWidget *chat = NULL;
 
 GtkWidget *label_name[3];
 GtkWidget *label_score[3];
@@ -135,9 +134,6 @@ first_empty_row (gint c)
 static gint
 get_n_human_players (void)
 {
-  if (ggz_network_mode)
-    return 2;
-  
   if (p.level[PLAYER1] != LEVEL_HUMAN && p.level[PLAYER2] != LEVEL_HUMAN) {
     return 0;
   }
@@ -366,9 +362,6 @@ set_status_message (const gchar * message)
 
 
 GtkAction *new_game_action;
-GtkAction *new_network_action;
-GtkAction *leave_network_action;
-GtkAction *player_list_action;
 GtkAction *undo_action;
 GtkAction *hint_action;
 GtkAction *fullscreen_action;
@@ -489,20 +482,9 @@ prompt_player (void)
   const gchar *who = NULL;
   gchar *str = NULL;
 
-#ifdef GGZ_CLIENT
-  if (ggz_network_mode) {
-    gtk_widget_show (chat);
-  } else {
-    gtk_widget_hide (chat);
-  }
-#endif
-
-  gtk_action_set_visible (new_game_action, !ggz_network_mode);
-  gtk_action_set_visible (hint_action, !ggz_network_mode);
-  gtk_action_set_visible (undo_action, !ggz_network_mode);
-  gtk_action_set_visible (new_network_action, !ggz_network_mode);
-  gtk_action_set_visible (player_list_action, ggz_network_mode);
-  gtk_action_set_visible (leave_network_action, ggz_network_mode);
+  gtk_action_set_visible (new_game_action, TRUE);
+  gtk_action_set_visible (hint_action, TRUE);
+  gtk_action_set_visible (undo_action, TRUE);
 
   gtk_action_set_sensitive (new_game_action, (human || gameover));
   gtk_action_set_sensitive (hint_action, (human || gameover));
@@ -545,31 +527,18 @@ prompt_player (void)
     break;
   case 2:
   case 0:
-    if (ggz_network_mode) {
-#ifdef GGZ_CLIENT
-      who = variables.name[(variables.num + 1) % 2];
-      if (!who)
-	return;
-#endif
-    } else {
-      if (player == PLAYER1)
+    if (player == PLAYER1)
 	who = _(theme_get_player (PLAYER1));
-      else
+    else
 	who = _(theme_get_player (PLAYER2));
-    }
 
     if (gameover) {
-      if (ggz_network_mode) {
-#ifdef GGZ_CLIENT
-	str = g_strdup_printf (_("%s wins!"),
-			       variables.name[(int) variables.winner]);
-#endif
-      } else {
 	str = g_strdup_printf (_("%s wins!"), who);
       }
-    } else if (player_active && ggz_network_mode) {
+    if (player_active) {
       set_status_message (_("It is your move."));
       return;
+
     } else {
       str = g_strdup_printf (_("Waiting for %s to move."), who);
     }
@@ -590,16 +559,6 @@ on_game_new (void)
 }
 
 static gboolean
-on_network_leave (GObject * object, gpointer data)
-{
-#ifdef GGZ_CLIENT
-  ggz_embed_leave_table ();
-  gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), NETWORK_PAGE);
-#endif
-  return TRUE;
-}
-
-static gboolean
 on_game_exit (GObject * object, gpointer data)
 {
 
@@ -609,14 +568,6 @@ on_game_exit (GObject * object, gpointer data)
 }
 
 static void
-on_player_list (void)
-{
-#ifdef GGZ_CLIENT
-  create_or_raise_dlg_players (GTK_WINDOW (app));
-#endif
-}
-
-static void
 on_game_undo (GtkMenuItem * m, gpointer data)
 {
   gint r, c;
@@ -1091,15 +1042,7 @@ next_move (gint c)
 static void
 game_process_move (gint c)
 {
-
-  if (ggz_network_mode) {
-#ifdef GGZ_CLIENT
-    network_send_move (c);
-#endif
-    return;
-  } else {
-    process_move (c);
-  }
+  process_move (c);
 }
 
 void
@@ -1198,7 +1141,7 @@ on_drawarea_draw (GtkWidget * w, cairo_t *cr, gpointer data)
 static gboolean
 on_key_press (GtkWidget * w, GdkEventKey * e, gpointer data)
 {
-  if ((!player_active && ggz_network_mode) || timeout ||
+  if ((player_active) || timeout ||
       (e->keyval != p.keypress[MOVE_LEFT] &&
        e->keyval != p.keypress[MOVE_RIGHT] &&
        e->keyval != p.keypress[MOVE_DROP])) {
@@ -1226,7 +1169,7 @@ static gboolean
 on_button_press (GtkWidget * w, GdkEventButton * e, gpointer data)
 {
   gint x, y;
-  if (!player_active && ggz_network_mode) {
+  if (player_active) {
     return FALSE;
   }
 
@@ -1247,16 +1190,6 @@ static const GtkActionEntry action_entry[] = {
   {"HelpMenu", NULL, N_("_Help")},
   {"NewGame", GAMES_STOCK_NEW_GAME, NULL, NULL, NULL,
    G_CALLBACK (on_game_new)},
-#ifdef GGZ_CLIENT
-  {"NewNetworkGame", GAMES_STOCK_NETWORK_GAME, NULL, NULL, NULL,
-   G_CALLBACK (on_network_game)},
-#else
-  {"NewNetworkGame", GAMES_STOCK_NETWORK_GAME, NULL, NULL, NULL, NULL},
-#endif
-  {"LeaveNetworkGame", GAMES_STOCK_NETWORK_LEAVE, NULL, NULL, NULL,
-   G_CALLBACK (on_network_leave)},
-  {"PlayerList", GAMES_STOCK_PLAYER_LIST, NULL, NULL, NULL,
-   G_CALLBACK (on_player_list)},
   {"UndoMove", GAMES_STOCK_UNDO_MOVE, NULL, NULL, NULL,
    G_CALLBACK (on_game_undo)},
   {"Hint", GAMES_STOCK_HINT, NULL, NULL, NULL, G_CALLBACK (on_game_hint)},
@@ -1275,15 +1208,12 @@ static const char ui_description[] =
   "  <menubar name='MainMenu'>"
   "    <menu action='GameMenu'>"
   "      <menuitem action='NewGame'/>"
-  "      <menuitem action='NewNetworkGame'/>"
-  "      <menuitem action='PlayerList'/>"
   "      <separator/>"
   "      <menuitem action='UndoMove'/>"
   "      <menuitem action='Hint'/>"
   "      <separator/>"
   "      <menuitem action='Scores'/>"
   "      <separator/>"
-  "      <menuitem action='LeaveNetworkGame'/>"
   "      <menuitem action='Quit'/>"
   "    </menu>"
   "    <menu action='ViewMenu'>"
@@ -1317,16 +1247,7 @@ create_game_menus (GtkUIManager * ui_manager)
 			      gtk_ui_manager_get_accel_group (ui_manager));
 
   new_game_action = gtk_action_group_get_action (action_group, "NewGame");
-  new_network_action = gtk_action_group_get_action (action_group,
-						    "NewNetworkGame");
-#ifndef GGZ_CLIENT
-  gtk_action_set_sensitive (new_network_action, FALSE);
-#endif
 
-  player_list_action =
-    gtk_action_group_get_action (action_group, "PlayerList");
-  leave_network_action =
-    gtk_action_group_get_action (action_group, "LeaveNetworkGame");
   hint_action = gtk_action_group_get_action (action_group, "Hint");
   undo_action = gtk_action_group_get_action (action_group, "UndoMove");
   fullscreen_action = GTK_ACTION (games_fullscreen_action_new ("Fullscreen", GTK_WINDOW (app)));
@@ -1375,10 +1296,7 @@ create_app (void)
   gridframe = games_grid_frame_new (7, 7);
 
   gtk_paned_pack1 (GTK_PANED (vpaned), gridframe, TRUE, FALSE);
-#ifdef GGZ_CLIENT
-  chat = create_chat_widget ();
-  gtk_paned_pack2 (GTK_PANED (vpaned), chat, FALSE, TRUE);
-#endif
+
   gtk_container_add (GTK_CONTAINER (grid), menubar);
   gtk_container_add (GTK_CONTAINER (grid), vpaned);
   gtk_container_add (GTK_CONTAINER (grid), statusbar);
@@ -1411,9 +1329,6 @@ create_app (void)
   gtk_action_set_sensitive (undo_action, FALSE);
 
   gtk_widget_show_all (app);
-#ifdef GGZ_CLIENT
-  gtk_widget_hide (chat);
-#endif
 
   gfx_refresh_pixmaps ();
   gfx_draw_all ();
@@ -1459,10 +1374,6 @@ main (int argc, char *argv[])
     exit (1);
   }
 
-#ifdef GGZ_CLIENT
-  network_init ();
-#endif
-
   if (create_app ()) {
     game_reset ();
     gtk_main ();
diff --git a/gnect/src/main.h b/gnect/src/main.h
index 3204238..c39c31b 100644
--- a/gnect/src/main.h
+++ b/gnect/src/main.h
@@ -14,7 +14,6 @@
 #define SIZE_VSTR      53
 
 #define MAIN_PAGE           	0
-#define NETWORK_PAGE           	1
 
 typedef enum {
   MOVE_LEFT,
@@ -55,7 +54,6 @@ extern GtkWidget *app;
 extern GtkWidget *notebook;
 
 gboolean player_active;
-gboolean ggz_network_mode;
 
 void game_reset (void);
 void process_move (int move);



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