Edgewall Software
Modify

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)

contributor-delegate.diff (1.1 KB ) - added by Paolo Capriotti 17 years ago.

Download all attachments as: .zip

Change History (4)

by Paolo Capriotti, 17 years ago

Attachment: contributor-delegate.diff added

comment:1 by Noah Kantrowitz, 17 years ago

Whats the use case for this? -1 unless there is a very compelling one.

in reply to:  1 comment:2 by anonymous, 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?

in reply to:  1 comment:3 by Paolo Capriotti, 17 years ago

Resolution: wontfix
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.