Editor dialogs not remembering table spacing

I’ve noticed that in 5.1.4 that any of the edit dialogs like events don’t remember what the spacing is for columns. Every time I open a dialog, it defaults back to the default spacing. Is there a way to have it remember them?

The list and column spacing have never been remembered between opening edit windows. The major Views; People, Families, Events, Places, Sources, Citations, Repositories, Notes, and Media have configurable columns and will remember the spacing allocated by the user.

You can hack the code to allocate more or less space for the various edit windows. Which dialog windows are you most interested in modifying?

Sorry getting back so late. In event Reference Editor, Source citations, I would like to have the title about 50 percent wider.

I am not sure which list you are referencing but since you mention the Source Title I will make these assumptions.

All files are in the Gramps program code folder. Edit…

\gramps\gui\selectors\selectcitation.py at line 69

def get_column_titles(self):
    return [
        (_('Source: Title or Citation: Volume/Page'), 350, BaseSelector.TEXT, 0),
        (_('ID'),     75, BaseSelector.TEXT, 1),
        (_('Last Change'), 150, BaseSelector.TEXT, 6),
        ]

To increase Source: Title…. change the 350 to maybe 450

Likewise, you may want to edit…

\gramps\gui\selectors\selectsource.py at line 64

def get_column_titles(self):
    return [
        (_('Title'), 350, BaseSelector.TEXT, 0),
        (_('Author'), 200, BaseSelector.TEXT, 2),
        (_('ID'), 75, BaseSelector.TEXT, 1),
        (_('Last Change'), 150, BaseSelector.TEXT, 7),
        ]

To change the column widths of the Tab that display the list of Citations, edit…

\gramps\gui\editors\displaytabs\citationembedlist.py at line 79

_column_names = [
    (_('Title'),   0, 200, TEXT_COL, -1, None),
    (_('Author'),  1, 125, TEXT_COL, -1, None),
    (_('Page'),    2, 100, TEXT_COL, -1, None),
    (_('ID'),      3,  75, TEXT_COL, -1, None),
    (_('Private'), 4,  30, ICON_COL, -1, 'gramps-lock')
]

Some pointers…

The program folders are protected so you will need to edit with administrator rights.

When the next version of Gramps comes out, you will need to make these changes again. The main code will not change column sizes based upon display size considerations. So you need to give yourself a way to remember any changes to the code you make.

When editing the code, make sure to not alter indents. They are important.

2 Likes

Remember to log any hacks that you do to the layouts. If you do not submit a feature request tweak to the base code that actually gets rolled into an update, you will have to repeat the hack for subsequent releases.

It is handy to manually renumber the original Note ZERO and keep details about hacks in a NEW Note assigned that ID. This makes finding them easier.

Thanks, I’ll try that.

Can you make a feature request for that. I think I have a solution.

3 Likes

You can see the PR: Column widths in selection dialogs. by SNoiraud · Pull Request #1302 · gramps-project/gramps · GitHub

4 Likes

Great work. This takes care of remembering previous column widths in Selectors.

Can the same be done for the lists under Tabs? It would be a lot of work. Not just the Tabs in Edit windows but if that can be made to work there would also be all the various gramplet tabs.

I don’t see where you want to have this done.
can you attach snapshot of these ?

Above

I offered up changing the Source Citations tab in edit windows to give the Title more space. \gramps\gui\editors\displaytabs\citationembedlist.py

So it would be remembering the space the user allocates under the various Tabs in the edit windows.

Remembering these tabs would be more important than gramplet tabs but it would create the expectation that all lists would be remembered.

Thank you! This seems like it should be very useful for translation… where different languages might need different widths for the data.

I wonder if there would be a way to manage/distribute persistent localized settings?

The PR #1302 is replaced by PR Make the tabs columns resizable: ResizableTreeView by SNoiraud · Pull Request #1306 · gramps-project/gramps · GitHub.

  • All tabs column width are saved (selectors, embedded list, views).
  • When you change the font size of gramps with the Themes plugins (Edit->Preferences->Themes)
    The column width is updated depending on the font size.
  • The new sizes will be kept between gramps session.
3 Likes

Just want to express my public appreciation to @SNoiraud for this PR.

It involved fussy changes to over 60 files and expands Gramps ability to support many special needs. The work deserves many kudos.

I look forward to experimenting with it for 5.2 ( or are we trending towards 6.0 as the next enhancement release?).

But I’d like to put forward a thought that a spot for a ‘fix’ be reserved for the maintenance release after the changes are rolled into Gramps main.

The ‘bug’ will be in the beta test & feedback cycle rather than the feature per se.

There won’t be enough people testing the changes … because of the extensive number of files being changed. So the default widths for the more than 3 dozen languages across a multitude of dialogs & views will not have have a chance to be integrated.

Like translations, those changes should be fast-tracked & rolled into maintenance instead of the enhancement release cycle. (And these configuration mods might also require a change management feature allowing sets of widths & orders to be distributed.)