diff options
author | siqi <me@siqi.fr> | 2013-07-10 10:47:34 +0200 |
---|---|---|
committer | siqi <me@siqi.fr> | 2013-07-10 10:48:01 +0200 |
commit | 424bc075d0d03832759e69b4a4eb35ec2eab2174 (patch) | |
tree | f35f49bfa87aa35d6f28385e08bf40f9a09c3882 /ios | |
parent | 509eee150a1cf0f87deb21ec9e321f849388f7a4 (diff) |
continue to interpret command from server if is not ended
Change-Id: Id970a54db5c61a9cada6b1fda0c3cecdebb4ffe7
Diffstat (limited to 'ios')
23 files changed, 170 insertions, 211 deletions
diff --git a/ios/iosremote/iosremote.xcodeproj/project.pbxproj b/ios/iosremote/iosremote.xcodeproj/project.pbxproj index bd13696ae597..d35a80db7978 100644 --- a/ios/iosremote/iosremote.xcodeproj/project.pbxproj +++ b/ios/iosremote/iosremote.xcodeproj/project.pbxproj @@ -36,7 +36,7 @@ 57C6E405175E06E800E8BC5F /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E404175E06E800E8BC5F /* Default.png */; }; 57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E406175E06E800E8BC5F /* Default@2x.png */; }; 57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E408175E06E800E8BC5F /* Default-568h@2x.png */; }; - 57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */; }; + 57C6E40C175E06E800E8BC5F /* iPhone_autolayout.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */; }; 57C6E42E175E076900E8BC5F /* Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E427175E076900E8BC5F /* Client.m */; }; 57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E429175E076900E8BC5F /* CommunicationManager.m */; }; 57C6E430175E076900E8BC5F /* CommandInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42B175E076900E8BC5F /* CommandInterpreter.m */; }; @@ -93,7 +93,7 @@ 57C6E404175E06E800E8BC5F /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; }; 57C6E406175E06E800E8BC5F /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; }; 57C6E408175E06E800E8BC5F /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; }; - 57C6E40B175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; }; + 57C6E40B175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPhone_autolayout.storyboard; sourceTree = "<group>"; }; 57C6E426175E076900E8BC5F /* Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Client.h; sourceTree = "<group>"; }; 57C6E427175E076900E8BC5F /* Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Client.m; sourceTree = "<group>"; }; 57C6E428175E076900E8BC5F /* CommunicationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CommunicationManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -217,7 +217,7 @@ isa = PBXGroup; children = ( 57C6E3F9175E06E800E8BC5F /* Supporting Files */, - 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */, + 57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */, 57FE71E11785C61300B50125 /* pinValidation_vc.h */, 57FE71E21785C61400B50125 /* pinValidation_vc.m */, 57AEEDAB1789443D007F4F97 /* slideShowPreview */, @@ -327,7 +327,7 @@ 57C6E405175E06E800E8BC5F /* Default.png in Resources */, 57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */, 57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */, - 57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */, + 57C6E40C175E06E800E8BC5F /* iPhone_autolayout.storyboard in Resources */, 57867A541787172A00EBBE52 /* impress.jpeg in Resources */, 57867A5A1787510700EBBE52 /* pushed_next_button.png in Resources */, 57867A5B1787510700EBBE52 /* released_next_button.png in Resources */, @@ -384,12 +384,12 @@ name = InfoPlist.strings; sourceTree = "<group>"; }; - 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */ = { + 57C6E40A175E06E800E8BC5F /* iPhone_autolayout.storyboard */ = { isa = PBXVariantGroup; children = ( 57C6E40B175E06E800E8BC5F /* en */, ); - name = MainStoryboard_iPhone.storyboard; + name = iPhone_autolayout.storyboard; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ diff --git a/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate b/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex b49a1f04ffc3..8869eee3efe1 100644 --- a/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate +++ b/ios/iosremote/iosremote.xcodeproj/project.xcworkspace/xcuserdata/siqi.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/ios/iosremote/iosremote.xcodeproj/xcuserdata/siqi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/ios/iosremote/iosremote.xcodeproj/xcuserdata/siqi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index 1011728402bf..e0c2aef646eb 100644 --- a/ios/iosremote/iosremote.xcodeproj/xcuserdata/siqi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/ios/iosremote/iosremote.xcodeproj/xcuserdata/siqi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -16,5 +16,31 @@ landmarkName = "@implementation libreoffice_sdremoteViewController" landmarkType = "3"> </FileBreakpoint> + <FileBreakpoint + shouldBeEnabled = "Yes" + ignoreCount = "0" + continueAfterRunningActions = "No" + filePath = "iosremote/newServer_vc.m" + timestampString = "395055655.034211" + startingColumnNumber = "9223372036854775807" + endingColumnNumber = "9223372036854775807" + startingLineNumber = "50" + endingLineNumber = "50" + landmarkName = "-viewWillAppear:" + landmarkType = "5"> + </FileBreakpoint> + <FileBreakpoint + shouldBeEnabled = "Yes" + ignoreCount = "0" + continueAfterRunningActions = "No" + filePath = "iosremote/newServer_vc.m" + timestampString = "395055655.034211" + startingColumnNumber = "9223372036854775807" + endingColumnNumber = "9223372036854775807" + startingLineNumber = "46" + endingLineNumber = "46" + landmarkName = "-viewDidLoad" + landmarkType = "5"> + </FileBreakpoint> </FileBreakpoints> </Bucket> diff --git a/ios/iosremote/iosremote/Communication/Client.m b/ios/iosremote/iosremote/Communication/Client.m index 42bcd8b0f0b7..ed8d3af2717d 100644 --- a/ios/iosremote/iosremote/Communication/Client.m +++ b/ios/iosremote/iosremote/Communication/Client.m @@ -195,7 +195,7 @@ int count = 0; } } } - + NSLog(@"Command:%@", str); NSArray *commands = [str componentsSeparatedByString:@"\n"]; [self.receiver parse:commands]; data = nil; diff --git a/ios/iosremote/iosremote/Communication/CommandInterpreter.m b/ios/iosremote/iosremote/Communication/CommandInterpreter.m index 27c93fdb1dd1..fb26da51699c 100644 --- a/ios/iosremote/iosremote/Communication/CommandInterpreter.m +++ b/ios/iosremote/iosremote/Communication/CommandInterpreter.m @@ -33,64 +33,56 @@ // Received a set of instructions from server. - (void) parse:(NSArray*)command{ + uint marker = 0; if ([command count] == 0) { return; } -// NSLog(@"Command:%@", command); + NSString *instruction = [command objectAtIndex:0]; if ([instruction isEqualToString:STATUS_PAIRING_PINVALIDATION]) { [[NSNotificationCenter defaultCenter] postNotificationName:STATUS_PAIRING_PINVALIDATION object:nil]; + marker = 2; } else if ([instruction isEqualToString:STATUS_PAIRING_PAIRED]){ NSLog(@"Paired command: %@", command); [[NSNotificationCenter defaultCenter] postNotificationName:STATUS_PAIRING_PAIRED object:nil]; - if ([command objectAtIndex:2] && [[command objectAtIndex:2] isEqualToString:@"slideshow_started"]){ - NSRange range; - range.location = 2; - range.length = [command count] - 2; - [self parse:[command subarrayWithRange:range]]; - } + marker = 2; } else if([instruction isEqualToString:@"slideshow_started"]){ uint slideLength = [[command objectAtIndex:1] integerValue]; uint currentSlide = [[command objectAtIndex:2] integerValue]; NSLog(@"Interpreter: slideshow_started with currentSlide: %u slideLength: %u", currentSlide, slideLength); - + [self.slideShow setSize:slideLength]; [self.slideShow setCurrentSlide:currentSlide]; - + [[NSNotificationCenter defaultCenter] postNotificationName:STATUS_CONNECTED_SLIDESHOW_RUNNING - object:nil]; + object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_CHANGED object:nil]; - + marker = 4; } else if ([instruction isEqualToString:@"slideshow_finished"]){ NSLog(@"Interpreter: slideshow_finished"); self.slideShow = [[SlideShow alloc] init]; [[NSNotificationCenter defaultCenter] postNotificationName:STATUS_CONNECTED_NOSLIDESHOW object:nil]; + marker = 2; } else { if ([instruction isEqualToString:@"slide_updated"]) { NSLog(@"Interpreter: slide_updated"); uint newSlideNumber = [[command objectAtIndex:1] integerValue]; [self.slideShow setCurrentSlide:newSlideNumber]; - + [[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_CHANGED object:nil]; - + marker = 3; } else if ([instruction isEqualToString:@"slide_preview"]){ NSLog(@"Interpreter: slide_preview"); uint slideNumber = [[command objectAtIndex:1] integerValue]; NSString * imageData = [command objectAtIndex:2]; [self.slideShow putImage:imageData - AtIndex:slideNumber]; + AtIndex:slideNumber]; [[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_PREVIEW object:[NSNumber numberWithUnsignedInt:slideNumber]]; - if ([[command objectAtIndex:4] isEqualToString:@"slide_notes"]) - { - NSRange range; - range.location = 4; - range.length = [command count] - 4; - [self parse:[command subarrayWithRange:range]]; - } + marker = 4; } else if ([instruction isEqualToString:@"slide_notes"]){ NSLog(@"Interpreter: slide_notes"); uint slideNumber = [[command objectAtIndex:1] integerValue]; @@ -98,15 +90,23 @@ for (int i = 2; i<command.count; ++i) { [notes appendString:[command objectAtIndex:i]]; if ([notes hasSuffix:@"</body>"]) { + marker = i+2; break; } } [self.slideShow putNotes:notes - AtIndex:slideNumber]; + AtIndex:slideNumber]; [[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_NOTES object: [NSNumber numberWithUnsignedInt:slideNumber]]; } + + } + if ([command objectAtIndex:marker] && ![[command objectAtIndex:marker] isEqualToString:@""]) + { + NSRange range; + range.location = marker; + range.length = [command count] - marker; + [self parse:[command subarrayWithRange:range]]; } - } @end diff --git a/ios/iosremote/iosremote/Communication/SlideShow.m b/ios/iosremote/iosremote/Communication/SlideShow.m index 079a23b5f87a..3ec06b8d77df 100644 --- a/ios/iosremote/iosremote/Communication/SlideShow.m +++ b/ios/iosremote/iosremote/Communication/SlideShow.m @@ -14,10 +14,10 @@ @interface SlideShow() -@property (nonatomic, strong) NSMutableDictionary* imagesDictionary; -@property (nonatomic, strong) NSMutableDictionary* notesDictionary; +@property (atomic, strong) NSMutableDictionary* imagesDictionary; +@property (atomic, strong) NSMutableDictionary* notesDictionary; -@property (nonatomic, strong) NSMutableDictionary* loadBuffer; +@property (atomic, strong) NSMutableDictionary* loadBuffer; @property (nonatomic, strong) id slideShowImageReadyObserver; @property (nonatomic, strong) id slideShowNoteReadyObserver; @@ -93,10 +93,8 @@ dispatch_queue_t backgroundQueue; } - (void) putImage: (NSString *)img AtIndex: (uint) index{ -// NSLog(@"Put Image into %u", index); NSData* data = [NSData dataWithBase64String:img]; UIImage* image = [UIImage imageWithData:data]; - NSLog(@"%@", image); [self.imagesDictionary setObject:image forKey:[NSNumber numberWithUnsignedInt:index]]; [[NSNotificationCenter defaultCenter] postNotificationName:@"storage_update_ready" object:nil @@ -129,6 +127,7 @@ dispatch_queue_t backgroundQueue; } if (![self.imagesDictionary objectForKey:[NSNumber numberWithUnsignedInt:index]]) { + NSLog(@"Didn't find %u, putting into buffer", index); [self.loadBuffer setObject:[NSNumber numberWithInt:index ] forKey:[NSNumber numberWithInt:[view tag]]]; } else{ diff --git a/ios/iosremote/iosremote/Communication/pinValidation_vc.h b/ios/iosremote/iosremote/Communication/pinValidation_vc.h index 6c7be76d546e..6d00f66fc6d9 100644 --- a/ios/iosremote/iosremote/Communication/pinValidation_vc.h +++ b/ios/iosremote/iosremote/Communication/pinValidation_vc.h @@ -1,10 +1,10 @@ -// -// pinValidation_vcViewController.h -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/Communication/pinValidation_vc.m b/ios/iosremote/iosremote/Communication/pinValidation_vc.m index 7a8c4d83ed36..2d9d3c3a3c46 100644 --- a/ios/iosremote/iosremote/Communication/pinValidation_vc.m +++ b/ios/iosremote/iosremote/Communication/pinValidation_vc.m @@ -1,10 +1,10 @@ -// -// pinValidation_vcViewController.m -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import "pinValidation_vc.h" #import "slideShowPreview_vc.h" diff --git a/ios/iosremote/iosremote/SWReavealMainController.h b/ios/iosremote/iosremote/SWReavealMainController.h index 3d08f0118cb1..0f1601e9e158 100644 --- a/ios/iosremote/iosremote/SWReavealMainController.h +++ b/ios/iosremote/iosremote/SWReavealMainController.h @@ -1,10 +1,10 @@ -// -// SWReavealMainController.h -// iosremote -// -// Created by Liu Siqi on 7/8/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/SWReavealMainController.m b/ios/iosremote/iosremote/SWReavealMainController.m index e2801f4fde74..acf91e4d0492 100644 --- a/ios/iosremote/iosremote/SWReavealMainController.m +++ b/ios/iosremote/iosremote/SWReavealMainController.m @@ -1,10 +1,10 @@ -// -// SWReavealMainController.m -// iosremote -// -// Created by Liu Siqi on 7/8/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import "SWReavealMainController.h" diff --git a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard b/ios/iosremote/iosremote/en.lproj/iPhone_autolayout.storyboard index b64e5f59b175..b64e5f59b175 100644 --- a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard +++ b/ios/iosremote/iosremote/en.lproj/iPhone_autolayout.storyboard diff --git a/ios/iosremote/iosremote/iosremote-Info.plist b/ios/iosremote/iosremote/iosremote-Info.plist index 2bd910bf530a..1dd50c9f0152 100644 --- a/ios/iosremote/iosremote/iosremote-Info.plist +++ b/ios/iosremote/iosremote/iosremote-Info.plist @@ -25,7 +25,7 @@ <key>LSRequiresIPhoneOS</key> <true/> <key>UIMainStoryboardFile</key> - <string>MainStoryboard_iPhone</string> + <string>iPhone_autolayout</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> @@ -33,8 +33,7 @@ <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationLandscapeRight</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> diff --git a/ios/iosremote/iosremote/main.m b/ios/iosremote/iosremote/main.m index 126838a75b05..51ae8dc7034a 100644 --- a/ios/iosremote/iosremote/main.m +++ b/ios/iosremote/iosremote/main.m @@ -1,10 +1,10 @@ -// -// main.m -// iosremote -// -// Created by Liu Siqi on 6/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/newServer_vc.h b/ios/iosremote/iosremote/newServer_vc.h index 6d725b56be7b..72148295d56f 100644 --- a/ios/iosremote/iosremote/newServer_vc.h +++ b/ios/iosremote/iosremote/newServer_vc.h @@ -1,3 +1,10 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> @@ -27,12 +34,7 @@ typedef NSUInteger ServerAttribute; @property (nonatomic, strong) EditableTableViewCell *addrCell; @property (nonatomic, strong) CommunicationManager *comManager; - (IBAction)save:(id)sender; -- (BOOL)isModal; - (EditableTableViewCell *)newDetailCellWithTag:(NSInteger)tag; -// Action Methods -- (void)save; -- (void)cancel; - @end diff --git a/ios/iosremote/iosremote/newServer_vc.m b/ios/iosremote/iosremote/newServer_vc.m index 59d8d0bd4db4..acd887ed21cf 100644 --- a/ios/iosremote/iosremote/newServer_vc.m +++ b/ios/iosremote/iosremote/newServer_vc.m @@ -38,14 +38,6 @@ } } -- (BOOL)isModal -{ - NSArray *viewControllers = [[self navigationController] viewControllers]; - UIViewController *rootViewController = [viewControllers objectAtIndex:0]; - - return rootViewController == self; -} - - (EditableTableViewCell *)newDetailCellWithTag:(NSInteger)tag { EditableTableViewCell *cell = [[EditableTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; @@ -57,45 +49,10 @@ } #pragma mark - -#pragma mark Action Methods - -- (void)save -{ - [self dismissModalViewControllerAnimated:YES]; -} - -- (void)cancel -{ - [self dismissModalViewControllerAnimated:YES]; -} - -#pragma mark - #pragma mark UIViewController Methods - (void)viewDidLoad { - // If the user clicked the '+' button in the list view, we're - // creating a new entry rather than modifying an existing one, so - // we're in a modal nav controller. Modal nav controllers don't add - // a back button to the nav bar; instead we'll add Save and - // Cancel buttons. - // - if ([self isModal]) - { - UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] - initWithBarButtonSystemItem:UIBarButtonSystemItemSave - target:self - action:@selector(save)]; - - [[self navigationItem] setRightBarButtonItem:saveButton]; - - UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] - initWithBarButtonSystemItem:UIBarButtonSystemItemCancel - target:self - action:@selector(cancel)]; - - [[self navigationItem] setLeftBarButtonItem:cancelButton]; - } self.comManager = [CommunicationManager sharedComManager]; [self setNameCell: [self newDetailCellWithTag:ServerName]]; [self setAddrCell: [self newDetailCellWithTag:ServerAddr]]; @@ -166,14 +123,7 @@ // value to the corresponding property of the model object. // - (void)textFieldDidEndEditing:(UITextField *)textField -{ - static NSNumberFormatter *_formatter; - - if (_formatter == nil) - { - _formatter = [[NSNumberFormatter alloc] init]; - } - +{ NSString *text = [textField text]; switch ([textField tag]) @@ -207,16 +157,9 @@ [nextTextField becomeFirstResponder]; } - else if ([self isModal]) - { - // We're in a modal navigation controller, which means the user is - // adding a new book rather than editing an existing one. - // - [self save]; - } else { - [[self navigationController] popViewControllerAnimated:YES]; + [self save:nil]; } return YES; @@ -233,24 +176,13 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return section == 0 ? 2 : 1; -} - -- (NSString *)tableView:(UITableView *)tableView -titleForHeaderInSection:(NSInteger)section -{ - switch (section) - { - case InformationSection: return nil; - } - return nil; + return 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { EditableTableViewCell *cell = nil; - NSInteger tag = INT_MIN; NSString *text = nil; NSString *placeholder = nil; UIKeyboardType keyboardType; @@ -266,7 +198,6 @@ titleForHeaderInSection:(NSInteger)section { cell = [self nameCell]; text = [self.server serverName]; - tag = ServerName; placeholder = @"Server Name (optional)"; keyboardType = UIKeyboardTypeDefault; } @@ -274,7 +205,6 @@ titleForHeaderInSection:(NSInteger)section { cell = [self addrCell]; text = [self.server serverAddress]; - tag = ServerAddr; placeholder = @"IP Address"; keyboardType = UIKeyboardTypeNumbersAndPunctuation; } @@ -282,7 +212,6 @@ titleForHeaderInSection:(NSInteger)section } } [cell.textField setPlaceholder:placeholder]; - [cell setTag:tag]; [cell.textField setText:text]; [cell.textField setKeyboardType:keyboardType]; return cell; diff --git a/ios/iosremote/iosremote/serverList_vc.m b/ios/iosremote/iosremote/serverList_vc.m index f6f2cf64cbac..9d15bc800612 100644 --- a/ios/iosremote/iosremote/serverList_vc.m +++ b/ios/iosremote/iosremote/serverList_vc.m @@ -17,7 +17,7 @@ @property (nonatomic, weak) NSNotificationCenter* center; @property (nonatomic, strong) id slideShowPreviewStartObserver; @property (nonatomic, strong) id pinValidationObserver; -@property (nonatomic, strong) NSIndexPath *lastSpinningCellIndex; +@property (atomic, strong) NSIndexPath *lastSpinningCellIndex; @end @@ -47,7 +47,7 @@ // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; - self.lastSpinningCellIndex = [[NSIndexPath alloc] init]; +// self.lastSpinningCellIndex = [[NSIndexPath alloc] init]; self.center = [NSNotificationCenter defaultCenter]; self.comManager = [CommunicationManager sharedComManager]; self.serverTable.dataSource = self; @@ -103,8 +103,12 @@ - (void)disableSpinner { - if ([[self.tableView cellForRowAtIndexPath:self.lastSpinningCellIndex] respondsToSelector:@selector(accessoryView)]) { - [self.tableView cellForRowAtIndexPath:self.lastSpinningCellIndex].accessoryView = nil; + @synchronized(self.lastSpinningCellIndex){ + if ([[self.tableView cellForRowAtIndexPath:self.lastSpinningCellIndex] respondsToSelector:@selector(accessoryView)]) { + if (self.tableView && [self.tableView cellForRowAtIndexPath:self.lastSpinningCellIndex]) { + [[self.tableView cellForRowAtIndexPath:self.lastSpinningCellIndex] setAccessoryView:nil]; + } + } } } diff --git a/ios/iosremote/iosremote/slideShowPreviewTable_vc.h b/ios/iosremote/iosremote/slideShowPreviewTable_vc.h index 0b07cc467876..46fe904d7c66 100644 --- a/ios/iosremote/iosremote/slideShowPreviewTable_vc.h +++ b/ios/iosremote/iosremote/slideShowPreviewTable_vc.h @@ -1,10 +1,10 @@ -// -// slideShowPreviewTable_vc.h -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/slideShowPreviewTable_vc.m b/ios/iosremote/iosremote/slideShowPreviewTable_vc.m index df8f093c8102..0904ea956c92 100644 --- a/ios/iosremote/iosremote/slideShowPreviewTable_vc.m +++ b/ios/iosremote/iosremote/slideShowPreviewTable_vc.m @@ -1,10 +1,10 @@ -// -// slideShowPreviewTable_vc.m -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import "slideShowPreviewTable_vc.h" #import "CommunicationManager.h" @@ -46,7 +46,7 @@ // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; - self.optionsArray = [NSArray arrayWithObjects:@"Lecturer's Notes", @"Timer", @"Pointer", nil]; + self.optionsArray = [NSArray arrayWithObjects:@"Timer auto-start", nil]; self.comManager = [CommunicationManager sharedComManager]; self.comManager.delegate = self; self.slidesRunning = NO; @@ -57,7 +57,6 @@ usingBlock:^(NSNotification *note) { self.slidesRunning = YES; }]; - } - (void) viewDidAppear:(BOOL)animated @@ -163,7 +162,6 @@ _startButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; _startButton.frame = CGRectMake(10.0, 10.0, 300.0, 50.0); [_startButton setTitle:@"Start Presentation" forState:UIControlStateNormal]; - _startButton.backgroundColor = [UIColor clearColor]; [_startButton addTarget:self action:@selector(startPresentationAction:) forControlEvents:UIControlEventTouchDown]; _startButton.tag = 1; diff --git a/ios/iosremote/iosremote/slideShowPreview_vc.h b/ios/iosremote/iosremote/slideShowPreview_vc.h index ffa198b927b3..55cb1f2f88ee 100644 --- a/ios/iosremote/iosremote/slideShowPreview_vc.h +++ b/ios/iosremote/iosremote/slideShowPreview_vc.h @@ -1,10 +1,10 @@ -// -// slideShowPreview_vc.h -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/slideShowPreview_vc.m b/ios/iosremote/iosremote/slideShowPreview_vc.m index fa986e595331..bb9578d3015c 100644 --- a/ios/iosremote/iosremote/slideShowPreview_vc.m +++ b/ios/iosremote/iosremote/slideShowPreview_vc.m @@ -1,17 +1,17 @@ -// -// slideShowPreview_vc.m -// iosremote -// -// Created by Liu Siqi on 7/4/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import "slideShowPreview_vc.h" #import "SlideShow.h" #import "CommandInterpreter.h" #import "CommunicationManager.h" -@interface slideShowPreview_vc () +@interface slideShowPreview_vc () <UINavigationControllerDelegate> @property (nonatomic, strong) CommunicationManager* comManager; @property (nonatomic, strong) SlideShow* slideshow; diff --git a/ios/iosremote/iosremote/slideShowSwipeInList.h b/ios/iosremote/iosremote/slideShowSwipeInList.h index b614c703b7b2..8b106040f72e 100644 --- a/ios/iosremote/iosremote/slideShowSwipeInList.h +++ b/ios/iosremote/iosremote/slideShowSwipeInList.h @@ -1,11 +1,10 @@ -// -// slideShowSwipeInList.h -// iosremote -// -// Created by Liu Siqi on 7/8/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// - +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> @interface slideShowSwipeInList : UITableViewController <UITableViewDataSource, UITableViewDelegate> diff --git a/ios/iosremote/iosremote/slideShow_vc.h b/ios/iosremote/iosremote/slideShow_vc.h index eb6fb06b39a4..b60c59046777 100644 --- a/ios/iosremote/iosremote/slideShow_vc.h +++ b/ios/iosremote/iosremote/slideShow_vc.h @@ -1,10 +1,10 @@ -// -// slideShow_vc.h -// iosremote -// -// Created by Liu Siqi on 7/5/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import <UIKit/UIKit.h> diff --git a/ios/iosremote/iosremote/slideShow_vc.m b/ios/iosremote/iosremote/slideShow_vc.m index efb28033cb71..840fe86b660e 100644 --- a/ios/iosremote/iosremote/slideShow_vc.m +++ b/ios/iosremote/iosremote/slideShow_vc.m @@ -1,11 +1,10 @@ -// -// slideShow_vc.m -// iosremote -// -// Created by Liu Siqi on 7/5/13. -// Copyright (c) 2013 libreoffice. All rights reserved. -// - +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #import "slideShow_vc.h" #import "SlideShow.h" #import "CommunicationManager.h" @@ -160,5 +159,9 @@ } - (IBAction)pointerAction:(id)sender { + static int i = 0; + NSLog(@"i = %u", i); + [self.slideshow getContentAtIndex:i forView:self.slideView]; + i++; } @end |