Closed Bug 595540 Opened 14 years ago Closed 13 years ago

Show Error Console in Firefox button menu when Error Console is enabled

Categories

(Firefox :: Menus, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 4.0b10

People

(Reporter: JasnaPaka, Assigned: KWierso)

References

Details

Attachments

(1 file, 7 obsolete files)

If you use Windows Vista/7 you see new Firefox button by default. In bug 593538 old Error Console was hidden by default for Firefox 4.0. When you use preference on about:config page and enable Error Console you will see Error console in main menu but not inside Firefox button. I think in this situation should be Error Console available in submenu Developer.
Assignee: nobody → pcvrcek
Status: NEW → ASSIGNED
Attached file Patch (WIP) (obsolete) —
Should work but I didn't test it yet.
Attached patch Patch (WIP) (obsolete) — Splinter Review
Attachment #477733 - Attachment is obsolete: true
Attachment #477734 - Flags: ui-review?(beltzner)
Attachment #477734 - Flags: review?(dolske)
Comment on attachment 477734 [details] [diff] [review]
Patch (WIP)

>+++ b/browser/base/content/browser.js	Thu Sep 23 00:27:03 2010 +0200
...
>   if (consoleEnabled) {
>     document.getElementById("javascriptConsole").hidden = false;
>     document.getElementById("key_errorConsole").removeAttribute("disabled");
>+    let appMenuJavaScriptConsole = document.getElementById("appmenu_javascriptConsole");
>+    if (appMenuJavaScriptConsole)
>+      appMenuJavaScriptConsole.setAttribute("hidden", false);

Nit: Just use ".hidden = false" as is done a few lines up.


>+++ b/browser/base/content/browser.xul	Thu Sep 23 00:27:03 2010 +0200
...
>+              <menuitem id="appmenu_javascriptConsole"
>+                        hidden="true"
>+                        label="&errorConsoleCmd.label;"
>+                        accesskey="&errorConsoleCmd.accesskey;"
>+                        key="key_errorConsole"
>+                        oncommand="toJavaScriptConsole();"/>  

Alas, the "C" accesskey is already used by the Character Encoding menu here.

But the simple fix is to just remove accesskey for what you're adding, since we're generally not using accesskeys in the appmenu anyway. [Character Encoding shoudn't really have one either, but it's #included from a file shared with the normal menubar.]

r+ with these two changes.
Attachment #477734 - Flags: review?(dolske) → review+
Attached file Patch (fixed) (obsolete) —
Patch where both comments are fixed.
Attached patch Patch (fixed) (obsolete) — Splinter Review
Attachment #479764 - Attachment is obsolete: true
Attachment #477734 - Flags: ui-review?(beltzner) → ui-review?(faaborg)
Attachment #477734 - Flags: ui-review?(faaborg) → ui-review+
Comment on attachment 477734 [details] [diff] [review]
Patch (WIP)

>diff -r 0e43f7a9d7a8 browser/base/content/browser.js
>--- a/browser/base/content/browser.js	Wed Sep 22 14:33:54 2010 -0700
>+++ b/browser/base/content/browser.js	Thu Sep 23 00:27:03 2010 +0200
>@@ -1594,16 +1594,19 @@ function delayedStartup(isLoadingBlank, 
>       appMenuInspect.setAttribute("hidden", false);
>   }
> 
>   // Enable Error Console?
>   let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled");
>   if (consoleEnabled) {
>     document.getElementById("javascriptConsole").hidden = false;
>     document.getElementById("key_errorConsole").removeAttribute("disabled");
>+    let appMenuJavaScriptConsole = document.getElementById("appmenu_javascriptConsole");
>+    if (appMenuJavaScriptConsole)
>+      appMenuJavaScriptConsole.setAttribute("hidden", false);

Make this:

#ifdef MENUBAR_CAN_AUTOHIDE
    document.getElementById("appmenu_javascriptConsole").hidden = false;
#endif

Also, please change the id from appmenu_javascriptConsole to appmenu_errorConsole.
Attachment #477734 - Flags: approval2.0?
Carrying forward review and ui-review, asking for approval.

All of the app menu contents have been moved to browser-appmenu.inc in Bug 585370, so I moved this patch's addition to that file instead of browser.xul.
Attachment #495263 - Flags: ui-review+
Attachment #495263 - Flags: review+
Attachment #495263 - Flags: approval2.0?
Thanks for updated patch! My notebook for Mozilla work is currently broken so I could not provide updated patch.
Assignee: pcvrcek → kwierso
Comment on attachment 495263 [details] [diff] [review]
updated to tip, addressing dao's comments

You changed the id here (indentation is off, btw):

>   if (consoleEnabled) {
>     document.getElementById("javascriptConsole").hidden = false;
>     document.getElementById("key_errorConsole").removeAttribute("disabled");
>+    #ifdef MENUBAR_CAN_AUTOHIDE
>+        document.getElementById("appmenu_errorConsole").hidden = false;
>+    #endif

but not here:

>+          <menuitem id="appmenu_javascriptConsole"
Attached patch oops (obsolete) — Splinter Review
I knew I'd find some way of messing up in only 8 lines of code...

Oops.

Let's try this again?
Attachment #495263 - Attachment is obsolete: true
Attachment #495312 - Flags: ui-review+
Attachment #495312 - Flags: review+
Attachment #495312 - Flags: approval2.0?
Attachment #495263 - Flags: approval2.0?
Attached patch oops2 (obsolete) — Splinter Review
(In reply to comment #9)
> (indentation is off, btw)

Oh hey, reading is important. 

Sorry for all the bugspam.
Attachment #495312 - Attachment is obsolete: true
Attachment #495313 - Flags: ui-review+
Attachment #495313 - Flags: review+
Attachment #495313 - Flags: approval2.0?
Comment on attachment 495313 [details] [diff] [review]
oops2

Indentation is still off. The patch also won't work, because you indented the ifdef.
Attachment #495313 - Flags: review-
Attachment #495313 - Flags: review+
Attachment #495313 - Flags: approval2.0?
Attachment #479766 - Attachment is obsolete: true
Attached patch oops3Splinter Review
Oh right.
Attachment #495313 - Attachment is obsolete: true
Attachment #495335 - Flags: review?(dao)
Attachment #495335 - Flags: approval2.0?
Comment on attachment 495335 [details] [diff] [review]
oops3

Looks good, thanks.
Attachment #495335 - Flags: review?(dao) → review+
Attachment #477734 - Attachment is obsolete: true
Comment on attachment 495335 [details] [diff] [review]
oops3

a=beltzner
Attachment #495335 - Flags: approval2.0? → approval2.0+
Whiteboard: [checkin-needed]
Keywords: checkin-needed
Whiteboard: [checkin-needed]
http://hg.mozilla.org/mozilla-central/rev/d66366f42efa
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Summary: Show Error Console in Firefox button when Error Console is enabled → Show Error Console in Firefox button menu when Error Console is enabled
Target Milestone: --- → Firefox 4.0b10
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: