Revision: 7599
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7599&view=rev
Author:   hofman
Date:     2011-12-25 15:45:53 +0000 (Sun, 25 Dec 2011)
Log Message:
-----------
Imply typeselect behavior from the match option, don't cycle results and don't 
match immediately when doing full string matching

Modified Paths:
--------------
    trunk/SKLeftSideViewController.m
    trunk/SKPresentationOptionsSheetController.m
    trunk/SKTypeSelectHelper.h
    trunk/SKTypeSelectHelper.m

Modified: trunk/SKLeftSideViewController.m
===================================================================
--- trunk/SKLeftSideViewController.m    2011-12-24 00:26:44 UTC (rev 7598)
+++ trunk/SKLeftSideViewController.m    2011-12-25 15:45:53 UTC (rev 7599)
@@ -95,10 +95,7 @@
     [groupedFindTableView setDelegate:mainController];
     [[thumbnailTableView menu] setDelegate:mainController];
     
-    SKTypeSelectHelper *typeSelectHelper = [SKTypeSelectHelper 
typeSelectHelperWithMatchOption:SKFullStringMatch];
-    [typeSelectHelper setMatchesImmediately:NO];
-    [typeSelectHelper setCyclesSimilarResults:NO];
-    [thumbnailTableView setTypeSelectHelper:typeSelectHelper];
+    [thumbnailTableView setTypeSelectHelper:[SKTypeSelectHelper 
typeSelectHelperWithMatchOption:SKFullStringMatch]];
     [tocOutlineView setTypeSelectHelper:[SKTypeSelectHelper 
typeSelectHelperWithMatchOption:SKSubstringMatch]];
 }
 

Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m        2011-12-24 00:26:44 UTC 
(rev 7598)
+++ trunk/SKPresentationOptionsSheetController.m        2011-12-25 15:45:53 UTC 
(rev 7599)
@@ -173,10 +173,7 @@
     
     [tableView setBackgroundColor:[[NSColor 
controlAlternatingRowBackgroundColors] lastObject]];
     
-    SKTypeSelectHelper *typeSelectHelper = [SKTypeSelectHelper 
typeSelectHelperWithMatchOption:SKFullStringMatch];
-    [typeSelectHelper setMatchesImmediately:NO];
-    [typeSelectHelper setCyclesSimilarResults:NO];
-    [tableView setTypeSelectHelper:typeSelectHelper];
+    [tableView setTypeSelectHelper:[SKTypeSelectHelper 
typeSelectHelperWithMatchOption:SKFullStringMatch]];
     
     if ([transitionController pageTransitions]) {
         [[self undoManager] disableUndoRegistration];

Modified: trunk/SKTypeSelectHelper.h
===================================================================
--- trunk/SKTypeSelectHelper.h  2011-12-24 00:26:44 UTC (rev 7598)
+++ trunk/SKTypeSelectHelper.h  2011-12-25 15:45:53 UTC (rev 7599)
@@ -50,8 +50,6 @@
     id dataSource;
     
     struct _tshFlags {
-        unsigned int cycleResults:1;
-        unsigned int matchesImmediately:1;
         unsigned int matchOption:2;
         unsigned int processing:1;
     } tshFlags;
@@ -62,7 +60,6 @@
 }
 
 @property (nonatomic, assign) id dataSource;
-@property (nonatomic) BOOL cyclesSimilarResults, matchesImmediately;
 @property (nonatomic) SKTypeSelectMatchOption matchOption;
 @property (nonatomic, retain) NSString *searchString;
 @property (nonatomic, readonly) BOOL isProcessing;

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2011-12-24 00:26:44 UTC (rev 7598)
+++ trunk/SKTypeSelectHelper.m  2011-12-25 15:45:53 UTC (rev 7599)
@@ -65,7 +65,7 @@
 @implementation SKTypeSelectHelper
 
 @synthesize dataSource, searchString;
-@dynamic cyclesSimilarResults, matchesImmediately, matchOption, isProcessing;
+@dynamic matchOption, isProcessing;
 
 
 + (id)typeSelectHelper {
@@ -82,8 +82,6 @@
         dataSource = nil;
         searchCache = nil;
         searchString = nil;
-        tshFlags.cycleResults = YES;
-        tshFlags.matchesImmediately = YES;
         tshFlags.matchOption = aMatchOption;
         tshFlags.processing = NO;
         timer = nil;
@@ -112,22 +110,6 @@
     }
 }
 
-- (BOOL)cyclesSimilarResults {
-    return tshFlags.cycleResults;
-}
-
-- (void)setCyclesSimilarResults:(BOOL)newValue {
-    tshFlags.cycleResults = newValue;
-}
-
-- (BOOL)matchesImmediately {
-    return tshFlags.matchesImmediately;
-}
-
-- (void)setMatchesImmediately:(BOOL)newValue {
-    tshFlags.matchesImmediately = newValue;
-}
-
 - (SKTypeSelectMatchOption)matchOption {
     return tshFlags.matchOption;
 }
@@ -183,7 +165,7 @@
     // Reset the timer if it hasn't expired yet
     [self startTimerForSelector:@selector(typeSelectSearchTimeout:)];
     
-    if (tshFlags.matchesImmediately)
+    if (tshFlags.matchOption != SKFullStringMatch)
         [self searchWithStickyMatch:tshFlags.processing];
     
     tshFlags.processing = YES;
@@ -278,7 +260,7 @@
 }
 
 - (void)typeSelectSearchTimeout:(id)sender {
-    if (tshFlags.matchesImmediately == NO)
+    if (tshFlags.matchOption == SKFullStringMatch)
         [self searchWithStickyMatch:NO];
     [self typeSelectCleanTimeout:sender];
 }
@@ -313,7 +295,7 @@
     if ([searchString length]) {
         NSUInteger selectedIndex, startIndex, foundIndex;
         
-        if (tshFlags.cycleResults) {
+        if (tshFlags.matchOption != SKFullStringMatch) {
             selectedIndex = [dataSource 
typeSelectHelperCurrentlySelectedIndex:self];
             if (selectedIndex >= [[self searchCache] count])
                 selectedIndex = NSNotFound;

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


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to