Opened 17 years ago
Closed 17 years ago
#6005 closed enhancement (wontfix)
[PATCH] Associate arbitrary navigation contributors to handlers
Reported by: | Paolo Capriotti | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
This patch allows a navigation contributor to be different from a request handler, and still have the corresponding navigation item being active when the handler is running. To associate a handler with a navigation contributor just set a 'contributor_delegate' member in your handler instance.
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | contributor-delegate.diff added |
---|
follow-ups: 2 3 comment:1 by , 17 years ago
comment:2 by , 17 years ago
Replying to nkantrowitz:
Whats the use case for this? -1 unless there is a very compelling one.
The idea behind this and #6003 is to be able to override a builtin navigation item. For instance, if you define anIRequestHandler
that overrides BrowserModule
by assigning it a higher priority, when this handler is activated, the "Browse Source" link is not highlighted.
So with this patch you can simply add a line
self.contributor_delegate = BrowserModule(self.env)
to solve the issue. Is there perhaps a better way to do all of this?
comment:3 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I've just found how this is supposed to be done: just let the request handler implement INavigationContributor
as well, and let it return:
- an empty list in
get_navigation_items
; - the correct navigation item to highlight in
get_active_navigation_item
.
Sorry, I didn't think about that. No need for this patch.
Whats the use case for this? -1 unless there is a very compelling one.