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"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||
timestampString = "480450634.41493"
|
||||
timestampString = "480456367.132317"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "95"
|
||||
endingLineNumber = "95"
|
||||
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"
|
||||
startingLineNumber = "93"
|
||||
endingLineNumber = "93"
|
||||
landmarkName = "-enterLSK:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
@ -57,13 +25,13 @@
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "FMC Planner 2/ViewControllerKeyboard.m"
|
||||
timestampString = "480449369.755953"
|
||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||
timestampString = "480457455.927911"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "117"
|
||||
endingLineNumber = "117"
|
||||
landmarkName = "-KeyTaps:"
|
||||
startingLineNumber = "131"
|
||||
endingLineNumber = "131"
|
||||
landmarkName = "-loadDataToScreen"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
@ -73,13 +41,45 @@
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "FMC Planner 2/ViewControllerKeyboard.m"
|
||||
timestampString = "480449401.34365"
|
||||
filePath = "FMC Planner 2/ViewControllerScreen.m"
|
||||
timestampString = "480457455.927911"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "97"
|
||||
endingLineNumber = "97"
|
||||
landmarkName = "-KeyTaps:"
|
||||
startingLineNumber = "101"
|
||||
endingLineNumber = "101"
|
||||
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">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<string>Departure</string>
|
||||
<string>Arrival</string>
|
||||
<string>Aircraft</string>
|
||||
<string></string>
|
||||
<string>DEPARTURE</string>
|
||||
<string>ARRIVAL</string>
|
||||
<string>AIRCRAFT</string>
|
||||
<string></string>
|
||||
<string></string>
|
||||
<string></string>
|
||||
<string>CO RTE</string>
|
||||
<string></string>
|
||||
<string></string>
|
||||
<string></string>
|
||||
|
||||
@ -15,9 +15,13 @@
|
||||
|
||||
@property(strong, nonatomic) ViewControllerScreen *screen;
|
||||
@property(strong, nonatomic) ViewControllerKeyboard *keys;
|
||||
@property(strong, nonatomic) NSMutableDictionary *save;
|
||||
|
||||
@property(strong, nonatomic) IBOutlet UIView *backdropKeys;
|
||||
|
||||
@property(strong, nonatomic) IBOutlet UIView *backdropScreen;
|
||||
|
||||
- (void)loadSave:(NSString *)file;
|
||||
- (void)saveToFile:(NSDictionary *)save;
|
||||
|
||||
@end
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
_backdropKeys.layer.masksToBounds = YES;
|
||||
_backdropScreen.layer.cornerRadius = 5;
|
||||
_backdropScreen.layer.masksToBounds = YES;
|
||||
// Setup save system
|
||||
_save = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
|
||||
- (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
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "ViewControllerKeyboard.h"
|
||||
#import "ViewController.h"
|
||||
|
||||
@implementation ViewControllerKeyboard
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
#import "SharedDeclerations.h"
|
||||
#import "ViewController.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class ViewController;
|
||||
@ -26,5 +27,6 @@
|
||||
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *FrameHeight;
|
||||
|
||||
- (void)loadScreen:(NSString *)screenName withOptions:(NSArray *)options;
|
||||
- (void)loadDataToScreen;
|
||||
|
||||
@end
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
// Copyright © 2016 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "ViewControllerScreen.h"
|
||||
|
||||
@implementation ViewControllerScreen
|
||||
@ -65,8 +66,6 @@
|
||||
for (UILabel *label in _LSK) {
|
||||
label.text = @"";
|
||||
}
|
||||
_Scratchpad.text = @"";
|
||||
_Header.text = @"";
|
||||
}
|
||||
|
||||
- (void)enterLSK:(UITapGestureRecognizer *)tapReg {
|
||||
@ -76,8 +75,8 @@
|
||||
((UILabel *)tapReg.view).text = _Scratchpad.text;
|
||||
}
|
||||
if ([((UILabel *)tapReg.view)
|
||||
.restorationIdentifier
|
||||
isEqualToString:@"LSKR6"] &&_numRoutePage = _maxNumRoutePages) {
|
||||
.restorationIdentifier isEqualToString:@"LSKR6"] &&
|
||||
_numRoutePage == _maxNumRoutePages) {
|
||||
_maxNumRoutePages += 1;
|
||||
NSRange indexSlash = [_Header.text rangeOfString:@"/"];
|
||||
_Header.text = [_Header.text
|
||||
@ -91,6 +90,12 @@
|
||||
_maxNumRoutePages]];
|
||||
}
|
||||
_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 {
|
||||
@ -120,6 +125,24 @@
|
||||
_numRoutePage,
|
||||
_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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user