mirror of
https://github.com/videolan/vlc.git
synced 2024-11-26 19:34:40 +08:00
macosx: Track items that are currently loading in status notifier view
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
df45819caf
commit
d3986198f2
@ -28,6 +28,7 @@
|
||||
@interface VLCStatusNotifierView ()
|
||||
|
||||
@property NSUInteger remainingCount;
|
||||
@property NSUInteger loadingCount;
|
||||
@property (nonatomic) BOOL permanentDiscoveryMessageActive;
|
||||
|
||||
@end
|
||||
@ -37,6 +38,7 @@
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
self.remainingCount = 0;
|
||||
self.loadingCount = 0;
|
||||
self.permanentDiscoveryMessageActive = NO;
|
||||
self.label.stringValue = _NS("Idle");
|
||||
|
||||
@ -44,6 +46,22 @@
|
||||
[defaultCenter addObserver:self selector:@selector(updateStatus:) name:nil object:nil];
|
||||
}
|
||||
|
||||
- (void)displayStartLoad
|
||||
{
|
||||
if (self.loadingCount == 0) {
|
||||
[self.progressIndicator startAnimation:self];
|
||||
}
|
||||
self.loadingCount++;
|
||||
}
|
||||
|
||||
- (void)displayFinishLoad
|
||||
{
|
||||
self.loadingCount--;
|
||||
if (self.loadingCount == 0) {
|
||||
[self.progressIndicator stopAnimation:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setPermanentDiscoveryMessageActive:(BOOL)permanentDiscoveryMessageActive
|
||||
{
|
||||
if (_permanentDiscoveryMessageActive == permanentDiscoveryMessageActive) {
|
||||
@ -53,10 +71,10 @@
|
||||
_permanentDiscoveryMessageActive = permanentDiscoveryMessageActive;
|
||||
if (permanentDiscoveryMessageActive) {
|
||||
self.remainingCount++;
|
||||
[self.progressIndicator startAnimation:self];
|
||||
[self displayStartLoad];
|
||||
} else {
|
||||
self.remainingCount--;
|
||||
[self.progressIndicator stopAnimation:self];
|
||||
[self displayFinishLoad];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user