Closed Bug 416303 Opened 18 years ago Closed 18 years ago

Show default list, clear search, focus list when hitting escape from the search box

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9beta4

People

(Reporter: Mardak, Assigned: Mardak)

References

Details

Attachments

(1 file, 6 obsolete files)

Madhava agrees that it would be good to clear the search and move focus to the list when the user hits escape. Whether or not we close the window on escape is a separate issue.
Attached patch v1 (obsolete) — Splinter Review
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #302093 - Flags: review?(sdwilsh)
I agree that I agree. I, personally, don't think that the window should close on escape, given that that's not standard behaviour on any of our platforms, but that's what bug 306197 is for.
Comment on attachment 302093 [details] [diff] [review] v1 r=sdwilsh This does, however, need a browser test before it can land ;)
Attachment #302093 - Flags: review?(sdwilsh) → review+
Attached patch v1.1 (obsolete) — Splinter Review
Now with more mochitest! That wasn't so bad was it? ;) ... yes it was! Silly EventUtils and keydown/keypress/keyup...
Attachment #302093 - Attachment is obsolete: true
Attachment #302221 - Flags: review+
Attachment #302221 - Flags: approval1.9?
Comment on attachment 302221 [details] [diff] [review] v1.1 >+function test() >+{ >+ // Close the UI if necessary >+ let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); nit: line wrapping >+ // Show the Download Manager UI >+ Cc["@mozilla.org/download-manager-ui;1"].getService(Ci.nsIDownloadManagerUI).show(); ditto >+ >+ // Wait for the UI to show up then do stuff >+ waitForExplicitFinish(); >+ setTimeout(function() { actually, setTimeout is bad, and sayrer will be angry with you. You need to actually register a listener with the window watcher, and then register a DOMContentLoaded event like so: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/toolkit/components/downloads/test/browser/browser_bug414214.js&rev=1.2#62 >+ win = wm.getMostRecentWindow("Download:Manager"); >+ >+ // Put in a value to clear out >+ let search = win.document.getElementById("searchbox"); >+ search.value = "booga"; >+ search.focus(); >+ >+ let doEscape = function(aType) EventUtils.synthesizeKey("VK_ESCAPE", { type: aType }, win); I'm not sure why you have to do all this. You should talk to Enn about it.
Attachment #302221 - Flags: review+ → review-
Attached patch v1.2 (obsolete) — Splinter Review
80 characters max per line.. :p
Attachment #302221 - Attachment is obsolete: true
Attachment #302225 - Flags: review+
Attachment #302225 - Flags: approval1.9?
Attachment #302221 - Flags: approval1.9?
Attachment #302225 - Flags: review+
Attachment #302225 - Flags: approval1.9?
Many hours later and I still can't get it to work with the window watcher. Some one else can take the bug.
Assignee: edilee → nobody
Status: ASSIGNED → NEW
Enn - any idea why sythesizeKey doesn't work, but actually pressing the key does?
Attached patch v1.3 (obsolete) — Splinter Review
Meh. Meh. Meh. Clearly not in the greatest of moods. Meh.
Assignee: nobody → edilee
Attachment #302225 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #302257 - Flags: review?
er, so, setTimeout with a timeout of 0 should be OK. The ones with non-zero values are the problem.
Attached patch v1.4 (obsolete) — Splinter Review
Went with keypress instead of keydown to be consistent with what the keyset expects.
Attachment #302257 - Attachment is obsolete: true
Attachment #302340 - Flags: review?(sdwilsh)
Attachment #302257 - Flags: review?
Comment on attachment 302340 [details] [diff] [review] v1.4 >+/* ***** BEGIN LICENSE BLOCK ***** >+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 is there normally that space there? >+ // Show the Download Manager UI >+ Cc["@mozilla.org/download-manager-ui;1"].getService(Ci.nsIDownloadManagerUI). >+ show(); nit: this line wrapping looks weird r=sdwilsh
Attachment #302340 - Flags: review?(sdwilsh) → review+
Attached patch v1.5 (obsolete) — Splinter Review
(In reply to comment #12) > >+/* ***** BEGIN LICENSE BLOCK ***** > is there normally that space there? Yup. > >+ // Show the Download Manager UI > >+ Cc["@mozilla.org/download-manager-ui;1"].getService(Ci.nsIDownloadManagerUI). > >+ show(); > nit: this line wrapping looks weird Moved getService to the next line and combined show.
Attachment #302340 - Attachment is obsolete: true
Attachment #304790 - Flags: review+
Attachment #304790 - Flags: approval1.9?
(In reply to comment #13) > > >+/* ***** BEGIN LICENSE BLOCK ***** > > is there normally that space there? > Yup. I meant the next line, because I've never seen the additional white space before it.
Oh. All the components/downloads/test/unit files have "* Version:..." while the mozapps/downloads/test/browser files have "* Version:..."
So that was probably my mistake at some point. Could you fix that please with this patch?
Attached patch v1.6Splinter Review
Fixed up license boilerplate on other files. Seems like we copy/paste a lot ! ;) :p
Attachment #304790 - Attachment is obsolete: true
Attachment #304799 - Flags: review+
Attachment #304799 - Flags: approval1.9?
Attachment #304790 - Flags: approval1.9?
Comment on attachment 304799 [details] [diff] [review] v1.6 a=beltzner for 1.9
Attachment #304799 - Flags: approval1.9? → approval1.9+
Checking in toolkit/components/downloads/src/nsDownloadManagerUI.js; /cvsroot/mozilla/toolkit/components/downloads/src/nsDownloadManagerUI.js,v <-- nsDownloadManagerUI.js new revision: 1.7; previous revision: 1.6 done Checking in toolkit/components/downloads/test/browser/browser_bug414214.js; /cvsroot/mozilla/toolkit/components/downloads/test/browser/browser_bug414214.js,v <-- browser_bug414214.js new revision: 1.3; previous revision: 1.2 done Checking in toolkit/components/downloads/test/browser/browser_nsIDownloadManagerUI.js; /cvsroot/mozilla/toolkit/components/downloads/test/browser/browser_nsIDownloadManagerUI.js,v <-- browser_nsIDownloadManagerUI.js new revision: 1.4; previous revision: 1.3 done Checking in toolkit/mozapps/downloads/content/downloads.js; /cvsroot/mozilla/toolkit/mozapps/downloads/content/downloads.js,v <-- downloads.js new revision: 1.138; previous revision: 1.137 done Checking in toolkit/mozapps/downloads/src/DownloadUtils.jsm; /cvsroot/mozilla/toolkit/mozapps/downloads/src/DownloadUtils.jsm,v <-- DownloadUtils.jsm new revision: 1.6; previous revision: 1.5 done Checking in toolkit/mozapps/downloads/tests/browser/Makefile.in; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/Makefile.in,v <-- Makefile.in new revision: 1.10; previous revision: 1.9 done Checking in toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_basic_functionality.js,v <-- browser_basic_functionality.js new revision: 1.4; previous revision: 1.3 done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_394039.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_394039.js,v <-- browser_bug_394039.js new revision: 1.2; previous revision: 1.1 done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_410289.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_410289.js,v <-- browser_bug_410289.js new revision: 1.2; previous revision: 1.1 done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_411172.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_411172.js,v <-- browser_bug_411172.js new revision: 1.4; previous revision: 1.3 done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_411172_mac.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_411172_mac.js,v <-- browser_bug_411172_mac.js new revision: 1.3; previous revision: 1.2 done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_413985.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_413985.js,v <-- browser_bug_413985.js new revision: 1.2; previous revision: 1.1 done RCS file: /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_416303.js,v done Checking in toolkit/mozapps/downloads/tests/browser/browser_bug_416303.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/browser/browser_bug_416303.js,v <-- browser_bug_416303.js initial revision: 1.1 done Checking in toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js; /cvsroot/mozilla/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js,v <-- test_DownloadUtils.js new revision: 1.2; previous revision: 1.1 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 beta4
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b4pre) Gecko/2008022204 Minefield/3.0b4pre. Also verified on the Win XP nightly.
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: