Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue 4814 ("Clear Activation List" needs confirmation)

  • Loading branch information...
commit 4557d9fbb2732eb283d84af06e41b774943a2f51 1 parent c549293
@SebastianZ SebastianZ authored
View
17 extension/content/firebug/chrome/panelActivation.js
@@ -6,10 +6,11 @@ define([
"firebug/chrome/firefox",
"firebug/lib/locale",
"firebug/lib/domplate",
+ "firebug/lib/xpcom",
"firebug/lib/url",
- "firebug/lib/dom",
+ "firebug/lib/dom"
],
-function(Obj, Firebug, Firefox, Locale, Domplate, Url, Dom) {
+function(Obj, Firebug, Firefox, Locale, Domplate, Xpcom, Url, Dom) {
// ************************************************************************************************
// Constants
@@ -18,7 +19,7 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
-
+const prompts = Xpcom.CCSV("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService");
/**
* @module Implements Panel activation logic. A Firebug panel can support activation in order
@@ -222,6 +223,16 @@ Firebug.PanelActivation = Obj.extend(Firebug.Module,
clearAnnotations: function()
{
+ var check = {value: false};
+ var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_YES +
+ prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_NO;
+
+ if (!prompts.confirmEx(Firebug.chrome.window, Locale.$STR("Firebug"),
+ Locale.$STR("annotations.confirm.clear"), flags, "", "", "", null, check) == 0)
+ {
+ return;
+ }
+
Firebug.connection.clearAnnotations();
},
View
5 extension/locale/en-US/firebug.properties
@@ -82,6 +82,11 @@ firebug.menu.Right=Right
firebug.menu.tip.Right=Align Firebug to the right of the user agent window
firebug.uiLocation=Firebug UI Location
firebug.menu.tip.UI_Location=Position of the Firebug user interface
+
+# LOCALIZATION NOTE (annotations.confirm.clear):
+# Used in a confirmation dialog when all Firebug annotations are going to be deleted
+annotations.confirm.clear=Do you want to clear the list of Firebug annotations for all websites?
+
# LOCALIZATION NOTE (firebug_options): Tooltip text used for Firebug icon menu (them left
# most button on Firebug main toolbar)
firebug_options=Firebug Options

5 comments on commit 4557d9f

@fflorent
Owner

This commit makes the FBTest fail (due to the confirm dialog).

Florent

@SebastianZ
Owner

Right, I should have tested this before committing the changes. Let's see if I can change FBTest to let it confirm the dialog.

Sebastian

@SebastianZ
Owner

Should be fixed in b561173.

Sebastian

@fflorent
Owner

Well, that doesn't always work.

Couldn't we rather add an optional force argument to clearAnnotations() so the FBTestFirebug.js file calls this function with force=true ?

@SebastianZ
Owner

Agree. Done in faadf97.

Sebastian

Please sign in to comment.
Something went wrong with that request. Please try again.