Re: [Freeciv-Dev] (PR#39324) Bugs in SDL client for 2.1.0-beta4

2007-04-15 Thread Stephen Bridges

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

On Thursday 12 April 2007 06:03:34 Christian Prochaska wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39324 

  [EMAIL PROTECTED] - Mi 04. Apr 2007, 21:34:31]:
 
  -The dialogue for selling all of a certain improvement isn't destroyed
  when an option is selected
  - The dialogue for buying a unit isn't destroyed when buying isn't
  allowed (due to a city being in disorder) until the city dialogue
  itself is closed

 Here's a patch for these two problems.

Yeah, that seems to work okay.  I played for about an hour and a half, and 
then my machine mysteriously ran out of memory and swap, and I didn't notice 
in time to be able to do anything more than reboot.  I don't recall running 
any greedy apps, but I can't prove it's freeciv.

Widget



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


[Freeciv-Dev] (PR#39324) Bugs in SDL client for 2.1.0-beta4

2007-04-11 Thread Christian Prochaska

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

 [EMAIL PROTECTED] - Mi 04. Apr 2007, 21:34:31]:
 
 -The dialogue for selling all of a certain improvement isn't destroyed
 when an option is selected
 - The dialogue for buying a unit isn't destroyed when buying isn't
 allowed (due to a city being in disorder) until the city dialogue 
 itself is closed


Here's a patch for these two problems.

Index: client/gui-sdl/citydlg.c
===
--- client/gui-sdl/citydlg.c	(Revision 12916)
+++ client/gui-sdl/citydlg.c	(Arbeitskopie)
@@ -1071,19 +1071,21 @@
 static int ok_buy_prod_city_dlg_callback(struct widget *pButton)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
+popdown_hurry_production_dialog();
+
 city_buy_production(pButton-data.city);
 
-if (pCityDlg)
-{
-  popdown_window_group_dialog(pHurry_Prod_Dlg-pBeginWidgetList,
-  pHurry_Prod_Dlg-pEndWidgetList);
-  FC_FREE(pHurry_Prod_Dlg);
+if (pCityDlg) {
   /* enable city dlg */
   enable_city_dlg_widgets();
+  
+  /* disable buy button */
   set_wstate(pCityDlg-pBuy_Button, FC_WS_DISABLED);
-} else {
-  popdown_hurry_production_dialog();
+  widget_redraw(pCityDlg-pBuy_Button);
+  widget_mark_dirty(pCityDlg-pBuy_Button);
+  flush_dirty();
 }
+
   }
   return -1;
 }
@@ -1109,7 +,7 @@
 {
   if (pHurry_Prod_Dlg) {
 popdown_window_group_dialog(pHurry_Prod_Dlg-pBeginWidgetList,
-			  pHurry_Prod_Dlg-pEndWidgetList);
+pHurry_Prod_Dlg-pEndWidgetList);
 FC_FREE(pHurry_Prod_Dlg);
 flush_dirty();
   }
@@ -1155,7 +1157,7 @@
   }
 
   value = city_buy_cost(pCity);
