Permalink
Browse files

Merge branch 'master' of git://github.com/simX/clicktoflash

Conflicts:
	Plugin/Plugin.h
	Plugin/Plugin.m
  • Loading branch information...
2 parents 6201844 + f1d8c95 commit 1c0a092382b4e0e5ea881bf200995b2416b45d36 @rentzsch rentzsch committed Jul 23, 2009
View
0 Plugin/CTFPreferencesDictionary.h 100755 → 100644
File mode changed.
View
0 Plugin/CTFUserDefaultsController.h 100755 → 100644
File mode changed.
View
3 Plugin/Plugin.h
@@ -52,8 +52,9 @@ THE SOFTWARE.
NSString *_src;
NSString *_videoId;
NSString *_launchedAppBundleIdentifier;
-
+
BOOL _contextMenuIsVisible;
+ BOOL _receivedAllResponses;
NSURLConnection *connections[2];
unsigned expectedResponses;
NSTimer *_delayingTimer;
View
34 Plugin/Plugin.m
@@ -747,21 +747,30 @@ - (void) _loadInvisibleContentForWindow: (NSNotification*) notification
- (NSString*) badgeLabelText
{
- if( [ self _useHDH264Version ] && [self _hasHDH264Version])
+ if( [ self _useHDH264Version ] && [self _hasHDH264Version]) {
return NSLocalizedString( @"HD H.264", @"HD H.264 badge text" );
- if( [ self _useH264Version ] && [self _hasH264Version])
- return NSLocalizedString( @"H.264", @"H.264 badge text" );
- else if( _fromYouTube && _videoId)
+ } else if( [ self _useH264Version ] && [self _hasH264Version]) {
+ if (_receivedAllResponses) {
+ return NSLocalizedString( @"H.264", @"H.264 badge text" );
+ } else {
+ return NSLocalizedString( @"H.264…", @"H.264 badge waiting text" );
+ }
+ } else if( _fromYouTube && _videoId) {
// we check the video ID too because if it's a flash ad on YouTube.com,
// we don't want to identify it as an actual YouTube video -- but if
// the flash object actually has a video ID parameter, it means its
// a bona fide YouTube video
- return NSLocalizedString( @"YouTube", @"YouTube badge text" );
- else if( _badgeText )
+ if (_receivedAllResponses) {
+ return NSLocalizedString( @"YouTube", @"YouTube badge text" );
+ } else {
+ return NSLocalizedString( @"YouTube…", @"YouTube badge waiting text" );
+ }
+ } else if( _badgeText ) {
return _badgeText;
- else
+ } else {
return NSLocalizedString( @"Flash", @"Flash badge text" );
+ }
}
- (void) _drawBadgeWithPressed: (BOOL) pressed
@@ -1138,24 +1147,27 @@ - (void)_checkForH264VideoVariants
}
expectedResponses = 2;
+ _receivedAllResponses = NO;
}
}
- (void)finishedWithConnection:(NSURLConnection *)connection
{
- BOOL receivedAllResponses = YES;
+ BOOL didReceiveAllResponses = YES;
for (int i = 0; i < 2; ++i) {
if (connection == connections[i]) {
[connection cancel];
[connection release];
connections[i] = nil;
} else if (connections[i])
- receivedAllResponses = NO;
+ didReceiveAllResponses = NO;
}
- if (receivedAllResponses)
- [self setUpExtraMenuItems];
+ if (didReceiveAllResponses) _receivedAllResponses = YES;
+
+ [self setUpExtraMenuItems];
+ [self setNeedsDisplay:YES];
}
- (void)connection:(NSURLConnection *)connection

0 comments on commit 1c0a092

Please sign in to comment.