← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-trainingsite-worker-display into lp:widelands

 

Notabilis has proposed merging lp:~widelands-dev/widelands/bug-trainingsite-worker-display into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1635808 in widelands: "Display of worker in training sites is not updated"
  https://bugs.launchpad.net/widelands/+bug/1635808

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-trainingsite-worker-display/+merge/314217

When a trainer enters a training site the entry in the worker-list is not updated and stays on "(coming)". This branch adds the missing binding to update the display on entering.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-trainingsite-worker-display into lp:widelands.
=== modified file 'src/wui/trainingsitewindow.cc'
--- src/wui/trainingsitewindow.cc	2016-08-04 15:59:26 +0000
+++ src/wui/trainingsitewindow.cc	2017-01-06 11:57:40 +0000
@@ -65,5 +65,8 @@
 ===============
 */
 void TrainingSite::create_options_window(InteractiveGameBase& plr, UI::Window*& registry) {
-	new TrainingSiteWindow(plr, *this, registry);
+	ProductionSiteWindow* win
+		= dynamic_cast<ProductionSiteWindow*>(new TrainingSiteWindow(plr, *this, registry));
+	Building::options_window_connections.push_back(Building::workers_changed.connect(
+	   boost::bind(&ProductionSiteWindow::update_worker_table, boost::ref(*win))));
 }