From 17b12685461281b81143c393a914819195e8428e Mon Sep 17 00:00:00 2001
From: Damiano Galassi <damiog@gmail.com>
Date: Sun, 11 Aug 2019 17:44:05 +0200
Subject: MacGui: improve queue accessibility.

---
macosx/HBQueueItemView.m | 9 +++++++++
1 file changed, 9 insertions(+)

(limited to 'macosx/HBQueueItemView.m')

diff --git a/macosx/HBQueueItemView.m b/macosx/HBQueueItemView.m
index 243c52938..5fcf55308 100644
--- a/macosx/HBQueueItemView.m
+++ b/macosx/HBQueueItemView.m
@@ -38,25 +38,32 @@
- (void)HB_updateState
{
NSImage *state = nil;
+ NSString *label = nil;
switch (_item.state) {
case HBQueueItemStateCompleted:
state = [NSImage imageNamed:@"EncodeComplete"];
+ label = NSLocalizedString(@"Encode complete", @"HBQueueItemView -> Encode state accessibility label");
break;
case HBQueueItemStateWorking:
state = [NSImage imageNamed:@"EncodeWorking0"];
+ label = NSLocalizedString(@"Encode working", @"HBQueueItemView -> Encode state accessibility label");
break;
case HBQueueItemStateCanceled:
state = [NSImage imageNamed:@"EncodeCanceled"];
+ label = NSLocalizedString(@"Encode canceled", @"HBQueueItemView -> Encode state accessibility label");
break;
case HBQueueItemStateFailed:
state = [NSImage imageNamed:@"EncodeFailed"];
+ label = NSLocalizedString(@"Encode failed", @"HBQueueItemView -> Encode state accessibility label");
break;
default:
state = [NSImage imageNamed:@"JobSmall"];
+ NSLocalizedString(@"Encode ready", @"HBQueueItemView -> Encode state accessibility label");
break;
}

self.imageView.image = state;
+ self.imageView.accessibilityLabel = label;
}

- (void)HB_updateRightButton
@@ -80,6 +87,7 @@
{
[_removeButton setImage:[NSImage imageNamed:darkAqua ? @"RevealHighlight" : @"Reveal"]];
}
+ _removeButton.accessibilityTitle = NSLocalizedString(@"Reveal destination in Finder", @"HBQueueItemView -> Reveal button accessibility label");
}
else
{
@@ -93,6 +101,7 @@
{
[_removeButton setImage:[NSImage imageNamed:darkAqua ? @"DeleteHighlight" : @"Delete"]];
}
+ _removeButton.accessibilityTitle = NSLocalizedString(@"Remove job", @"HBQueueItemView -> Remove button accessibility label");
}
}

--
cgit v1.2.3