diff --git a/DDWRT-Monitor.xcodeproj/project.pbxproj b/DDWRT-Monitor.xcodeproj/project.pbxproj index 4d449f2..afb17a2 100644 --- a/DDWRT-Monitor.xcodeproj/project.pbxproj +++ b/DDWRT-Monitor.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 96DEDE2A139486BB00EF8526 /* WRTStatusClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DEDE29139486BB00EF8526 /* WRTStatusClient.m */; }; - F215851013930D1700853C55 /* WRTRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = F215850F13930D1700853C55 /* WRTRequest.m */; }; F215851213931CF000853C55 /* MenuIconDisabled.png in Resources */ = {isa = PBXBuildFile; fileRef = F215851113931CF000853C55 /* MenuIconDisabled.png */; }; F2511F5C13914A120053990C /* MenuIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = F2511F5B13914A120053990C /* MenuIcon.png */; }; F2511FFB1391543E0053990C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2511FFA1391543E0053990C /* WebKit.framework */; }; @@ -35,8 +34,6 @@ 8D1107320486CEB800E47090 /* DDWRT-Monitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DDWRT-Monitor.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 96DEDE28139486BB00EF8526 /* WRTStatusClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRTStatusClient.h; sourceTree = ""; }; 96DEDE29139486BB00EF8526 /* WRTStatusClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WRTStatusClient.m; sourceTree = ""; }; - F215850E13930D1700853C55 /* WRTRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WRTRequest.h; sourceTree = ""; }; - F215850F13930D1700853C55 /* WRTRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WRTRequest.m; sourceTree = ""; }; F215851113931CF000853C55 /* MenuIconDisabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MenuIconDisabled.png; sourceTree = ""; }; F2511F5B13914A120053990C /* MenuIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MenuIcon.png; sourceTree = ""; }; F2511FFA1391543E0053990C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; @@ -63,8 +60,6 @@ 256AC3D90F4B6AC300CF3369 /* DDWRT_MonitorAppDelegate.m */, 96DEDE28139486BB00EF8526 /* WRTStatusClient.h */, 96DEDE29139486BB00EF8526 /* WRTStatusClient.m */, - F215850E13930D1700853C55 /* WRTRequest.h */, - F215850F13930D1700853C55 /* WRTRequest.m */, ); name = Classes; sourceTree = ""; @@ -207,7 +202,6 @@ files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, 256AC3DA0F4B6AC300CF3369 /* DDWRT_MonitorAppDelegate.m in Sources */, - F215851013930D1700853C55 /* WRTRequest.m in Sources */, 96DEDE2A139486BB00EF8526 /* WRTStatusClient.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/DDWRT-Monitor.xcodeproj/project.xcworkspace/xcuserdata/spike.xcuserdatad/UserInterfaceState.xcuserstate b/DDWRT-Monitor.xcodeproj/project.xcworkspace/xcuserdata/spike.xcuserdatad/UserInterfaceState.xcuserstate index 17cdb3c..ba0439c 100644 --- a/DDWRT-Monitor.xcodeproj/project.xcworkspace/xcuserdata/spike.xcuserdatad/UserInterfaceState.xcuserstate +++ b/DDWRT-Monitor.xcodeproj/project.xcworkspace/xcuserdata/spike.xcuserdatad/UserInterfaceState.xcuserstate @@ -40,7 +40,7 @@ CF$UID - 353 + 349 @@ -2897,9 +2897,9 @@ - 328577831.65647697 - {5038, 1062} - {5793, 0} + 328577902.92416799 + {0, 1089} + {2472, 0} $class @@ -2945,7 +2945,7 @@ - 328502359.63207901 + 328577897.30594701 {0, 871} {296, 89} @@ -3720,14 +3720,6 @@ CF$UID 347 - - CF$UID - 349 - - - CF$UID - 351 - @@ -3837,42 +3829,6 @@ 346 - file://localhost/Users/spike/Downloads/DDWRT-Monitor/WRTRequest.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 348 - - - file://localhost/Users/spike/Downloads/DDWRT-Monitor/WRTRequest.h - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 350 - - file://localhost/Users/spike/Downloads/DDWRT-Monitor/English.lproj/InfoPlist.strings $class @@ -3888,7 +3844,7 @@ NS.relative CF$UID - 352 + 348 file://localhost/Users/spike/Downloads/DDWRT-Monitor/DDWRT_Monitor_Prefix.pch @@ -3906,7 +3862,7 @@ CF$UID - 354 + 350 CF$UID @@ -3933,11 +3889,11 @@ CF$UID - 355 + 351 CF$UID - 477 + 464 CF$UID @@ -3945,11 +3901,11 @@ CF$UID - 354 + 350 CF$UID - 478 + 465 @@ -4007,19 +3963,19 @@ CF$UID - 356 + 352 CF$UID - 357 + 353 CF$UID - 363 + 359 CF$UID - 413 + 407 CF$UID @@ -4027,7 +3983,7 @@ CF$UID - 421 + 415 @@ -4049,7 +4005,7 @@ CF$UID - 358 + 354 @@ -4063,11 +4019,11 @@ CF$UID - 359 + 355 CF$UID - 361 + 357 @@ -4096,7 +4052,7 @@ CF$UID - 360 + 356 @@ -4126,7 +4082,7 @@ CF$UID - 362 + 358 @@ -4145,11 +4101,11 @@ CF$UID - 364 + 360 CF$UID - 365 + 361 CF$UID @@ -4157,22 +4113,22 @@ CF$UID - 366 + 362 NS.objects CF$UID - 367 + 363 CF$UID - 378 + 372 CF$UID - 382 + 376 CF$UID @@ -4180,7 +4136,7 @@ CF$UID - 395 + 389 @@ -4228,7 +4184,7 @@ CF$UID - 368 + 364 CF$UID @@ -4248,11 +4204,11 @@ CF$UID - 369 + 365 CF$UID - 373 + 366 @@ -4264,37 +4220,8 @@ 13 NS.objects - - - CF$UID - 370 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 371 - - - CF$UID - 65 - - - CF$UID - 372 - - + - DDWRT-Monitor - DDWRT_MonitorAppDelegate.m $class @@ -4305,19 +4232,19 @@ CF$UID - 374 + 367 CF$UID - 375 + 369 CF$UID - 376 + 370 CF$UID - 377 + 371 @@ -4331,10 +4258,11 @@ CF$UID - 371 + 368 + DDWRT-Monitor $class @@ -4345,7 +4273,7 @@ CF$UID - 371 + 368 CF$UID @@ -4363,7 +4291,7 @@ CF$UID - 371 + 368 CF$UID @@ -4381,7 +4309,7 @@ CF$UID - 371 + 368 CF$UID @@ -4399,15 +4327,15 @@ CF$UID - 379 + 373 CF$UID - 380 + 374 CF$UID - 381 + 375 NS.objects @@ -4439,31 +4367,31 @@ CF$UID - 383 + 377 CF$UID - 384 + 378 CF$UID - 385 + 379 CF$UID - 386 + 380 CF$UID - 387 + 381 CF$UID - 388 + 382 CF$UID - 389 + 383 NS.objects @@ -4482,11 +4410,11 @@ CF$UID - 390 + 384 CF$UID - 391 + 385 CF$UID @@ -4494,7 +4422,7 @@ CF$UID - 393 + 387 @@ -4510,7 +4438,7 @@ $class CF$UID - 392 + 386 NSRangeCount 0 @@ -4528,7 +4456,7 @@ $class CF$UID - 394 + 388 NSRangeCount 0 @@ -4553,43 +4481,43 @@ CF$UID - 396 + 390 CF$UID - 397 + 391 CF$UID - 398 + 392 CF$UID - 399 + 393 CF$UID - 400 + 394 CF$UID - 401 + 395 CF$UID - 402 + 396 CF$UID - 403 + 397 CF$UID - 404 + 398 CF$UID - 405 + 399 NS.objects @@ -4600,19 +4528,19 @@ CF$UID - 406 + 400 CF$UID - 407 + 401 CF$UID - 409 + 403 CF$UID - 410 + 404 CF$UID @@ -4624,7 +4552,7 @@ CF$UID - 411 + 405 CF$UID @@ -4632,7 +4560,7 @@ CF$UID - 412 + 406 @@ -4651,7 +4579,7 @@ $class CF$UID - 408 + 402 NS.objects @@ -4670,7 +4598,7 @@ $class CF$UID - 408 + 402 NS.objects @@ -4688,7 +4616,7 @@ $class CF$UID - 408 + 402 NS.objects @@ -4697,7 +4625,7 @@ $class CF$UID - 408 + 402 NS.objects @@ -4719,7 +4647,7 @@ CF$UID - 414 + 408 @@ -4733,15 +4661,15 @@ CF$UID - 415 + 409 CF$UID - 417 + 411 CF$UID - 419 + 413 @@ -4770,7 +4698,7 @@ CF$UID - 416 + 410 @@ -4800,7 +4728,7 @@ CF$UID - 418 + 412 @@ -4830,7 +4758,7 @@ CF$UID - 420 + 414 @@ -4880,15 +4808,15 @@ CF$UID - 422 + 416 CF$UID - 434 + 424 CF$UID - 455 + 442 CF$UID @@ -4900,11 +4828,11 @@ CF$UID - 470 + 457 CF$UID - 476 + 463 CF$UID @@ -4926,12 +4854,12 @@ primaryEditorContextNode CF$UID - 423 + 417 rootLayoutTreeNode CF$UID - 432 + 422 @@ -4950,14 +4878,14 @@ documentArchivableRepresentation CF$UID - 424 + 418 orientation 0 parent CF$UID - 432 + 422 @@ -4969,22 +4897,22 @@ DocumentLocation CF$UID - 430 + 421 DomainIdentifier CF$UID - 87 + 0 IdentifierPath CF$UID - 425 + 419 IndexOfDocumentIdentifier CF$UID - 26 + 420 @@ -4994,58 +4922,9 @@ 13 NS.objects - - - CF$UID - 426 - - - CF$UID - 427 - - - CF$UID - 428 - - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 372 - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 65 - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 429 - + - DDWRT-Monitor + 9223372036854775807 $class @@ -5055,7 +4934,7 @@ documentURL CF$UID - 431 + 336 timestamp @@ -5063,15 +4942,6 @@ 0 - - $class - - CF$UID - 97 - - NS.string - file://localhost/Users/spike/Downloads/DDWRT-Monitor/DDWRT_MonitorAppDelegate.m - $class @@ -5081,7 +4951,7 @@ children CF$UID - 433 + 423 contentType 0 @@ -5108,7 +4978,7 @@ CF$UID - 423 + 417 @@ -5129,7 +4999,7 @@ CF$UID - 435 + 425 @@ -5150,7 +5020,7 @@ CF$UID - 436 + 426 @@ -5179,7 +5049,7 @@ CF$UID - 437 + 427 CF$UID @@ -5187,7 +5057,7 @@ CF$UID - 453 + 440 @@ -5201,7 +5071,7 @@ CF$UID - 438 + 428 @@ -5246,23 +5116,23 @@ CF$UID - 439 + 429 CF$UID - 440 + 430 CF$UID - 446 + 433 CF$UID - 450 + 437 CF$UID - 372 + 438 CF$UID @@ -5270,7 +5140,7 @@ CF$UID - 451 + 439 @@ -5284,22 +5154,22 @@ DocumentLocation CF$UID - 430 + 421 DomainIdentifier CF$UID - 87 + 0 IdentifierPath CF$UID - 441 + 431 IndexOfDocumentIdentifier CF$UID - 26 + 432 @@ -5309,58 +5179,9 @@ 13 NS.objects - - - CF$UID - 442 - - - CF$UID - 443 - - - CF$UID - 444 - - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 372 - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 65 - - - - $class - - CF$UID - 90 - - Identifier - - CF$UID - 445 - + - DDWRT-Monitor + 9223372036854775807 $class @@ -5390,11 +5211,11 @@ CF$UID - 447 + 434 CF$UID - 448 + 435 CF$UID @@ -5402,14 +5223,15 @@ CF$UID - 449 + 436 - 328577831.66576701 - {5038, 1062} - {5793, 0} - -showBandwidthViewer: + 328577902.926952 + {0, 1089} + {2472, 0} + @implementation DDWRT_MonitorAppDelegate + DDWRT_MonitorAppDelegate.m $class @@ -5424,10 +5246,9 @@ NS.relative CF$UID - 452 + 336 - file://localhost/Users/spike/Downloads/DDWRT-Monitor/DDWRT_MonitorAppDelegate.m $class @@ -5438,7 +5259,7 @@ CF$UID - 454 + 441 @@ -5484,11 +5305,11 @@ CF$UID - 456 + 443 CF$UID - 457 + 444 CF$UID @@ -5496,11 +5317,11 @@ CF$UID - 458 + 445 CF$UID - 464 + 451 @@ -5563,7 +5384,7 @@ CF$UID - 459 + 446 @@ -5577,11 +5398,11 @@ CF$UID - 460 + 447 CF$UID - 462 + 449 @@ -5610,7 +5431,7 @@ CF$UID - 461 + 448 @@ -5640,7 +5461,7 @@ CF$UID - 463 + 450 @@ -5662,7 +5483,7 @@ CF$UID - 465 + 452 @@ -5676,11 +5497,11 @@ CF$UID - 466 + 453 CF$UID - 468 + 455 @@ -5709,7 +5530,7 @@ CF$UID - 467 + 454 @@ -5739,7 +5560,7 @@ CF$UID - 469 + 456 @@ -5761,7 +5582,7 @@ CF$UID - 471 + 458 @@ -5775,11 +5596,11 @@ CF$UID - 472 + 459 CF$UID - 474 + 461 @@ -5808,7 +5629,7 @@ CF$UID - 473 + 460 @@ -5838,7 +5659,7 @@ CF$UID - 475 + 462 @@ -5864,7 +5685,7 @@ CF$UID - 354 + 350 diff --git a/WRTRequest.h b/WRTRequest.h deleted file mode 100644 index d926592..0000000 --- a/WRTRequest.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// WRTRequest.h -// DDWRT-Monitor -// -// Created by Matthieu Lalonde on 11-05-29. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - - -@interface WRTRequest : NSObject { - BOOL wrtReachable; -@private - NSString *username; - NSString *password; - NSMutableData *receivedData; - NSURLRequest *theRequest; - NSURLConnection *theConnection; - id delegate; - SEL callback; - SEL errorCallback; -} - -@property(nonatomic, retain) NSString *username; -@property(nonatomic, retain) NSString *password; -@property(nonatomic, retain) NSMutableData *receivedData; -@property(nonatomic, retain) id delegate; -@property(nonatomic) SEL callback; -@property(nonatomic) SEL errorCallback; - --(void)doRequest:(id)requestDelegate requestSelector:(SEL)requestSelector uri:(NSString *)uri; --(void)request:(NSURL *) url; - -@end diff --git a/WRTRequest.m b/WRTRequest.m deleted file mode 100644 index 1108545..0000000 --- a/WRTRequest.m +++ /dev/null @@ -1,127 +0,0 @@ -// -// WRTRequest.m -// DDWRT-Monitor -// -// Created by Matthieu Lalonde on 11-05-29. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import "WRTRequest.h" - - -@implementation WRTRequest - -@synthesize username; -@synthesize password; -@synthesize receivedData; -@synthesize delegate; -@synthesize callback; -@synthesize errorCallback; - -- (id)init -{ - self = [super init]; - if (self) { - // Initialization code here. - wrtReachable = false; - } - - return self; -} - -- (void)dealloc -{ - [super dealloc]; -} - --(void)doRequest:(id)requestDelegate requestSelector:(SEL)requestSelector uri:(NSString *)uri -{ - self.delegate = requestDelegate; - self.callback = requestSelector; - - NSString *urlAddress = [NSString stringWithFormat:@"https://%@:%d/%@", - [[NSUserDefaults standardUserDefaults] stringForKey:@"hostname"], - [[NSUserDefaults standardUserDefaults] integerForKey:@"port"], - uri]; - - NSURL *url = [NSURL URLWithString:urlAddress]; - - [self request:url]; -} - --(void)request:(NSURL *) url -{ - theRequest = [[NSMutableURLRequest alloc] initWithURL:url]; - theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; - - if (theConnection) { - receivedData = [[NSMutableData data] retain]; - } else { - // TODO return error - } -} - --(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge -{ - NSLog(@"1"); - if ([challenge previousFailureCount] == 0) { - NSLog(@"1.1.1"); - NSURLCredential *newCredential; - newCredential = [NSURLCredential credentialWithUser:@"user" password:@"password" persistence:NSURLCredentialPersistenceForSession]; - - NSLog(@"1.1.2"); - [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge]; - } else { - NSLog(@"1.2"); - [[challenge sender] cancelAuthenticationChallenge:challenge]; - // TODO Pop up authentication error - NSLog(@"Invalid Username or Password"); - } -} - --(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response -{ - NSLog(@"2"); - [receivedData setLength:0]; -} - --(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data -{ - NSLog(@"3"); - [receivedData appendData:data]; -} - --(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error -{ - NSLog(@"4"); - [connection release]; - [receivedData release]; - [theRequest release]; - - //TODO Return alert - NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSErrorFailingURLStringKey]); - - if (errorCallback) { - [delegate performSelector:errorCallback withObject:error]; - } - -} - --(void)connectionDidFinishLoading:(NSURLConnection *)connection -{ - NSLog(@"5"); - // TODO: Return the data - if (delegate && callback) { - if ([delegate respondsToSelector:self.callback]) { - [delegate performSelector:self.callback withObject:receivedData]; - } else { - // TODO: Return no data - NSLog(@"No response data from delegate"); - } - } - - [theConnection release]; - [receivedData release]; - [theRequest release]; -} -@end