Closed Bug 671572 Opened 9 years ago Closed 9 years ago

Switch suite to use Services.prompt

Categories

(SeaMonkey :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.5

People

(Reporter: iann_bugzilla, Assigned: iann_bugzilla)

References

Details

Attachments

(1 file, 1 obsolete file)

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 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 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?]
Changes since last version:
* Used false instead of zero for calls to confirmEx
* Fixed indentation issues.
Attachment #545929 - Attachment is obsolete: true
Attachment #546149 - Flags: review?(neil)
Attachment #545929 - Flags: review?(neil)
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+
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]
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]
Status: ASSIGNED → RESOLVED
Closed: 9 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.