Closed Bug 226491 Opened 21 years ago Closed 20 years ago

Need to build a Progressmeter that supports undetermined mode

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mscott, Assigned: neil)

References

Details

(Keywords: fixed-aviary1.0, helpwanted)

Attachments

(8 files, 1 obsolete file)

On Windows, if you put the current progressmeter into undetermined mode, we
currently don't do anything. 

Ben and I were talking and it would be great if we had an XBL widget that was
used  instead of the existing progressmeter binding if the meter is in
undetermined mode.

In theory, one should be able to easily fake our own undetermined mode for the
progressmeter.
Apparently this is affecting other platforms. There is a recent thread on
n.p.m.xpfe about it entitled 'No "undetermined" progressbar on Linux'.
I'm not actively working on this if someone on that thread wants to work on it.
I think it requires changes to the native theme apis and probably some xbl magic
too.
Attached patch Possible patch (obsolete) — Splinter Review
I don't know why the background image doesn't animate, so I didn't CC myself.
it seems that the image is not in any jar files... (firefox 0.9.1)

so, the image progressmeter-busy.gif must be added in the jar file : 
classix.jar:skin/global/progressmeter/

th patch must be added, and then it works.

(sorry, i can't correct it directly, no access to cvs ...)
That's not really the problem. For the classic theme our progressmeter is a
native looking progressmeter.

We need to write some XBL to produce a native looking progressmeter in
undetermined mode.

We can leverage parts of the existing marquee tag and the stack tag to animate a
progress chunk back and forth over a progressbar.

Test mock up coming up.

Would be awesome if we could get someone to write an XBL widget to do this. 
Keywords: helpwanted
Attachment #142135 - Attachment is obsolete: true
Attached file here is a demo
Attached patch Hacky patchSplinter Review
I ran into a couple of issues:

the size of the progressmeter isn't known immediately, so I just set the size
of the scrolling bitty in the loop, although I should only need to set it once

the stack doesn't mind moving things off its left but objects if you try to
move things off its right, so I use a large negative margin to work around it.
looks pretty cool
Comment on attachment 153574 [details] [diff] [review]
Hacky patch

Would it make more sense to put the XBL binding for the progressmeter over in
xul.css (where the content binding for progressmeter exists) instead of
global.css?
I did see one thing. When the progressmeter leaves the undetermined state (or
gets hidden because there is no more progress to report), the timeout is still
firing leading to the following exception:

JavaScript error: chrome://global/content/bindings/progressmeter.xml, line 67: u
ncaught exception: [Exception... "Component returned failure code: 0x80004005 (N
S_ERROR_FAILURE) [nsIDOMXULElement.boxObject]"  nsresult: "0x80004005 (NS_ERROR_
FAILURE)"  location: "JS frame :: chrome://global/content/bindings/progressmeter
.xml :: nextStep :: line 67"  data: no]
actually that exception is probably because of the way I happen to be using the
widget. I bet I'm hiding it without taking it out of the undetermined state so
the destructor never gets called. Probably something the consumer should have to
worry about and not necessarily the widget itself.
The reason I put the style rule in Classic's global.css is that Modern (and
possibly third party themes) already has an undetermined progressmeter.
Neil this "less unreliable patch" is working really well for me so far.
I'm ready to run with this patch if you are Neil. I've been using it all day and
it's working great. Anything else you want to do it before we get some code
reviews going?
Attachment #153946 - Flags: superreview?(jag)
Attachment #153946 - Flags: review?(mconnor)
It occurs to me that the old background image won't be necessary.
Assignee: mscott → neil.parkwaycc.co.uk
Attachment #153946 - Flags: review?(mconnor) → review+
Ah, ok, so trees still use that image. And until trees can draw native themed
progressmeters, then no, we're not changing the tree versions. Also my
understanding was that the Mac has a native undetermined progressmeter.
I'm getting some reports of folks seeing the progress chunk start outside the
boundary of the progressmeter. Here's a screen shot:

http://pub.tsn.dk/screendumps/thunderbird.bug2.jpg

