Revision: 26006 http://sourceforge.net/p/bibdesk/svn/26006 Author: hofman Date: 2021-05-18 23:31:09 +0000 (Tue, 18 May 2021) Log Message: ----------- Use binding fro target-action of add/remove condition buttons
Modified Paths: -------------- trunk/bibdesk/BDSKConditionController.h trunk/bibdesk/BDSKConditionController.m trunk/bibdesk/BDSKFilterController.m trunk/bibdesk/Base.lproj/BDSKCondition.xib Modified: trunk/bibdesk/BDSKConditionController.h =================================================================== --- trunk/bibdesk/BDSKConditionController.h 2021-05-18 23:19:05 UTC (rev 26005) +++ trunk/bibdesk/BDSKConditionController.h 2021-05-18 23:31:09 UTC (rev 26006) @@ -100,10 +100,7 @@ - (id)initWithCondition:(BDSKCondition *)aCondition; -- (IBAction)addNewCondition:(id)sender; -- (IBAction)removeThisCondition:(id)sender; - (IBAction)changeRating:(id)sender; -- (IBAction)selectKeyText:(id)sender; @property (nonatomic, assign) BDSKFilterController *filterController; Modified: trunk/bibdesk/BDSKConditionController.m =================================================================== --- trunk/bibdesk/BDSKConditionController.m 2021-05-18 23:19:05 UTC (rev 26005) +++ trunk/bibdesk/BDSKConditionController.m 2021-05-18 23:31:09 UTC (rev 26006) @@ -139,19 +139,6 @@ [self layoutValueControls]; } -- (IBAction)addNewCondition:(id)sender { - [filterController insertNewConditionAfter:self]; -} - -- (IBAction)removeThisCondition:(id)sender { - if ([filterController hasMultipleConditions]) - [filterController removeConditionController:self]; -} - -- (IBAction)selectKeyText:(id)sender { - [keyComboBox selectText:sender]; -} - // we could implement binding in BDSKRatingButton, but that's a lot of hassle and exposes us to the binding-to-owner bug - (IBAction)changeRating:(id)sender { [[self condition] setStringValue:[NSString stringWithFormat:@"%ld", (long)[sender rating]]]; Modified: trunk/bibdesk/BDSKFilterController.m =================================================================== --- trunk/bibdesk/BDSKFilterController.m 2021-05-18 23:19:05 UTC (rev 26005) +++ trunk/bibdesk/BDSKFilterController.m 2021-05-18 23:31:09 UTC (rev 26006) @@ -138,7 +138,7 @@ ++idx; BDSKConditionController *newController = [[[BDSKConditionController alloc] init] autorelease]; [self insertObject:newController inConditionControllersAtIndex:idx]; - [newController selectKeyText:self]; + [[newController keyComboBox] selectText:self]; } - (void)insertObject:(BDSKConditionController *)newController inConditionControllersAtIndex:(NSUInteger)idx { Modified: trunk/bibdesk/Base.lproj/BDSKCondition.xib =================================================================== --- trunk/bibdesk/Base.lproj/BDSKCondition.xib 2021-05-18 23:19:05 UTC (rev 26005) +++ trunk/bibdesk/Base.lproj/BDSKCondition.xib 2021-05-18 23:31:09 UTC (rev 26006) @@ -621,7 +621,11 @@ <font key="font" metaFont="cellTitle"/> </buttonCell> <connections> - <action selector="removeThisCondition:" target="-2" id="290"/> + <binding destination="-2" name="argument" keyPath="self" id="xFP-Wv-mLY"> + <dictionary key="options"> + <string key="NSSelectorName">removeConditionController:</string> + </dictionary> + </binding> <binding destination="-2" name="enabled" keyPath="filterController.hasMultipleConditions" id="Y5g-N1-RJs"/> <binding destination="403" name="hidden" keyPath="selection.self" previousBinding="Y5g-N1-RJs" id="IRl-h6-e8g"> <dictionary key="options"> @@ -628,6 +632,11 @@ <string key="NSValueTransformerName">NSIsNil</string> </dictionary> </binding> + <binding destination="-2" name="target" keyPath="filterController" previousBinding="xFP-Wv-mLY" id="pL6-yR-qIn"> + <dictionary key="options"> + <string key="NSSelectorName">removeConditionController:</string> + </dictionary> + </binding> <outlet property="nextKeyView" destination="271" id="277"/> </connections> </button> @@ -638,7 +647,16 @@ <font key="font" metaFont="cellTitle"/> </buttonCell> <connections> - <action selector="addNewCondition:" target="-2" id="289"/> + <binding destination="-2" name="argument" keyPath="self" id="u7B-Vl-GWc"> + <dictionary key="options"> + <string key="NSSelectorName">insertNewConditionAfter:</string> + </dictionary> + </binding> + <binding destination="-2" name="target" keyPath="filterController" previousBinding="u7B-Vl-GWc" id="CQn-W9-XcQ"> + <dictionary key="options"> + <string key="NSSelectorName">insertNewConditionAfter:</string> + </dictionary> + </binding> </connections> </button> <comboBox verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="272"> @@ -652,13 +670,13 @@ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </comboBoxCell> <connections> + <binding destination="-2" name="contentValues" keyPath="keys" id="278"/> + <binding destination="403" name="value" keyPath="selection.key" previousBinding="278" id="429"/> <binding destination="403" name="hidden" keyPath="selection.self" id="DT9-6a-Cel"> <dictionary key="options"> <string key="NSValueTransformerName">NSIsNil</string> </dictionary> </binding> - <binding destination="-2" name="contentValues" keyPath="keys" id="278"/> - <binding destination="403" name="value" keyPath="selection.key" previousBinding="278" id="429"/> </connections> </comboBox> <customView translatesAutoresizingMaskIntoConstraints="NO" id="0gC-VL-mI4"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit