Switch suite to use Services.prompt

RESOLVED FIXED in seamonkey2.5

Status

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: iann_bugzilla, Assigned: iann_bugzilla)

Tracking

Trunk
seamonkey2.5
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
Created attachment 545929 [details] [diff] [review]
switch suite to use Services.prompt

We import Services.jsm but we need to make better use of prompt provided by it.
This patch:
* Switches suite code to use prompt provided by Services.jsm
Attachment #545929 - Flags: review?(neil)

Comment 1

7 years ago
Comment on attachment 545929 [details] [diff] [review]
switch suite to use Services.prompt

>     nsPreferences.setUnicharPref("browser.startup.homepage", aURL);
[You haven't done Services.prefs yet, have you?]

>diff --git a/suite/common/downloads/downloadmanager.js b/suite/common/downloads/downloadmanager.js
This is used by the progress dialog which doesn't import Services yet...

>   setWallpaper: function() {
[I keep forgetting to write a proper wallpaper dialog...]

Comment 3

7 years ago
Comment on attachment 545929 [details] [diff] [review]
switch suite to use Services.prompt

>+  if (Services.prompt.confirmEx(window, promptTitle, promptMsg,
>+      (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) +
>+      (Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1),
>+      okButton, null, null, null, {value:0}) == 0)
Not really the right indentation here, but you don't really have much choice, so I'd just go for an extra two spaces.

>     nsPreferences.setUnicharPref("browser.startup.homepage", aURL);
>-  }
Looks like it's missing some reindentation, although in this case you might be changing the line again shortly anyway...

>-    if (!prompts.confirm(null,
>+    if (!Services.prompt.confirm(null,
>                          PlacesUIUtils.getString("bookmarksRestoreAlertTitle"),
>                          PlacesUIUtils.getString("bookmarksRestoreAlert")))
Nit: reindentation

>-                                                promptConfirmButton, null, null, null, {value:0});
>+                                   promptConfirmButton, null, null, null, {value:0}) != 0)
[I'm not actually sure that {value:0} is correct. Isn't it inout boolean?]
(Assignee)

Comment 4

7 years ago
Created attachment 546149 [details] [diff] [review]
switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 6]

Changes since last version:
* Used false instead of zero for calls to confirmEx
* Fixed indentation issues.
Attachment #545929 - Attachment is obsolete: true
Attachment #545929 - Flags: review?(neil)
Attachment #546149 - Flags: review?(neil)

Comment 5

7 years ago
Comment on attachment 546149 [details] [diff] [review]
switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 6]

>     nsPreferences.setUnicharPref("browser.startup.homepage", aURL);
>-  }
> }
I hope this gets reindented eventually ;-)
Attachment #546149 - Flags: review?(neil) → review+
(Assignee)

Comment 6

7 years ago
Comment on attachment 546149 [details] [diff] [review]
switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 6]

http://hg.mozilla.org/comm-central/rev/a87f3182f6f9
Attachment #546149 - Attachment description: switch suite to use Services.prompt with more space and less zeros → switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 5]
(Assignee)

Updated

7 years ago
Attachment #546149 - Attachment description: switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 5] → switch suite to use Services.prompt with more space and less zeros [Checked in: Comment 6]
(Assignee)

Updated

7 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.5
You need to log in before you can comment on or make changes to this bug.