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

> [book - Sun Feb 15 05:05:03 2009]:
> 
> > [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.

Updated to recent S2_1 and post the trunk version this time. :|


-----------------------------------------------------------------------
クソ前後関係!!
 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 b1ebd21..5b270e3 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 split_bottom_notebook = FALSE;
+bool metaserver_tab_first = FALSE;
 
 GtkWidget *toplevel;
 GdkWindow *root_window;
@@ -196,7 +197,13 @@ client_option gui_options[] = {
                      N_("Enabling this option will split the bottom "
                         "notebook into a left and right notebook so that "
                         "two tabs may be viewed at once."),
-                     COC_INTERFACE, split_bottom_notebook_callback)
+                     COC_INTERFACE, split_bottom_notebook_callback),
+  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 db15136..c52ce86 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 split_bottom_notebook;
+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 a0f138b..fdac9a4 100644
--- a/client/gui-gtk-2.0/pages.c
+++ b/client/gui-gtk-2.0/pages.c
@@ -789,7 +789,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);
 client/gui-gtk-2.0/gui_main.c |    7 +++++++
 client/gui-gtk-2.0/gui_main.h |    1 +
 client/gui-gtk-2.0/pages.c    |    6 +++++-
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/client/gui-gtk-2.0/gui_main.c b/client/gui-gtk-2.0/gui_main.c
index c5fe7a1..6840df0 100644
--- a/client/gui-gtk-2.0/gui_main.c
+++ b/client/gui-gtk-2.0/gui_main.c
@@ -99,6 +99,7 @@ bool enable_tabs = TRUE;
 bool better_fog = TRUE;
 bool show_chat_message_time = FALSE;
 bool split_bottom_notebook = FALSE;
+bool metaserver_tab_first = FALSE;
 
 GtkWidget *toplevel;
 GdkWindow *root_window;
@@ -216,6 +217,12 @@ client_option gui_options[] = {
                         "notebook into a left and right notebook so that "
                         "two tabs may be viewed at once."),
                      COC_INTERFACE, split_bottom_notebook_callback),
+  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),
   GEN_FONT_OPTION(font_city_label,
   		  city_label,
 		  N_("City Label"),
diff --git a/client/gui-gtk-2.0/gui_main.h b/client/gui-gtk-2.0/gui_main.h
index 38567d9..e587768 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 split_bottom_notebook;
+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 928b042..b80f2a0 100644
--- a/client/gui-gtk-2.0/pages.c
+++ b/client/gui-gtk-2.0/pages.c
@@ -783,7 +783,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

Reply via email to