Ticket #42309

client gui : Nation report : add many columns, gov, gold, research ...

Open Date: 2021-05-18 09:33 Last Update: 2022-05-05 12:36

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
6

Details

S3_0 , gui-gtk3.22

This patch add columns in the Nation report (F3 in gtk3 and QT clients)

  • government, culture, gold, %tax, %science, %lux , researching (= most of the first tab in intelligence report of a nation, translated )
  • It takes into account know or not information due to contact/embassy.
  • it is possible to sort on these columns
  • i added screenshots, much better than explainations.

Maybe the code could/should be moved/splitted elsewhere, but i believe it is an honest starting point

Ticket History (3/28 Histories)

2021-05-18 09:33 Updated by: alain_bkr
  • New Ticket "gtk3.22 :F3 Nation report : add many columns, gov, gold, research ..." created
2021-05-19 09:33 Updated by: alain_bkr
Comment

The patch does not apply on S2_6, due to "player" type.

On S3_0 it does work (show the wanted informations in nation report) for the following clients :

  • gtk3.22
  • qt
  • sdl2

Other clients does not compile or crash at startup or have not been tested. Other branches have not been tested.

2021-05-19 09:35 Updated by: alain_bkr
  • Details Updated
2021-05-19 10:18 Updated by: alain_bkr
2021-05-19 17:15 Updated by: chippo
Comment

I get some complaints about applying it.

chippo@chiphund:~/github/freeciv/S3_0/src$ git apply ~/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch
/home/chippo/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch:26: trailing whitespace.
  /*  'contact' gives the knowledge of other's government */ 
/home/chippo/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch:27: trailing whitespace.
  if (me==them 
/home/chippo/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch:28: trailing whitespace.
          || player_has_embassy(me, them) 
/home/chippo/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch:102: trailing whitespace.
  /*  'contact' gives the knowledge of other's gold */ 
/home/chippo/Downloads/gtk3.22_F3_Nation_report__add_many_columns.patch:103: trailing whitespace.
  if (me==them 
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

It works for me in the QT client, and it's pretty sweet. You can even turn the columns on and off. Like the Cities page, it has it's own diabolical ideas about the best column widths and will quickly dispose of any changes that you make manually.

2021-05-20 20:37 Updated by: alain_bkr
Comment

Reply To chippo

I get some complaints about applying it. {{{ chippo@chiphund:~/github/freeciv/S3_0/src$ git apply ~/Downloads/gtk3.22_F3_Nation_reportadd_many_columns.patch /home/chippo/Downloads/gtk3.22_F3_Nation_reportadd_many_columns.patch:26: trailing whitespace. ... warning: squelched 6 whitespace errors warning: 11 lines add whitespace errors. }}}

I ll fix trailing white spaces in next revision of the patch.

It works for me in the QT client, and it's pretty sweet. You can even turn the columns on and off. Like the Cities page, it has it's own diabolical ideas about the best column widths and will quickly dispose of any changes that you make manually.

Yes, it is like a kind of magic. I find amazing that it works so nicely for gtk and QT (and sdl2) . :-)

Currently i try to factorise the code, which is mostly 6x copy/paste (but i was a fortran programmer , not a C one ... )

2021-05-22 14:05 Updated by: cazfi
Comment

- Read doc/CodingStyle

- Most player_has_embassy() calls should probably be replaced by team_has_embassy() as team members automatically share information between them, starting from S3_0.

2021-05-24 00:12 Updated by: chippo
Comment

I wannu vote for this patch to go into mainline.

To me it's very useful and every time I'm forced to do a 'git reset --hard' (because some other patch I'm testing has made it in), I painfully forget to apply this one, only to miss it later.

It works (at least) in gtk and qt guis. If configured appropriately, it doesn't change anything. It's so useful if you, at a glance, want to see what the AIs are up to.

2021-05-24 00:16 Updated by: chippo
Comment

Reply To chippo

I wannu vote for this patch to go into mainline.

When alain has followed cazfi's coding style advice.

2021-05-24 01:22 Updated by: cazfi
Comment

I have not looked the patch in detail yet. Waiting for the known issues to get fixed first. But I assume that it will get to S3_1 & master only (at least for d3f reasons).

2021-05-24 01:32 Updated by: cazfi
Comment

Reply To chippo

To me it's very useful and every time I'm forced to do a 'git reset --hard' (because some other patch I'm testing has made it in)

Maybe I should write a tutorial about how I handle my stack of 40 - 60 patches.

2021-05-24 01:50 Updated by: chippo
Comment

Reply To cazfi

Maybe I should write a tutorial about how I handle my stack of 40 - 60 patches.

Maybe there is a way to tell git, "Please do a 'git pull' and if any of the patches/updates are already in my worktree, consider that OK", 'cos that's my usual problem - I'm running a test patch and it gets accepted.

2021-05-24 04:21 Updated by: chippo
Comment

The last column in your patch, should (in English) say 'Researching'. You've got 'Science' twice (again, in English - dunno what it says in French).

2021-05-26 06:58 Updated by: alain_bkr
  • Component Update from Gtk3.22-client to Client common
  • Details Updated
  • Summary Updated
2021-10-08 02:21 Updated by: cazfi
2022-02-03 13:05 Updated by: cazfi
2022-02-19 16:04 Updated by: cazfi
Comment

- Read doc/CodingStyle, and adjust the style accordingly
- In later branches you should use team_has_embassy() instead of player_has_embassy()

2022-04-02 21:49 Updated by: cazfi
2022-04-02 22:03 Updated by: cazfi
Comment

Reply To cazfi

- Read doc/CodingStyle, and adjust the style accordingly
- In later branches you should use team_has_embassy() instead of player_has_embassy()

If there's no activity before we get 3.0.1 out of the way, I assume there's no new version coming, and will steal this to myself to get it handled in 3.0.2 cycle.

2022-04-28 19:16 Updated by: cazfi
Comment

This changes client settings file contents. Can't have in S3_0. For S3_1 I'd still want to include this (despite that meaning that we go from zero d3f things left to implement back to active implementation). From the file format change point of view this is a small and relatively safe change.

I should have a new version of this ready tonight.

2022-04-28 23:03 Updated by: cazfi
  • Resolution Update from None to Accepted
Comment

- Coding Style refresh
- Provide proper function headers for doxygen to process
- Use team_has_embassy() instead of player_has_embassy(), for showing information shared by team members
- Handle global observers
- Refactored functions to write the output buffer just once instead of overwriting it in consecutive "if {} if {}" -blocks. I think this fixed some bugs where the buffer got overwritten even when it should have not. Hopefully did not add too many new bugs in the logic changes.
- Do not try to show current research when have only contact - it's not known at that situation
- Renamed current research column as "Research" to avoid having two "Science" columns

2022-05-05 12:36 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login