Merge lp://staging/~widelands-dev/widelands/fix-dropdowns into lp://staging/widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 9160
Proposed branch: lp://staging/~widelands-dev/widelands/fix-dropdowns
Merge into: lp://staging/widelands
Diff against target: 2577 lines (+782/-513)
44 files modified
data/templates/default/init.lua (+20/-0)
src/editor/CMakeLists.txt (+2/-0)
src/editor/ui_menus/main_menu_new_map.cc (+5/-34)
src/editor/ui_menus/main_menu_new_map.h (+3/-4)
src/editor/ui_menus/main_menu_random_map.cc (+15/-57)
src/editor/ui_menus/main_menu_random_map.h (+2/-2)
src/editor/ui_menus/map_size_box.cc (+76/-0)
src/editor/ui_menus/map_size_box.h (+57/-0)
src/editor/ui_menus/player_menu.cc (+10/-10)
src/editor/ui_menus/tool_resize_options_menu.cc (+21/-58)
src/editor/ui_menus/tool_resize_options_menu.h (+3/-4)
src/graphic/style_manager.cc (+2/-1)
src/graphic/styles/font_style.h (+1/-0)
src/graphic/styles/table_style.h (+6/-2)
src/graphic/text/rt_parse.cc (+4/-2)
src/graphic/text_layout.cc (+7/-0)
src/graphic/text_layout.h (+2/-0)
src/scripting/lua_ui.cc (+135/-32)
src/scripting/lua_ui.h (+38/-1)
src/ui_basic/button.cc (+1/-3)
src/ui_basic/button.h (+0/-3)
src/ui_basic/checkbox.cc (+2/-2)
src/ui_basic/checkbox.h (+2/-2)
src/ui_basic/dropdown.cc (+93/-59)
src/ui_basic/dropdown.h (+42/-22)
src/ui_basic/icongrid.cc (+1/-1)
src/ui_basic/icongrid.h (+1/-1)
src/ui_basic/listselect.cc (+98/-74)
src/ui_basic/listselect.h (+30/-40)
src/ui_basic/panel.cc (+10/-3)
src/ui_basic/panel.h (+3/-2)
src/ui_basic/radiobutton.cc (+1/-1)
src/ui_basic/radiobutton.h (+1/-1)
src/ui_basic/slider.h (+0/-1)
src/ui_basic/unique_window.cc (+7/-1)
src/ui_fsmenu/launch_game.cc (+3/-3)
src/ui_fsmenu/launch_spg.cc (+2/-0)
src/ui_fsmenu/options.cc (+12/-10)
src/wui/economy_options_window.cc (+1/-1)
src/wui/fieldaction.cc (+1/-1)
src/wui/game_client_disconnected.cc (+3/-2)
src/wui/game_message_menu.cc (+17/-25)
src/wui/multiplayersetupgroup.cc (+12/-8)
src/wui/seafaring_statistics_menu.cc (+30/-40)
To merge this branch: bzr merge lp://staging/~widelands-dev/widelands/fix-dropdowns
Reviewer Review Type Date Requested Status
Klaus Halfmann testplay Needs Fixing
Review via email: mp+368223@code.staging.launchpad.net

Commit message

Dropdown fixes and improvements
- Fix positioning of dropdown lists on fullscreen switches
- Define dropdown list height by number of items
- Add dropdowns to Lua interface
- Panel::free_children() now frees all its children
- Create styles for hotkeys and reduce number of render calls in listselect
- Get rid of map width/height code duplication in the editor
- Add support for using dropdowns as toolbar menus with hotkeys
- Fix toggling of minimized UniqueWindows

Description of the change

I pulled out some code from

https://code.launchpad.net/~widelands-dev/widelands/toolbar-dropdown-menus

to make it more reviewable, because that branch has become too big.

The new dropdown functionality in the Lua interface and for toolbar menus is not being used in this branch, but it can be tested with the other branch.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5113. State: failed. Details: https://travis-ci.org/widelands/widelands/builds/540070598.
Appveyor build 4895. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_dropdowns-4895.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5121. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/540143701.
Appveyor build 4903. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_dropdowns-4903.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5163. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/542120713.
Appveyor build 4945. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_dropdowns-4945.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Most travis builds green, two fail as of test_inputqueues.lua

Compiled. To test:
* in MapEditor
** Widht/Height dropdowns (new Map)
** Widht/Height dropdowns (resize Map)
** Number of Players dropdown
* Filter in news overview
* Which examples of minimzed UniqueWindows can you give me?

* How can I find the hotkeys and test them?
* Improved SyntaxErrorImpl - no idea how to test this :-)
  Can I break som RichText in an easy way?

* Sure we want to log every (Lua Button) keypress?

Nice refactoring of boring code :-)

Will no test the Lua part -> next Branch.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Found a unrealted, minor Bug: when leaving the "Set Player Positions" Window,
the Map still shows only Big buidling Plots. Not sure if we _must_ fix this.
Will go away with the next map commands.

When trying to open an Online Game I get:
InternetGaming: Connecting to the metaserver.
[NetClient]: Trying to connect to 2a03:4000:32:524:48cb:feff:feae:b0c6:7395 ... failed.
Could not resolve network name: resolve: Host not found (authoritative)

> dig widelands.org AAAA
widelands.org. 2431 IN AAAA 2a03:4000:32:524:48cb:feff:feae:b0c6

> dig widelands.org A
widelands.org. 3312 IN A 85.235.66.69

./widelands --metaserver=2a03:4000:32:524:48cb:feff:feae:b0c6
> OK

./widelands --metaserver=85.235.66.69
> OK

