Author: cazfi
Date: Sat Aug 15 20:21:28 2015
New Revision: 29528

URL: http://svn.gna.org/viewcvs/freeciv?rev=29528&view=rev
Log:
Include current production to city worklist items count shown in sdl client.

See bug #23770

Modified:
    branches/S2_5/client/gui-sdl/wldlg.c

Modified: branches/S2_5/client/gui-sdl/wldlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/wldlg.c?rev=29528&r1=29527&r2=29528&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/wldlg.c        (original)
+++ branches/S2_5/client/gui-sdl/wldlg.c        Sat Aug 15 20:21:28 2015
@@ -960,16 +960,24 @@
   widget_mark_dirty(pEditor->pProduction_Progres);
 }
 
-
-/* update and redraw worklist length counter in worklist editor */
+/**************************************************************************
+  Update and redraw worklist length counter in worklist editor
+**************************************************************************/
 static void refresh_worklist_count_label(void)
 {
   char cBuf[64];
   SDL_Rect area;
+  int external_entries;
+
+  if (pEditor->pCity != NULL) {
+    external_entries = 1; /* Current production */
+  } else {
+    external_entries = 0;
+  }
 
   /* TRANS: length of worklist */
   fc_snprintf(cBuf, sizeof(cBuf), _("( %d entries )"),
-                               worklist_length(&pEditor->worklist_copy));
+              worklist_length(&pEditor->worklist_copy) + external_entries);
   copy_chars_to_string16(pEditor->pWorkList_Counter->string16, cBuf);
 
   widget_undraw(pEditor->pWorkList_Counter);
@@ -1019,7 +1027,8 @@
   bool advanced_tech;
   bool can_build, can_eventually_build;
   SDL_Rect area;
-  
+  int external_entries;
+
   if (pEditor) {
     return;
   }
@@ -1064,14 +1073,16 @@
   pEditor->pEndWidgetList = pWindow;
 
   area = pWindow->area;
-  
+
   /* ---------------- */
   if (pCity) {
     fc_snprintf(cBuf, sizeof(cBuf), _("Worklist of\n%s"), city_name(pCity));
+    external_entries = 1; /* Current production */
   } else {
     fc_snprintf(cBuf, sizeof(cBuf), "%s", global_worklist_name(pGWL));
-  }
-    
+    external_entries = 0;
+  }
+
   pStr = create_str16_from_char(cBuf, adj_font(12));
   pStr->style |= (TTF_STYLE_BOLD|SF_CENTER);
   
@@ -1082,7 +1093,7 @@
 
   /* TRANS: length of worklist */
   fc_snprintf(cBuf, sizeof(cBuf), _("( %d entries )"),
-              worklist_length(&pEditor->worklist_copy));
+              worklist_length(&pEditor->worklist_copy) + external_entries);
   pStr = create_str16_from_char(cBuf, adj_font(10));
   pStr->bgcol = (SDL_Color) {0, 0, 0, 0};
   pBuf = create_iconlabel(NULL, pWindow->dst, pStr, WF_RESTORE_BACKGROUND);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to