Revision: 3760
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3760&view=rev
Author:   hofman
Date:     2008-04-18 11:45:17 -0700 (Fri, 18 Apr 2008)

Log Message:
-----------
Add status message to progress value for accessibility.

Modified Paths:
--------------
    trunk/SKProgressCell.m

Modified: trunk/SKProgressCell.m
===================================================================
--- trunk/SKProgressCell.m      2008-04-18 17:36:52 UTC (rev 3759)
+++ trunk/SKProgressCell.m      2008-04-18 18:45:17 UTC (rev 3760)
@@ -124,4 +124,27 @@
     }
 }
 
+- (id)accessibilityAttributeValue:(NSString *)attribute {
+    if ([attribute isEqualToString:NSAccessibilityValueAttribute] && 
progressIndicator == nil) {
+        NSString *string = nil;
+        switch (status) {
+            case SKDownloadStatusStarting:
+                string = [NSLocalizedString(@"Starting", @"Download status 
message") stringByAppendingEllipsis];
+                break;
+            case SKDownloadStatusFinished:
+                string = NSLocalizedString(@"Finished", @"Download status 
message");
+                break;
+            case SKDownloadStatusFailed:
+                string = NSLocalizedString(@"Failed", @"Download status 
message");
+                break;
+            case SKDownloadStatusCanceled:
+                string = NSLocalizedString(@"Canceled", @"Download status 
message");
+                break;
+        }
+        return [[super accessibilityAttributeValue:attribute] 
stringByAppendingFormat:@"\n%@", string];
+    } else {
+        return [super accessibilityAttributeValue:attribute];
+    }
+}
+
 @end


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to