Kaydet (Commit) 2626c6cf authored tarafından siqi's avatar siqi

delegate & bugs fix

Change-Id: I2799d0756276ab43b2567e5b21e511a038a7462d
üst be025c19
......@@ -36,7 +36,7 @@
if ([command count] == 0) {
return;
}
NSLog(@"Command:%@", command);
// NSLog(@"Command:%@", command);
NSString *instruction = [command objectAtIndex:0];
if ([instruction isEqualToString:STATUS_PAIRING_PINVALIDATION]) {
[[NSNotificationCenter defaultCenter] postNotificationName:STATUS_PAIRING_PINVALIDATION
......@@ -57,7 +57,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:STATUS_CONNECTED_SLIDESHOW_RUNNING
object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_CHANGED object:[NSNumber numberWithUnsignedInt:currentSlide]];
[[NSNotificationCenter defaultCenter] postNotificationName:MSG_SLIDE_CHANGED object:nil];
} else if ([instruction isEqualToString:@"slideshow_finished"]){
NSLog(@"Interpreter: slideshow_finished");
......@@ -91,6 +91,9 @@
NSMutableString *notes = [[NSMutableString alloc] init];
for (int i = 2; i<command.count; ++i) {
[notes appendString:[command objectAtIndex:i]];
if ([notes hasSuffix:@"</body>"]) {
break;
}
}
[self.slideShow putNotes:notes
AtIndex:slideNumber];
......
......@@ -37,6 +37,8 @@ dispatch_queue_t backgroundQueue;
self.notesDictionary = [[NSMutableDictionary alloc] init];
_size = 0;
_currentSlide = 0;
self.lastRequestedImage = -1;
self.lastRequestedNote = -1;
backgroundQueue = dispatch_queue_create("org.libreoffice.iosremote.bgqueue", NULL);
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
......@@ -47,7 +49,7 @@ dispatch_queue_t backgroundQueue;
queue:mainQueue
usingBlock:^(NSNotification *note) {
if ([[[note userInfo] objectForKey:@"index"] intValue] == self.lastRequestedImage) {
// NSLog(@"Load last requsted image");
NSLog(@"Load last requsted image: %u", self.lastRequestedImage);
[[self.delegate slideView] setImage:[self getImageAtIndex:self.lastRequestedImage]];
self.lastRequestedImage = -1;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -116,6 +116,7 @@
cellForRowAtIndexPath:indexPath];
[[cell textField] becomeFirstResponder];
[self.comManager setDelegate:self];
}
// Force textfields to resign firstResponder so that our implementation of
......
......@@ -70,6 +70,7 @@
usingBlock:^(NSNotification *note) {
[self performSegueWithIdentifier:@"SlideShowPreview" sender:self ];
}];
[self.comManager setDelegate:self];
[super viewDidAppear:animated];
}
......
......@@ -43,6 +43,11 @@
self.comManager = [CommunicationManager sharedComManager];
self.slideshow = [self.comManager.interpreter slideShow];
self.slideshow.delegate = self;
[self.slideView setImage:[self.slideshow getImageAtIndex:self.slideshow.currentSlide]];
[self.lecturer_notes loadHTMLString: [self.slideshow getNotesAtIndex:self.slideshow.currentSlide]baseURL:nil];
[self.lecturer_notes setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"lines.png"]]];
}
......
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