Skip to content

Commit

Permalink
Fix for ticket #3: Better end-of-talk display. We remove the CounterV…
Browse files Browse the repository at this point in the history
…iew when the timer has expired on the last slide.

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Philippe Casgrain authored and rentzsch committed Jul 13, 2009
1 parent 71d81c7 commit b4be0c5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions BlitzPDFView.h
Expand Up @@ -11,6 +11,7 @@

@property uint16_t secondsElapsed;

- (void)atLastPage;
- (IBAction)updateSecondsElapsed:(id)sender;

@end
12 changes: 8 additions & 4 deletions BlitzPDFView.m
Expand Up @@ -163,9 +163,8 @@ - (void)drawPagePost:(PDFPage*)page {
[counterView setNeedsDisplay: YES];
}

- (void)dealloc
{
[counterView release];
- (void)dealloc {
[self atLastPage];
[super dealloc];
}

Expand All @@ -175,7 +174,12 @@ - (uint16_t) secondsElapsed {

- (void)setSecondsElapsed:(uint16_t)secs {
secondsElapsed = secs;
counterView.secondsElapsed = secs;
counterView.secondsElapsed = secs;
}

- (void)atLastPage {
[[counterView animator] removeFromSuperview];
counterView = nil;
}

- (IBAction)updateSecondsElapsed:(id)sender {
Expand Down
8 changes: 7 additions & 1 deletion MyDocument.m
Expand Up @@ -52,7 +52,13 @@ - (BOOL)readFromURL:(NSURL *)initWithURL ofType:(NSString *)typeName error:(NSEr

- (void)updateElapsedTimer:(NSTimer*)timer_ {
if (self.pdfView.secondsElapsed != 0 && (self.pdfView.secondsElapsed % 15 == 0)) {
[self.pdfView goToNextPage:nil];
if ([self.pdfView canGoToNextPage]) {
[self.pdfView goToNextPage:nil];
}
else {
[self.pdfView atLastPage];
[timer_ invalidate];
}
}
self.pdfView.secondsElapsed += 1;
[self.pdfView setNeedsDisplay:YES];
Expand Down

0 comments on commit b4be0c5

Please sign in to comment.