Basic saving done (save on every LSK entry, no saving on empty CO RTE -> (TODO: possibly more dynamic for more than one leading whitespace, delete leading whitespace))
This commit is contained in:
parent
18d73bd264
commit
ad1381d5df
@ -10,43 +10,11 @@
|
|||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||||
timestampString = "480450634.41493"
|
timestampString = "480456367.132317"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "95"
|
startingLineNumber = "93"
|
||||||
endingLineNumber = "95"
|
endingLineNumber = "93"
|
||||||
landmarkName = "-loadScreen:withOptions:"
|
|
||||||
landmarkType = "5">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "No"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
|
||||||
timestampString = "480450634.41493"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "109"
|
|
||||||
endingLineNumber = "109"
|
|
||||||
landmarkName = "-loadScreen:withOptions:"
|
|
||||||
landmarkType = "5">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "No"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
|
||||||
timestampString = "480449290.841766"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "72"
|
|
||||||
endingLineNumber = "72"
|
|
||||||
landmarkName = "-enterLSK:"
|
landmarkName = "-enterLSK:"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
@ -57,13 +25,13 @@
|
|||||||
shouldBeEnabled = "No"
|
shouldBeEnabled = "No"
|
||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "FMC Planner 2/ViewControllerKeyboard.m"
|
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||||
timestampString = "480449369.755953"
|
timestampString = "480457455.927911"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "117"
|
startingLineNumber = "131"
|
||||||
endingLineNumber = "117"
|
endingLineNumber = "131"
|
||||||
landmarkName = "-KeyTaps:"
|
landmarkName = "-loadDataToScreen"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
@ -73,13 +41,45 @@
|
|||||||
shouldBeEnabled = "No"
|
shouldBeEnabled = "No"
|
||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "FMC Planner 2/ViewControllerKeyboard.m"
|
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||||
timestampString = "480449401.34365"
|
timestampString = "480457455.927911"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "97"
|
startingLineNumber = "101"
|
||||||
endingLineNumber = "97"
|
endingLineNumber = "101"
|
||||||
landmarkName = "-KeyTaps:"
|
landmarkName = "-loadScreen:withOptions:"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "FMC Planner 2/ViewController.m"
|
||||||
|
timestampString = "480458312.697239"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "40"
|
||||||
|
endingLineNumber = "40"
|
||||||
|
landmarkName = "-saveToFile:"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "FMC Planner 2/ViewController.m"
|
||||||
|
timestampString = "480458375.079937"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "39"
|
||||||
|
endingLineNumber = "39"
|
||||||
|
landmarkName = "-saveToFile:"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<array>
|
<array>
|
||||||
<string>Departure</string>
|
<string>DEPARTURE</string>
|
||||||
<string>Arrival</string>
|
<string>ARRIVAL</string>
|
||||||
<string>Aircraft</string>
|
<string>AIRCRAFT</string>
|
||||||
<string></string>
|
|
||||||
<string></string>
|
<string></string>
|
||||||
<string></string>
|
<string></string>
|
||||||
<string></string>
|
<string></string>
|
||||||
|
<string>CO RTE</string>
|
||||||
<string></string>
|
<string></string>
|
||||||
<string></string>
|
<string></string>
|
||||||
<string></string>
|
<string></string>
|
||||||
|
|||||||
@ -15,9 +15,13 @@
|
|||||||
|
|
||||||
@property(strong, nonatomic) ViewControllerScreen *screen;
|
@property(strong, nonatomic) ViewControllerScreen *screen;
|
||||||
@property(strong, nonatomic) ViewControllerKeyboard *keys;
|
@property(strong, nonatomic) ViewControllerKeyboard *keys;
|
||||||
|
@property(strong, nonatomic) NSMutableDictionary *save;
|
||||||
|
|
||||||
@property(strong, nonatomic) IBOutlet UIView *backdropKeys;
|
@property(strong, nonatomic) IBOutlet UIView *backdropKeys;
|
||||||
|
|
||||||
@property(strong, nonatomic) IBOutlet UIView *backdropScreen;
|
@property(strong, nonatomic) IBOutlet UIView *backdropScreen;
|
||||||
|
|
||||||
|
- (void)loadSave:(NSString *)file;
|
||||||
|
- (void)saveToFile:(NSDictionary *)save;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -18,6 +18,8 @@
|
|||||||
_backdropKeys.layer.masksToBounds = YES;
|
_backdropKeys.layer.masksToBounds = YES;
|
||||||
_backdropScreen.layer.cornerRadius = 5;
|
_backdropScreen.layer.cornerRadius = 5;
|
||||||
_backdropScreen.layer.masksToBounds = YES;
|
_backdropScreen.layer.masksToBounds = YES;
|
||||||
|
// Setup save system
|
||||||
|
_save = [[NSMutableDictionary alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||||
@ -32,4 +34,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning TODO: check if file already exists -- load or replace
|
||||||
|
#warning TODO: else -> jump to file browsing for load/delete
|
||||||
|
- (void)saveToFile:(NSDictionary *)save {
|
||||||
|
if (!([_save valueForKey:@"MENU@LSKR1"] == nil ||
|
||||||
|
[[_save valueForKey:@"MENU@LSKR1"] isEqualToString:@""])) {
|
||||||
|
NSArray *paths = NSSearchPathForDirectoriesInDomains(
|
||||||
|
NSDocumentDirectory, NSUserDomainMask, YES);
|
||||||
|
NSString *documentsPath = [paths objectAtIndex:0];
|
||||||
|
[_save writeToFile:[documentsPath
|
||||||
|
stringByAppendingString:
|
||||||
|
[NSString
|
||||||
|
stringWithFormat:
|
||||||
|
@"/%@",
|
||||||
|
[_save valueForKey:@"MENU@LSKR1"]]]
|
||||||
|
atomically:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "ViewController.h"
|
|
||||||
#import "ViewControllerKeyboard.h"
|
#import "ViewControllerKeyboard.h"
|
||||||
|
#import "ViewController.h"
|
||||||
|
|
||||||
@implementation ViewControllerKeyboard
|
@implementation ViewControllerKeyboard
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SharedDeclerations.h"
|
#import "SharedDeclerations.h"
|
||||||
|
#import "ViewController.h"
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
@class ViewController;
|
@class ViewController;
|
||||||
@ -26,5 +27,6 @@
|
|||||||
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *FrameHeight;
|
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *FrameHeight;
|
||||||
|
|
||||||
- (void)loadScreen:(NSString *)screenName withOptions:(NSArray *)options;
|
- (void)loadScreen:(NSString *)screenName withOptions:(NSArray *)options;
|
||||||
|
- (void)loadDataToScreen;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import "ViewController.h"
|
||||||
#import "ViewControllerScreen.h"
|
#import "ViewControllerScreen.h"
|
||||||
|
|
||||||
@implementation ViewControllerScreen
|
@implementation ViewControllerScreen
|
||||||
@ -65,8 +66,6 @@
|
|||||||
for (UILabel *label in _LSK) {
|
for (UILabel *label in _LSK) {
|
||||||
label.text = @"";
|
label.text = @"";
|
||||||
}
|
}
|
||||||
_Scratchpad.text = @"";
|
|
||||||
_Header.text = @"";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)enterLSK:(UITapGestureRecognizer *)tapReg {
|
- (void)enterLSK:(UITapGestureRecognizer *)tapReg {
|
||||||
@ -76,8 +75,8 @@
|
|||||||
((UILabel *)tapReg.view).text = _Scratchpad.text;
|
((UILabel *)tapReg.view).text = _Scratchpad.text;
|
||||||
}
|
}
|
||||||
if ([((UILabel *)tapReg.view)
|
if ([((UILabel *)tapReg.view)
|
||||||
.restorationIdentifier
|
.restorationIdentifier isEqualToString:@"LSKR6"] &&
|
||||||
isEqualToString:@"LSKR6"] &&_numRoutePage = _maxNumRoutePages) {
|
_numRoutePage == _maxNumRoutePages) {
|
||||||
_maxNumRoutePages += 1;
|
_maxNumRoutePages += 1;
|
||||||
NSRange indexSlash = [_Header.text rangeOfString:@"/"];
|
NSRange indexSlash = [_Header.text rangeOfString:@"/"];
|
||||||
_Header.text = [_Header.text
|
_Header.text = [_Header.text
|
||||||
@ -91,6 +90,12 @@
|
|||||||
_maxNumRoutePages]];
|
_maxNumRoutePages]];
|
||||||
}
|
}
|
||||||
_Scratchpad.text = @"";
|
_Scratchpad.text = @"";
|
||||||
|
[_main.save
|
||||||
|
setObject:((UILabel *)tapReg.view).text
|
||||||
|
forKey:[NSString stringWithFormat:@"%@@%@", _Header.text,
|
||||||
|
((UILabel *)tapReg.view)
|
||||||
|
.restorationIdentifier]];
|
||||||
|
[_main saveToFile:_main.save];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)loadScreen:(NSString *)screenName withOptions:(NSArray *)options {
|
- (void)loadScreen:(NSString *)screenName withOptions:(NSArray *)options {
|
||||||
@ -120,6 +125,24 @@
|
|||||||
_numRoutePage,
|
_numRoutePage,
|
||||||
_maxNumRoutePages]];
|
_maxNumRoutePages]];
|
||||||
}
|
}
|
||||||
|
[self loadDataToScreen];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)loadDataToScreen {
|
||||||
|
for (NSString *ident in _main.save) {
|
||||||
|
NSRange range = [ident rangeOfString:@"@"];
|
||||||
|
if ([[ident substringToIndex:range.location]
|
||||||
|
isEqualToString:_Header.text]) {
|
||||||
|
for (UILabel *label in _LSK) {
|
||||||
|
if ([label.restorationIdentifier
|
||||||
|
isEqualToString:[ident
|
||||||
|
substringFromIndex:range.location +
|
||||||
|
1]]) {
|
||||||
|
label.text = [_main.save valueForKey:ident];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user