Last Comment Bug 512146 - Make "Delete History for (host|domain) available in History context menus
: Make "Delete History for (host|domain) available in History context menus
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: UI Design (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: seamonkey2.0b2
Assigned To: Jens Hatlak (:InvisibleSmiley)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-23 07:01 PDT by Jens Hatlak (:InvisibleSmiley)
Modified: 2009-09-01 14:30 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
proposed patch (3.62 KB, patch)
2009-08-23 07:01 PDT, Jens Hatlak (:InvisibleSmiley)
neil: review-
Details | Diff | Splinter Review
patch v2 (7.66 KB, patch)
2009-08-26 12:55 PDT, Jens Hatlak (:InvisibleSmiley)
neil: review+
neil: superreview+
Details | Diff | Splinter Review

Description Jens Hatlak (:InvisibleSmiley) 2009-08-23 07:01:19 PDT
Created attachment 396139 [details] [diff] [review]
proposed patch

This is the equivalent of Firefox bug 465082 (and bug 460086). The idea is to have "Delete History for (host|domain)" available in the context menu so that these commands can be used from the sidebar (the patch also adds it to the context menu available in the History window but there the commands are already available through the Edit menu).

Some background: the placesCmd_delete:* commands in controller.js check gLastHostname and gLastDomain which are only set by historyOnSelect() in history.js. To make it work in the Sidebar I had to call that function and make sure it doesn't access gHistoryStatus which is not available in the Sidebar case.
Comment 1 neil@parkwaycc.co.uk 2009-08-24 04:59:13 PDT
Comment on attachment 396139 [details] [diff] [review]
proposed patch

>+    <command id="placesCmd_delete:hostname"
>+             oncommand="goDoCommand('placesCmd_delete:hostname');"/>
>+    <command id="placesCmd_delete:domain"
>+             oncommand="goDoCommand('placesCmd_delete:domain');"/>
Nit: these can now be removed from history.xul

>     <menuitem id="placesContext_delete"
>               command="cmd_delete"
>               label="&deleteCmd.label;"
>               accesskey="&deleteCmd.accesskey;"
>               selection="link|host|day"/>
>+    <menuitem id="menu_deleteByHostname"
>+              command="placesCmd_delete:hostname"
>+              selection="link|host"/>
>+    <menuitem id="menu_deleteByDomain"
>+              command="placesCmd_delete:domain"
>+              selection="link|host"/>
This breaks the Edit menu, since you have duplicate IDs. One workaround is to set the label and accesskey on the command element instead.
Comment 2 Jens Hatlak (:InvisibleSmiley) 2009-08-26 12:55:32 PDT
Created attachment 396818 [details] [diff] [review]
patch v2

Now with different IDs. Had to switch over to using setAttribute() for both .label and .accessKey now that the target is a command element.
Comment 3 Frank Wein [:mcsmurf] 2009-09-01 14:30:25 PDT
Pushed: http://hg.mozilla.org/comm-central/rev/c98edd97fb3f

Note You need to log in before you can comment on or make changes to this bug.