Re: [Freeciv-Dev] (PR#40343) trunk fails to compile here too

2008-06-30 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40343 

On Mon, 30 Jun 2008 10:01:13 +0900, Madeline Book  
[EMAIL PROTECTED] wrote:


 URL: http://bugs.freeciv.org/Ticket/Display.html?id=40343 

 [book - Sun Jun 29 18:36:10 2008]:

  [EMAIL PROTECTED] - Sun Jun 29 16:57:24 2008]:
 
  2008/6/29 Daniel Markstedt:
  
   ld: Undefined symbols:
   _gtk_image_clear
 
   gtk_image_clear() seems to be gtk 2.8 feature. Either we have to
  replace this call or to make 2.8 minimum gtk version.
 
   This is on MacOSX 10.3.9, with GTK+ 2.6.8

 I'll look into finding a compatible replacement for this
 function.

 Attached patch gets rid of the two calls to gtk_image_clear
 by taking advantage of the fact that passing a NULL pixbuf
 to gtk_image_set_from_pixbuf does the same thing.


 --
 しやすい

With this patch trunk compiles fine.

Tried the editor briefly and it seems to be working fine, except for the  
fact that the editor toolbar items have no icons.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40346) [Patch] Avoid duplicate check for available nation count

2008-06-30 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40346 

 There's duplicate check for available nations count before triggering
civil war - one before civil_war() is called and another in the
beginning of civil_war(). Attached patch removes slow one before the
call. For S2_2 and TRUNK only.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/citytools.c freeciv/server/citytools.c
--- freeciv/server/citytools.c  2008-06-25 12:21:39.0 +0300
+++ freeciv/server/citytools.c  2008-06-30 19:09:49.0 +0300
@@ -1267,7 +1267,7 @@
 **/
 void unit_enter_city(struct unit *punit, struct city *pcity, bool passenger)
 {
-  bool do_civil_war = FALSE;
+  bool try_civil_war = FALSE;
   int coins;
   struct player *pplayer = unit_owner(punit);
   struct player *cplayer = city_owner(pcity);
@@ -1307,15 +1307,7 @@
game.info.civilwarsize  GAME_MAX_CIVILWARSIZE
player_count_no_barbarians()  MAX_NUM_PLAYERS
civil_war_triggered(cplayer)) {
-/* Do a civil war only if there's an available unused nation. */
-nations_iterate(pnation) {
-  if (is_nation_playable(pnation)
-  pnation-is_available
-  !pnation-player) {
-   do_civil_war = TRUE;
-   break;
-  }
-} nations_iterate_end;
+try_civil_war = TRUE;
   }
 
   /* 
@@ -1331,7 +1323,7 @@
 city_name(pcity),
 player_name(pplayer));
 remove_city(pcity);
-if (do_civil_war) {
+if (try_civil_war) {
   civil_war(cplayer);
 }
 return;
@@ -1420,7 +1412,7 @@
   city_reduce_size(pcity, 1);
   send_player_info(pplayer, pplayer); /* Update techs */
 
-  if (do_civil_war) {
+  if (try_civil_war) {
 civil_war(cplayer);
   }
 }
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40343) trunk fails to compile here too

2008-06-30 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40343 

 [book - Mon Jun 30 01:01:12 2008]:
 
 Attached patch gets rid of the two calls to gtk_image_clear
 by taking advantage of the fact that passing a NULL pixbuf
 to gtk_image_set_from_pixbuf does the same thing.

Mini-patch committed to S2_2 (r14924) and trunk (r14925).
 

--
流れ星より早いんだよ。

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40343) trunk fails to compile here too

2008-06-30 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40343 

 [dmarks - Mon Jun 30 13:09:18 2008]:
 
 Tried the editor briefly and it seems to be working fine, except
 for the  fact that the editor toolbar items have no icons.

That's strange. :(

I assume since no assertions were triggered that the image
files are loading fine, just gtk has some problem putting
the image into the button.

It's just a guess, but try the attached patch to see if
it helps.
diff --git a/client/gui-gtk-2.0/editgui.c b/client/gui-gtk-2.0/editgui.c
index fd32851..b46d78e 100644
--- a/client/gui-gtk-2.0/editgui.c
+++ b/client/gui-gtk-2.0/editgui.c
@@ -359,7 +359,7 @@ static GtkWidget *create_editbar_radiobutton(struct editbar *eb,
   pixbuf = sprite_get_pixbuf(sprite);
   image = gtk_image_new_from_pixbuf(pixbuf);
 
-  gtk_button_set_image(GTK_BUTTON(button), image);
+  gtk_container_add(GTK_CONTAINER(button), image);
   gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(button), FALSE);
   gtk_tooltips_set_tip(eb-tooltips, button,
editor_tool_get_tooltip(ett), );
@@ -419,7 +419,7 @@ static struct editbar *editbar_create(void)
   button = gtk_toggle_button_new();
   pixbuf = sprite_get_pixbuf(sprites-erase);
   image = gtk_image_new_from_pixbuf(pixbuf);
-  gtk_button_set_image(GTK_BUTTON(button), image);
+  gtk_container_add(GTK_CONTAINER(button), image);
   gtk_tooltips_set_tip(eb-tooltips, button,
_(Set Erase Mode), );
   gtk_widget_set_size_request(button, BWIDTH, BHEIGHT);
@@ -487,7 +487,7 @@ static struct editbar *editbar_create(void)
   button = gtk_button_new();
   pixbuf = sprite_get_pixbuf(sprites-properties);
   image = gtk_image_new_from_pixbuf(pixbuf);
-  gtk_button_set_image(GTK_BUTTON(button), image);
+  gtk_container_add(GTK_CONTAINER(button), image);
   gtk_tooltips_set_tip(eb-tooltips, button,
_(Modify Player), );
   gtk_widget_set_size_request(button, BWIDTH, BHEIGHT);
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40165) Re: Expanded terrain set, request for info

2008-06-30 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 

2008/3/24 Marko Lindqvist:

  TERRAIN_XXX_IDENTIFIER definitions have to go, and terrains must be
 selected by properly checking their flags, ocean_depth -value, or what
 ever is appropriate for each case.

 Attached patch removes code that creates these special ocean types.
If such special features are needed in the future, they should be
reimplemented in a proper, generic, fashion.
 civ1  civ2 rulesets have only one ocean type, default ruleset three
types; Lake, Ocean and Deep Ocean.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/control.c freeciv/client/control.c
--- freeciv/client/control.c2008-06-24 01:37:58.0 +0300
+++ freeciv/client/control.c2008-06-30 21:01:55.0 +0300
@@ -2858,14 +2858,6 @@
 }
 
 /**
-  Regenerate water.
-**/
-void key_editor_regenerate_water(void)
-{
-  send_packet_edit_regenerate_water(client.conn);
-}
-
-/**
   Send a request to the server to toggle fog-of-war for the current
   player (only applies in edit mode).
 **/
diff -Nurd -X.diff_ignore freeciv/client/control.h freeciv/client/control.h
--- freeciv/client/control.h2008-06-24 01:37:58.0 +0300
+++ freeciv/client/control.h2008-06-30 21:02:04.0 +0300
@@ -194,7 +194,6 @@
 
 void key_editor_toggle(void);
 void key_editor_recalculate_borders(void);
-void key_editor_regenerate_water(void);
 void key_editor_toggle_fogofwar(void);
 
 /* don't change this unless you also put more entries in data/Freeciv */
diff -Nurd -X.diff_ignore freeciv/client/gui-gtk-2.0/menu.c 
freeciv/client/gui-gtk-2.0/menu.c
--- freeciv/client/gui-gtk-2.0/menu.c   2008-06-24 01:37:56.0 +0300
+++ freeciv/client/gui-gtk-2.0/menu.c   2008-06-30 21:03:08.0 +0300
@@ -169,7 +169,6 @@
  
   MENU_EDITOR_TOGGLE,
   MENU_EDITOR_RECALCULATE_BORDERS,
-  MENU_EDITOR_REGENERATE_WATER,
   MENU_EDITOR_TOGGLE_FOGOFWAR,
 
   MENU_HELP_LANGUAGES,
@@ -632,9 +631,6 @@
   case MENU_EDITOR_RECALCULATE_BORDERS:
 key_editor_recalculate_borders();
 break;
-  case MENU_EDITOR_REGENERATE_WATER:
-key_editor_regenerate_water();
-break;
   case MENU_EDITOR_TOGGLE_FOGOFWAR:
 key_editor_toggle_fogofwar();
 break;
@@ -806,8 +802,6 @@
editor_menu_callback, MENU_EDITOR_TOGGLE, CheckItem },
   { / N_(_Edit) / N_(Recalculate _Borders), NULL,
editor_menu_callback, MENU_EDITOR_RECALCULATE_BORDERS },
-  { / N_(_Edit) / N_(Regenerate _Water), NULL,
-   editor_menu_callback, MENU_EDITOR_REGENERATE_WATER },
   { / N_(_Edit) / N_(Toggle Fog-of-war), controlf,
editor_menu_callback, MENU_EDITOR_TOGGLE_FOGOFWAR },
 
diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def
--- freeciv/common/packets.def  2008-06-30 12:02:12.0 +0300
+++ freeciv/common/packets.def  2008-06-30 20:41:22.0 +0300
@@ -1427,9 +1427,6 @@
   BOOL state;
 end
 
-PACKET_EDIT_REGENERATE_WATER=151;cs,handle-per-conn
-end
-
 PACKET_EDIT_RECALCULATE_BORDERS=152;cs,handle-per-conn
 end
 
diff -Nurd -X.diff_ignore freeciv/common/terrain.h freeciv/common/terrain.h
--- freeciv/common/terrain.h2008-06-28 20:49:38.0 +0300
+++ freeciv/common/terrain.h2008-06-30 21:16:26.0 +0300
@@ -152,13 +152,7 @@
 
   char identifier; /* Single-character identifier used in savegames. */
 
-#define TERRAIN_SEA_IDENTIFIER '-'
-#define TERRAIN_OCEAN_IDENTIFIER ' '
-#define TERRAIN_SHELF_IDENTIFIER ','
-#define TERRAIN_FLOOR_IDENTIFIER ':'
-#define TERRAIN_RIDGE_IDENTIFIER '^'
-#define TERRAIN_GLACIER_IDENTIFIER 'a'
-#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
+#define TERRAIN_UNKNOWN_IDENTIFIER '?'
 
   int movement_cost;
   int defense_bonus; /* % defense bonus - defaults to zero */
diff -Nurd -X.diff_ignore freeciv/data/civ1/terrain.ruleset 
freeciv/data/civ1/terrain.ruleset
--- freeciv/data/civ1/terrain.ruleset   2008-06-30 12:02:12.0 +0300
+++ freeciv/data/civ1/terrain.ruleset   2008-06-30 21:13:09.0 +0300
@@ -172,41 +172,6 @@
 ; helptext = optional help text string; should escape all raw 
 ;newlines so that xgettext parsing works
 
-[terrain_salt_water_coast]
-name = _(Sea)
-graphic  = coast
-graphic_alt  = -
-identifier   = -
-movement_cost= 1
-defense_bonus= 0
-food = 1
-shield   = 0
-trade= 2
-resources= resource_fish
-road_trade_incr  = 0
-road_time= 0
-irrigation_result= no
-irrigation_food_incr = 0
-irrigation_time  = 0
-mining_result= no
-mining_shield_incr   = 0
-mining_time  = 0
-transform_result = no
-transform_time   = 

[Freeciv-Dev] (PR#40344) Empty space in main page.

2008-06-30 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40344 

Strangely, this was caused by the total height of the
toplevel window being calculated as the maximum of all
its child widgets, both shown and hidden. In particular,
the hidden edit info box (which should be considered
as taking the place of the unit info box) height was
being added to the full height of the unit info box.

So I was mistaken in thinking it would be enough to just
hide/show widgets based on edit mode. :(

The attached patch gets rid of this assumption by
internally reparenting the unit/edit info boxes instead
of just hiding/showing them.


--
信じられない、このありえないこと。
diff --git a/client/gui-gtk-2.0/editgui.c b/client/gui-gtk-2.0/editgui.c
index b96b3df..74f0640 100644
--- a/client/gui-gtk-2.0/editgui.c
+++ b/client/gui-gtk-2.0/editgui.c
@@ -1225,6 +1225,15 @@ static struct editinfobox *editinfobox_create(void)
   gtk_box_pack_start(GTK_BOX(vbox), combo, FALSE, FALSE, 0);
   ei-tool_applied_player_combobox = combo;
 
+  /* We add a ref to the editinfobox widget so that it is
+   * not destroyed when replaced by the unit info box when
+   * we leave edit mode. See editinfobox_refresh(). */
+  g_object_ref(ei-widget);
+
+  /* The edit info box starts with no parent, so we have to
+   * show its internal widgets manually. */
+  gtk_widget_show_all(ei-widget);
+
   return ei;
 }
 
@@ -1424,6 +1433,23 @@ static GdkPixbuf *get_brush_pixbuf(void)
 }
 
 /
+  NB: Assumes that widget 'old' has enough references to not be destroyed
+  when removed from its parent container.
+/
+static void replace_widget(GtkWidget *old, GtkWidget *new)
+{
+  GtkWidget *parent;
+
+  parent = gtk_widget_get_parent(old);
+  if (!parent) {
+return;
+  }
+
+  gtk_container_remove(GTK_CONTAINER(parent), old);
+  gtk_container_add(GTK_CONTAINER(parent), new);
+}
+
+/
   Refresh the given editinfobox according to the current editor state.
 /
 static void editinfobox_refresh(struct editinfobox *ei)
@@ -1439,8 +1465,7 @@ static void editinfobox_refresh(struct editinfobox *ei)
   }
 
   if (!editor_is_active()) {
-gtk_widget_hide(ei-widget);
-gtk_widget_show(unit_info_box);
+replace_widget(ei-widget, unit_info_box);
 return;
   }
 
@@ -1502,8 +1527,7 @@ static void editinfobox_refresh(struct editinfobox *ei)
 
   refresh_tool_applied_player_combo(ei);
 
-  gtk_widget_hide(unit_info_box);
-  gtk_widget_show(ei-widget);
+  replace_widget(unit_info_box, ei-widget);
 }
 
 /
diff --git a/client/gui-gtk-2.0/gui_main.c b/client/gui-gtk-2.0/gui_main.c
index 6257453..1ed2e8b 100644
--- a/client/gui-gtk-2.0/gui_main.c
+++ b/client/gui-gtk-2.0/gui_main.c
@@ -1204,6 +1204,12 @@ static void setup_widgets(void)
   unit_info_box = gtk_vbox_new(FALSE, 0);
   gtk_box_pack_start(GTK_BOX(avbox), unit_info_box, FALSE, FALSE, 0);
 
+  /* In edit mode the unit_info_box widget is replaced by the
+   * editinfobox, so we need to add a ref here so that it is
+   * not destroyed when removed from its container.
+   * See editinfobox_refresh(). */
+  g_object_ref(unit_info_box);
+
   unit_info_frame = gtk_frame_new();
   gtk_box_pack_start(GTK_BOX(unit_info_box), unit_info_frame, FALSE, FALSE, 0);
 
@@ -1222,11 +1228,6 @@ static void setup_widgets(void)
   unit_pixmap_table = table;
   populate_unit_pixmap_table();
 
-  /* Editor info box */
-  gtk_box_pack_start(GTK_BOX(avbox),
- editgui_get_editinfobox()-widget,
- FALSE, FALSE, 0);
-
   /* Map canvas, editor toolbar, and scrollbars */
 
   top_notebook = gtk_notebook_new();  
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40165) Re: Expanded terrain set, request for info

2008-06-30 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 

Marko Lindqvist wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=40165 
 
 2008/3/24 Marko Lindqvist:
  TERRAIN_XXX_IDENTIFIER definitions have to go, and terrains must be
 selected by properly checking their flags, ocean_depth -value, or what
 ever is appropriate for each case.
 
  Attached patch removes code that creates these special ocean types.
 If such special features are needed in the future, they should be
 reimplemented in a proper, generic, fashion.
  civ1  civ2 rulesets have only one ocean type, default ruleset three
 types; Lake, Ocean and Deep Ocean.

Great.

I don't understand though what the identifiers are supposed to do?  I 
understand and am happy that they're being removed but what could 
possibly have prompted the re-addition of hardcoded terrain identifiers 
in the first place?

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40342)

2008-06-30 Thread [EMAIL PROTECTED]

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40342 

Hello:

Ok, I already figured out that 'make distclean' and re-run autogen.sh will fix 
the compile errors. Although I have no idea what went wrong. So, I got SVN 
snapshot 1213/1216 to compile on both F8 and F9 Linux. Used GTK client on both. 
However, now the civserver on both seg-faults without comment immediately after 
the civclient issues the 'Start' game. Note that, although very similar in 
software selection, etc., these are two different OSs.

Anything else I could/should try ?

Regards,
VJS

=
From: The default queue [EMAIL PROTECTED]
Date: 2008/06/29 Sun AM 07:17:07 EDT
To: [EMAIL PROTECTED]
Subject: (PR#40342) AutoReply:


Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:
, 
a summary of which appears below.

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of (PR#40342).

Please include the string:

 (PR#40342)

in the subject line of all future correspondence about this issue. To do so, 
you may reply to this message.

Thank you,


I disapprove of what you say, but I will defend to the death your right to say 
it. EB Hall, Friends of Voltaire, 1906



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40342)

2008-06-30 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40342 

[EMAIL PROTECTED] wrote:

 Anything else I could/should try ?

Run the server inside gdb (gdb civserver) and when it crashes get a 
backtrace (bt full) which you can send us.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev