Edgewall Software

Opened 14 years ago

Last modified 9 years ago

#9162 closed enhancement

More modularity for preferences — at Version 11

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.6
Component: general Version: 0.12dev
Severity: normal Keywords: preferences
Cc: Branch:
Release Notes:

Preference panels are modular and can be individually enabled and disabled.

API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Current PreferencesModule is extension point for IPreferencePanelProvider and still implements few IPreferencePanelProviders itself.

I think this should be divided in the way that all preference panels (even the built in ones) are separate Components. This way it is possible to disable some of the preference panels from the trac.ini components section.

Use case
In our project we do not need some of the views that built in panels offers. We can't disable General section even though we have a different implementation that works in our case and end up having similar fields twice in different panels.

Change History (13)

comment:1 by Christian Boos, 14 years ago

Description: modified (diff)

Why not, yes.

But if you were able to build your own IPreferencePanelProviders, I'm sure you're also able to provide a patch for this feature.

comment:2 by Christian Boos, 14 years ago

Description: modified (diff)

in reply to:  1 comment:3 by steeni <niko.sten@…>, 14 years ago

Replying to cboos:

But if you were able to build your own IPreferencePanelProviders, I'm sure you're also able to provide a patch for this feature.

Good point :). I will do that when I have some time.

comment:4 by Christian Boos, 14 years ago

Milestone: next-minor-0.12.xunscheduled

PatchWelcome, until then it's unscheduled.

by Bartosz Szatkowski <bulislaw@…>, 14 years ago

Patch for moving preferences panel to separate modules

comment:5 by Bartosz Szatkowski <bulislaw@…>, 14 years ago

HI, iam working on my bs. project and needed similar behavior, so here's go the patch for modular preferences panel.

Its my first patch for Trac so please let me know what needs to be changed or what ever.

TESTS: Ran 1055 tests in 157.186s

comment:6 by Christian Boos, 14 years ago

Hello Bartosz,

The patch is a good start, however:

  • you seem to have mixed space/tabs inside, please fix that first
  • if you split in different panel provider, then I think it makes more sense to have a render_preference_panel method in each, doing only the part it needs to do, rather than an inherited render_preference_panel that still knows about all…

by Bartosz Szatkowski <bulislaw@…>, 14 years ago

comment:7 by Bartosz Szatkowski <bulislaw@…>, 14 years ago

Ok - fixed both

1) Sorry for that, i may use "stock" vim on my vm

2) You're right - ive refactored my patch further:

  • Added _name and _title - keeping panels name and tab title
  • get_preference_panels moved to base class (using _name and _title)
  • common part of render_preference_panel moved to base class
  • render_preference_panel in each panel know only about itself

Tests: all ok

comment:8 by Ryan J Ollos, 9 years ago

Milestone: unscheduled1.1.4
Owner: set to Ryan J Ollos
Status: newassigned

comment:9 by Ryan J Ollos, 9 years ago

Milestone: 1.1.41.1.5

Narrowing focus for 1.1.4.

comment:10 by Ryan J Ollos, 9 years ago

Keywords: prefs removed

comment:11 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Note: See TracTickets for help on using tickets.