NNTP cancel dialog: Show buttons Yes/No instead of OK/Cancel. Bug 168231, r=BenB, r=neil, sr=bienvenu, ui-r=clarkbw
authorEdmund Wong <ewong@pw-wspx.org>
Thu, 18 Mar 2010 12:44:59 +0100
changeset 5205 25591e6c9e1dd72230b03f7d432ea66748b6c86b
parent 5204 7b60a657c20cd1055afe1b0c3308b1e224cab034
child 5206 5ad4853677c70f4f8124b3634757b418b2d70713
push idunknown
push userunknown
push dateunknown
reviewersBenB, neil, bienvenu, clarkbw
bugs168231
NNTP cancel dialog: Show buttons Yes/No instead of OK/Cancel. Bug 168231, r=BenB, r=neil, sr=bienvenu, ui-r=clarkbw
mailnews/news/src/nsNNTPProtocol.cpp
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -4098,23 +4098,25 @@ reported here */
   else
     NNTP_LOG_NOTE("CANCELCHK supported, don't do the us vs. them test");
 
   // QA needs to be able to disable this confirm dialog, for the automated tests.  see bug #31057
   rv = prefBranch->GetBoolPref(PREF_NEWS_CANCEL_CONFIRM, &requireConfirmationForCancel);
   if (NS_FAILED(rv) || requireConfirmationForCancel) {
     /* Last chance to cancel the cancel.*/
     GetNewsStringByName("cancelConfirm", getter_Copies(confirmText));
-    rv = dialog->Confirm(nsnull, confirmText.get(), &confirmCancelResult);
-    // XXX:  todo, check rv?
+    rv = dialog->ConfirmEx(nsnull, confirmText.get(), nsIPrompt::STD_YES_NO_BUTTONS,
+                           nsnull, nsnull, nsnull, nsnull, nsnull, &confirmCancelResult);
+    if (NS_FAILED(rv))
+    	confirmCancelResult = 1; // Default to No.
   }
   else
-    confirmCancelResult = 1;
-
-  if (confirmCancelResult != 1) {
+    confirmCancelResult = 0; // Default to Yes.
+    
+  if (confirmCancelResult != 0) {
       // they cancelled the cancel
       status = MK_NNTP_NOT_CANCELLED;
       failure = PR_TRUE;
       goto FAIL;
   }
 
   if (!subject || !body)
   {