This looks like it was from win2k. I'll test that out later today.
(In reply to comment #20)
> I'm getting some reports of folks seeing the progress chunk start outside the
> boundary of the progressmeter. Here's a screen shot:
> 
> http://pub.tsn.dk/screendumps/thunderbird.bug2.jpg
> 
> This looks like it was from win2k. I'll test that out later today.

I also see this with build 20040726 using WinXP.  Same as the screenshot.
(In reply to comment #20)
> I'm getting some reports of folks seeing the progress chunk start outside the
> boundary of the progressmeter. Here's a screen shot:
> 
> This looks like it was from win2k. I'll test that out later today.

Same for me. I missed this bug so i reported this earlier today in bug 253232.
Depends on: 253232
OK, there are two ways to fix bug 253232:

Either add stack.progress-remainder { overflow: -moz-hidden-unscrollable; } to
progressmeter.css

Or add style="overflow: -moz-hidden-unscrollable;" to progressmeter.xul
This works for me - but seems *VERY* fast. Can it be slowed down a little?
Comment on attachment 153946 [details] [diff] [review]
Less unreliable patch

sr=jag
Attachment #153946 - Flags: superreview?(jag) → superreview+
(In reply to comment #24)
>This works for me - but seems *VERY* fast. Can it be slowed down a little?
mscott, do you think we should slow it down a bit?
that's a tricky question Neil. I notice a big difference between the cycling
speed when the chunk is small (such as the main mail 3pane window) vs when the
chunk is large (such as the mail compose progress dialog. A value good for one
looks too fast or to slow for the other.

That being said, I did some experimentation and found a value of 20 instead of
10 for the timer seemed better for both scenarios....just my 2 cents
Attached patch Slower versionSplinter Review
Comment on attachment 155259 [details] [diff] [review]
Slower version

Hopefully this version runs at a reasonable speed on the send progress dialog.
Attachment #155259 - Flags: review?(mscott)
Comment on attachment 155259 [details] [diff] [review]
Slower version

The send progress dialog now works perfect. Maybe its my imagination but now
the main mail 3 pane seems too fast. Maybe this patch + tweaking the timer
interval will give us the ideal result. I'll play around with it.
Comment on attachment 155259 [details] [diff] [review]
Slower version

Change the >> 2 to >> 7 like you sent me over e-mail

and r/sr=mscott
Attachment #155259 - Flags: review?(mscott) → review+
Attached patch Final versionSplinter Review
I couldn't stop twiddling until I got to this patch which now feels right :-)
Comment on attachment 155349 [details] [diff] [review]
Final version

that seems to work just right!
Attachment #155349 - Flags: superreview+
Attachment #155349 - Flags: review+
Final version checked in to trunk.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Since there is a fix, requesting
?1.0PR
Flags: blocking-aviary1.0PR?
this is already in the aviary branch. No need to request something that's alrady
there.
Flags: blocking-aviary1.0PR? → blocking-aviary1.0PR-
Whiteboard: fixed-aviary1.0
Keywords: fixed-aviary1.0
Whiteboard: fixed-aviary1.0
Scott,
The changes to the 3 css files did not make it onto the aviary branch, though
the changes to the xul file did I think.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
this is working fine on the aviary branch. 
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
http://neil.rashbrook.org/pyeximon.xul
Works fine on nightly but not on 0.10.1 so something hasn't made it into the branch
Logged bug 266459 on problem
As pointed out by Ian, the changes to the files
mozilla/themes/classic/global/win/global.css
mozilla/themes/classic/global/unix/global.css
has not made it to avery trunk.

I got my avery trunk from
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ .

Also according to
http://bonsai.mozilla.org/cvsgraph.cgi?file=mozilla/themes/classic/global/win/global.css
we can see that version 1.43 of this file (the version that contains the patch
for this bug) is not in any avery / firefox branch. 

(May I reopen this bug?)
Aviary doesn't use the mozilla/themes folders.
Where dose skin\classic\global\global.css in chrome\classic.jar come from in the
cvs?
I've workout what's going on here. I've submited patch to Bug 266459
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: