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 )
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)
follow-up: 3 comment:1 by , 14 years ago
Description: | modified (diff) |
---|
comment:2 by , 14 years ago
Description: | modified (diff) |
---|
comment:3 by , 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 , 14 years ago
Milestone: | next-minor-0.12.x → unscheduled |
---|
PatchWelcome, until then it's unscheduled.
by , 14 years ago
Attachment: | prefs_panels_as_separate_modules.path added |
---|
Patch for moving preferences panel to separate modules
comment:5 by , 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 , 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 inheritedrender_preference_panel
that still knows about all…
by , 14 years ago
Attachment: | prefs_panels_as_separate_modules.patch added |
---|
comment:7 by , 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 , 9 years ago
Milestone: | unscheduled → 1.1.4 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:10 by , 9 years ago
Keywords: | prefs removed |
---|
comment:11 by , 9 years ago
Release Notes: | 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.