-  if(!pCity-did_buy) {
+  if (city_can_buy(pCity)) {
 if (game.player_ptr-economic.gold = value) {
   my_snprintf(cBuf, sizeof(cBuf),
 		_(Buy %s for %d gold?\n
@@ -1168,8 +1170,13 @@
 		name, value, game.player_ptr-economic.gold);
 }
   } else {
-my_snprintf(cBuf, sizeof(cBuf),
-		_(Sorry, You have already bought here in this turn));
+if (pCity-did_buy) {
+  my_snprintf(cBuf, sizeof(cBuf),
+  _(Sorry, You have already bought here in this turn.));
+} else {
+  my_snprintf(cBuf, sizeof(cBuf),
+  _(Sorry, You can't buy here in this turn.));
+}
   }
 
   pStr = create_str16_from_char(_(Buy It?), adj_font(12));
@@ -1207,7 +1214,7 @@
 
   add_to_gui_list(ID_BUTTON, pBuf);
 
-  if (!pCity-did_buy  game.player_ptr-economic.gold = value) {
+  if (city_can_buy(pCity)  game.player_ptr-economic.gold = value) {
 pBuf = create_themeicon_button_from_chars(pTheme-OK_Icon, pWindow-dst,
 	  _(Yes), adj_font(12), 0);
 
@@ -1278,7 +1285,7 @@
   pBuf = pWindow-prev;
   pBuf-size.y = dst.y;
   
-  if (!pCity-did_buy  game.player_ptr-economic.gold = value) {
+  if (city_can_buy(pCity)  game.player_ptr-economic.gold = value) {
 /* yes */
 pBuf = pBuf-prev;
 pBuf-size.x = area.x + (area.w - (2 * pBuf-size.w + adj_size(20))) / 2;
@@ -1512,7 +1519,7 @@
   }
 }
   
-if (pCityDlg-pCity-did_buy  pCityDlg-pBuy_Button) {
+if (!city_can_buy(pCityDlg-pCity)  pCityDlg-pBuy_Button) {
   set_wstate(pCityDlg-pBuy_Button, FC_WS_DISABLED);
 }
 
@@ -3237,7 +3244,7 @@
 
 } else {
 
-  if (!pCity-did_buy  pCityDlg-pBuy_Button
+  if (city_can_buy(pCity)  pCityDlg-pBuy_Button
 	  (get_wstate(pCityDlg-pBuy_Button) == FC_WS_DISABLED)) {
 	set_wstate(pCityDlg-pBuy_Button, FC_WS_NORMAL);
 	widget_redraw(pCityDlg-pBuy_Button);
@@ -3815,7 +3822,7 @@
   pBuf-size.y = area.y + area.h - pBuf-size.h - adj_size(5);
   pCityDlg-pBuy_Button = pBuf;
   pBuf-key = SDLK_h;
-  if ((pOwner == game.player_ptr)  (!pCity-did_buy)) {
+  if (city_can_buy(pCity)) {
 set_wstate(pBuf, FC_WS_NORMAL);
   }
   add_to_gui_list(ID_CITY_DLG_PROD_BUY_BUTTON, pBuf);
Index: client/gui-sdl/repodlgs.c
===
--- client/gui-sdl/repodlgs.c	(Revision 12916)
+++ client/gui-sdl/repodlgs.c	(Arbeitskopie)
@@ -1414,7 +1414,7 @@
 total_count = pImpr-data.cont-id1;
 
 /* popdown sell dlg */
-del_group_of_widgets_from_gui_list(pEconomy_Sell_Dlg-pBeginWidgetList,
+popdown_window_group_dialog(pEconomy_Sell_Dlg-pBeginWidgetList,
 pEconomy_Sell_Dlg-pEndWidgetList);
 FC_FREE(pEconomy_Sell_Dlg);
 enable_economy_dlg();
@@ -1496,12 +1496,12 @@
 if(count  0) {
   my_snprintf(cBuf, sizeof(cBuf),
   _(We have %d of %s\n(total value is : %d)\n
-  We can sell %d of them for %d gold),
+  We can sell %d of them for %d gold.),
   total_count, get_improvement_name(imp),
   total_count * value, count, gold); 
 } else {
   my_snprintf(cBuf, sizeof(cBuf),
-  _(We can't sell any %s in this turn), get_improvement_name(imp)); 
+  _(We can't 

Re: [Freeciv-Dev] (PR#39324) Bugs in SDL client for 2.1.0-beta4

2007-04-05 Thread Stephen Bridges

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

On Thursday 05 April 2007 00:51:25 Daniel Markstedt wrote:


 This command has changed to 'middle-click' in beta4.

Ah, apologies.

Widget



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


[Freeciv-Dev] (PR#39324) Bugs in SDL client for 2.1.0-beta4

2007-04-04 Thread Stephen Bridges

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

I'm not sure if bugs can be reported directly to this address or not, but here 
goes:

-The dialogue for selling all of a certain improvement isn't destroyed when an 
option is selected
- The dialogue for buying a unit isn't destroyed when buying isn't allowed 
(due to a city being in disorder) until the city dialogue itself is closed
- Since beta3, right-clicking on a tech in the  science manager no longer 
brings up the help.  I assume this was deliberate, but now I can't find any 
way of accessing the help.
- The city manager window (F1 one) doesn't fill the entire window with cities.  
They and the slideronly use about 2/3rds of the window.

HTH.  Selected stats about my system (Gentoo) below.

Widget
--
Portage 2.1.2.3 (default-linux/amd64/2006.1/desktop, gcc-4.1.2, glibc-2.5-r1, 
2.6.20-gentoo-r4 x86_64)
=
System uname: 2.6.20-gentoo-r4 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 
3800+
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 30 Mar 2007 13:50:01 +
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled]
dev-java/java-config: 1.3.7, 2.0.31-r5
dev-lang/python: 2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.20-r2
ACCEPT_KEYWORDS=amd64 ~amd64
AUTOCLEAN=yes
CBUILD=x86_64-pc-linux-gnu
CFLAGS=-march=athlon64 -O2 -pipe
CHOST=x86_64-pc-linux-gnu
CXXFLAGS=-march=athlon64 -O2 -pipe



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


Re: [Freeciv-Dev] (PR#39324) Bugs in SDL client for 2.1.0-beta4

2007-04-04 Thread Daniel Markstedt

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

On 4/5/07, Stephen Bridges [EMAIL PROTECTED] wrote:

(..)
 - Since beta3, right-clicking on a tech in the  science manager no longer
 brings up the help.  I assume this was deliberate, but now I can't find any
 way of accessing the help.
(..)

This command has changed to 'middle-click' in beta4.

 ~Daniel



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