Closed
Bug 385787
Opened 18 years ago
Closed 18 years ago
Gray-out restart firefox button on installing theme/extension updates window
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla1.9alpha8
People
(Reporter: tchung, Assigned: dao)
References
Details
Attachments
(3 files, 8 obsolete files)
32.26 KB,
image/jpeg
|
Details | |
18.16 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
11.00 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a6pre) Gecko/20070625 Minefield/3.0a6pre
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a6pre) Gecko/20070625 Minefield/3.0a6pre
I think we should gray out the "restart firefox" button when the user is trying to install a update to themes and extensions. Call the attention to the "Install updates" button, or you will confuse the user to restart firefox instead, thinking it will install the updates by simply restarting.
See attachment.
Reproducible: Always
Steps to Reproduce:
1. add a extension or theme to a prior version of FF, that supports the latest alpha (eg. myFirefox theme)
2. update to the latest nightly build
3. open up addon manager, and do a "Find updates" on the theme or extension
4. When update is available for the theme / extension, go to Updates dialog
5. Verify the "Restart Firefox" button is active, but we should call the user to attention on the "Install updates" first.
See attachment.
Actual Results:
Restart Firefox button is active on the install updates window
Expected Results:
Should gray out the Restart Firefox button until the Update has been installed.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Updated•18 years ago
|
Assignee: nobody → dao
Comment 2•18 years ago
|
||
(In reply to comment #0)
> Should gray out the Restart Firefox button until the Update has been installed.
... or another extension was enabled/disabled/uninstalled or a new theme was selected/uninstalled. Even with updates pending, you might want to do other extension related stuff first.
BTW: Extensions should be able to easily enable that button from their Options dialog as well when they need it - e.g. through
window.opener.getElementById("restartAppButton").disabled = false;
Assignee | ||
Comment 3•18 years ago
|
||
I can't open attachment 269705 [details].
(In reply to comment #2)
> BTW: Extensions should be able to easily enable that button from their Options
> dialog as well when they need it - e.g. through
>
> window.opener.getElementById("restartAppButton").disabled = false;
Well, that's a hack. The state would get lost when doing other stuff in the Add-ons manager.
OS: Mac OS X → All
Hardware: PC → All
Comment 4•18 years ago
|
||
I think if add-ons need a restart for some of their options then they should handle it themselves, it's easy enough. This button should be for restarting due to changes in the add-ons window, that is add-on installs/uninstalls/enables/disables or theme switches.
Reporter | ||
Updated•18 years ago
|
Attachment #269705 -
Attachment is private: false
Reporter | ||
Comment 5•18 years ago
|
||
dao-- sorry, i accidently checked the private button on the attachment. it's viewable now.
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Updated•18 years ago
|
Flags: blocking-firefox3?
Assignee | ||
Updated•18 years ago
|
Attachment #269705 -
Attachment description: gray out restart button → restart button not grayed out
Assignee | ||
Comment 6•18 years ago
|
||
Attachment #270298 -
Flags: review?(robert.bugzilla)
Assignee | ||
Comment 7•18 years ago
|
||
Attachment #270298 -
Attachment is obsolete: true
Attachment #270300 -
Flags: review?(robert.bugzilla)
Attachment #270298 -
Flags: review?(robert.bugzilla)
![]() |
||
Comment 8•18 years ago
|
||
Since we display the Restart button all the time I think we should move the Install Updates button to the left. This would make it consistent with the location of the Find Updates button and just look better overall IMO. Dão, could you add that to this patch?
Assignee | ||
Comment 9•18 years ago
|
||
Attachment #270300 -
Attachment is obsolete: true
Attachment #270347 -
Flags: review?(robert.bugzilla)
Attachment #270300 -
Flags: review?(robert.bugzilla)
![]() |
||
Comment 10•18 years ago
|
||
Comment on attachment 270347 [details] [diff] [review]
gray out restart button, move install button to the left
I did a quick test of this patch and it appears that if you switch to any other view while an extension is being updated the restart button is enabled. r-'ing based on that.
Attachment #270347 -
Flags: review?(robert.bugzilla) → review-
Assignee | ||
Comment 11•18 years ago
|
||
(In reply to comment #10)
> (From update of attachment 270347 [details] [diff] [review])
> I did a quick test of this patch and it appears that if you switch to any other
> view while an extension is being updated the restart button is enabled.
Isn't that what gExtensionsView.hasAttribute("update-operation") is there for? I don't understand how the patch could make a difference for that matter.
![]() |
||
Comment 12•18 years ago
|
||
The logic used for enabling / disabling the restart button changed with the landing of bug 369075.
![]() |
||
Comment 13•18 years ago
|
||
To be more specific, we didn't display a restart button in the other views and now we do. Now the code for enabling / disabling it will need to be updated accordingly.
Assignee | ||
Comment 14•18 years ago
|
||
Attachment #270347 -
Attachment is obsolete: true
Attachment #271807 -
Flags: review?(robert.bugzilla)
![]() |
||
Comment 15•18 years ago
|
||
Comment on attachment 271807 [details] [diff] [review]
gray out restart button, move install button to the left v2
I'm going to only review the portions of this patch that are actually applicable to fix this bug. The majority if not all of the remaining changes can be fixed as those parts of the file are patched.
Updated•18 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Comment 16•18 years ago
|
||
Comment on attachment 271807 [details] [diff] [review]
gray out restart button, move install button to the left v2
Rob asked me to take a look over this. Generally looks good to me however I came across one issue:
>+var gInstalling = 0;
This assumes that there are no install operations ongoing when the add-ons window is opened. In the event that there are the restart buttons will be incorrectly enabled. You need to initialise this to an appropriate value in Startup.
Attachment #271807 -
Flags: review?(robert.bugzilla) → review-
Assignee | ||
Comment 17•18 years ago
|
||
(In reply to comment #16)
> This assumes that there are no install operations ongoing when the add-ons
> window is opened. In the event that there are the restart buttons will be
> incorrectly enabled. You need to initialise this to an appropriate value in
> Startup.
I don't see a direct way to get the number of installing extensions or an easy way to check all the extensions' states. So I'm not sure if I'll be able to address that. If it can be left to a new bug, that would be my preferred way to proceed. It's only remotely related to the original bug anyway, which was about the "installing updates" view specifically.
Comment 18•18 years ago
|
||
This is really just the same issue as that from comment 10 in different circumstances so I think we want to take care of this here. True there is no direct method to just get a count but it is not difficult to work out. Just check all the add-ons for a state property. If they have one and it isn't success or failure then count it as an install.
updateOptionalViews already iterates all the add-ons and is called from Startup so I guess you could potentially use that to initialise the count, it shouldn't matter that it gets recalculated occasionally while the window is open.
Assignee | ||
Comment 19•18 years ago
|
||
(In reply to comment #18)
> This is really just the same issue as that from comment 10 in different
> circumstances so I think we want to take care of this here.
Indeed, your review- wasn't less justified than the one before that. But I think comment 10 already goes beyond what this bug was about.
> updateOptionalViews already iterates all the add-ons and is called from Startup
> so I guess you could potentially use that to initialise the count, it shouldn't
> matter that it gets recalculated occasionally while the window is open.
Ah, I must have missed that function. I'll take a look at it.
Assignee | ||
Comment 20•18 years ago
|
||
Disclaimer: While the previous patch was tested, this one isn't. I'm also not familiar with RDF.
Attachment #271807 -
Attachment is obsolete: true
Attachment #273764 -
Flags: review?(dtownsend)
Comment 21•18 years ago
|
||
Comment on attachment 273764 [details] [diff] [review]
patch v3
This is pretty much there I think, one issue though, since updateOptionalViews can be called while the window is open you need to set gInstalling to 0 at the start of it to avoid doubling up the count.
A couple of other nits:
>+var gInstalling = 0;
Sorry, should have thought of this before, maybe gInstallCount is more descriptive?
>- var elements = ctr.GetElements();
>+ var elements = ctr.GetElements(),
>+ showLocales = false,
>+ showPlugins = false,
>+ showUpdates = false,
>+ showInstalls = false;
Looks like you have tabs or something and please declare with var to avoid strict warnings.
>+ if (state) {
>+ state = state.QueryInterface(Components.interfaces.nsIRDFLiteral);
Better I think is just:
if (state && state instanceof Components.interfaces.nsIRDFLiteral)
>+ if (state.Value && state.Value != "success" && state.Value != "failure")
Shouldn't be any need for the first check of state.Value.
With those changes this will be fine by me, please request the final review from rob since he has to have the final say.
Attachment #273764 -
Flags: review?(dtownsend) → review-
Assignee | ||
Comment 22•18 years ago
|
||
(In reply to comment #21)
> >- var elements = ctr.GetElements();
> >+ var elements = ctr.GetElements(),
> >+ showLocales = false,
> >+ showPlugins = false,
> >+ showUpdates = false,
> >+ showInstalls = false;
>
> Looks like you have tabs or something and please declare with var to avoid
> strict warnings.
It's all the same statement (-> commas at the end of the lines).
Comment 23•18 years ago
|
||
Oops sorry, missed that. My personal preference would be to change it to multiple statements (for the very reason that I think it's less clear), but I guess I'm happy either way.
Assignee | ||
Comment 24•18 years ago
|
||
Attachment #273764 -
Attachment is obsolete: true
Attachment #273773 -
Flags: review?(robert.bugzilla)
Assignee | ||
Comment 25•18 years ago
|
||
bogus whitespace removed
Attachment #273773 -
Attachment is obsolete: true
Attachment #273774 -
Flags: review?(robert.bugzilla)
Attachment #273773 -
Flags: review?(robert.bugzilla)
Assignee | ||
Comment 26•18 years ago
|
||
because of the code removal in updateGlobalCommands(), the loop can be optimized
Attachment #273774 -
Attachment is obsolete: true
Attachment #273779 -
Flags: review?(robert.bugzilla)
Attachment #273774 -
Flags: review?(robert.bugzilla)
Updated•18 years ago
|
Target Milestone: --- → Firefox 3 M8
![]() |
||
Comment 27•18 years ago
|
||
Comment on attachment 273779 [details] [diff] [review]
patch v4
>Index: toolkit/mozapps/extensions/content/extensions.js
>===================================================================
>RCS file: /cvsroot/mozilla/toolkit/mozapps/extensions/content/extensions.js,v
>retrieving revision 1.128
>diff -u -8 -p -r1.128 extensions.js
>--- toolkit/mozapps/extensions/content/extensions.js 19 Jul 2007 18:14:05 -0000 1.128
>+++ toolkit/mozapps/extensions/content/extensions.js 25 Jul 2007 13:23:16 -0000
>...
>@@ -1371,74 +1379,85 @@ function canWriteToLocation(element)
>...
>+ var stateArc = rdfs.GetResource(PREFIX_NS_EM + "state");
>+ var state = ds.GetTarget(e, stateArc, true);
>+ if (state && state instanceof Components.interfaces.nsIRDFLiteral &&
>+ state.Value != "success" && state.Value != "failure")
>+ gInstallCount++;
>+
> if (!showUpdates) {
> var updateURLArc = rdfs.GetResource(PREFIX_NS_EM + "availableUpdateURL");
> var updateURL = ds.GetTarget(e, updateURLArc, true);
> if (updateURL) {
> var updateableArc = rdfs.GetResource(PREFIX_NS_EM + "updateable");
> var updateable = ds.GetTarget(e, updateableArc, true);
> updateable = updateable.QueryInterface(Components.interfaces.nsIRDFLiteral);
> if (updateable.Value == "true")
>- var showUpdates = true;
>+ showUpdates = true;
> }
> }
>
> if (showInstalls)
> continue;
>
> var stateArc = rdfs.GetResource(PREFIX_NS_EM + "state");
> var state = ds.GetTarget(e, stateArc, true);
> if (state)
>- var showInstalls = true;
>+ showInstalls = true;
This should be rewritten into the previous state check to remove the optimization to not check state since we alsways check state for gInstallCount. Something like:
>+ var stateArc = rdfs.GetResource(PREFIX_NS_EM + "state");
>+ var state = ds.GetTarget(e, stateArc, true);
>+ if (state) {
>+ showInstalls = true;
>+ if (state instanceof Components.interfaces.nsIRDFLiteral &&
>+ state.Value != "success" && state.Value != "failure")
>+ gInstallCount++;
>+ }
>+
> if (!showUpdates) {
> var updateURLArc = rdfs.GetResource(PREFIX_NS_EM + "availableUpdateURL");
> var updateURL = ds.GetTarget(e, updateURLArc, true);
> if (updateURL) {
> var updateableArc = rdfs.GetResource(PREFIX_NS_EM + "updateable");
> var updateable = ds.GetTarget(e, updateableArc, true);
> updateable = updateable.QueryInterface(Components.interfaces.nsIRDFLiteral);
> if (updateable.Value == "true")
>- var showUpdates = true;
>+ showUpdates = true;
> }
> }
>
>- if (showInstalls)
>- continue;
>-
>- var stateArc = rdfs.GetResource(PREFIX_NS_EM + "state");
>- var state = ds.GetTarget(e, stateArc, true);
>- if (state)
>- var showInstalls = true;
Almost there... the next one should do it
btw: when you have lots of whitespace changes and I'm the reviewer I'd appreciate a diff -w
Attachment #273779 -
Flags: review?(robert.bugzilla) → review-
Assignee | ||
Comment 28•18 years ago
|
||
Attachment #273779 -
Attachment is obsolete: true
Attachment #275698 -
Flags: review?(robert.bugzilla)
Assignee | ||
Comment 29•18 years ago
|
||
![]() |
||
Comment 30•18 years ago
|
||
Comment on attachment 275698 [details] [diff] [review]
patch v5
Thanks
Attachment #275698 -
Flags: review?(robert.bugzilla) → review+
![]() |
||
Comment 32•18 years ago
|
||
Checked in to trunk
Checking in mozilla/toolkit/mozapps/extensions/content/extensions.js;
/cvsroot/mozilla/toolkit/mozapps/extensions/content/extensions.js,v <-- extensions.js
new revision: 1.130; previous revision: 1.129
done
Checking in mozilla/toolkit/mozapps/extensions/content/extensions.xul;
/cvsroot/mozilla/toolkit/mozapps/extensions/content/extensions.xul,v <-- extensions.xul
new revision: 1.59; previous revision: 1.58
done
Reporter | ||
Comment 33•17 years ago
|
||
Verified fix on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007092705 Minefield/3.0a9pre.
Status: RESOLVED → VERIFIED
Updated•17 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•