Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bendermh committed Apr 10, 2016
0 parents commit 45d3637
Show file tree
Hide file tree
Showing 524 changed files with 54,217 additions and 0 deletions.
32 changes: 32 additions & 0 deletions AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// AppDelegate.h
// RombergLab
//
// Created by Jorge Rey Martínez on 29/11/15.
// Copyright © 2015 Jorge Rey Martínez. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "WiiRemote.h"

@interface AppDelegate : NSObject <NSApplicationDelegate>

{
BOOL reconectarOn;
}

@property (weak) IBOutlet NSMenuItem *MenuReconectar;
@property (weak) IBOutlet NSMenuItem *MenuModo;

- (IBAction)menuconexion:(id)sender;
- (IBAction)itemweb:(id)sender;
- (IBAction)itemnormal:(id)sender;
- (IBAction)itemposturografia:(id)sender;
- (IBAction)lostest:(id)sender;
- (IBAction)losduro:(id)sender;
- (IBAction)losmedio:(id)sender;
- (IBAction)losflojo:(id)sender;
- (IBAction)itemexit:(id)sender;

@end

142 changes: 142 additions & 0 deletions AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// AppDelegate.m
// RombergLab
//
// Created by Jorge Rey Martínez on 29/11/15.
// Copyright © 2015 Jorge Rey Martínez. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()


@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application

[self.MenuModo setEnabled:NO];

//ASUNTOS LEGALES Y SEGURIDAD

NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
if (! [defaults boolForKey:@"notFirstRun"]) {
[defaults setBool:YES forKey:@"notFirstRun"];

NSAlert *alert = [[NSAlert alloc] init];
NSString *userLocale = [[NSLocale currentLocale] localeIdentifier];
NSString *userLanguage = [userLocale substringToIndex:2];
if([userLanguage isEqualToString:@"es"]){
[alert setMessageText:@"Pulse OK si está de acuerdo con los términos de uso de este programa.\r\rSi continua ejecutando este progama acepta dichos términos.\r\rNo use este programa si no está de acuerdo con sus términos de uso"];
[alert setInformativeText:@"Puede encontrar estos términos en el menú 'Acerca' de esta aplicacion"];
}
else{
[alert setMessageText:@"Press OK if you are in agreement with the terms of use of this software.\r\rIf you continue using this software you accept this terms.\r\rDo not use this software if you are not in agreement with this terms"];
[alert setInformativeText:@"You can find this terms written on the 'About' menu of this software"];
}
[alert addButtonWithTitle:@"OK"];
[alert runModal];
}
else {
// [defaults setBool:NO forKey:@"notFirstRun"]; //ACTIVAR SOLO EN PRUEBAS
}
// FIN LEGALES SEGUIR NORMAL

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reconectaActivo:)
name:@"ConexiónApagada"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(menuModoActivo:)
name:@"MenuModoActivo"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(menuModoInactivo:)
name:@"MenuModoInactivo"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(iniciarlibre:)
name:@"PruebaTerminada"
object:nil];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application


}

- (IBAction)menuconexion:(id)sender{
if (reconectarOn){
[[NSNotificationCenter defaultCenter]
postNotificationName:@"MenuConexión"
object:nil];}

}

-(void)reconectaActivo:(id)sender{
reconectarOn = YES;
}

-(void)iniciarlibre:(id)sender{
[self performSelector: @selector(itemnormal:) withObject:self afterDelay: 0.0];
}

-(void)menuModoActivo:(id)sender{
[self.MenuModo setEnabled:YES];
}

-(void)menuModoInactivo:(id)sender{
[self.MenuModo setEnabled:NO];
}

- (IBAction)itemweb:(id)sender{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://mlibra.com/"]];
}

- (IBAction)itemnormal:(id)sender {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemNormal"
object:nil];
}
- (IBAction)itemposturografia:(id)sender {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemPosturografia"
object:nil];
}
- (IBAction)lostest:(id)sender {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemLosTest"
object:nil];

}
- (IBAction)losduro:(id)sender {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemLosDuro"
object:nil];

}
- (IBAction)losmedio:(id)sender {
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemLosMedio"
object:nil];

}
- (IBAction)losflojo:(id)sender{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"ItemLosFlojo"
object:nil];

}
- (IBAction)itemexit:(id)sender{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"Terminando"
object:nil];
}



@end
Loading

0 comments on commit 45d3637

Please sign in to comment.