Project

General

Profile

Actions

Feature #1288

closed

GTK client remember size of the options dlog

Added by Dean Brown 2 months ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Category:
gtk3.22-client
Target version:
Start date:
04/06/2025
Due date:
% Done:

0%

Estimated time:

Description

Similar to #1287, the qt client does it.

I haven't figured out how to yet, but will try.


Files

1288-1time.patch (3.38 KB) 1288-1time.patch Dean Brown, 04/13/2025 04:13 AM
1288-alltime.patch (15.7 KB) 1288-alltime.patch Dean Brown, 04/13/2025 04:13 AM
1288-gtk5-alltime.patch (1.61 KB) 1288-gtk5-alltime.patch Dean Brown, 04/16/2025 01:56 AM
1288combined.patch (17 KB) 1288combined.patch Dean Brown, 05/04/2025 11:58 PM
1288-3_1+3_2Better.patch (3.37 KB) 1288-3_1+3_2Better.patch Dean Brown, 06/03/2025 07:34 AM
1288-3_3+MainBetter.patch (13.8 KB) 1288-3_3+MainBetter.patch Dean Brown, 06/03/2025 07:57 AM

Related issues 1 (0 open1 closed)

Blocked by Feature #1287: GTK client remember size of help dlgClosedMarko Lindqvist04/06/2025

Actions

Updated by Dean Brown 2 months ago

Found fixes for gtk3.22 & gtk4.

The 1time patch made from 3.1 branch, doesn't touch freeciv-client-rc-* file, saves the size during one runtime.

The alltime patch made from main branch, affects freeciv-client-rc-* file, saves the size across runtimes. This patch was created after the patch "#1287-main.patch" from issue #1287 was done.

Actions #2

Updated by Dean Brown 2 months ago

copy the fix into gtk5

Actions #3

Updated by Marko Lindqvist about 1 month ago

  • Target version set to 3.1.6
Actions #4

Updated by Dean Brown about 1 month ago

Replace files 1288-alltime.patch and 1288-gtk5-alltime.patch with 1288combined.patch

Actions #5

Updated by Marko Lindqvist 29 days ago

- Some gtk-style "function ()" calls instead of freeciv style "function()"
- You should not add dummy options for already removed clients
- I'm not sure it's an improvement to replace dynamically adjusting option dialog width with hardcoded value that will be sensible/correct only for some users (font size etc).

Actions #6

Updated by Dean Brown 21 days ago

Running into problems because of changes for #1287 - this issue wants to add lines of code in client/options.c that are adjacent to the lines added in #1287. Running 'gif apply ...' fails unless the patch was made with the appropriate diff. Better to wait until #1287 is closed.

Actions #7

Updated by Marko Lindqvist 21 days ago

  • Blocked by Feature #1287: GTK client remember size of help dlg added
Actions #8

Updated by Marko Lindqvist 21 days ago

Instructions for patch creation in https://www.freeciv.org/wiki/How_to_Contribute#How_to_create_patch_file_with_Git should be good also for working with a stack of patches, if you want to develop this patch already on top of #1287.

Updated by Dean Brown 12 days ago

Better patches.
"function ()" calls -> "function()"
removed gtk2 and gtk3 stuff

The original code had hardcoded values in

  gtk_window_set_default_size(GTK_WINDOW(pdialog->shell), -1, 480);

For the 3_1+3_2 patch I kept the -1, 480 values for initializing the added variables.
For the 3_3+Main patch, I kept the 480 value for GUI_GTK..._OPTIONSDLG_DEFAULT_YSIZE,
but using -1 value for GUI_GTK..._OPTIONSDLG_DEFAULT_XSIZE doesn't work because it needs to be >= GUI_GTK..._OPTIONSDLG_MIN_XSIZE.
So I used 128 for both the default and minimum value, and it tests OK.

Actions #10

Updated by Dean Brown 12 days ago

Forgot to add, the 3_3+Main patch now also does the migrate_options_from_gtk...()

Actions #11

Updated by Marko Lindqvist 11 days ago

Maybe we finish this with the way it's now, but for the future development:
I now started thinking that these should not be options (that you also can set in the options dialog). I assume that the actual dialog size and option field are not even properly synced (value shown in the optiondlg field is not updated when the size is saved from a window)
I think the right way for this to work would be that these dialog size options would not appear in the options dialog at all.

Actions #12

Updated by Marko Lindqvist 11 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #13

Updated by Marko Lindqvist 11 days ago

Marko Lindqvist wrote in #note-11:

I assume that the actual dialog size and option field are not even properly synced

e.g.:
1) Open Options dialog
2) Open Help dialog
3) Adjust size of the help dialog
4) Close help dialog
5) Reopen help dialog, and observe that it has kept its size
6) Close help dialog
7) Click 'Apply' in the options dialog
8) Reopen help dialog, and observe that its size is now back to the very original one

Actions #14

Updated by Dean Brown 11 days ago

You are correct, never occurred to me you could have both dialogs open at the same time. Closing the help dialog triggers writing the freeciv-client-rc-* file, and 'Apply' in the options dialog does also. Whoever does it last wins. Having the options dialog update its help dialog settings while it's open would be a can of worms and likely not a good idea. Same problem with the city dialog size. I just tried and found you can have all 3 dialogs open!

Agree for the future - dialog size options should not appear in the options dialog at all.

Actions #15

Updated by Marko Lindqvist 8 days ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF