<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40701 >
> [book - Wed Feb 04 05:35:29 2009]: > > The attached patch makes the metaserver tab in the network page > appear before the lan (local server) tab. So the metaserver > list appears right away when users click the "Connect to Network > Game" button on the start page. Version 2 makes this an interface option, with the default preserving the existing notebook tab order. ----------------------------------------------------------------------- 秩序は動揺しないでください。
client/gui-gtk-2.0/gui_main.c | 9 ++++++++- client/gui-gtk-2.0/gui_main.h | 1 + client/gui-gtk-2.0/pages.c | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/gui-gtk-2.0/gui_main.c b/client/gui-gtk-2.0/gui_main.c index e33762e..fb83aa5 100644 --- a/client/gui-gtk-2.0/gui_main.c +++ b/client/gui-gtk-2.0/gui_main.c @@ -96,6 +96,7 @@ bool enable_tabs = TRUE; bool better_fog = TRUE; bool show_chat_message_time = FALSE; bool new_messages_go_to_top = FALSE; +bool metaserver_tab_first = FALSE; GtkWidget *toplevel; GdkWindow *root_window; @@ -193,7 +194,13 @@ client_option gui_options[] = { N_("If this option is enabled, new events in the " "message window will appear at the top of the list, " "rather than being appended at the bottom."), - COC_INTERFACE) + COC_INTERFACE), + GEN_BOOL_OPTION(metaserver_tab_first, + N_("Metaserver tab first in network page"), + N_("If this option is enabled, the metaserver tab will " + "be the first notebook tab in the network page. This " + "option requires a restart in order to take effect."), + COC_NETWORK) }; const int num_gui_options = ARRAY_SIZE(gui_options); diff --git a/client/gui-gtk-2.0/gui_main.h b/client/gui-gtk-2.0/gui_main.h index 28e521e..5771997 100644 --- a/client/gui-gtk-2.0/gui_main.h +++ b/client/gui-gtk-2.0/gui_main.h @@ -28,6 +28,7 @@ extern bool enable_tabs; extern bool better_fog; extern bool show_chat_message_time; extern bool new_messages_go_to_top; +extern bool metaserver_tab_first; extern GdkGC * civ_gc; extern GdkGC * mask_fg_gc; diff --git a/client/gui-gtk-2.0/pages.c b/client/gui-gtk-2.0/pages.c index 78d5f92..ba6f7dc 100644 --- a/client/gui-gtk-2.0/pages.c +++ b/client/gui-gtk-2.0/pages.c @@ -790,7 +790,11 @@ GtkWidget *create_network_page(void) gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(sw), view); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label); + if (metaserver_tab_first) { + gtk_notebook_prepend_page(GTK_NOTEBOOK(notebook), sw, label); + } else { + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label); + } /* Bottom part of the page, outside the inner notebook. */ sbox = gtk_vbox_new(FALSE, 0);
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev