diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-07 13:14:48 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-07 13:14:48 +0200 |
| commit | 0f26c5c3b3e606c89724067d4785323de3fee751 (patch) | |
| tree | 00ccd17d4776b639b383f1b086dd39ac4dbbf1b9 | |
| parent | a081f7ea92f32b8284cce4d11f8e899b08754acf (diff) | |
Autosave on change
| -rw-r--r-- | QSDeliciousPlugIn_Source.h | 2 | ||||
| -rw-r--r-- | QSDeliciousPlugIn_Source.m | 11 | ||||
| -rw-r--r-- | QSDeliciousPlugIn_Source.xib | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/QSDeliciousPlugIn_Source.h b/QSDeliciousPlugIn_Source.h index 9d22d91..1eff1c7 100644 --- a/QSDeliciousPlugIn_Source.h +++ b/QSDeliciousPlugIn_Source.h @@ -17,6 +17,8 @@ IBOutlet NSTextField *passField; IBOutlet NSTextField *hostField; } + +- (IBAction)settingsChanged:(id)sender; @end @interface QSCatalogEntry (OldStyleSourceSupport) diff --git a/QSDeliciousPlugIn_Source.m b/QSDeliciousPlugIn_Source.m index ab8c1f1..fb09a97 100644 --- a/QSDeliciousPlugIn_Source.m +++ b/QSDeliciousPlugIn_Source.m @@ -12,10 +12,6 @@ @implementation QSDeliciousPlugIn_Source -+ (void)initialize { - [self setKeys:[NSArray arrayWithObject:@"selection"] triggerChangeNotificationsForDependentKey:@"currentPassword"]; -} - - (BOOL)indexIsValidFromDate:(NSDate *)indexDate forEntry:(NSDictionary *)theEntry { return -[indexDate timeIntervalSinceNow] < 24 * 60 * 60; } @@ -59,6 +55,11 @@ return [[self.selectedEntry.sourceSettings objectForKey:@"includeTags"] boolValue]; } + +- (IBAction)settingsChanged:(id)sender { + [[NSNotificationCenter defaultCenter] postNotificationName:QSCatalogEntryChangedNotification object:self.selectedEntry]; +} + #pragma mark - Keychain Access - (SecProtocolType)protocolTypeForString:(NSString *)protocol { @@ -206,8 +207,6 @@ - (NSArray *)objectsForEntry:(NSDictionary *)theEntry { NSLog(@"WE HAVE BEEN REQUESTED"); - [[NSNotificationCenter defaultCenter] postNotificationName:QSCatalogEntryChangedNotification object:theEntry]; - SocialSite site = [self siteIndex]; NSString *username = [self currentUsername]; NSString *password = [self currentPassword]; diff --git a/QSDeliciousPlugIn_Source.xib b/QSDeliciousPlugIn_Source.xib index 65d8dda..83b620f 100644 --- a/QSDeliciousPlugIn_Source.xib +++ b/QSDeliciousPlugIn_Source.xib @@ -88,6 +88,7 @@ <constraint firstAttribute="height" constant="16" id="egr-kg-1on"/> </constraints> <connections> + <action selector="settingsChanged:" target="-2" id="BfD-Jh-b7j"/> <binding destination="-2" name="value" keyPath="selectedEntry.sourceSettings.includeTags" id="lGp-jw-qTE"/> </connections> </button> @@ -107,6 +108,7 @@ </menu> </popUpButtonCell> <connections> + <action selector="settingsChanged:" target="-2" id="oJT-OY-H1d"/> <binding destination="-2" name="selectedTag" keyPath="selectedEntry.sourceSettings.site" id="QdB-Zt-A1e"/> </connections> </popUpButton> @@ -122,6 +124,7 @@ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> + <action selector="settingsChanged:" target="-2" id="BAP-23-5Li"/> <binding destination="-2" name="value" keyPath="selectedEntry.sourceSettings.username" id="Xmw-cK-SeB"/> </connections> </textField> @@ -140,6 +143,7 @@ </allowedInputSourceLocales> </secureTextFieldCell> <connections> + <action selector="settingsChanged:" target="-2" id="mWc-uc-BZi"/> <binding destination="-2" name="value" keyPath="selectedEntry.sourceSettings.password" id="iVD-TC-GTV"/> </connections> </secureTextField> @@ -155,6 +159,7 @@ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> <connections> + <action selector="settingsChanged:" target="-2" id="4GR-6l-ZnG"/> <binding destination="-2" name="value" keyPath="selectedEntry.sourceSettings.host" id="7qk-HC-e8v"/> </connections> </textField> |