Revision: 25891 http://sourceforge.net/p/bibdesk/svn/25891 Author: hofman Date: 2021-05-06 15:09:58 +0000 (Thu, 06 May 2021) Log Message: ----------- Only update UI when view was loaded
Modified Paths: -------------- trunk/bibdesk/BibPref_AutoFile.m trunk/bibdesk/BibPref_CiteKey.m trunk/bibdesk/BibPref_Crossref.m trunk/bibdesk/BibPref_General.m trunk/bibdesk/BibPref_Sharing.m Modified: trunk/bibdesk/BibPref_AutoFile.m =================================================================== --- trunk/bibdesk/BibPref_AutoFile.m 2021-05-06 15:02:12 UTC (rev 25890) +++ trunk/bibdesk/BibPref_AutoFile.m 2021-05-06 15:09:58 UTC (rev 25891) @@ -104,7 +104,6 @@ - (void)defaultsDidRevert { // reset UI, but only if we loaded the nib if ([self isViewLoaded]) { - [self updateFormatPreviewUI]; [self updateFormatPresetUI]; } } @@ -410,7 +409,8 @@ [self willChangeValueForKey:@"hasPapersFolder"]; [self didChangeValueForKey:@"hasPapersFolder"]; } - [self updateFormatPreviewUI]; + if ([self isViewLoaded]) + [self updateFormatPreviewUI]; } @end Modified: trunk/bibdesk/BibPref_CiteKey.m =================================================================== --- trunk/bibdesk/BibPref_CiteKey.m 2021-05-06 15:02:12 UTC (rev 25890) +++ trunk/bibdesk/BibPref_CiteKey.m 2021-05-06 15:09:58 UTC (rev 25891) @@ -334,7 +334,8 @@ #pragma mark KVO - (void)observeValueForUserDefaultsKey:(NSString *)key { - [self updateFormatPreviewUI]; + if ([self isViewLoaded]) + [self updateFormatPreviewUI]; } @end Modified: trunk/bibdesk/BibPref_Crossref.m =================================================================== --- trunk/bibdesk/BibPref_Crossref.m 2021-05-06 15:02:12 UTC (rev 25890) +++ trunk/bibdesk/BibPref_Crossref.m 2021-05-06 15:09:58 UTC (rev 25891) @@ -148,7 +148,8 @@ #pragma mark KVO - (void)observeValueForUserDefaultsKey:(NSString *)key { - [self updateAddRemoveButton]; + if ([self isViewLoaded]) + [self updateAddRemoveButton]; } @end Modified: trunk/bibdesk/BibPref_General.m =================================================================== --- trunk/bibdesk/BibPref_General.m 2021-05-06 15:02:12 UTC (rev 25890) +++ trunk/bibdesk/BibPref_General.m 2021-05-06 15:09:58 UTC (rev 25891) @@ -100,9 +100,11 @@ NSTimeInterval interval = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"SUScheduledCheckInterval"] doubleValue]; [[SUUpdater sharedUpdater] setUpdateCheckInterval:interval]; [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:interval > 0.0]; - [self updateEmailTemplateUI]; - [self updateDefaultBibFileUI]; - [self updateUpdaterUI]; + if ([self isViewLoaded]) { + [self updateEmailTemplateUI]; + [self updateDefaultBibFileUI]; + [self updateUpdaterUI]; + } } @@ -190,10 +192,12 @@ } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if (context == &BDSKBibPrefGeneralUpdaterObservationContext) - [self updateUpdaterUI]; - else + if (context == &BDSKBibPrefGeneralUpdaterObservationContext) { + if ([self isViewLoaded]) + [self updateUpdaterUI]; + } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } } @end Modified: trunk/bibdesk/BibPref_Sharing.m =================================================================== --- trunk/bibdesk/BibPref_Sharing.m 2021-05-06 15:02:12 UTC (rev 25890) +++ trunk/bibdesk/BibPref_Sharing.m 2021-05-06 15:09:58 UTC (rev 25891) @@ -208,13 +208,15 @@ [[BDSKSharingBrowser sharedBrowser] enableSharedBrowsing]; else [[BDSKSharingBrowser sharedBrowser] disableSharedBrowsing]; - [self updateStatusUI]; + if ([self isViewLoaded]) + [self updateStatusUI]; } else if ([key isEqualToString:BDSKShouldShareFilesKey]) { if ([sud boolForKey:BDSKShouldShareFilesKey]) [[BDSKSharingServer defaultServer] enableSharing]; else [[BDSKSharingServer defaultServer] disableSharing]; - [self updateStatusUI]; + if ([self isViewLoaded]) + [self updateStatusUI]; } } 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