Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2006:
[Freeciv-Dev] (PR#14345) GTK2 client: add buttons to the players dialog
Home

[Freeciv-Dev] (PR#14345) GTK2 client: add buttons to the players dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14345) GTK2 client: add buttons to the players dialog
From: "Daniel Markstedt" <himasaram@xxxxxxxx>
Date: Mon, 13 Feb 2006 05:13:56 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14345 >

This is as far I got on this project. Note that I had no idea what I was
doing, so this might be a dead end.

The Diplomacy menu is removed and five buttons are added in it's place.
The buttons are correctly activated and greyed out as you select
different players, but clicking on them has no effect but closing the
players dialog.

-Daniel
Index: client/gui-gtk-2.0/plrdlg.c
===================================================================
--- client/gui-gtk-2.0/plrdlg.c (revision 11583)
+++ client/gui-gtk-2.0/plrdlg.c (working copy)
@@ -476,40 +476,27 @@
   }
   gtk_widget_show_all(menu);
 
-  item = gtk_menu_item_new_with_mnemonic(_("_Diplomacy"));
-  gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
+  players_sship_command = gui_dialog_add_button(players_dialog_shell,
+      _("_Spaceship"), NULL);
 
-  menu = gtk_menu_new();
-  gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu);
+  players_vision_command  = gui_dialog_add_button(players_dialog_shell,
+      _("_Withdraw vision"), NULL);
 
-  players_int_command = gtk_menu_item_new_with_mnemonic(_("_Intelligence"));
-  gtk_widget_set_sensitive(players_int_command, FALSE);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), players_int_command);
+  players_war_command = gui_dialog_add_button(players_dialog_shell,
+      _("_Cancel Treaty"), NULL);
 
-  sep = gtk_separator_menu_item_new();
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
+  players_meet_command = gui_dialog_add_button(players_dialog_shell,
+      _("_Meet"), NULL);
 
-  players_meet_command = gtk_menu_item_new_with_mnemonic(_("_Meet"));
-  gtk_widget_set_sensitive(players_meet_command, FALSE);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), players_meet_command);
+  players_int_command = gui_dialog_add_button(players_dialog_shell,
+      _("_Intelligence"), NULL);
 
-  players_war_command = gtk_menu_item_new_with_mnemonic(_("_Cancel Treaty"));
-  gtk_widget_set_sensitive(players_war_command, FALSE);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), players_war_command);
+  gui_dialog_add_button(players_dialog_shell,
+      GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
 
-  players_vision_command=gtk_menu_item_new_with_mnemonic(_("_Withdraw 
vision"));
-  gtk_widget_set_sensitive(players_vision_command, FALSE);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), players_vision_command);
+  gui_dialog_set_default_response(players_dialog_shell,
+      GTK_RESPONSE_CLOSE);
 
-  sep = gtk_separator_menu_item_new();
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), sep);
-
-  players_sship_command = gtk_menu_item_new_with_mnemonic(_("_Spaceship"));
-  gtk_widget_set_sensitive(players_sship_command, FALSE);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), players_sship_command);
-
-
-
   gui_dialog_show_all(players_dialog_shell);
 
   g_signal_connect(players_meet_command, "activate",

[Prev in Thread] Current Thread [Next in Thread]