How did this branch break the Internet (IPv6) connectivitiy?
Can anybody confirm.

I will continue testing with the hardcoded IPv6 Adress

Revision history for this message
GunChleoc (gunchleoc) wrote :

> Found a unrealted, minor Bug: when leaving the "Set Player Positions" Window,
> the Map still shows only Big buidling Plots. Not sure if we _must_ fix this.
> Will go away with the next map commands.

That's independent from this branch, so I have created a new bug report: https://bugs.launchpad.net/widelands/+bug/1834001

> When trying to open an Online Game I get:

This is probably related to the server move this weekend. I don't think that this branch broke it, but I'll merge trunk to make sure that the networking code is up to date.

Revision history for this message
GunChleoc (gunchleoc) wrote :

> * How can I find the hotkeys and test them?

Best use https://code.launchpad.net/~widelands-dev/widelands/toolbar-dropdown-menus/+merge/368230 for that where you can see them in action.

> * Improved SyntaxErrorImpl - no idea how to test this :-)
> Can I break som RichText in an easy way?

You could edit one of the basic layouting functions in data/scripting/richtext.lua (for example, add an additional "<p>" to the p() function without closing the tag) and then access the encyclopedia.

> * Sure we want to log every (Lua Button) keypress?

It makes debugging scenarios easier.

> Nice refactoring of boring code :-)

And that bug in UI::Panel is really nasty, it cost me many hours of pulling my hair when I originally implemented the dropdowns.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Played a bit and tested the MapEditor. So far all fine.

The new WorkAreaIndicator (when selecting a building) is a pain, at least on my OSX-Computer.
It is so slow, that selecting the correct building becomes quit difficult.
Do we have an optin to disable this? Do we have a bug for this?

This branch per se is fine, except for the Networking Issue.

Will wait for other opinions for now.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Can you test the networking issue with trunk? I don't think that it's related to this branch.

We also just merged an improvement for the work areas, so they will hopefully be a bit faster now.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5233. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/549672031.
Appveyor build 5012. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_dropdowns-5012.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5237. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/549847068.
Appveyor build 5016. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_dropdowns-5016.

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

Compiling again, got:

src/wui/constructionsitewindow.cc:33:19: warning: unused variable 'pic_max_fill_indicator'
static const char pic_max_fill_indicator[] = "images/wui/buildings/max_fill_indicator.png";
                  ^
src/wui/constructionsitewindow.cc:34:19: warning: unused variable 'pic_priority_low'
static const char pic_priority_low[] = "images/wui/buildings/low_priority_button.png";
                  ^
src/wui/constructionsitewindow.cc:35:19: warning: unused variable 'pic_priority_normal'
static const char pic_priority_normal[] = "images/wui/buildings/normal_priority_button.png";
                  ^
src/wui/constructionsitewindow.cc:36:19: warning: unused variable 'pic_priority_high'
static const char pic_priority_high[] = "images/wui/buildings/high_priority_button.png";

Not sure where got that from?

After merging with trunk I dont see the network Issue any longer, well.

Did we just break savegame ccompatibility (yes with the elk_moose)
OK, will start a new game for testing

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

No I got a crash :( kaputtnik is right, we must play some network games on trunk, RSN.

FATAL ERROR - game crashed. Attempting emergency save.
...
InternetGaming: logout(SERVER_CRASHED)
[NetClient] Closing network socket connected to 2a03:4000:32:524:48cb:feff:feae:b0c6:7395.
Warning: Economy still has requests left on destruction
Warning: Economy still has flags left on destruction
Warning: Economy still has warehouses left on destruction
WareList: 125 items of 30 left.
WareList: 2 items of 33 left.
...
WareList: 1 items of 102 left.
Warning: Economy still has requests left on destruction
Warning: Economy still has flags left on destruction
Warning: Economy still has warehouses left on destruction
WareList: 127 items of 0 left.
...
WareList: 12 items of 102 left.
ObjectManager: ouch! remaining objects
lastserial: 2499
[NetRelayConnection] Closing network socket connected to 2a03:4000:32:524:48cb:feff:feae:b0c6:7397.
InternetGaming: logout(SERVER_CRASHED)
libc++abi.dylib: terminating with uncaught exception of type WException: [../src/logic/playercommand.cc:1070] Unreachable code was reached.
Abort trap: 6
ObjectManager: ouch! remaining objects
lastserial: 2499
[NetRelayConnection] Closing network socket connected to 2a03:4000:32:524:48cb:feff:feae:b0c6:7397.
InternetGaming: logout(SERVER_CRASHED)

I dont think this is related to tis particular branch, though.

Will try this on trunk again, later

review: Needs Fixing (testplay)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Can you please create a bug report when finding errors caused by trunk, rather than putting them in a code review? You now have marked this branch as "needs fixing"; but it's trunk that needs fixing ;)

I have created a new bug report for this:

https://bugs.launchpad.net/widelands/+bug/1834151

Since you have found no further error in this branch, I'll go ahead and merge.

@bunnybot merge

> Compiling again, got:
>
> src/wui/constructionsitewindow.cc:33:19: warning: unused variable
> 'pic_max_fill_indicator'
> static const char pic_max_fill_indicator[] =
> "images/wui/buildings/max_fill_indicator.png";
> ^

These are already in trunk. It's time for another "fix compiler warnings" branch.
> After merging with trunk I dont see the network Issue any longer, well.

Excellent

> Did we just break savegame ccompatibility (yes with the elk_moose)

No, that branch has compatibility code. You won't be able to load new maps on older WIdelands versions though.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Tracked down the line for the crash, it is caused by the new WIP constructionsite options. So, definitely not related to this branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: