Browse Source

Search bug fixed.

v1.2.2
Abhishek Banthia 9 years ago
parent
commit
d988b539a1
  1. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  2. 10
      Clocker/Preferences/CLPreferencesView.xib
  3. 32
      Clocker/Preferences/CLPreferencesViewController.m

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

10
Clocker/Preferences/CLPreferencesView.xib

@ -97,8 +97,8 @@ CA
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="xOd-3p-ihC">
<font key="font" size="13" name="SFUIDisplay-Light"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
@ -264,7 +264,7 @@ CA
<tableViewGridLines key="gridStyleMask" vertical="YES"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="availableTimezones" editable="NO" width="236" minWidth="200" maxWidth="1000" id="48H-5i-utq">
<tableColumn identifier="availableTimezones" editable="NO" width="225" minWidth="200" maxWidth="1000" id="48H-5i-utq">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Places/Timezone(s)">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@ -280,14 +280,14 @@ CA
<binding destination="-2" name="headerTitle" keyPath="self.columnName" id="7nT-oz-EFo"/>
</connections>
</tableColumn>
<tableColumn identifier="abbreviation" editable="NO" width="87" minWidth="70" maxWidth="100" id="V1c-xe-G2h">
<tableColumn identifier="abbreviation" editable="NO" width="90" minWidth="90" maxWidth="100" id="V1c-xe-G2h">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Abbreviation">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="j4V-8w-sXt">
<font key="font" metaFont="system"/>
<font key="font" size="13" name="SFUIDisplay-Light"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>

32
Clocker/Preferences/CLPreferencesViewController.m

@ -78,12 +78,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
[self.timezoneTableView registerForDraggedTypes: [NSArray arrayWithObject: CLDragSessionKey]];
self.columnName = @"Place(s)";
self.abbreviation.hidden = YES;
// Do view setup here.
}
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self
@ -178,8 +176,21 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
{
return selectedDataSource.isFavourite;
}
else if ([tableColumn.identifier isEqualToString:@"abbreviation"])
{
if (self.searchField.stringValue.length > 0)
{
if (row < self.timeZoneFilteredArray.count)
{
return [NSTimeZone timeZoneWithName:self.timeZoneFilteredArray[row]].abbreviation;
}
}
return [NSTimeZone timeZoneWithName:self.timeZoneArray[row]].abbreviation;
}
return nil;
}
@ -233,8 +244,16 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
- (IBAction)addTimeZone:(id)sender
{
self.abbreviation.hidden = YES;
self.filteredArray = [NSMutableArray new];
self.searchCriteria.selectedSegment = 0;
[self.view.window beginSheet:self.timezonePanel completionHandler:nil];
self.timeZoneArray = [NSMutableArray new];
[self.view.window beginSheet:self.timezonePanel
completionHandler:nil];
}
- (IBAction)addToFavorites:(id)sender
@ -359,6 +378,9 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
- (IBAction)closePanel:(id)sender
{
self.filteredArray = [NSMutableArray array];
self.timeZoneArray = [NSMutableArray new];
self.searchCriteria.selectedSegment = 0;
self.columnName = @"Place(s)";
self.placeholderLabel.placeholderString = CLEmptyString;
[self.availableTimezoneTableView reloadData];
self.searchField.stringValue = CLEmptyString;
@ -753,8 +775,6 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
self.abbreviation.hidden = NO;
}
self.filteredArray = [NSMutableArray new];
self.searchField.stringValue = CLEmptyString;
[self.availableTimezoneTableView reloadData];
}

Loading…
Cancel
Save