From 75293a475db8d61dddc48b69afe0cf069a7e325d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 May 2013 15:33:15 -0400 Subject: [PATCH] Use nicer alerts for error reporting error messages --- chrome/content/zotero/errorReport.xul | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/errorReport.xul b/chrome/content/zotero/errorReport.xul index b0042802c..67f31b774 100644 --- a/chrome/content/zotero/errorReport.xul +++ b/chrome/content/zotero/errorReport.xul @@ -70,17 +70,32 @@ return; } + var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + if (!xmlhttp.responseXML){ try { if (xmlhttp.status>1000){ - alert(Zotero.getString('errorReport.noNetworkConnection')); + ps.alert( + null, + Zotero.getString('general.error'), + Zotero.getString('errorReport.noNetworkConnection') + ); } else { - alert(Zotero.getString('errorReport.invalidResponseRepository')); + ps.alert( + null, + Zotero.getString('general.error'), + Zotero.getString('errorReport.invalidResponseRepository') + ); } } catch (e){ - alert(Zotero.getString('errorReport.repoCannotBeContacted')); + ps.alert( + null, + Zotero.getString('general.error'), + Zotero.getString('errorReport.repoCannotBeContacted') + ); } wizard.rewind(); @@ -90,7 +105,11 @@ var reported = xmlhttp.responseXML.getElementsByTagName('reported'); if (reported.length != 1) { - alert(Zotero.getString('errorReport.invalidResponseRepository')); + ps.alert( + null, + Zotero.getString('general.error'), + Zotero.getString('errorReport.invalidResponseRepository') + ); wizard.rewind(); return; }