Now we are using the JPAKEReporter too 1.1.x
authorstefan
Wed, 24 Nov 2010 16:55:43 -0500
branch1.1.x
changeset 297 8f272cde0acec90b82e154d241a71ee86b040c75
parent 296 c5ade286e7aac3f349fb7de4b58db9bab3461a51
child 298 b7cc873547d943bff48829f0ba47d0695f7360be
push id159
push userstefan@arentz.ca
push dateWed, 24 Nov 2010 23:30:14 +0000
Now we are using the JPAKEReporter too
Sources/UserInterface/WelcomePage.h
Sources/UserInterface/WelcomePage.m
--- a/Sources/UserInterface/WelcomePage.h
+++ b/Sources/UserInterface/WelcomePage.h
@@ -14,16 +14,17 @@
  The Original Code is weave-iphone.
  
  The Initial Developer of the Original Code is Mozilla Labs.
  Portions created by the Initial Developer are Copyright (C) 2009
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
  Dan Walkowski <dwalkowski@mozilla.com>
+ Stefan Arentz <stefan@arentz.ca>
  
  Alternatively, the contents of this file may be used under the terms of either
  the GNU General Public License Version 2 or later (the "GPL"), or the GNU
  Lesser General Public License Version 2.1 or later (the "LGPL"), in which case
  the provisions of the GPL or the LGPL are applicable instead of those above.
  If you wish to allow use of your version of this file only under the terms of
  either the GPL or the LGPL, and not to allow others to use your version of
  this file under the terms of the MPL, indicate your decision by deleting the
--- a/Sources/UserInterface/WelcomePage.m
+++ b/Sources/UserInterface/WelcomePage.m
@@ -14,16 +14,17 @@
  The Original Code is weave-iphone.
  
  The Initial Developer of the Original Code is Mozilla Labs.
  Portions created by the Initial Developer are Copyright (C) 2009
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
  Dan Walkowski <dwalkowski@mozilla.com>
+ Stefan Arentz <stefan@arentz.ca>
  
  Alternatively, the contents of this file may be used under the terms of either
  the GNU General Public License Version 2 or later (the "GPL"), or the GNU
  Lesser General Public License Version 2.1 or later (the "LGPL"), in which case
  the provisions of the GPL or the LGPL are applicable instead of those above.
  If you wish to allow use of your version of this file only under the terms of
  either the GPL or the LGPL, and not to allow others to use your version of
  this file under the terms of the MPL, indicate your decision by deleting the
@@ -32,16 +33,19 @@
  recipient may use your version of this file under the terms of any one of the
  MPL, the GPL or the LGPL.
  
  ***** END LICENSE BLOCK *****/
 
 #import "WelcomePage.h"
 #import "AccountHelp.h"
 #import "WeaveAppDelegate.h"
+#import "JPAKEReporter.h"
+
+JPAKEReporter* gSharedReporter = nil;
 
 @implementation WelcomePage
 
 - (void) manualSetupViewControllerDidLogin: (ManualSetupViewController*) vc
 {
 	[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"showedFirstRunPage"];
 	[[NSUserDefaults standardUserDefaults] synchronize];
 
@@ -100,18 +104,26 @@
 	if ([delegate canConnectToInternet] == NO) {
 		UIAlertView* alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString(@"Cannot Setup Sync", @"Cannot Setup Sync")
 			message: NSLocalizedString(@"No internet connection available", "no internet connection")
 				delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"ok") otherButtonTitles:nil];
 		[alert show];
 		[alert release];
 	} else {
 		EasySetupViewController* easySetupViewController = [[EasySetupViewController new] autorelease];
-		if (easySetupViewController != nil) {
-			easySetupViewController.server = [NSURL URLWithString: @"https://stage-setup.services.mozilla.com"];
+		if (easySetupViewController != nil)
+		{
+			NSURL* server = [NSURL URLWithString: @"https://stage-setup.services.mozilla.com"];
+		
+			if (gSharedReporter == nil) {
+				gSharedReporter = [[JPAKEReporter alloc] initWithServer: server];
+			}
+		
+			easySetupViewController.reporter = gSharedReporter;
+			easySetupViewController.server = server;
 			easySetupViewController.delegate = self;
 			[self presentModalViewController: easySetupViewController animated: YES];
 		}
 	}
 }
 
 - (IBAction) presentAccountHelpViewController;
 {