Revision: 2833
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2833&view=rev
Author:   hofman
Date:     2007-09-05 05:51:37 -0700 (Wed, 05 Sep 2007)

Log Message:
-----------
Show a different message when type-select fails.

Modified Paths:
--------------
    trunk/SKBookmarkController.m
    trunk/SKMainWindowController.m
    trunk/SKTypeSelectHelper.h
    trunk/SKTypeSelectHelper.m

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2007-09-05 08:57:31 UTC (rev 2832)
+++ trunk/SKBookmarkController.m        2007-09-05 12:51:37 UTC (rev 2833)
@@ -372,6 +372,10 @@
     [tableView scrollRowToVisible:itemIndex];
 }
 
+- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString {
+    [statusBar setLeftStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"[EMAIL PROTECTED]"", @"Status 
message"), searchString]];
+}
+
 - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
updateSearchString:(NSString *)searchString {
     NSString *message = @"";
     if (searchString)

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2007-09-05 08:57:31 UTC (rev 2832)
+++ trunk/SKMainWindowController.m      2007-09-05 12:51:37 UTC (rev 2833)
@@ -3684,6 +3684,16 @@
     }
 }
 
+- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString {
+    if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || 
[typeSelectHelper isEqual:[pdfView typeSelectHelper]]) {
+        [statusBar setLeftStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: %@", @"Status message"), 
searchString]];
+    } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) {
+        [statusBar setRightStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"[EMAIL PROTECTED]"", @"Status 
message"), searchString]];
+    } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) {
+        [statusBar setLeftStringValue:[NSString 
stringWithFormat:NSLocalizedString(@"No match: \"[EMAIL PROTECTED]"", @"Status 
message"), searchString]];
+    }
+}
+
 - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
updateSearchString:(NSString *)searchString {
     if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || 
[typeSelectHelper isEqual:[pdfView typeSelectHelper]]) {
         if (searchString)

Modified: trunk/SKTypeSelectHelper.h
===================================================================
--- trunk/SKTypeSelectHelper.h  2007-09-05 08:57:31 UTC (rev 2832)
+++ trunk/SKTypeSelectHelper.h  2007-09-05 12:51:37 UTC (rev 2833)
@@ -88,6 +88,7 @@
 - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper 
*)typeSelectHelper; // required
 - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
selectItemAtIndex:(unsigned int)itemIndex; // required
 
+- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
didFailToFindMatchForSearchString:(NSString *)searchString; // optional
 - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper 
updateSearchString:(NSString *)searchString; // optional
 
 @end

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2007-09-05 08:57:31 UTC (rev 2832)
+++ trunk/SKTypeSelectHelper.m  2007-09-05 12:51:37 UTC (rev 2833)
@@ -234,9 +234,13 @@
         
         foundIndex = [self indexOfMatchedItemAfterIndex:startIndex];
         
-        // Avoid flashing a selection all over the place while you're still 
typing the thing you have selected
-        if (foundIndex != NSNotFound && foundIndex != selectedIndex)
+        if (foundIndex == NSNotFound) {
+            if ([dataSource 
respondsToSelector:@selector(typeSelectHelper:didFailToFindMatchForSearchString:)])
+                [dataSource typeSelectHelper:self 
didFailToFindMatchForSearchString:searchString];
+        } else if (foundIndex != selectedIndex) {
+            // Avoid flashing a selection all over the place while you're 
still typing the thing you have selected
             [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex];
+        }
     }
 }
 


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to