[Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client |
From: |
"Gregor Richards" <akaquinn@xxxxxxxxxxx> |
Date: |
Fri, 22 Oct 2004 21:52:58 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10435 >
The option is in the right place, and now the tabs are dynamically
loaded and unloaded as needed.
Next step: Instead of having:
if (enable_tabs) {
...
} else {
...
}
make some wrapper functions that server the purpose either way.
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/cityrep.c
tabbed/client/gui-gtk-2.0/cityrep.c
--- freeciv/client/gui-gtk-2.0/cityrep.c 2004-10-16 21:27:47.000000000
-0700
+++ tabbed/client/gui-gtk-2.0/cityrep.c 2004-10-22 21:48:26.156555028 -0700
@@ -154,20 +154,37 @@
****************************************************************/
/****************************************************************
-...
-****************************************************************/
-void popup_city_report_dialog(bool make_modal)
+ load the city report dialog
+ ***************************************************************/
+void load_city_report_dialog(bool make_modal)
{
if(!city_dialog_shell) {
city_dialog_shell_is_modal = make_modal;
create_city_report_dialog(make_modal);
- gtk_set_relative_position(toplevel, city_dialog_shell, 10, 10);
+ if (!enable_tabs) {
+ gtk_set_relative_position(toplevel, city_dialog_shell, 10, 10);
+ }
select_menu_cached = FALSE;
}
+}
+
+/****************************************************************
+...
+****************************************************************/
+void popup_city_report_dialog(bool make_modal)
+{
+ load_city_report_dialog(make_modal);
+
+ if (!enable_tabs) {
+ gtk_window_present(GTK_WINDOW(city_dialog_shell));
+ } else {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(topnbook)) != 1) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 1);
+ }
+ }
- gtk_window_present(GTK_WINDOW(city_dialog_shell));
hilite_cities_from_canvas();
}
@@ -178,6 +195,7 @@
{
if (city_dialog_shell) {
gtk_widget_destroy(city_dialog_shell);
+ city_dialog_shell=NULL;
}
}
@@ -763,56 +781,83 @@
static char *titles [NUM_CREPORT_COLS];
static char buf [NUM_CREPORT_COLS][64];
struct city_report_spec *spec;
-
+
GtkWidget *w, *sw, *menubar;
int i;
- city_dialog_shell = gtk_dialog_new_with_buttons(_("Cities"),
- NULL,
- 0,
- NULL);
- setup_dialog(city_dialog_shell, toplevel);
- gtk_window_set_default_size(GTK_WINDOW(city_dialog_shell), -1, 420);
- gtk_dialog_set_default_response(GTK_DIALOG(city_dialog_shell),
- GTK_RESPONSE_CLOSE);
-
- if (make_modal) {
- gtk_window_set_transient_for(GTK_WINDOW(city_dialog_shell),
- GTK_WINDOW(toplevel));
- gtk_window_set_modal(GTK_WINDOW(city_dialog_shell), TRUE);
- }
-
- g_signal_connect(city_dialog_shell, "response",
- G_CALLBACK(gtk_widget_destroy), NULL);
- g_signal_connect(city_dialog_shell, "destroy",
- G_CALLBACK(gtk_widget_destroyed), &city_dialog_shell);
+ if (!enable_tabs) {
+ city_dialog_shell = gtk_dialog_new_with_buttons(_("Cities"),
+ NULL,
+ 0,
+ NULL);
+ setup_dialog(city_dialog_shell, toplevel);
+ gtk_window_set_default_size(GTK_WINDOW(city_dialog_shell), -1, 420);
+ gtk_dialog_set_default_response(GTK_DIALOG(city_dialog_shell),
+ GTK_RESPONSE_CLOSE);
+
+ if (make_modal) {
+ gtk_window_set_transient_for(GTK_WINDOW(city_dialog_shell),
+ GTK_WINDOW(toplevel));
+ gtk_window_set_modal(GTK_WINDOW(city_dialog_shell), TRUE);
+ }
+
+ g_signal_connect(city_dialog_shell, "response",
+ G_CALLBACK(gtk_widget_destroy), NULL);
+ g_signal_connect(city_dialog_shell, "destroy",
+ G_CALLBACK(gtk_widget_destroyed), &city_dialog_shell);
+ } else {
+ city_dialog_shell = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tnbcities), city_dialog_shell, TRUE, TRUE, 0);
+ }
/* menubar */
menubar = create_city_report_menubar();
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(city_dialog_shell)->vbox),
- menubar, FALSE, FALSE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(city_dialog_shell)->vbox),
+ menubar, FALSE, FALSE, 0);
+ } else {
+ gtk_box_pack_start(GTK_BOX(city_dialog_shell),
+ menubar, FALSE, FALSE, 0);
+ }
/* buttons */
w = gtk_stockbutton_new(GTK_STOCK_ZOOM_FIT, _("Cen_ter"));
- gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
- w, FALSE, TRUE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
+ w, FALSE, TRUE, 0);
+ } else {
+ gtk_box_pack_end(GTK_BOX(city_dialog_shell),
+ w, FALSE, TRUE, 0);
+ }
g_signal_connect(w, "clicked", G_CALLBACK(city_center_callback), NULL);
city_center_command = w;
w = gtk_stockbutton_new(GTK_STOCK_ZOOM_IN, _("_Popup"));
- gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
- w, FALSE, TRUE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
+ w, FALSE, TRUE, 0);
+ } else {
+ gtk_box_pack_end(GTK_BOX(city_dialog_shell),
+ w, FALSE, TRUE, 0);
+ }
g_signal_connect(w, "clicked", G_CALLBACK(city_popup_callback), NULL);
city_popup_command = w;
w = gtk_stockbutton_new(GTK_STOCK_EXECUTE, _("_Buy"));
- gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
- w, FALSE, TRUE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_end(GTK_BOX(GTK_DIALOG(city_dialog_shell)->action_area),
+ w, FALSE, TRUE, 0);
+ } else {
+ gtk_box_pack_end(GTK_BOX(city_dialog_shell),
+ w, FALSE, TRUE, 0);
+ }
g_signal_connect(w, "clicked", G_CALLBACK(city_buy_callback), NULL);
city_buy_command = w;
- gtk_dialog_add_button(GTK_DIALOG(city_dialog_shell),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ if (!enable_tabs) {
+ gtk_dialog_add_button(GTK_DIALOG(city_dialog_shell),
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ }
/* tree view */
for (i=0; i<NUM_CREPORT_COLS; i++)
@@ -856,11 +901,20 @@
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(sw), city_view);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(city_dialog_shell)->vbox),
- sw, TRUE, TRUE, 0);
-
- gtk_widget_show_all(GTK_DIALOG(city_dialog_shell)->vbox);
- gtk_widget_show_all(GTK_DIALOG(city_dialog_shell)->action_area);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(city_dialog_shell)->vbox),
+ sw, TRUE, TRUE, 0);
+ } else {
+ gtk_box_pack_start(GTK_BOX(city_dialog_shell),
+ sw, TRUE, TRUE, 0);
+ }
+
+ if (!enable_tabs) {
+ gtk_widget_show_all(GTK_DIALOG(city_dialog_shell)->vbox);
+ gtk_widget_show_all(GTK_DIALOG(city_dialog_shell)->action_area);
+ } else {
+ gtk_widget_show_all(city_dialog_shell);
+ }
city_model_init();
city_selection_changed_callback(city_selection);
@@ -1025,6 +1079,9 @@
static void city_center_callback(GtkWidget *w, gpointer data)
{
gtk_tree_selection_selected_foreach(city_selection, center_iterate, NULL);
+ if (enable_tabs) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 0);
+ }
}
/****************************************************************
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/cityrep.h
tabbed/client/gui-gtk-2.0/cityrep.h
--- freeciv/client/gui-gtk-2.0/cityrep.h 2002-12-14 16:38:23.000000000
-0800
+++ tabbed/client/gui-gtk-2.0/cityrep.h 2004-10-22 21:26:29.274242342 -0700
@@ -15,6 +15,8 @@
#include "cityrep_g.h"
+void load_city_report_dialog(bool make_modal);
+
void popdown_city_report_dialog(void);
#endif /* FC__CITYREP_H */
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/gui_main.c
tabbed/client/gui-gtk-2.0/gui_main.c
--- freeciv/client/gui-gtk-2.0/gui_main.c 2004-10-22 20:21:56.108674103
-0700
+++ tabbed/client/gui-gtk-2.0/gui_main.c 2004-10-22 21:36:29.209905075
-0700
@@ -45,6 +45,7 @@
#include "version.h"
#include "chatline.h"
+#include "cityrep.h"
#include "civclient.h"
#include "climisc.h"
#include "clinet.h"
@@ -64,11 +65,12 @@
#include "optiondlg.h"
#include "options.h"
#include "pages.h"
+#include "plrdlg.h"
+#include "repodlgs.h"
#include "spaceshipdlg.h"
#include "resources.h"
#include "tilespec.h"
-
#include "freeciv.ico"
const char *client_string = "gui-gtk-2.0";
@@ -84,8 +86,12 @@
int overview_canvas_store_height = 2 * 50;
bool fullscreen_mode = FALSE;
+bool enable_tabs = FALSE;
+bool enable_tabs_next_load = FALSE;
GtkWidget *toplevel;
+GtkWidget *topnbook, *tnbcities, *tnbunits, *tnbplrs;
+GtkWidget *tnbecon, *tnbsci;
GtkWidget *toplevel_tabs;
GtkWidget *top_vbox;
GdkWindow *root_window;
@@ -136,6 +142,7 @@
GEN_BOOL_OPTION(dialogs_on_top, N_("Keep dialogs on top")),
GEN_BOOL_OPTION(show_task_icons, N_("Show worklist task icons")),
GEN_BOOL_OPTION(fullscreen_mode, N_("Fullscreen Mode")),
+ GEN_BOOL_OPTION(enable_tabs_next_load,N_("Enable status report tabs (upon
restart)")),
};
const int num_gui_options = ARRAY_SIZE(gui_options);
@@ -179,6 +186,8 @@
static gint timer_callback(gpointer data);
gboolean show_conn_popup(GtkWidget *view, GdkEventButton *ev, gpointer data);
+void topnbook_page_callback(GtkNotebook *nbook, GtkNotebookPage *page, guint
page_num, gpointer data);
+
/**************************************************************************
...
**************************************************************************/
@@ -621,6 +630,8 @@
struct Sprite *sprite;
GtkWidget *notebook, *messages;
+ GtkWidget *label_l;
+ char *label_c;
message_buffer = gtk_text_buffer_new(NULL);
@@ -838,10 +849,34 @@
unit_pixmap_table = table;
populate_unit_pixmap_table();
- /* Map canvas and scrollbars */
-
- table = gtk_table_new(2, 2, FALSE);
- gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
+ /* If tabs were enabled at load, set enable_tabs for this session */
+ if (enable_tabs_next_load) {
+ enable_tabs = TRUE;
+ }
+
+ if (!enable_tabs) {
+ /* Map canvas and scrollbars */
+ table = gtk_table_new(2, 2, FALSE);
+ gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
+ } else {
+ /* Map canvas and scrollbars, in a tab interface that shows reports */
+
+ /* *** the top is controlled by tabs *** */
+ topnbook = gtk_notebook_new();
+ gtk_notebook_set_tab_pos(GTK_NOTEBOOK(topnbook), GTK_POS_BOTTOM);
+ gtk_box_pack_start(GTK_BOX(hbox), topnbook, TRUE, TRUE, 0);
+
+ /* Other tabs only load on "switch-page" */
+ g_signal_connect(topnbook, "switch-page",
+ G_CALLBACK(topnbook_page_callback),
+ NULL);
+
+ table = gtk_table_new(2, 2, FALSE);
+ //gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
+ label_c = _("Map");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), table, label_l);
+ }
frame = gtk_frame_new(NULL);
gtk_table_attach(GTK_TABLE(table), frame, 0, 1, 0, 1,
@@ -893,6 +928,34 @@
g_signal_connect(toplevel, "key_press_event",
G_CALLBACK(keyboard_handler), NULL);
+ if (enable_tabs) {
+ /* add other tabs */
+ tnbcities = gtk_vbox_new(FALSE, 0);
+ label_c = _("Cities");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), tnbcities, label_l);
+
+ tnbunits = gtk_vbox_new(FALSE, 0);
+ label_c = _("Units");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), tnbunits, label_l);
+
+ tnbplrs = gtk_vbox_new(FALSE, 0);
+ label_c = _("Players");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), tnbplrs, label_l);
+
+ tnbecon = gtk_vbox_new(FALSE, 0);
+ label_c = _("Economy");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), tnbecon, label_l);
+
+ tnbsci = gtk_vbox_new(FALSE, 0);
+ label_c = _("Science");
+ label_l = gtk_label_new_with_mnemonic(label_c);
+ gtk_notebook_append_page(GTK_NOTEBOOK(topnbook), tnbsci, label_l);
+ }
+
/* *** The message window -- this is a detachable widget *** */
sbox = detached_widget_new();
@@ -1211,6 +1274,39 @@
}
/**************************************************************************
+ Load the dialog corresponding to the page loaded
+ *************************************************************************/
+void topnbook_page_callback(GtkNotebook *nbook, GtkNotebookPage *page, guint
page_num, gpointer data)
+{
+ /* Before loading the appropriate page, unload every page
+ this is (probably) more efficient than checking each page
+ to see if it's loaded, then unloading it */
+ popdown_city_report_dialog();
+ popdown_activeunits_report_dialog();
+ popdown_players_dialog();
+ popdown_economy_report_dialog();
+ popdown_science_dialog();
+
+ switch (page_num) {
+ case 1: /* Cities */
+ load_city_report_dialog(0);
+ break;
+ case 2: /* Units */
+ load_activeunits_report_dialog(0);
+ break;
+ case 3: /* Players */
+ load_players_dialog();
+ break;
+ case 4: /* Economy */
+ load_economy_report_dialog(0);
+ break;
+ case 5: /* Science */
+ load_science_dialog(0);
+ break;
+ }
+}
+
+/**************************************************************************
obvious...
**************************************************************************/
void sound_bell(void)
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/gui_main.h
tabbed/client/gui-gtk-2.0/gui_main.h
--- freeciv/client/gui-gtk-2.0/gui_main.h 2004-10-22 20:21:56.110673932
-0700
+++ tabbed/client/gui-gtk-2.0/gui_main.h 2004-10-22 20:42:09.378853013
-0700
@@ -42,6 +42,8 @@
extern PangoFontDescription * city_productions_font;
extern bool fullscreen_mode;
+extern bool enable_tabs;
+extern bool enable_tabs_next_load;
extern GdkGC * civ_gc;
extern GdkGC * mask_fg_gc;
@@ -59,6 +61,14 @@
extern GtkTextView * main_message_area;
extern GtkWidget * text_scrollbar;
extern GtkWidget * toplevel;
+
+extern GtkWidget * topnbook;
+extern GtkWidget * tnbcities;
+extern GtkWidget * tnbunits;
+extern GtkWidget * tnbplrs;
+extern GtkWidget * tnbecon;
+extern GtkWidget * tnbsci;
+
extern GtkWidget * top_vbox;
extern GtkWidget * main_frame_civ_name;
extern GtkWidget * main_label_info;
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/plrdlg.c
tabbed/client/gui-gtk-2.0/plrdlg.c
--- freeciv/client/gui-gtk-2.0/plrdlg.c 2004-05-01 10:28:47.000000000 -0700
+++ tabbed/client/gui-gtk-2.0/plrdlg.c 2004-10-22 21:48:12.330738121 -0700
@@ -68,16 +68,33 @@
static void update_views(void);
/**************************************************************************
+ load the dialog
+ *************************************************************************/
+void load_players_dialog(void)
+{
+ if (!players_dialog_shell) {
+ create_players_dialog();
+ if (!enable_tabs) {
+ gtk_window_set_position(GTK_WINDOW(players_dialog_shell),
+ GTK_WIN_POS_MOUSE);
+ }
+ }
+}
+
+/**************************************************************************
popup the dialog 10% inside the main-window
**************************************************************************/
void popup_players_dialog(void)
{
- if (!players_dialog_shell){
- create_players_dialog();
- gtk_window_set_position(GTK_WINDOW(players_dialog_shell),
- GTK_WIN_POS_MOUSE);
+ load_players_dialog();
+
+ if (!enable_tabs) {
+ gtk_window_present(GTK_WINDOW(players_dialog_shell));
+ } else {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(topnbook)) != 3) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 3);
+ }
}
- gtk_window_present(GTK_WINDOW(players_dialog_shell));
}
/****************************************************************
@@ -87,6 +104,7 @@
{
if (players_dialog_shell) {
gtk_widget_destroy(players_dialog_shell);
+ players_dialog_shell=NULL;
}
}
@@ -258,19 +276,24 @@
GtkWidget *sep, *sw;
GtkWidget *menubar, *menu, *item;
- players_dialog_shell = gtk_dialog_new_with_buttons(_("Players"),
- NULL,
- 0,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
- NULL);
- setup_dialog(players_dialog_shell, toplevel);
-
- gtk_window_set_default_size(GTK_WINDOW(players_dialog_shell), -1, 270);
-
- g_signal_connect(players_dialog_shell, "destroy",
- G_CALLBACK(players_destroy_callback), NULL);
- g_signal_connect_swapped(players_dialog_shell, "response",
- G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(players_dialog_shell));
+ if (!enable_tabs) {
+ players_dialog_shell = gtk_dialog_new_with_buttons(_("Players"),
+ NULL,
+ 0,
+ GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
+ NULL);
+ setup_dialog(players_dialog_shell, toplevel);
+
+ gtk_window_set_default_size(GTK_WINDOW(players_dialog_shell), -1, 270);
+
+ g_signal_connect(players_dialog_shell, "destroy",
+ G_CALLBACK(players_destroy_callback), NULL);
+ g_signal_connect_swapped(players_dialog_shell, "response",
+ G_CALLBACK(gtk_widget_destroy),
GTK_OBJECT(players_dialog_shell));
+ } else {
+ players_dialog_shell = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tnbplrs), players_dialog_shell, TRUE, TRUE, 0);
+ }
create_store();
@@ -349,10 +372,17 @@
gtk_container_add(GTK_CONTAINER(sw), players_list);
menubar = gtk_menu_bar_new();
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(players_dialog_shell)->vbox), menubar,
- FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(players_dialog_shell)->vbox), sw,
- TRUE, TRUE, 5);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(players_dialog_shell)->vbox),
menubar,
+ FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(players_dialog_shell)->vbox), sw,
+ TRUE, TRUE, 5);
+ } else {
+ gtk_box_pack_start(GTK_BOX(players_dialog_shell), menubar,
+ FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(players_dialog_shell), sw,
+ TRUE, TRUE, 5);
+ }
item = gtk_menu_item_new_with_mnemonic(_("_Player"));
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
@@ -403,8 +433,12 @@
gtk_widget_add_accelerator(players_sship_command,
"activate", accel, GDK_S, 0, GTK_ACCEL_VISIBLE);
- gtk_window_add_accel_group(GTK_WINDOW(players_dialog_shell), accel);
- gtk_widget_show_all(GTK_DIALOG(players_dialog_shell)->vbox);
+ if (!enable_tabs) {
+ gtk_window_add_accel_group(GTK_WINDOW(players_dialog_shell), accel);
+ gtk_widget_show_all(players_dialog_shell);
+ } else {
+ gtk_widget_show_all(players_dialog_shell);
+ }
g_signal_connect(players_meet_command, "activate",
G_CALLBACK(players_meet_callback), NULL);
@@ -420,8 +454,10 @@
gtk_list_store_clear(store);
update_players_dialog();
- gtk_dialog_set_default_response(GTK_DIALOG(players_dialog_shell),
- GTK_RESPONSE_CLOSE);
+ if (!enable_tabs) {
+ gtk_dialog_set_default_response(GTK_DIALOG(players_dialog_shell),
+ GTK_RESPONSE_CLOSE);
+ }
}
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/plrdlg.h
tabbed/client/gui-gtk-2.0/plrdlg.h
--- freeciv/client/gui-gtk-2.0/plrdlg.h 2002-12-14 16:38:23.000000000 -0800
+++ tabbed/client/gui-gtk-2.0/plrdlg.h 2004-10-22 21:30:49.304991176 -0700
@@ -15,6 +15,7 @@
#include "plrdlg_g.h"
+void load_players_dialog(void);
void popdown_players_dialog(void);
#endif /* FC__PLRDLG_H */
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/repodlgs.c
tabbed/client/gui-gtk-2.0/repodlgs.c
--- freeciv/client/gui-gtk-2.0/repodlgs.c 2004-09-28 19:24:21.000000000
-0700
+++ tabbed/client/gui-gtk-2.0/repodlgs.c 2004-10-22 21:48:43.129102665
-0700
@@ -134,18 +134,34 @@
/****************************************************************
-...
-*****************************************************************/
-void popup_science_dialog(bool make_modal)
+ load the science dialog
+ ***************************************************************/
+void load_science_dialog(bool make_modal)
{
if(!science_dialog_shell) {
science_dialog_shell_is_modal = make_modal;
create_science_dialog(make_modal);
- gtk_set_relative_position(toplevel, science_dialog_shell, 10, 10);
+ if (!enable_tabs) {
+ gtk_set_relative_position(toplevel, science_dialog_shell, 10, 10);
+ }
+ }
+}
+
+/****************************************************************
+ pop up the science dialog
+*****************************************************************/
+void popup_science_dialog(bool make_modal)
+{
+ load_science_dialog(make_modal);
+
+ if (!enable_tabs) {
+ gtk_window_present(GTK_WINDOW(science_dialog_shell));
+ } else {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(topnbook)) != 5) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 5);
+ }
}
-
- gtk_window_present(GTK_WINDOW(science_dialog_shell));
}
@@ -156,6 +172,7 @@
{
if (science_dialog_shell) {
gtk_widget_destroy(science_dialog_shell);
+ science_dialog_shell=NULL;
}
}
@@ -168,35 +185,50 @@
GtkWidget *frame, *hbox, *w;
int i;
- science_dialog_shell = gtk_dialog_new_with_buttons(_("Science"),
- NULL,
- 0,
- GTK_STOCK_CLOSE,
- GTK_RESPONSE_CLOSE,
- NULL);
- setup_dialog(science_dialog_shell, toplevel);
- gtk_dialog_set_default_response(GTK_DIALOG(science_dialog_shell),
- GTK_RESPONSE_CLOSE);
-
- if (make_modal) {
- gtk_window_set_transient_for(GTK_WINDOW(science_dialog_shell),
- GTK_WINDOW(toplevel));
- gtk_window_set_modal(GTK_WINDOW(science_dialog_shell), TRUE);
- }
-
- g_signal_connect(science_dialog_shell, "response",
- G_CALLBACK(gtk_widget_destroy), NULL);
- g_signal_connect(science_dialog_shell, "destroy",
- G_CALLBACK(gtk_widget_destroyed), &science_dialog_shell);
+ if (!enable_tabs) {
+ science_dialog_shell = gtk_dialog_new_with_buttons(_("Science"),
+ NULL,
+ 0,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_CLOSE,
+ NULL);
+ setup_dialog(science_dialog_shell, toplevel);
+ gtk_dialog_set_default_response(GTK_DIALOG(science_dialog_shell),
+ GTK_RESPONSE_CLOSE);
+
+ if (make_modal) {
+ gtk_window_set_transient_for(GTK_WINDOW(science_dialog_shell),
+ GTK_WINDOW(toplevel));
+ gtk_window_set_modal(GTK_WINDOW(science_dialog_shell), TRUE);
+ }
+
+ g_signal_connect(science_dialog_shell, "response",
+ G_CALLBACK(gtk_widget_destroy), NULL);
+ g_signal_connect(science_dialog_shell, "destroy",
+ G_CALLBACK(gtk_widget_destroyed), &science_dialog_shell);
+ } else {
+ science_dialog_shell = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tnbsci), science_dialog_shell, TRUE, TRUE, 0);
+ }
science_label = gtk_label_new("no text set yet");
- gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
- science_label, FALSE, FALSE, 0 );
+ if (!enable_tabs) {
+ gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
+ science_label, FALSE, FALSE, 0 );
+ } else {
+ gtk_box_pack_start( GTK_BOX( science_dialog_shell ),
+ science_label, FALSE, FALSE, 0 );
+ }
frame = gtk_frame_new(_("Researching"));
- gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
- frame, FALSE, FALSE, 0 );
+ if (!enable_tabs) {
+ gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
+ frame, FALSE, FALSE, 0 );
+ } else {
+ gtk_box_pack_start( GTK_BOX( science_dialog_shell ),
+ frame, FALSE, FALSE, 0 );
+ }
hbox = gtk_hbox_new( TRUE, 5 );
gtk_container_add(GTK_CONTAINER(frame), hbox);
@@ -215,8 +247,13 @@
gtk_box_pack_start( GTK_BOX( hbox ), science_help_toggle, TRUE, FALSE, 0 );
frame = gtk_frame_new( _("Goal"));
- gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
- frame, FALSE, FALSE, 0 );
+ if (!enable_tabs) {
+ gtk_box_pack_start( GTK_BOX( GTK_DIALOG(science_dialog_shell)->vbox ),
+ frame, FALSE, FALSE, 0 );
+ } else {
+ gtk_box_pack_start( GTK_BOX( science_dialog_shell ),
+ frame, FALSE, FALSE, 0 );
+ }
hbox = gtk_hbox_new( TRUE, 5 );
gtk_container_add(GTK_CONTAINER(frame),hbox);
@@ -235,8 +272,13 @@
gtk_box_pack_start( GTK_BOX( hbox ), w,TRUE, FALSE, 0 );
hbox = gtk_hbox_new(TRUE, 0);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(science_dialog_shell)->vbox),
- hbox, TRUE, TRUE, 5);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(science_dialog_shell)->vbox),
+ hbox, TRUE, TRUE, 5);
+ } else {
+ gtk_box_pack_start(GTK_BOX(science_dialog_shell),
+ hbox, TRUE, TRUE, 5);
+ }
@@ -263,11 +305,17 @@
G_CALLBACK(science_help_callback), science_model[i]);
}
- gtk_widget_show_all(GTK_DIALOG(science_dialog_shell)->vbox);
+ if (!enable_tabs) {
+ gtk_widget_show_all(GTK_DIALOG(science_dialog_shell)->vbox);
+ } else {
+ gtk_widget_show_all(science_dialog_shell);
+ }
science_dialog_update();
- gtk_window_set_focus(GTK_WINDOW(science_dialog_shell),
- science_change_menu_button);
+ if (!enable_tabs) {
+ gtk_window_set_focus(GTK_WINDOW(science_dialog_shell),
+ science_change_menu_button);
+ }
}
/****************************************************************
@@ -586,18 +634,34 @@
****************************************************************/
/****************************************************************
-...
-****************************************************************/
-void popup_economy_report_dialog(bool make_modal)
+ load the economy report dialog
+ ***************************************************************/
+void load_economy_report_dialog(bool make_modal)
{
if(!economy_dialog_shell) {
economy_dialog_shell_is_modal = make_modal;
create_economy_report_dialog(make_modal);
- gtk_set_relative_position(toplevel, economy_dialog_shell, 10, 10);
+ if (!enable_tabs) {
+ gtk_set_relative_position(toplevel, economy_dialog_shell, 10, 10);
+ }
}
+}
- gtk_window_present(GTK_WINDOW(economy_dialog_shell));
+/****************************************************************
+ pop up the economy report dialog
+****************************************************************/
+void popup_economy_report_dialog(bool make_modal)
+{
+ load_economy_report_dialog(make_modal);
+
+ if (!enable_tabs) {
+ gtk_window_present(GTK_WINDOW(economy_dialog_shell));
+ } else {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(topnbook)) != 4) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 4);
+ }
+ }
}
@@ -608,6 +672,7 @@
{
if (economy_dialog_shell) {
gtk_widget_destroy(economy_dialog_shell);
+ economy_dialog_shell=NULL;
}
}
@@ -636,18 +701,23 @@
intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
- economy_dialog_shell = gtk_dialog_new_with_buttons(_("Economy"),
- NULL,
- 0,
- NULL);
- setup_dialog(economy_dialog_shell, toplevel);
- gtk_dialog_set_default_response(GTK_DIALOG(economy_dialog_shell),
- GTK_RESPONSE_CLOSE);
-
- if (make_modal) {
- gtk_window_set_transient_for(GTK_WINDOW(economy_dialog_shell),
- GTK_WINDOW(toplevel));
- gtk_window_set_modal(GTK_WINDOW(economy_dialog_shell), TRUE);
+ if (!enable_tabs) {
+ economy_dialog_shell = gtk_dialog_new_with_buttons(_("Economy"),
+ NULL,
+ 0,
+ NULL);
+ setup_dialog(economy_dialog_shell, toplevel);
+ gtk_dialog_set_default_response(GTK_DIALOG(economy_dialog_shell),
+ GTK_RESPONSE_CLOSE);
+
+ if (make_modal) {
+ gtk_window_set_transient_for(GTK_WINDOW(economy_dialog_shell),
+ GTK_WINDOW(toplevel));
+ gtk_window_set_modal(GTK_WINDOW(economy_dialog_shell), TRUE);
+ }
+ } else {
+ economy_dialog_shell = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tnbecon), economy_dialog_shell, TRUE, TRUE, 0);
}
economy_store = gtk_list_store_newv(ARRAY_SIZE(model_types), model_types);
@@ -657,8 +727,13 @@
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(economy_dialog_shell)->vbox),
- sw, TRUE, TRUE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(economy_dialog_shell)->vbox),
+ sw, TRUE, TRUE, 0);
+ } else {
+ gtk_box_pack_start(GTK_BOX(economy_dialog_shell),
+ sw, TRUE, TRUE, 0);
+ }
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(economy_store));
g_object_unref(economy_store);
@@ -691,33 +766,58 @@
gtk_container_add(GTK_CONTAINER(sw), view);
economy_label2 = gtk_label_new(_("Total Cost:"));
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(economy_dialog_shell)->vbox),
- economy_label2, FALSE, FALSE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(economy_dialog_shell)->vbox),
+ economy_label2, FALSE, FALSE, 0);
+ } else {
+ gtk_box_pack_start(GTK_BOX(economy_dialog_shell),
+ economy_label2, FALSE, FALSE, 0);
+ }
gtk_misc_set_padding(GTK_MISC(economy_label2), 5, 5);
sellobsolete_command = gtk_button_new_with_mnemonic(_("Sell _Obsolete"));
- gtk_dialog_add_action_widget(GTK_DIALOG(economy_dialog_shell),
- sellobsolete_command, ECONOMY_SELL_OBSOLETE);
+ if (!enable_tabs) {
+ gtk_dialog_add_action_widget(GTK_DIALOG(economy_dialog_shell),
+ sellobsolete_command, ECONOMY_SELL_OBSOLETE);
+ } else {
+ g_signal_connect(sellobsolete_command, "clicked",
+ G_CALLBACK(economy_command_callback), (void *)
ECONOMY_SELL_OBSOLETE);
+ gtk_box_pack_start(GTK_BOX(economy_dialog_shell), sellobsolete_command,
FALSE, FALSE, 0);
+ }
gtk_widget_set_sensitive(sellobsolete_command, FALSE);
sellall_command = gtk_button_new_with_mnemonic(_("Sell _All"));
- gtk_dialog_add_action_widget(GTK_DIALOG(economy_dialog_shell),
- sellall_command, ECONOMY_SELL_ALL);
+ if (!enable_tabs) {
+ gtk_dialog_add_action_widget(GTK_DIALOG(economy_dialog_shell),
+ sellall_command, ECONOMY_SELL_ALL);
+ } else {
+ g_signal_connect(sellall_command, "clicked",
+ G_CALLBACK(economy_command_callback), (void *)
ECONOMY_SELL_ALL);
+ gtk_box_pack_start(GTK_BOX(economy_dialog_shell), sellall_command, FALSE,
FALSE, 0);
+ }
gtk_widget_set_sensitive(sellall_command, FALSE);
- gtk_dialog_add_button(GTK_DIALOG(economy_dialog_shell),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
-
- g_signal_connect(economy_dialog_shell, "response",
- G_CALLBACK(economy_command_callback), NULL);
- g_signal_connect(economy_dialog_shell, "destroy",
- G_CALLBACK(gtk_widget_destroyed), &economy_dialog_shell);
+ if (!enable_tabs) {
+ gtk_dialog_add_button(GTK_DIALOG(economy_dialog_shell),
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+
+ g_signal_connect(economy_dialog_shell, "response",
+ G_CALLBACK(economy_command_callback), NULL);
+ g_signal_connect(economy_dialog_shell, "destroy",
+ G_CALLBACK(gtk_widget_destroyed), &economy_dialog_shell);
+ }
economy_report_dialog_update();
- gtk_window_set_default_size(GTK_WINDOW(economy_dialog_shell), -1, 350);
+ if (!enable_tabs) {
+ gtk_window_set_default_size(GTK_WINDOW(economy_dialog_shell), -1, 350);
+ }
- gtk_widget_show_all(GTK_DIALOG(economy_dialog_shell)->vbox);
- gtk_widget_show_all(GTK_DIALOG(economy_dialog_shell)->action_area);
+ if (!enable_tabs) {
+ gtk_widget_show_all(GTK_DIALOG(economy_dialog_shell)->vbox);
+ gtk_widget_show_all(GTK_DIALOG(economy_dialog_shell)->action_area);
+ } else {
+ gtk_widget_show_all(economy_dialog_shell);
+ }
gtk_tree_view_focus(GTK_TREE_VIEW(view));
}
@@ -777,7 +877,7 @@
if (is_impr == TRUE) {
if (response_id == ECONOMY_SELL_ALL) {
shell = gtk_message_dialog_new(
- GTK_WINDOW(economy_dialog_shell),
+ ((enable_tabs) ? NULL : GTK_WINDOW(economy_dialog_shell)),
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
_("Do you really wish to sell your %s?\n"),
@@ -801,7 +901,7 @@
disband_all_units(i, FALSE, buf, sizeof(buf));
}
- shell = gtk_message_dialog_new(GTK_WINDOW(economy_dialog_shell),
+ shell = gtk_message_dialog_new(((enable_tabs) ? NULL :
GTK_WINDOW(economy_dialog_shell)),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
buf);
@@ -880,18 +980,34 @@
#define AU_COL 7
/****************************************************************
-...
-****************************************************************/
-void popup_activeunits_report_dialog(bool make_modal)
+ load the active units dialog
+ ***************************************************************/
+void load_activeunits_report_dialog(bool make_modal)
{
if(!activeunits_dialog_shell) {
activeunits_dialog_shell_is_modal = make_modal;
create_activeunits_report_dialog(make_modal);
- gtk_set_relative_position(toplevel, activeunits_dialog_shell, 10, 10);
+ if (!enable_tabs) {
+ gtk_set_relative_position(toplevel, activeunits_dialog_shell, 10, 10);
+ }
}
+}
- gtk_window_present(GTK_WINDOW(activeunits_dialog_shell));
+/****************************************************************
+ pop up the active units dialog
+****************************************************************/
+void popup_activeunits_report_dialog(bool make_modal)
+{
+ load_activeunits_report_dialog(make_modal);
+
+ if (!enable_tabs) {
+ gtk_window_present(GTK_WINDOW(activeunits_dialog_shell));
+ } else {
+ if (gtk_notebook_get_current_page(GTK_NOTEBOOK(topnbook)) != 2) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 2);
+ }
+ }
}
@@ -902,6 +1018,7 @@
{
if (activeunits_dialog_shell) {
gtk_widget_destroy(activeunits_dialog_shell);
+ activeunits_dialog_shell=NULL;
}
}
@@ -938,18 +1055,23 @@
intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
- activeunits_dialog_shell = gtk_dialog_new_with_buttons(_("Units"),
- NULL,
- 0,
- NULL);
- setup_dialog(activeunits_dialog_shell, toplevel);
- gtk_dialog_set_default_response(GTK_DIALOG(activeunits_dialog_shell),
- GTK_RESPONSE_CLOSE);
-
- if (make_modal) {
- gtk_window_set_transient_for(GTK_WINDOW(activeunits_dialog_shell),
- GTK_WINDOW(toplevel));
- gtk_window_set_modal(GTK_WINDOW(activeunits_dialog_shell), TRUE);
+ if (!enable_tabs) {
+ activeunits_dialog_shell = gtk_dialog_new_with_buttons(_("Units"),
+ NULL,
+ 0,
+ NULL);
+ setup_dialog(activeunits_dialog_shell, toplevel);
+ gtk_dialog_set_default_response(GTK_DIALOG(activeunits_dialog_shell),
+ GTK_RESPONSE_CLOSE);
+
+ if (make_modal) {
+ gtk_window_set_transient_for(GTK_WINDOW(activeunits_dialog_shell),
+ GTK_WINDOW(toplevel));
+ gtk_window_set_modal(GTK_WINDOW(activeunits_dialog_shell), TRUE);
+ }
+ } else {
+ activeunits_dialog_shell = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(tnbunits), activeunits_dialog_shell, TRUE,
TRUE, 0);
}
activeunits_store = gtk_list_store_newv(ARRAY_SIZE(model_types),
model_types);
@@ -959,8 +1081,13 @@
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(activeunits_dialog_shell)->vbox),
- sw, TRUE, TRUE, 0);
+ if (!enable_tabs) {
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(activeunits_dialog_shell)->vbox),
+ sw, TRUE, TRUE, 0);
+ } else {
+ gtk_box_pack_start(GTK_BOX(activeunits_dialog_shell),
+ sw, TRUE, TRUE, 0);
+ }
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(activeunits_store));
g_object_unref(activeunits_store);
@@ -994,30 +1121,50 @@
gtk_container_add(GTK_CONTAINER(sw), view);
command = gtk_stockbutton_new(GTK_STOCK_FIND, _("Find _Nearest"));
- gtk_dialog_add_action_widget(GTK_DIALOG(activeunits_dialog_shell),
- command, ACTIVEUNITS_NEAREST);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_NEAREST, FALSE);
+ if (!enable_tabs) {
+ gtk_dialog_add_action_widget(GTK_DIALOG(activeunits_dialog_shell),
+ command, ACTIVEUNITS_NEAREST);
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
+ ACTIVEUNITS_NEAREST, FALSE);
+ } else {
+ g_signal_connect(command, "clicked",
+ G_CALLBACK(activeunits_command_callback), (void *)
ACTIVEUNITS_NEAREST);
+ gtk_box_pack_start(GTK_BOX(activeunits_dialog_shell), command, FALSE,
FALSE, 0);
+ }
command = gtk_button_new_with_mnemonic(_("_Upgrade"));
- gtk_dialog_add_action_widget(GTK_DIALOG(activeunits_dialog_shell),
- command, ACTIVEUNITS_UPGRADE);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_UPGRADE, FALSE);
+ if (!enable_tabs) {
+ gtk_dialog_add_action_widget(GTK_DIALOG(activeunits_dialog_shell),
+ command, ACTIVEUNITS_UPGRADE);
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
+ ACTIVEUNITS_UPGRADE, FALSE);
+ } else {
+ g_signal_connect(command, "clicked",
+ G_CALLBACK(activeunits_command_callback), (void *)
ACTIVEUNITS_UPGRADE);
+ gtk_box_pack_start(GTK_BOX(activeunits_dialog_shell), command, FALSE,
FALSE, 0);
+ }
- gtk_dialog_add_button(GTK_DIALOG(activeunits_dialog_shell),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ if (!enable_tabs) {
+ gtk_dialog_add_button(GTK_DIALOG(activeunits_dialog_shell),
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
- g_signal_connect(activeunits_dialog_shell, "response",
+ g_signal_connect(activeunits_dialog_shell, "response",
G_CALLBACK(activeunits_command_callback), NULL);
- g_signal_connect(activeunits_dialog_shell, "destroy",
+ g_signal_connect(activeunits_dialog_shell, "destroy",
G_CALLBACK(gtk_widget_destroyed), &activeunits_dialog_shell);
+ }
activeunits_report_dialog_update();
- gtk_window_set_default_size(GTK_WINDOW(activeunits_dialog_shell), -1, 350);
+ if (!enable_tabs) {
+ gtk_window_set_default_size(GTK_WINDOW(activeunits_dialog_shell), -1, 350);
+ }
- gtk_widget_show_all(GTK_DIALOG(activeunits_dialog_shell)->vbox);
- gtk_widget_show_all(GTK_DIALOG(activeunits_dialog_shell)->action_area);
+ if (!enable_tabs) {
+ gtk_widget_show_all(GTK_DIALOG(activeunits_dialog_shell)->vbox);
+ gtk_widget_show_all(GTK_DIALOG(activeunits_dialog_shell)->action_area);
+ } else {
+ gtk_widget_show_all(activeunits_dialog_shell);
+ }
gtk_tree_view_focus(GTK_TREE_VIEW(view));
}
@@ -1045,26 +1192,28 @@
}
}
- if (!is_unit_type) {
- gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_NEAREST, FALSE);
-
- gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_UPGRADE, FALSE);
- } else {
- gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_NEAREST,
- can_client_issue_orders());
-
- if (can_upgrade_unittype(game.player_ptr, activeunits_type[row]) != -1) {
+ if (!enable_tabs) {
+ if (!is_unit_type) {
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
+ ACTIVEUNITS_NEAREST, FALSE);
+
gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_UPGRADE,
- can_client_issue_orders());
+ ACTIVEUNITS_UPGRADE, FALSE);
} else {
gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
- ACTIVEUNITS_UPGRADE, FALSE);
+ ACTIVEUNITS_NEAREST,
+ can_client_issue_orders());
+
+ if (can_upgrade_unittype(game.player_ptr, activeunits_type[row]) != -1) {
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
+ ACTIVEUNITS_UPGRADE,
+ can_client_issue_orders());
+ } else {
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(activeunits_dialog_shell),
+ ACTIVEUNITS_UPGRADE, FALSE);
+ }
}
- }
+ } /* FIXME: NEEDS EQUIV. FOR TABBED */
}
/****************************************************************
@@ -1130,11 +1279,15 @@
set_unit_focus_and_select(punit);
}
}
+
+ if (enable_tabs) {
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(topnbook), 0);
+ }
} else {
ut2 = can_upgrade_unittype(game.player_ptr, activeunits_type[row]);
shell = gtk_message_dialog_new(
- GTK_WINDOW(activeunits_dialog_shell),
+ ((enable_tabs) ? NULL : GTK_WINDOW(activeunits_dialog_shell)),
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
_("Upgrade as many %s to %s as possible for %d gold each?\n"
diff -ruN -X freeciv/diff_ignore freeciv/client/gui-gtk-2.0/repodlgs.h
tabbed/client/gui-gtk-2.0/repodlgs.h
--- freeciv/client/gui-gtk-2.0/repodlgs.h 2002-12-14 16:38:23.000000000
-0800
+++ tabbed/client/gui-gtk-2.0/repodlgs.h 2004-10-22 21:26:13.835563450
-0700
@@ -15,6 +15,10 @@
#include "repodlgs_g.h"
+void load_science_dialog(bool make_modal);
+void load_economy_report_dialog(bool make_modal);
+void load_activeunits_report_dialog(bool make_modal);
+
void popdown_science_dialog(void);
void popdown_economy_report_dialog(void);
void popdown_activeunits_report_dialog(void);
diff -ruN -X freeciv/diff_ignore freeciv/client/packhand.c
tabbed/client/packhand.c
--- freeciv/client/packhand.c 2004-10-22 20:21:55.664712094 -0700
+++ tabbed/client/packhand.c 2004-10-22 21:01:09.309307697 -0700
@@ -357,6 +357,14 @@
/* Find something sensible to display instead of the intro gfx. */
center_on_something();
+ /* if (enable_tabs) {
+ popup_city_report_dialog(0);
+ popup_activeunits_report_dialog(0);
+ popup_players_dialog();
+ popup_economy_report_dialog(0);
+ popup_science_dialog(0);
+ }*/
+
free_intro_radar_sprites();
agents_game_start();
}
diff -ruN -X freeciv/diff_ignore freeciv/client/plrdlg_common.c
tabbed/client/plrdlg_common.c
--- freeciv/client/plrdlg_common.c 2004-08-15 02:47:04.000000000 -0700
+++ tabbed/client/plrdlg_common.c 2004-10-22 20:22:59.679234289 -0700
@@ -223,9 +223,9 @@
{TRUE, COL_TEXT, N_("Vision"), col_vision, NULL, "vision"},
{TRUE, COL_TEXT, N_("Reputation"), col_reputation, NULL, "reputation"},
{TRUE, COL_TEXT, N_("State"), col_state, NULL, "state"},
- {TRUE, COL_TEXT, N_("?Player_dlg:Host"), col_host, NULL, "host"},
- {TRUE, COL_RIGHT_TEXT, N_("?Player_dlg:Idle"), col_idle, NULL, "idle"},
- {TRUE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, NULL, "ping"}
+ {FALSE, COL_TEXT, N_("?Player_dlg:Host"), col_host, NULL, "host"},
+ {FALSE, COL_RIGHT_TEXT, N_("?Player_dlg:Idle"), col_idle, NULL, "idle"},
+ {FALSE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, NULL, "ping"}
};
const int num_player_dlg_columns = ARRAY_SIZE(player_dlg_columns);
- [Freeciv-Dev] Re: (PR#10435) Repodlg tabs in GTK+2 client, Jason Short, 2004/10/05
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Gregor Richards, 2004/10/05
- [Freeciv-Dev] Re: (PR#10435) Repodlg tabs in GTK+2 client, Jason Short, 2004/10/05
- [Freeciv-Dev] Re: (PR#10435) Repodlg tabs in GTK+2 client, Jason Short, 2004/10/07
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Gregor Richards, 2004/10/16
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client,
Gregor Richards <=
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Gregor Richards, 2004/10/24
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Vasco Alexandre da Silva Costa, 2004/10/29
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Vasco Alexandre da Silva Costa, 2004/10/29
- [Freeciv-Dev] (PR#10435) Repodlg tabs in GTK+2 client, Vasco Alexandre da Silva Costa, 2004/10/30
- [Freeciv-Dev] (PR#10435) ITC October 31 at ~ 19:00 GMT, Vasco Alexandre da Silva Costa, 2004/10/30
|
|