Closed Bug 342169 Opened 18 years ago Closed 18 years ago

Disable "Undo Close Tab" if no tabs to restore

Categories

(Firefox :: Tabbed Browser, defect)

2.0 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2 beta2

People

(Reporter: dietrich, Assigned: dietrich)

References

Details

(Keywords: fixed1.8.1, Whiteboard: [swag: .5d])

Attachments

(1 file)

If there are no tabs to restore, disable this option in the tab context menu. See discussion at 254021 for more discussion.
Status: NEW → ASSIGNED
OS: Mac OS X 10.3 → All
Whiteboard: [swag: .5d]
Attached patch hides menuSplinter Review
This hides the menu, per mconnor's request. However, Simon's argument for discoverability makes sense IMO. I don't think having a disabled context menu item on tabs would be terribly discordant with our context-menu practices elsewhere, as the content window context menu has disabled items.
Attachment #226563 - Flags: review?(mconnor)
Flags: blocking-firefox2?
Target Milestone: --- → Firefox 2 beta1
Comment on attachment 226563 [details] [diff] [review] hides menu >Index: base/content/browser.js >+ AugmentTabs.undoCloseTabMenu.hidden = (ss.getClosedTabCount(window) > 0) ? false : true; Why convert a boolean to a boolean? Why not: ....disabled = ss.getClosedTabCount(window) <= 0; And as I already mentioned (and you acknowledged), items should really only be hidden depending on the direct context, otherwise they should just be disabled. >Index: components/sessionstore/src/nsSessionStore.js >+ if (tabState && tabState.Entry[0].url != "about:blank") { Are you sure that there's no possibility that about:blank is just the first entry in the tab's history? If not, please also check for tabState.Entry.length == 1.
Flags: blocking-firefox2? → blocking-firefox2+
Target Milestone: Firefox 2 beta1 → Firefox 2 beta2
Comment on attachment 226563 [details] [diff] [review] hides menu >+ onTabContextMenuLoad: function at_onTabContextMenuLoad() { >+ if (AugmentTabs.undoCloseTabMenu) { >+ // only add the menu of there are tabs to restore >+ var ss = Cc["@mozilla.org/browser/sessionstore;1"]. >+ getService(Ci.nsISessionStore); >+ AugmentTabs.undoCloseTabMenu.hidden = (ss.getClosedTabCount(window) > 0) ? false : true; >+ } just do: AugmentTabs.undoCloseTabMenu.hidden = !(ss.getClosedTabCount(window) > 0); otherwise, r=me
Attachment #226563 - Flags: review?(mconnor) → review+
Checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #226563 - Flags: approval1.8.1?
Attachment #226563 - Flags: approval1.8.1? → approval1.8.1+
Keywords: fixed1.8.1
> And as I already mentioned (and you acknowledged), items should really only be > hidden depending on the direct context, otherwise they should just be disabled. Isn't this inconsistent with the current behavior of FF where actions are "disabled" instead of removed/hidden if the action cannot be performed? Why introduce another inconsistency? With FF 2.0 there have been a number of "new" inconsistencies introduced throughout the UI that just don't make sense... ~B
Blocks: 350731
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: