Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/stock-amounts into lp:widelands

2018-09-10 Thread GunChleoc
Just 1 nit for the i18n

Diff comments:

> === modified file 'src/wui/waresdisplay.cc'
> --- src/wui/waresdisplay.cc   2018-07-08 13:53:45 +
> +++ src/wui/waresdisplay.cc   2018-09-10 09:50:43 +
> @@ -385,12 +385,31 @@
>   remove_all_warelists();
>  }
>  
> +const char* unit_suffixes[] = {
> + "",
> + /** TRANSLATORS: This is a suffix for large numbers (5k = 5,000) */
> + _("k"),
> + /** TRANSLATORS: This is a suffix for large numbers (5M = 5,000,000) */
> + _("M"),
> + /** TRANSLATORS: This is a suffix for large numbers (5G = 
> 5,000,000,000) */
> + _("G")
> +};
> +static std::string get_amount_string(uint32_t amount) {
> + uint8_t size = 0;
> + while (amount >= (size ? 1000 : 1)) {
> + amount /= 1000;
> + size++;
> + }
> + /** TRANSLATORS: the first placeholder is a number and the second one a 
> size suffix, e.g. 50 k */
> + return (boost::format(_("%1%%2%")) % amount % 
> unit_suffixes[size]).str();

Please shift this code to the unit suffixes to make translators' lives easier. 
The hint should tell them to use the narrow format, 1 letter maximum, and to 
contact us if they need more letters.

> +}
> +
>  std::string WaresDisplay::info_for_ware(Widelands::DescriptionIndex ware) {
>   int totalstock = 0;
>   for (const Widelands::WareList* warelist : warelists_) {
>   totalstock += warelist->stock(ware);
>   }
> - return boost::lexical_cast(totalstock);
> + return get_amount_string(totalstock);
>  }
>  
>  /*


-- 
https://code.launchpad.net/~widelands-dev/widelands/stock-amounts/+merge/354558
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/stock-amounts into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands

2018-09-10 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into 
lp:widelands has been updated.

Status: Needs review => Rejected

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix-codecheck-boost-sha1/+merge/354633
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands

2018-09-10 Thread GunChleoc
We have the same fix in 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354637, 
so I'm merging that one.

> What is funny about this issue, is that codecheck didn't complain as long as 
> the conditional includes were indented in the if loop. Only after 
> clang_format removed the indents it doesn't work anymore.

It's a rule we wrote ourselves, so it was possible to circumvent it by some 
clever formatting hacks... then clang-format came along and fixed the 
formatting...
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix-codecheck-boost-sha1/+merge/354633
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread GunChleoc
Review: Approve

LGTM :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354637
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/appveyor_fix.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/rework-resource-indicators into lp:widelands

2018-09-10 Thread GunChleoc
We're getting there :)

I still have trouble seeing the differences between little stone and lots of 
stone for the Empire. Maybe make the dark frame around the inner color a bit 
wider?

The Atlantean "none" is well visible now, but since it has more cloth than the 
others, it implies that it has lots and lost of something... maybe give it some 
ropes without cloth, as if they got ready to hang a cloth for the resources, 
but there was nothing there? Or a really thin horizontal band of cloth.
-- 
https://code.launchpad.net/~widelands-dev/widelands/rework-resource-indicators/+merge/353996
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/rework-resource-indicators.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3931. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/426875443.
Appveyor build 3729. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_appveyor_fix-3729.
-- 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354637
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/appveyor_fix into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3930. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/426830290.
Appveyor build 3728. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_codecheck_boost_sha1-3728.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix-codecheck-boost-sha1/+merge/354633
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ship_scheduling_2 into lp:widelands

2018-09-10 Thread ypopezios
Added inline comments concerning the NOCOM comments.

Diff comments:

> 
> === modified file 'src/economy/portdock.cc'
> --- src/economy/portdock.cc   2018-04-16 07:03:12 +
> +++ src/economy/portdock.cc   2018-09-04 18:46:42 +
> @@ -281,44 +286,70 @@
>   }
>  }
>  
> -void PortDock::update_shippingitem(Game& game, 
> std::vector::iterator it) {
> +void PortDock::update_shippingitem(Game& game, 
> std::list::iterator it) {
>   it->update_destination(game, *this);
>  
> - PortDock* dst = it->get_destination(game);
> + const PortDock* dst = it->get_destination(game);
>   assert(dst != this);
>  
>   // Destination might have vanished or be in another economy altogether.
>   if (dst && dst->get_economy() == get_economy()) {
> - set_need_ship(game, true);
> + if (ships_coming_ <= 0) {
> + set_need_ship(game, true);
> + }
>   } else {
>   it->set_location(game, warehouse_);
>   it->end_shipping(game);
>   *it = waiting_.back();
>   waiting_.pop_back();
> -
> - if (waiting_.empty())
> - set_need_ship(game, false);
> - }
> -}
> -
> -/**
> - * A ship has arrived at the dock. Clear all items designated for this dock,
> - * and load the ship.
> + }
> +}
> +
> +/**
> + * Receive shipping item from unloading ship.
> + * Called by ship code.
> + */
> +void PortDock::shipping_item_arrived(Game& game, ShippingItem& si) {
> + si.set_location(game, warehouse_);
> + si.end_shipping(game);
> +}
> +
> +/**
> + * Receive shipping item from departing ship.
> + * Called by ship code.
> + */
> +void PortDock::shipping_item_returned(Game& game, ShippingItem& si) {
> + si.set_location(game, this);
> + waiting_.push_back(si);
> +}
> +
> +/**
> + * A ship changed destination and is now coming to the dock. Increase 
> counter for need_ship.
> + */
> +void PortDock::ship_coming(bool affirmative) {
> + if (affirmative) {
> + ++ships_coming_;
> + } else {
> + // Max used for compatibility with old savegames
> + // NOCOM We should shift the savegame compatibility into 
> PortDock::Loader::load it at all possible.
> + // Increment kCurrentPacketVersion and write separate loading 
> code for both versions.
> + // Which case is for compatibility, and which case is the 
> actual case that we want now?
> + ships_coming_ = std::max(0, ships_coming_ - 1);

The current line is for the compatibility case. The line for the actual case 
would be simply "--ships_coming_".

> + }
> +}
> +
> +/**
> + * A ship has arrived at the dock. Set its next destination and load it 
> accordingly.
>   */
>  void PortDock::ship_arrived(Game& game, Ship& ship) {
> - std::vector items_brought_by_ship;
> - ship.withdraw_items(game, *this, items_brought_by_ship);
> -
> - for (ShippingItem& shipping_item : items_brought_by_ship) {
> - shipping_item.set_location(game, warehouse_);
> - shipping_item.end_shipping(game);
> - }
> + ship_coming(false);
>  
>   if (expedition_ready_) {
>   assert(expedition_bootstrap_ != nullptr);
>  
>   // Only use an empty ship.
>   if (ship.get_nritems() < 1) {
> + ship.set_destination(nullptr);
>   // Load the ship
>   std::vector workers;
>   std::vector wares;
> @@ -337,46 +368,71 @@
>   // The expedition goods are now on the ship, so from 
> now on it is independent from the port
>   // and thus we switch the port to normal, so we could 
> even start a new expedition,
>   cancel_expedition(game);
> - return fleet_->update(game);
> + fleet_->update(game);
> + return;
>   }
>   }
>  
> - if (ship.get_nritems() < ship.descr().get_capacity() && 
> !waiting_.empty()) {
> - uint32_t nrload =
> -std::min(waiting_.size(), 
> ship.descr().get_capacity() - ship.get_nritems());
> -
> - while (nrload--) {
> - // Check if the item has still a valid destination
> - if (waiting_.back().get_destination(game)) {
> - // Destination is valid, so we load the item 
> onto the ship
> - ship.add_item(game, waiting_.back());
> + // Decide where the arrived ship will go next
> + PortDock* next_port = fleet_->find_next_dest(game, ship, *this);
> + if (!next_port) {
> + ship.set_destination(next_port);
> + return; // no need to load anything
> + }
> +
> + // Unload any wares/workers onboard the departing ship which are not 
> favored by next dest
> + ship.unload_unfit_items(game, *this, *next_port);
> +
> 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1766957-sinking-ship-animation into lp:widelands

2018-09-10 Thread Notabilis
Review: Needs Fixing

Thanks for looking into this.
Unfortunately, this branch doesn't fix it for me.
I took a look into this now and I think the bug might be due to a mismatch 
between animation duration (3000 ms), animation speed (7 fps) and number of 
animation frames (20 images). In some cases (strangely it seems to be random) 
this leads to 21 frames being displayed, looping and showing the first image of 
the sinking animation again. That image is more or less the same as in the idle 
animation, so it probably isn't the idle animation playing at all.
Fixing it would mean changing one of these values. I guess the easiest one 
would be the number of images by copying the (empty) 20st image and naming it 
as 21 (for both Atlanteans and Frisians).

Even when it doesn't fix the bug, I tend to merge your code change anyway. It 
seems to be the more correct behavior independent of the bug. After all, the 
code should never reach this method when the ship is currently sinking.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1766957-sinking-ship-animation/+merge/353746
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1766957-sinking-ship-animation.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread hessenfarmer
hessenfarmer has proposed merging lp:~widelands-dev/widelands/appveyor_fix into 
lp:widelands.

Commit message:
small fixes to make the CI environments working again

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1789835 in widelands: "Appveyor glbinding incompatible with WL code"
  https://bugs.launchpad.net/widelands/+bug/1789835

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354637

fixed __has_include() argument to avoid clang-format introducing spaces.
included boost headers as system headers 
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/appveyor_fix into lp:widelands.
=== modified file 'src/graphic/gl/system_headers.h'
--- src/graphic/gl/system_headers.h	2018-09-10 06:11:01 +
+++ src/graphic/gl/system_headers.h	2018-09-10 19:47:02 +
@@ -41,9 +41,9 @@
 // testing for the presence of glbinding.h to determine whether we have a glbinding version newer
 // then 2.1.4
 #ifdef __has_include
-#if __has_include()
+#if __has_include("glbinding/glbinding.h")
+#include 
 #include 
-#include 
 #define GLBINDING3
 #endif
 #endif

=== modified file 'src/network/crypto.cc'
--- src/network/crypto.cc	2018-09-10 06:11:01 +
+++ src/network/crypto.cc	2018-09-10 19:47:02 +
@@ -1,9 +1,9 @@
 #include "network/crypto.h"
 
 #if BOOST_VERSION > 106700
-#include "boost/uuid/detail/sha1.hpp"
+#include 
 #else
-#include "boost/uuid/sha1.hpp"
+#include 
 #endif
 
 namespace crypto {

=== modified file 'src/network/crypto.h'
--- src/network/crypto.h	2018-09-06 07:32:28 +
+++ src/network/crypto.h	2018-09-10 19:47:02 +
@@ -21,8 +21,7 @@
 #define WL_NETWORK_CRYPTO_H
 
 #include 
-
-#include "boost/version.hpp"
+#include 
 
 namespace crypto {
 

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/gdpr_1 into lp:widelands-website

2018-09-10 Thread noreply
The proposal to merge lp:~widelands-dev/widelands-website/gdpr_1 into 
lp:widelands-website has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/gdpr_1/+merge/354355
-- 
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands

2018-09-10 Thread hessenfarmer
I think we have introduced the same issue in crypro.h by accident. What is 
funny about this issue, is that codecheck didn't complain as long as the 
conditional includes were indented in the if loop. Only after clang_format 
removed the indents it doesn't work anymore. 
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix-codecheck-boost-sha1/+merge/354633
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands

2018-09-10 Thread Notabilis
Notabilis has proposed merging 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.

Commit message:
Including boost sha1 headers as system headers.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix-codecheck-boost-sha1/+merge/354633

CodeCheck is interpreting the boost headers in network/crypto.cc as local 
Widelands includes, since they are included as
  #include "boost/sha1.h"

Instead, they should be included as
  #include 
since boost is a system header (or at least, not local to Widelands).
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix-codecheck-boost-sha1 into lp:widelands.
=== modified file 'src/network/crypto.cc'
--- src/network/crypto.cc	2018-09-10 06:11:01 +
+++ src/network/crypto.cc	2018-09-10 18:43:08 +
@@ -1,9 +1,9 @@
 #include "network/crypto.h"
 
 #if BOOST_VERSION > 106700
-#include "boost/uuid/detail/sha1.hpp"
+#include 
 #else
-#include "boost/uuid/sha1.hpp"
+#include 
 #endif
 
 namespace crypto {

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/mines-worldsavior into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3929. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/426668190.
Appveyor build 3727. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_mines_worldsavior-3727.
-- 
https://code.launchpad.net/~widelands-dev/widelands/mines-worldsavior/+merge/350716
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/mines-worldsavior.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/stock-amounts into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3928. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/426624392.
Appveyor build 3726. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_stock_amounts-3726.
-- 
https://code.launchpad.net/~widelands-dev/widelands/stock-amounts/+merge/354558
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/stock-amounts into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/mines-worldsavior into lp:widelands

2018-09-10 Thread hessenfarmer
I don't know why this is the case. and yes this is really illogical, ut I know 
that changing this would affect balancing directly as the empire would need one 
item less to build fully trained soldiers. 
The idea behind the balance of tribes is to some extent based on equal costs. 
Nevertheless I will search the forum for a reason / thread. I am open to change 
this in build 21 while keeping the balance. But this needs proper evaluation. 
So feel free to start / continue a forum discussion and open a bug to not 
forget the issue.  
-- 
https://code.launchpad.net/~widelands-dev/widelands/mines-worldsavior/+merge/350716
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/mines-worldsavior.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/mines-worldsavior into lp:widelands

2018-09-10 Thread Toni Förster
I do have one question regarding the empire.

The armorsmithy produces 2 armor_helmet with the changes made in this branch, 
instead of one. The question I have is: why does the trainingcamp need helmets? 
The soldiers are already equipped with one.

The barbarians for example don't have a helmet when they start as a soldier 
they just need an ax and when they level up the receive new improved gear.

Why not go the same route with the empire?

Option 1:

Normal soldiers receive only a wooden spear but no helmet.
When they level up they receive their helmets.

Option 2:

Normal soldiers receive a wooden spear and helmet, but the trainingcamp doesn't 
need one.


I just noticed this while merging trunk and fixing merge conflicts.
-- 
https://code.launchpad.net/~widelands-dev/widelands/mines-worldsavior/+merge/350716
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/mines-worldsavior.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1434875-net-client-disconnect into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3925. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/426559900.
Appveyor build 3723. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1434875_net_client_disconnect-3723.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1434875-net-client-disconnect/+merge/354531
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1434875-net-client-disconnect into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/stock-amounts into lp:widelands

2018-09-10 Thread Benedikt Straub
Benedikt Straub has proposed merging lp:~widelands-dev/widelands/stock-amounts 
into lp:widelands.

Commit message:
Very large amounts in WaresDisplays are shortened as "10k", "10M", "10G" to 
prevent text from flowing over on the left.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1791458 in widelands: "Number text too long in stock inventory"
  https://bugs.launchpad.net/widelands/+bug/1791458

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/stock-amounts/+merge/354558

Numbers from 0 to  are displayed normally, then abbreviated 10k up to 999k, 
then 1M to 999M, then 1G.
A whitespace between number and suffix ("10 k") would look nicer but sadly 
isn´t possible; testing, I found that "972 M" overflows again, while "972M" 
just fits. The current font and layout don´t permit more than 4 chars total 
here.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/stock-amounts into lp:widelands.
=== modified file 'src/wui/waresdisplay.cc'
--- src/wui/waresdisplay.cc	2018-07-08 13:53:45 +
+++ src/wui/waresdisplay.cc	2018-09-10 09:50:43 +
@@ -22,7 +22,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include "base/i18n.h"
 #include "base/wexception.h"
@@ -385,12 +385,31 @@
 	remove_all_warelists();
 }
 
+const char* unit_suffixes[] = {
+	"",
+	/** TRANSLATORS: This is a suffix for large numbers (5k = 5,000) */
+	_("k"),
+	/** TRANSLATORS: This is a suffix for large numbers (5M = 5,000,000) */
+	_("M"),
+	/** TRANSLATORS: This is a suffix for large numbers (5G = 5,000,000,000) */
+	_("G")
+};
+static std::string get_amount_string(uint32_t amount) {
+	uint8_t size = 0;
+	while (amount >= (size ? 1000 : 1)) {
+		amount /= 1000;
+		size++;
+	}
+	/** TRANSLATORS: the first placeholder is a number and the second one a size suffix, e.g. 50 k */
+	return (boost::format(_("%1%%2%")) % amount % unit_suffixes[size]).str();
+}
+
 std::string WaresDisplay::info_for_ware(Widelands::DescriptionIndex ware) {
 	int totalstock = 0;
 	for (const Widelands::WareList* warelist : warelists_) {
 		totalstock += warelist->stock(ware);
 	}
-	return boost::lexical_cast(totalstock);
+	return get_amount_string(totalstock);
 }
 
 /*
@@ -420,7 +439,7 @@
    "first)->icon_filename() +
    "\">" +
-   boost::lexical_cast(static_cast(c->second)) +
+   get_amount_string(c->second) +
    "";
 			}
 	return ret;

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread hessenfarmer
something has been changed in network/crypto.cc as well to make travis unhappy
-- 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354160
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/appveyor_fix.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1772168-unused-key-in-luatable into lp:widelands

2018-09-10 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 3887. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/424046125.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1772168-unused-key-in-luatable/+merge/354202
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1772168-unused-key-in-luatable.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread hessenfarmer
Sorry for the commit message. 
However it seems that the code style script for the master release has broken 
the GLbinding switch in Grapic/gl/system_headers.h, cause it introduced some 
spaces in the detection if glbing/glbinding.h is present 
-- 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354160
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/appveyor_fix.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread GunChleoc
This has now landed with commit message "I need an appveyor build to further 
debug this". Please take care in the future to set a proper commit message and 
add such comments in the comment/description section. I don't always catch them 
all ;)
-- 
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354160
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/appveyor_fix.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/gdpr_1 into lp:widelands-website

2018-09-10 Thread kaputtnik
Ok :-) 

Will it deploy this evening.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/gdpr_1/+merge/354355
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1772168-unused-key-in-luatable into lp:widelands

2018-09-10 Thread GunChleoc
Thanks for the review :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1772168-unused-key-in-luatable/+merge/354202
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1772168-unused-key-in-luatable.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/rework-resource-indicators into lp:widelands

2018-09-10 Thread Benedikt Straub
I can´t reproduce these saturation improvements in Blender well enough, so I 
used GIMP to edit my renders now. Also gave the atlanteans a new none resi that 
is better visible because it´s animated.
-- 
https://code.launchpad.net/~widelands-dev/widelands/rework-resource-indicators/+merge/353996
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/rework-resource-indicators.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ferry into lp:widelands

2018-09-10 Thread bunnybot
Continuous integration builds have changed state:

Travis build 3922. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/426400155.
Appveyor build 3720. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ferry-3720.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ferry/+merge/351880
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ferry into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/appveyor_fix into lp:widelands

2018-09-10 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/appveyor_fix into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/appveyor_fix/+merge/354160
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/appveyor_fix.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/const_portdock_fleet_and_ship_functions into lp:widelands

2018-09-10 Thread noreply
The proposal to merge 
lp:~widelands-dev/widelands/const_portdock_fleet_and_ship_functions into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/const_portdock_fleet_and_ship_functions/+merge/354301
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/const_portdock_fleet_and_ship_functions.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp