#9162 closed enhancement (fixed)
More modularity for preferences
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.
Attachments (2)
Change History (20)
follow-up: 3 comment:1 by , 15 years ago
Description: | modified (diff) |
---|
comment:2 by , 15 years ago
Description: | modified (diff) |
---|
comment:3 by , 15 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 , 10 years ago
Milestone: | unscheduled → 1.1.4 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:10 by , 10 years ago
Keywords: | prefs removed |
---|
comment:11 by , 10 years ago
Release Notes: | modified (diff) |
---|
comment:12 by , 10 years ago
Removed duplicated logging statement on 1.0-stable in [13989], on trunk in [13990:13991].
comment:13 by , 10 years ago
Proposed changes in log:rjollos.git:t9162-preferences-modularity. I haven't tested any use cases of preference pages with child panels (#11853). I'll look into testing the changes in #11870.
comment:14 by , 10 years ago
Milestone: | 1.1.5 → 1.1.6 |
---|
Fixed some issue with child preference panel rendering in log:rjollos.git:t9162-preferences-modularity.2. I'll wait until the next milestone to commit the changes.
comment:15 by , 10 years ago
Functional tests still failing.
python trac/tests/functional/__init__.py ..............................................................................................................................................................................F....................................... ====================================================================== FAIL: runTest (trac.prefs.tests.functional.RegressionTestTicket11515) Test for regression of http://trac.edgewall.org/ticket/11515 ---------------------------------------------------------------------- Traceback (most recent call last): File "/run/shm/b6bed89f1c1d21161b83f909ba005d7ac3d1fe96/py27-sqlite/trac/prefs/tests/functional.py", line 207, in runTest tc.find('Your preferences have been saved') File "/run/shm/b6bed89f1c1d21161b83f909ba005d7ac3d1fe96/py27-sqlite/trac/tests/functional/better_twill.py", line 229, in better_find (to_unicode(e), filename)) TwillAssertionError: no match to 'Your preferences have been saved' at file:///run/shm/b6bed89f1c1d21161b83f909ba005d7ac3d1fe96/py27-sqlite/testenv/trac/log/RegressionTestTicket11515.html ---------------------------------------------------------------------- Ran 214 tests in 334.885s FAILED (failures=1) make: *** [functional-test] Error 1
comment:16 by , 9 years ago
I didn't see the test failure because message catalogs were not compiled in my environment. I've added log messages to make it easier to notice the test being skipped.
Revised changes in log:rjollos.git:t9162-preferences-modularity.3.
comment:17 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [14097:14098].
comment:18 by , 9 years ago
In [14100]: Allow xhr when all preference panels are disabled but PreferencesModule
is enabled.
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.