Kaydet (Commit) 19168e3f authored tarafından siqi's avatar siqi

slideshow control pad

Change-Id: Ie82e10fcdfc495ac19a34be85249480540e88d1d
üst c154551d
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
5753DD901781EA0300DB71BB /* serverList_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 5753DD8F1781EA0300DB71BB /* serverList_vc.m */; }; 5753DD901781EA0300DB71BB /* serverList_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 5753DD8F1781EA0300DB71BB /* serverList_vc.m */; };
5753DD9917834D7100DB71BB /* newServer_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 5753DD9817834D7100DB71BB /* newServer_vc.m */; }; 5753DD9917834D7100DB71BB /* newServer_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 5753DD9817834D7100DB71BB /* newServer_vc.m */; };
57867A541787172A00EBBE52 /* impress.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 57867A531787172A00EBBE52 /* impress.jpeg */; };
57867A571787385800EBBE52 /* slideShow_vc.m in Sources */ = {isa = PBXBuildFile; fileRef = 57867A561787385800EBBE52 /* slideShow_vc.m */; };
57867A5A1787510700EBBE52 /* pushed_next_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 57867A581787510700EBBE52 /* pushed_next_button.png */; };
57867A5B1787510700EBBE52 /* released_next_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 57867A591787510700EBBE52 /* released_next_button.png */; };
57867A5E178752CD00EBBE52 /* pushed_previous_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 57867A5C178752CD00EBBE52 /* pushed_previous_button.png */; };
57867A5F178752CD00EBBE52 /* released_previous_button.png in Resources */ = {isa = PBXBuildFile; fileRef = 57867A5D178752CD00EBBE52 /* released_previous_button.png */; };
57B152991764703500EECC67 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B152981764703500EECC67 /* Base64.m */; }; 57B152991764703500EECC67 /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B152981764703500EECC67 /* Base64.m */; };
57B1529F176486C300EECC67 /* CommandTransmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B1529E176486C300EECC67 /* CommandTransmitter.m */; }; 57B1529F176486C300EECC67 /* CommandTransmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B1529E176486C300EECC67 /* CommandTransmitter.m */; };
57B7625D17621E42007703F6 /* SlideShow.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B7625C17621E42007703F6 /* SlideShow.m */; }; 57B7625D17621E42007703F6 /* SlideShow.m in Sources */ = {isa = PBXBuildFile; fileRef = 57B7625C17621E42007703F6 /* SlideShow.m */; };
...@@ -38,6 +44,13 @@ ...@@ -38,6 +44,13 @@
5753DD8F1781EA0300DB71BB /* serverList_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = serverList_vc.m; sourceTree = "<group>"; }; 5753DD8F1781EA0300DB71BB /* serverList_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = serverList_vc.m; sourceTree = "<group>"; };
5753DD9717834D7100DB71BB /* newServer_vc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newServer_vc.h; sourceTree = "<group>"; }; 5753DD9717834D7100DB71BB /* newServer_vc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newServer_vc.h; sourceTree = "<group>"; };
5753DD9817834D7100DB71BB /* newServer_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = newServer_vc.m; sourceTree = "<group>"; }; 5753DD9817834D7100DB71BB /* newServer_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = newServer_vc.m; sourceTree = "<group>"; };
57867A531787172A00EBBE52 /* impress.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = impress.jpeg; sourceTree = "<group>"; };
57867A551787385800EBBE52 /* slideShow_vc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slideShow_vc.h; sourceTree = "<group>"; };
57867A561787385800EBBE52 /* slideShow_vc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = slideShow_vc.m; sourceTree = "<group>"; };
57867A581787510700EBBE52 /* pushed_next_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pushed_next_button.png; sourceTree = "<group>"; };
57867A591787510700EBBE52 /* released_next_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = released_next_button.png; sourceTree = "<group>"; };
57867A5C178752CD00EBBE52 /* pushed_previous_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pushed_previous_button.png; sourceTree = "<group>"; };
57867A5D178752CD00EBBE52 /* released_previous_button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = released_previous_button.png; sourceTree = "<group>"; };
57B152971764703500EECC67 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Base64.h; path = iosremote/Base64.h; sourceTree = "<group>"; }; 57B152971764703500EECC67 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Base64.h; path = iosremote/Base64.h; sourceTree = "<group>"; };
57B152981764703500EECC67 /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Base64.m; path = iosremote/Base64.m; sourceTree = "<group>"; }; 57B152981764703500EECC67 /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Base64.m; path = iosremote/Base64.m; sourceTree = "<group>"; };
57B1529D176486C300EECC67 /* CommandTransmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandTransmitter.h; sourceTree = "<group>"; }; 57B1529D176486C300EECC67 /* CommandTransmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandTransmitter.h; sourceTree = "<group>"; };
...@@ -126,18 +139,20 @@ ...@@ -126,18 +139,20 @@
57C6E3F8175E06E800E8BC5F /* iosremote */ = { 57C6E3F8175E06E800E8BC5F /* iosremote */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
57C6E3F9175E06E800E8BC5F /* Supporting Files */,
57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */,
57FE71E11785C61300B50125 /* pinValidation_vc.h */, 57FE71E11785C61300B50125 /* pinValidation_vc.h */,
57FE71E21785C61400B50125 /* pinValidation_vc.m */, 57FE71E21785C61400B50125 /* pinValidation_vc.m */,
57FE71E41785D7FE00B50125 /* slideShowPreview_vc.h */, 57FE71E41785D7FE00B50125 /* slideShowPreview_vc.h */,
57FE71E51785D7FE00B50125 /* slideShowPreview_vc.m */, 57FE71E51785D7FE00B50125 /* slideShowPreview_vc.m */,
57C6E401175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.h */, 57C6E401175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.h */,
57C6E402175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m */, 57C6E402175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m */,
57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */, 57867A551787385800EBBE52 /* slideShow_vc.h */,
57867A561787385800EBBE52 /* slideShow_vc.m */,
5753DD9717834D7100DB71BB /* newServer_vc.h */, 5753DD9717834D7100DB71BB /* newServer_vc.h */,
5753DD9817834D7100DB71BB /* newServer_vc.m */, 5753DD9817834D7100DB71BB /* newServer_vc.m */,
5753DD8E1781EA0300DB71BB /* serverList_vc.h */, 5753DD8E1781EA0300DB71BB /* serverList_vc.h */,
5753DD8F1781EA0300DB71BB /* serverList_vc.m */, 5753DD8F1781EA0300DB71BB /* serverList_vc.m */,
57C6E3F9175E06E800E8BC5F /* Supporting Files */,
57CFED9717838FDC00E82E05 /* EditableTableViewCell.h */, 57CFED9717838FDC00E82E05 /* EditableTableViewCell.h */,
57CFED9817838FDC00E82E05 /* EditableTableViewCell.m */, 57CFED9817838FDC00E82E05 /* EditableTableViewCell.m */,
57FE71E717861A9000B50125 /* slideShowPreviewTable_vc.h */, 57FE71E717861A9000B50125 /* slideShowPreviewTable_vc.h */,
...@@ -149,6 +164,11 @@ ...@@ -149,6 +164,11 @@
57C6E3F9175E06E800E8BC5F /* Supporting Files */ = { 57C6E3F9175E06E800E8BC5F /* Supporting Files */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
57867A581787510700EBBE52 /* pushed_next_button.png */,
57867A591787510700EBBE52 /* released_next_button.png */,
57867A5C178752CD00EBBE52 /* pushed_previous_button.png */,
57867A5D178752CD00EBBE52 /* released_previous_button.png */,
57867A531787172A00EBBE52 /* impress.jpeg */,
57C6E3FA175E06E800E8BC5F /* iosremote-Info.plist */, 57C6E3FA175E06E800E8BC5F /* iosremote-Info.plist */,
57C6E3FB175E06E800E8BC5F /* InfoPlist.strings */, 57C6E3FB175E06E800E8BC5F /* InfoPlist.strings */,
57C6E3FE175E06E800E8BC5F /* main.m */, 57C6E3FE175E06E800E8BC5F /* main.m */,
...@@ -237,6 +257,11 @@ ...@@ -237,6 +257,11 @@
57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */, 57C6E407175E06E800E8BC5F /* Default@2x.png in Resources */,
57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */, 57C6E409175E06E800E8BC5F /* Default-568h@2x.png in Resources */,
57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */, 57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */,
57867A541787172A00EBBE52 /* impress.jpeg in Resources */,
57867A5A1787510700EBBE52 /* pushed_next_button.png in Resources */,
57867A5B1787510700EBBE52 /* released_next_button.png in Resources */,
57867A5E178752CD00EBBE52 /* pushed_previous_button.png in Resources */,
57867A5F178752CD00EBBE52 /* released_previous_button.png in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -262,6 +287,7 @@ ...@@ -262,6 +287,7 @@
57FE71E31785C61400B50125 /* pinValidation_vc.m in Sources */, 57FE71E31785C61400B50125 /* pinValidation_vc.m in Sources */,
57FE71E61785D7FE00B50125 /* slideShowPreview_vc.m in Sources */, 57FE71E61785D7FE00B50125 /* slideShowPreview_vc.m in Sources */,
57FE71E917861A9000B50125 /* slideShowPreviewTable_vc.m in Sources */, 57FE71E917861A9000B50125 /* slideShowPreviewTable_vc.m in Sources */,
57867A571787385800EBBE52 /* slideShow_vc.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
...@@ -37,8 +37,15 @@ ...@@ -37,8 +37,15 @@
} }
NSLog(@"Command:%@", command); NSLog(@"Command:%@", command);
NSString *instruction = [command objectAtIndex:0]; NSString *instruction = [command objectAtIndex:0];
if ([instruction isEqualToString:STATUS_PAIRING_PINVALIDATION]) {
if([instruction isEqualToString:@"slideshow_started"]){ [[NSNotificationCenter defaultCenter] postNotificationName:STATUS_PAIRING_PINVALIDATION
object:nil];
}
else if ([instruction isEqualToString:STATUS_PAIRING_PAIRED]){
[[NSNotificationCenter defaultCenter] postNotificationName:STATUS_PAIRING_PAIRED
object:nil];
}
else if([instruction isEqualToString:@"slideshow_started"]){
NSLog(@"Interpreter: slideshow_started"); NSLog(@"Interpreter: slideshow_started");
uint slideLength = [[command objectAtIndex:1] integerValue]; uint slideLength = [[command objectAtIndex:1] integerValue];
uint currentSlide = [[command objectAtIndex:2] integerValue]; uint currentSlide = [[command objectAtIndex:2] integerValue];
...@@ -83,7 +90,6 @@ ...@@ -83,7 +90,6 @@
AtIndex:slideNumber]; AtIndex:slideNumber];
[[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_NOTES object: [NSNumber numberWithUnsignedInt:slideNumber]]; [[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_NOTES object: [NSNumber numberWithUnsignedInt:slideNumber]];
} }
} }
} }
......
...@@ -37,7 +37,16 @@ ...@@ -37,7 +37,16 @@
*/ */
#define STATUS_CONNECTED_NOSLIDESHOW @"STATUS_CONNECTED_NOSLIDESHOW" #define STATUS_CONNECTED_NOSLIDESHOW @"STATUS_CONNECTED_NOSLIDESHOW"
#define STATUS_PAIRING_PINVALIDATION @"STATUS_PAIRING_PINVALIDATION" /**
* Asking for a pairing interface
*/
#define STATUS_PAIRING_PINVALIDATION @"LO_SERVER_VALIDATING_PIN"
/*
* Paired, should bring users to the preview page
*/
#define STATUS_PAIRING_PAIRED @"LO_SERVER_SERVER_PAIRED"
#define STATUS_CONNECTION_FAILED @"STATUS_CONNECTION_FAILED" #define STATUS_CONNECTION_FAILED @"STATUS_CONNECTION_FAILED"
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
@interface CommunicationManager() @interface CommunicationManager()
@property (nonatomic, strong) Client* client; @property (nonatomic, strong) Client* client;
@property (nonatomic, strong) id connectionConnectedObserver;
@property (nonatomic, strong) id connectionDisconnectedObserver;
@end @end
...@@ -35,8 +33,6 @@ ...@@ -35,8 +33,6 @@
@synthesize transmitter = _transmitter; @synthesize transmitter = _transmitter;
@synthesize servers = _servers; @synthesize servers = _servers;
@synthesize delegate = _delegate; @synthesize delegate = _delegate;
@synthesize connectionConnectedObserver = _connectionConnectedObserver;
@synthesize connectionDisconnectedObserver = _connectionDisconnectedObserver;
+ (CommunicationManager *)sharedComManager + (CommunicationManager *)sharedComManager
{ {
...@@ -59,9 +55,6 @@ ...@@ -59,9 +55,6 @@
NSLog(@"Connected"); NSLog(@"Connected");
self.transmitter = [[CommandTransmitter alloc] initWithClient:self.client]; self.transmitter = [[CommandTransmitter alloc] initWithClient:self.client];
self.state = CONNECTED; self.state = CONNECTED;
[self.delegate performSegueWithIdentifier:@"pinValidation" sender:nil];
} else {
NSLog(@"Already connected");
} }
} else if ([[note name] isEqualToString:@"connection.status.disconnected"]){ } else if ([[note name] isEqualToString:@"connection.status.disconnected"]){
if (self.state != DISCONNECTED) { if (self.state != DISCONNECTED) {
......
...@@ -40,21 +40,21 @@ ...@@ -40,21 +40,21 @@
self.comManager = [CommunicationManager sharedComManager]; self.comManager = [CommunicationManager sharedComManager];
[self.pinLabel setText:[NSString stringWithFormat:@"%@", [self.comManager getPairingPin]]]; [self.pinLabel setText:[NSString stringWithFormat:@"%@", [self.comManager getPairingPin]]];
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
self.slideShowPreviewStartObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_CONNECTED_SLIDESHOW_RUNNING self.slideShowPreviewStartObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_PAIRING_PAIRED
object:nil object:nil
queue:mainQueue queue:mainQueue
usingBlock:^(NSNotification *note) { usingBlock:^(NSNotification *note) {
[self performSegueWithIdentifier:@"pinValidated" sender:self ]; [self performSegueWithIdentifier:@"pinValidated" sender:self ];
}]; }];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([segue.identifier isEqualToString:@"pinValidated"]) {
slideShowPreview_vc *destViewController = segue.destinationViewController;
destViewController.slideshow = [self.comManager.interpreter slideShow];
[destViewController.slideshow setDelegate:destViewController];
}
} }
//
//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
// if ([segue.identifier isEqualToString:@"pinValidated"]) {
// slideShowPreview_vc *destViewController = segue.destinationViewController;
// destViewController.slideshow = [self.comManager.interpreter slideShow];
// [destViewController.slideshow setDelegate:destViewController];
// }
//}
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning
{ {
......
//
// Prefix header for all source files of the 'iosremote' target in the 'iosremote' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
@property (nonatomic, strong) CommunicationManager *comManager; @property (nonatomic, strong) CommunicationManager *comManager;
@property (nonatomic, weak) NSNotificationCenter* center; @property (nonatomic, weak) NSNotificationCenter* center;
@property (nonatomic, strong) id slideShowPreviewStartObserver; @property (nonatomic, strong) id slideShowPreviewStartObserver;
@property (nonatomic, strong) id pinValidationObserver;
@property (nonatomic, strong) NSIndexPath *lastSpinningCellIndex; @property (nonatomic, strong) NSIndexPath *lastSpinningCellIndex;
@end @end
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
@synthesize comManager = _comManager; @synthesize comManager = _comManager;
@synthesize lastSpinningCellIndex = _lastSpinningCellIndex; @synthesize lastSpinningCellIndex = _lastSpinningCellIndex;
@synthesize slideShowPreviewStartObserver = _slideShowPreviewStartObserver; @synthesize slideShowPreviewStartObserver = _slideShowPreviewStartObserver;
@synthesize pinValidationObserver = _pinValidationObserver;
- (id)initWithStyle:(UITableViewStyle)style - (id)initWithStyle:(UITableViewStyle)style
{ {
...@@ -52,12 +54,18 @@ ...@@ -52,12 +54,18 @@
self.serverTable.delegate = self; self.serverTable.delegate = self;
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
self.slideShowPreviewStartObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_CONNECTED_SLIDESHOW_RUNNING self.pinValidationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_PAIRING_PINVALIDATION
object:nil object:nil
queue:mainQueue queue:mainQueue
usingBlock:^(NSNotification *note) { usingBlock:^(NSNotification *note) {
[self performSegueWithIdentifier:@"SlideShowPreview" sender:self ]; [self performSegueWithIdentifier:@"pinValidation" sender:self ];
}]; }];
self.slideShowPreviewStartObserver = [[NSNotificationCenter defaultCenter] addObserverForName:STATUS_PAIRING_PAIRED
object:nil
queue:mainQueue
usingBlock:^(NSNotification *note) {
[self performSegueWithIdentifier:@"SlideShowPreview" sender:self ];
}];
} }
-(void)viewWillAppear:(BOOL)animated -(void)viewWillAppear:(BOOL)animated
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface slideShowPreviewTable_vc : UITableViewController @interface slideShowPreviewTable_vc : UITableViewController <UITableViewDataSource, UITableViewDelegate>
@property (strong, nonatomic) IBOutlet UITableView *optionsTable;
@end @end
...@@ -7,16 +7,21 @@ ...@@ -7,16 +7,21 @@
// //
#import "slideShowPreviewTable_vc.h" #import "slideShowPreviewTable_vc.h"
#import "CommunicationManager.h"
#import "CommandTransmitter.h"
@interface slideShowPreviewTable_vc () @interface slideShowPreviewTable_vc ()
@property (nonatomic, strong) UIButton * startButton; @property (nonatomic, weak) UIButton * startButton;
@property (nonatomic, strong) NSArray * optionsArray;
@property (nonatomic, strong) CommunicationManager * comManager;
@end @end
@implementation slideShowPreviewTable_vc @implementation slideShowPreviewTable_vc
@synthesize startButton = _startButton; @synthesize startButton = _startButton;
@synthesize optionsTable = _optionsTable;
@synthesize optionsArray = _optionsArray;
- (id)initWithStyle:(UITableViewStyle)style - (id)initWithStyle:(UITableViewStyle)style
{ {
...@@ -36,6 +41,9 @@ ...@@ -36,6 +41,9 @@
// Uncomment the following line to display an Edit button in the navigation bar for this view controller. // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem; // self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.optionsArray = [NSArray arrayWithObjects:@"Lecturer's Notes", @"Timer", @"Pointer", nil];
self.comManager = [CommunicationManager sharedComManager];
self.comManager.delegate = self;
} }
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning
...@@ -46,26 +54,25 @@ ...@@ -46,26 +54,25 @@
#pragma mark - Table view data source #pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
#warning Incomplete method implementation. return [self.optionsArray count];
// Return the number of rows in the section.
return 0;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
static NSString *CellIdentifier = @"Cell"; static NSString *CellIdentifier = @"optionCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell... if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UISwitch *toggleSwitch = [[UISwitch alloc] init];
cell.accessoryView = [[UIView alloc] initWithFrame:toggleSwitch.frame];
[toggleSwitch setOn:YES];
[cell.accessoryView addSubview:toggleSwitch];
}
cell.textLabel.text = [self.optionsArray objectAtIndex:indexPath.row];
return cell; return cell;
} }
...@@ -110,28 +117,21 @@ ...@@ -110,28 +117,21 @@
*/ */
-(IBAction)startPresentationAction:(id)sender { -(IBAction)startPresentationAction:(id)sender {
[[self.comManager transmitter] startPresentation];
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Reset" [self performSegueWithIdentifier:@"slideShowSegue" sender:self];
message:@"You just pressed the Reset button"
delegate:self
cancelButtonTitle:@"Acknowledged"
otherButtonTitles:nil];
[alert show];
} }
- (UIButton *)startButton{ - (UIButton *)startButton{
if (self.startButton == nil) if (_startButton == nil) {
{ _startButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
_startButton.frame = CGRectMake(10.0, 10.0, 300.0, 50.0);
self.startButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [_startButton setTitle:@"Start Presentation" forState:UIControlStateNormal];
self.startButton.frame = CGRectMake(20.0, 40 , 95.0, 37.0); _startButton.backgroundColor = [UIColor clearColor];
[self.startButton setTitle:@"Start Presentation" forState:UIControlStateNormal]; [_startButton addTarget:self action:@selector(startPresentationAction:) forControlEvents:UIControlEventTouchDown];
self.startButton.backgroundColor = [UIColor clearColor];
[self.startButton addTarget:self action:@selector(startPresentationAction:) forControlEvents:UIControlEventTouchDown];
self.startButton.tag = 1; _startButton.tag = 1;
} }
return self.startButton; return _startButton;
} }
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
...@@ -146,23 +146,20 @@ ...@@ -146,23 +146,20 @@
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{ {
return 100.0; return 50.0;
} }
#pragma mark - Table view delegate #pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
// Navigation logic may go here. Create and push another view controller. UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
/* UISwitch * toggle = [[[cell accessoryView] subviews] objectAtIndex:0];
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; [toggle setOn:![toggle isOn] animated:YES];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
} }
- (void)viewDidUnload { - (void)viewDidUnload {
[self setOptionsTable:nil];
[super viewDidUnload]; [super viewDidUnload];
} }
@end @end
//
// slideShow_vc.h
// iosremote
//
// Created by Liu Siqi on 7/5/13.
// Copyright (c) 2013 libreoffice. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface slideShow_vc : UIViewController
- (IBAction)nextSlideAction:(id)sender;
- (IBAction)previousSlideAction:(id)sender;
@end
//
// slideShow_vc.m
// iosremote
//
// Created by Liu Siqi on 7/5/13.
// Copyright (c) 2013 libreoffice. All rights reserved.
//
#import "slideShow_vc.h"
#import "CommunicationManager.h"
#import "CommandTransmitter.h"
@interface slideShow_vc ()
@property (nonatomic, strong) CommunicationManager *comManager;
@end
@implementation slideShow_vc
@synthesize comManager = _comManager;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.comManager = [CommunicationManager sharedComManager];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidUnload {
[super viewDidUnload];
}
- (IBAction)nextSlideAction:(id)sender {
[[self.comManager transmitter] nextTransition];
}
- (IBAction)previousSlideAction:(id)sender {
[[self.comManager transmitter] previousTransition];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment