activegs-ios/Common.iphone/infoViewController.mm

106 lines
3.0 KiB
Plaintext
Raw Normal View History

2016-03-26 16:16:01 +00:00
/*
ActiveGS, Copyright 2004-2016 Olivier Goguel, https://github.com/ogoguel/ActiveGS
Based on Kegs, Copyright 2004 Kent Dickey, https://kegs.sourceforge.net
This code is covered by the GNU GPL licence
*/
#import "activegsAppDelegate.h"
#import "infoViewController.h"
#import "activegsList.h"
#include "../Common/svnversion.h"
#import "asyncimageview.h"
#import "activegsViewController.h"
@implementation infoViewController
@synthesize versionUI=_versionIU;
@synthesize portraitView= _portraitView;
-(void)viewDidLoad
{
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSString *buildVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
2016-03-26 16:16:01 +00:00
self.versionUI.text = [NSString stringWithFormat: @"v%@.%@ -- ActiveGS "TOSTRING(ACTIVEGSMAJOR)"."TOSTRING(ACTIVEGSMINOR)"."TOSTRING(ACTIVEGSBUILD)"",appVersion,buildVersion];
2016-03-26 16:16:01 +00:00
// [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
}
-(void)viewDidAppear:(BOOL)animated
{
printf("viewDidAppear");
[super viewDidAppear:animated];
2016-03-26 16:16:01 +00:00
// Swipe left to go back to browsing
UISwipeGestureRecognizer* grswipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)];
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
grswipeleft.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswipeleft];
// Swipe Right to go back to browsing
UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
grswiperight.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswiperight];
[self.instructionsView flashScrollIndicators];
2016-03-26 16:16:01 +00:00
}
-(void)swipeLeft :(UISwipeGestureRecognizer*)_rec
{
if (_rec.state == UIGestureRecognizerStateEnded)
{
[pManager doStateChange:[pManager getBrowserView] type:kCATransitionPush sens:kCATransitionFromRight];
}
}
-(void)swipeRight :(UISwipeGestureRecognizer*)_rec
{
if (_rec.state == UIGestureRecognizerStateEnded)
{
[pManager doStateChange:[pManager getBrowserView] type:kCATransitionPush sens:kCATransitionFromLeft];
}
}
- (IBAction) doneButton:(id)_sender;
{
[pManager doStateChange:[pManager getBrowserView] type:kCATransitionFade sens:kCATransitionFromLeft];
}
- (IBAction) emailButton:(id)_sender;
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com/groups/187271854617450/"]];
}
- (IBAction) parametersButton:(id)_sender
{
2016-03-31 21:21:48 +00:00
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ActiveGS" message:@"Not implemented yet" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil];
2016-03-26 16:16:01 +00:00
[alert show];
}
// IOS 5 Compatibility
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
2016-04-02 20:03:47 +00:00
return YES;
2016-03-26 16:16:01 +00:00
}
- (BOOL)shouldAutorotate
{
2016-04-02 20:03:47 +00:00
return YES;
}
// IOS 8
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
2016-03-26 16:16:01 +00:00
@end