diff --git a/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj b/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj index 2f9e507..efb6266 100644 --- a/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj +++ b/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj @@ -33,6 +33,11 @@ D5DB80A71792F4DE0081662A /* OZLProjectListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5DB80A51792F4DE0081662A /* OZLProjectListViewController.xib */; }; D5DB80AC1792F6980081662A /* OZLProjectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D5DB80AA1792F6980081662A /* OZLProjectViewController.m */; }; D5DB80AD1792F6980081662A /* OZLProjectViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5DB80AB1792F6980081662A /* OZLProjectViewController.xib */; }; + D5DB80B1179300B90081662A /* OZLNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = D5DB80B0179300B90081662A /* OZLNetwork.m */; }; + D5DB80B51793016B0081662A /* OZLAccountViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D5DB80B31793016B0081662A /* OZLAccountViewController.m */; }; + D5DB80B61793016B0081662A /* OZLAccountViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5DB80B41793016B0081662A /* OZLAccountViewController.xib */; }; + D5DB80BA17930C830081662A /* OZLNetworkBase.m in Sources */ = {isa = PBXBuildFile; fileRef = D5DB80B917930C830081662A /* OZLNetworkBase.m */; }; + D5DB80BD17930ECD0081662A /* OZLSingleton.m in Sources */ = {isa = PBXBuildFile; fileRef = D5DB80BC17930ECD0081662A /* OZLSingleton.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -82,6 +87,15 @@ D5DB80A91792F6980081662A /* OZLProjectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLProjectViewController.h; path = ViewControllers/OZLProjectViewController.h; sourceTree = ""; }; D5DB80AA1792F6980081662A /* OZLProjectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLProjectViewController.m; path = ViewControllers/OZLProjectViewController.m; sourceTree = ""; }; D5DB80AB1792F6980081662A /* OZLProjectViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = OZLProjectViewController.xib; path = ViewControllers/OZLProjectViewController.xib; sourceTree = ""; }; + D5DB80AF179300B90081662A /* OZLNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLNetwork.h; path = Utils/OZLNetwork.h; sourceTree = ""; }; + D5DB80B0179300B90081662A /* OZLNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLNetwork.m; path = Utils/OZLNetwork.m; sourceTree = ""; }; + D5DB80B21793016B0081662A /* OZLAccountViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLAccountViewController.h; path = ViewControllers/OZLAccountViewController.h; sourceTree = ""; }; + D5DB80B31793016B0081662A /* OZLAccountViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLAccountViewController.m; path = ViewControllers/OZLAccountViewController.m; sourceTree = ""; }; + D5DB80B41793016B0081662A /* OZLAccountViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = OZLAccountViewController.xib; path = ViewControllers/OZLAccountViewController.xib; sourceTree = ""; }; + D5DB80B817930C830081662A /* OZLNetworkBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLNetworkBase.h; path = Utils/OZLNetworkBase.h; sourceTree = ""; }; + D5DB80B917930C830081662A /* OZLNetworkBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLNetworkBase.m; path = Utils/OZLNetworkBase.m; sourceTree = ""; }; + D5DB80BB17930ECD0081662A /* OZLSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLSingleton.h; path = Utils/OZLSingleton.h; sourceTree = ""; }; + D5DB80BC17930ECD0081662A /* OZLSingleton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLSingleton.m; path = Utils/OZLSingleton.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -129,6 +143,7 @@ D5DB805F1792F2BF0081662A /* RedmineMobile */ = { isa = PBXGroup; children = ( + D5DB80AE1793008F0081662A /* Utils */, D5DB80A81792F4E40081662A /* ViewControllers */, D5DB80681792F2BF0081662A /* OZLAppDelegate.h */, D5DB80691792F2BF0081662A /* OZLAppDelegate.m */, @@ -226,10 +241,26 @@ D5DB80A91792F6980081662A /* OZLProjectViewController.h */, D5DB80AA1792F6980081662A /* OZLProjectViewController.m */, D5DB80AB1792F6980081662A /* OZLProjectViewController.xib */, + D5DB80B21793016B0081662A /* OZLAccountViewController.h */, + D5DB80B31793016B0081662A /* OZLAccountViewController.m */, + D5DB80B41793016B0081662A /* OZLAccountViewController.xib */, ); name = ViewControllers; sourceTree = ""; }; + D5DB80AE1793008F0081662A /* Utils */ = { + isa = PBXGroup; + children = ( + D5DB80AF179300B90081662A /* OZLNetwork.h */, + D5DB80B0179300B90081662A /* OZLNetwork.m */, + D5DB80B817930C830081662A /* OZLNetworkBase.h */, + D5DB80B917930C830081662A /* OZLNetworkBase.m */, + D5DB80BB17930ECD0081662A /* OZLSingleton.h */, + D5DB80BC17930ECD0081662A /* OZLSingleton.m */, + ); + name = Utils; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -288,6 +319,7 @@ D5DB80701792F2BF0081662A /* Default-568h@2x.png in Resources */, D5DB80A71792F4DE0081662A /* OZLProjectListViewController.xib in Resources */, D5DB80AD1792F6980081662A /* OZLProjectViewController.xib in Resources */, + D5DB80B61793016B0081662A /* OZLAccountViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -315,6 +347,10 @@ D5DB80A21792F3EE0081662A /* PPRevealSideViewController.m in Sources */, D5DB80A61792F4DE0081662A /* OZLProjectListViewController.m in Sources */, D5DB80AC1792F6980081662A /* OZLProjectViewController.m in Sources */, + D5DB80B1179300B90081662A /* OZLNetwork.m in Sources */, + D5DB80B51793016B0081662A /* OZLAccountViewController.m in Sources */, + D5DB80BA17930C830081662A /* OZLNetworkBase.m in Sources */, + D5DB80BD17930ECD0081662A /* OZLSingleton.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/RedmineMobile/RedmineMobile/Utils/OZLNetwork.h b/RedmineMobile/RedmineMobile/Utils/OZLNetwork.h new file mode 100644 index 0000000..e534f03 --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLNetwork.h @@ -0,0 +1,15 @@ +// +// OZLNetwork.h +// RedmineMobile +// +// Created by Lee Zhijie on 7/14/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import + +@interface OZLNetwork : NSObject + ++(void)getProjectListWithBlock:(void (^)(NSDictionary *result, NSError *error))block; + +@end diff --git a/RedmineMobile/RedmineMobile/Utils/OZLNetwork.m b/RedmineMobile/RedmineMobile/Utils/OZLNetwork.m new file mode 100644 index 0000000..13dd4d0 --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLNetwork.m @@ -0,0 +1,38 @@ +// +// OZLNetwork.m +// RedmineMobile +// +// Created by Lee Zhijie on 7/14/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import "OZLNetwork.h" +#import "OZLNetworkBase.h" +#import "AFHTTPRequestOperation.h" + +@implementation OZLNetwork + ++(void)getProjectListWithBlock:(void (^)(NSDictionary *result, NSError *error))block +{ + NSString* path = @"/projects.json"; + NSDictionary* params = [[NSDictionary alloc] initWithObjectsAndKeys: nil]; + [[OZLNetworkBase sharedClient] getPath:path parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { + + if (block) { + NSLog(@"the repsonse:%@",responseObject); + block(responseObject,nil); + } + + + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { + + + if (block) { + block(nil, error); + } + + }]; +} + + +@end diff --git a/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.h b/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.h new file mode 100644 index 0000000..78706df --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.h @@ -0,0 +1,16 @@ +// +// OZLNetworkBase.h +// RedmineMobile +// +// Created by Lee Zhijie on 7/15/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import +#import "AFHTTPClient.h" + +@interface OZLNetworkBase : AFHTTPClient + ++(OZLNetworkBase *)sharedClient; + +@end diff --git a/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.m b/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.m new file mode 100644 index 0000000..2ceaa7a --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLNetworkBase.m @@ -0,0 +1,42 @@ +// +// OZLNetworkBase.m +// RedmineMobile +// +// Created by Lee Zhijie on 7/15/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import "OZLNetworkBase.h" +#import "AFJSONRequestOperation.h" +#import "OZLSingleton.h" + + +@implementation OZLNetworkBase + ++(OZLNetworkBase *)sharedClient +{ + static OZLNetworkBase *_sharedClient = nil; + if (_sharedClient == nil) { + + _sharedClient = [[OZLNetworkBase alloc] initWithBaseURL:[NSURL URLWithString:[[OZLSingleton sharedInstance] redmineHomeURL]]]; + + }; + + return _sharedClient; +} + +- (id)initWithBaseURL:(NSURL *)url { + self = [super initWithBaseURL:url]; + if (!self) { + return nil; + } + + [self registerHTTPOperationClass:[AFJSONRequestOperation class]]; + + // Accept HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 + [self setDefaultHeader:@"Accept" value:@"application/json"]; + + return self; +} + +@end diff --git a/RedmineMobile/RedmineMobile/Utils/OZLSingleton.h b/RedmineMobile/RedmineMobile/Utils/OZLSingleton.h new file mode 100644 index 0000000..268dcdf --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLSingleton.h @@ -0,0 +1,20 @@ +// +// OZLSingleton.h +// RedmineMobile +// +// Created by Lee Zhijie on 7/15/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import + +@interface OZLSingleton : NSObject + ++(OZLSingleton*) sharedInstance; + +//network +@property(nonatomic,strong) NSString* redmineHomeURL; +@property(nonatomic,strong) NSString* redmineUserKey; + + +@end diff --git a/RedmineMobile/RedmineMobile/Utils/OZLSingleton.m b/RedmineMobile/RedmineMobile/Utils/OZLSingleton.m new file mode 100644 index 0000000..eaf2a44 --- /dev/null +++ b/RedmineMobile/RedmineMobile/Utils/OZLSingleton.m @@ -0,0 +1,56 @@ +// +// OZLSingleton.m +// RedmineMobile +// +// Created by Lee Zhijie on 7/15/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import "OZLSingleton.h" + +@implementation OZLSingleton + +NSString* USER_DEFUALTS_REDMINE_HOME_URL = @"USER_DEFUALTS_REDMINE_HOME_URL"; +NSString* USER_DEFUALTS_REDMINE_USER_KEY = @"USER_DEFUALTS_REDMINE_USER_KEY"; + + +static OZLSingleton* sharedInstance = nil; ++(OZLSingleton*) sharedInstance +{ + if (sharedInstance == nil) { + sharedInstance = [[OZLSingleton alloc] init + ]; + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + NSDictionary* dic = [[NSDictionary alloc] initWithObjectsAndKeys: + @"http://demo.redmine.org/",USER_DEFUALTS_REDMINE_HOME_URL, + @"",USER_DEFUALTS_REDMINE_USER_KEY, + nil]; + [defaults registerDefaults:dic]; + } + return sharedInstance; +} + +-(NSString*)redmineHomeURL +{ + NSUserDefaults* userdefaults = [NSUserDefaults standardUserDefaults]; + return [userdefaults objectForKey:USER_DEFUALTS_REDMINE_HOME_URL]; +} +-(void)setRedmineHomeURL:(NSString *)redmineHomeURL +{ + NSUserDefaults* userdefaults = [NSUserDefaults standardUserDefaults]; + [userdefaults setObject:redmineHomeURL forKey:USER_DEFUALTS_REDMINE_HOME_URL]; + [userdefaults synchronize]; +} +-(NSString*)redmineUserKey +{ + NSUserDefaults* userdefaults = [NSUserDefaults standardUserDefaults]; + return [userdefaults objectForKey:USER_DEFUALTS_REDMINE_USER_KEY]; +} +-(void)setRedmineUserKey:(NSString *)redmineUserKey +{ + NSUserDefaults* userdefaults = [NSUserDefaults standardUserDefaults]; + [userdefaults setObject:redmineUserKey forKey:USER_DEFUALTS_REDMINE_USER_KEY]; + [userdefaults synchronize]; +} + +@end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.h b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.h new file mode 100644 index 0000000..d3753ee --- /dev/null +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.h @@ -0,0 +1,17 @@ +// +// OZLAccountViewController.h +// RedmineMobile +// +// Created by Lee Zhijie on 7/14/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import + +@interface OZLAccountViewController : UIViewController + +@property (strong, nonatomic) IBOutlet UITextField *redmineHomeURL; +@property (strong, nonatomic) IBOutlet UITextField *redmineUserKey; +- (IBAction)onOk:(id)sender; + +@end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.m new file mode 100644 index 0000000..1666a7d --- /dev/null +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.m @@ -0,0 +1,95 @@ +// +// OZLAccountViewController.m +// RedmineMobile +// +// Created by Lee Zhijie on 7/14/13. +// Copyright (c) 2013 Lee Zhijie. All rights reserved. +// + +#import "OZLAccountViewController.h" +#import "PPRevealSideViewController.h" +#import "OZLProjectListViewController.h" +#import "OZLSingleton.h" +#import "OZLNetwork.h" + +@interface OZLAccountViewController (){ + float _sideviewOffset; +} + +@end + +@implementation OZLAccountViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self changeSideViewOffset:90]; + + UIBarButtonItem* projectListBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(showLeft)]; + [self.navigationItem setLeftBarButtonItem:projectListBtn]; + + _redmineHomeURL.text = [[OZLSingleton sharedInstance] redmineHomeURL]; + _redmineUserKey.text = [[OZLSingleton sharedInstance] redmineUserKey]; +} + + +- (void) preloadLeft { + OZLProjectListViewController *c = [[OZLProjectListViewController alloc] initWithNibName:@"OZLProjectListViewController" bundle:nil]; + [self.revealSideViewController preloadViewController:c + forSide:PPRevealSideDirectionLeft + withOffset:_sideviewOffset]; + PP_RELEASE(c); +} +- (void) viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(preloadLeft) object:nil]; + [self performSelector:@selector(preloadLeft) withObject:nil afterDelay:0.3]; +} + +- (void) showLeft { + OZLProjectListViewController *c = [[OZLProjectListViewController alloc] initWithNibName:@"OZLProjectListViewController" bundle:nil]; + [self.revealSideViewController pushViewController:c onDirection:PPRevealSideDirectionLeft withOffset:_sideviewOffset animated:YES]; + PP_RELEASE(c); +} + +- (IBAction)changeSideViewOffset:(int)offset { + _sideviewOffset = offset; + [self.revealSideViewController changeOffset:_sideviewOffset + forDirection:PPRevealSideDirectionRight]; + [self.revealSideViewController changeOffset:_sideviewOffset + forDirection:PPRevealSideDirectionLeft]; + [self.revealSideViewController changeOffset:_sideviewOffset + forDirection:PPRevealSideDirectionTop]; + [self.revealSideViewController changeOffset:_sideviewOffset + forDirection:PPRevealSideDirectionBottom]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)viewDidUnload { + [self setRedmineHomeURL:nil]; + [self setRedmineUserKey:nil]; + [super viewDidUnload]; +} +- (IBAction)onOk:(id)sender { + [[OZLSingleton sharedInstance] setRedmineUserKey:_redmineUserKey.text]; + [[OZLSingleton sharedInstance] setRedmineHomeURL:_redmineHomeURL.text]; + + [OZLNetwork getProjectListWithBlock:^(NSDictionary *respond, NSError *error) { + NSLog(@"respond:%@",respond.description); + }]; +} +@end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.xib b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.xib new file mode 100644 index 0000000..b302a51 --- /dev/null +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLAccountViewController.xib @@ -0,0 +1,338 @@ + + + + 1552 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 2083 + + + IBProxyObject + IBUIButton + IBUILabel + IBUITextField + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 292 + {{20, 49}, {280, 30}} + + + _NS:9 + NO + YES + IBCocoaTouchFramework + 0 + + 3 + + 3 + MAA + + 2 + + + YES + 17 + + IBCocoaTouchFramework + + + 1 + 14 + + + Helvetica + 14 + 16 + + + + + 292 + {{20, 20}, {42, 21}} + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + url: + + 1 + MCAwIDAAA + darkTextColor + + + 0 + + 1 + 17 + + + Helvetica + 17 + 16 + + NO + + + + 292 + {{20, 116}, {280, 30}} + + + _NS:9 + NO + YES + IBCocoaTouchFramework + 0 + + 3 + + 3 + MAA + + + YES + 17 + + IBCocoaTouchFramework + + + + + + + 292 + {{20, 87}, {42, 21}} + + + _NS:9 + NO + YES + 7 + NO + IBCocoaTouchFramework + key: + + + 0 + + + NO + + + + 292 + {{20, 154}, {280, 44}} + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + OK + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {{0, 64}, {320, 504}} + + + + 3 + MQA + + + + + NO + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + redmineHomeURL + + + + 9 + + + + redmineUserKey + + + + 10 + + + + onOk: + + + 7 + + 11 + + + + + + 0 + + + + + + 1 + + + + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + + + OZLAccountViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 11 + + + 0 + IBCocoaTouchFramework + YES + 3 + 2083 + + diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.h b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.h index 5f9bd5d..76b1df1 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.h +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.h @@ -10,4 +10,5 @@ @interface OZLProjectListViewController : UIViewController +- (IBAction)showAccountView:(id)sender; @end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m index e5b48c2..42f7d35 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m @@ -9,6 +9,7 @@ #import "OZLProjectListViewController.h" #import "PPRevealSideViewController.h" #import "OZLProjectViewController.h" +#import "OZLAccountViewController.h" @interface OZLProjectListViewController () @@ -44,6 +45,12 @@ UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:c]; [self.revealSideViewController popViewControllerWithNewCenterController:n animated:YES]; - +} + +- (IBAction)showAccountView:(id)sender { + OZLAccountViewController *c = [[OZLAccountViewController alloc] initWithNibName:@"OZLAccountViewController" bundle:nil]; + UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:c]; + [self.revealSideViewController popViewControllerWithNewCenterController:n + animated:YES]; } @end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.xib b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.xib index 43e429f..c21fed3 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.xib +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.xib @@ -1,17 +1,19 @@ - 1536 - 12A269 - 2835 - 1187 - 624.00 + 1552 + 12E55 + 3084 + 1187.39 + 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1919 + 2083 IBProxyObject + IBUIButton + IBUITableView IBUIView @@ -33,10 +35,63 @@ 274 + + + + 292 + {320, 44} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Account + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 274 + {{0, 45}, {320, 503}} + + _NS:9 + + YES + IBCocoaTouchFramework + YES + 1 + 0 + YES + 44 + 22 + 22 + + {{0, 20}, {320, 548}} - - + 3 MQA @@ -75,6 +130,15 @@ 3 + + + showAccountView: + + + 7 + + 17 + @@ -87,6 +151,10 @@ 1 + + + + @@ -100,6 +168,18 @@ + + 4 + + + + + + 9 + + + + @@ -108,30 +188,20 @@ UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 3 - - - - - OZLProjectListViewController - UIViewController - - IBProjectSource - ./Classes/OZLProjectListViewController.h - - - + 17 + 0 IBCocoaTouchFramework YES 3 - YES - 1919 + 2083 diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m index 4cefbaf..92daac2 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m @@ -29,7 +29,10 @@ - (void)viewDidLoad { [super viewDidLoad]; - [self changeSideViewOffset:80]; + [self changeSideViewOffset:90]; + + UIBarButtonItem* projectListBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize target:self action:@selector(showLeft)]; + [self.navigationItem setLeftBarButtonItem:projectListBtn]; } diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.xib b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.xib index d6a98f7..ade903e 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.xib +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.xib @@ -33,9 +33,9 @@ 274 + {{0, 64}, {320, 504}} - 3 MQA @@ -89,6 +89,7 @@ 1 + @@ -115,20 +116,9 @@ - 3 - - - - - OZLProjectViewController - UIViewController - - IBProjectSource - ./Classes/OZLProjectViewController.h - - - + 5 + 0 IBCocoaTouchFramework YES