From d022fa25000388f65b2950ead303bf10e05708c3 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Tue, 15 Jan 2019 11:32:18 +0100 Subject: [PATCH] Using button view to retrieve model index. Removed unused localizations --- MacPass/MPEntryInspectorViewController.m | 2 ++ MacPass/MPPluginRepositoryBrowserViewController.m | 4 +--- MacPass/en.lproj/Localizable.strings | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index aa2776eb..64a4cdd8 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -201,6 +201,8 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { } - (void)removeCustomField:(id)sender { NSUInteger index = [sender tag]; + NSUInteger viewIndex = [self.customFieldsTableView rowForView:sender]; + NSLog(@"index:%ld viewIndex:%ld", index, viewIndex); KPKAttribute *attribute = self.representedEntry.customAttributes[index]; [self.observer willChangeModelProperty]; [self.representedEntry removeCustomAttribute:attribute]; diff --git a/MacPass/MPPluginRepositoryBrowserViewController.m b/MacPass/MPPluginRepositoryBrowserViewController.m index b660d6b7..3bfdc2b7 100644 --- a/MacPass/MPPluginRepositoryBrowserViewController.m +++ b/MacPass/MPPluginRepositoryBrowserViewController.m @@ -68,17 +68,16 @@ typedef NS_ENUM(NSUInteger, MPPluginTableColumn) { else if(column == MPPluginTableColumnStatus) { MPPluginStatusTableCellView *statusView = (MPPluginStatusTableCellView *)view; statusView.actionButton.hidden = NO; + statusView.actionButton.title = NSLocalizedString(@"PLUGIN_BROWSER_DOWNLOAD_PLUGIN_BUTTON", "Button to download the Plugin"); MPPlugin *plugin = [MPPluginHost.sharedHost pluginWithBundleIdentifier:item.bundleIdentifier]; if(plugin) { switch([MPPluginVersionComparator compareVersion:plugin.shortVersionString toVersion:item.currentVersion]) { case NSOrderedSame: view.textField.stringValue = [NSString stringWithFormat:NSLocalizedString(@"PLUGIN_BROWSER_LATEST_VERSION_INSTALLED", "Status for an up-to-date plugin in the plugin browser")]; statusView.actionButton.hidden = YES; - statusView.actionButton.title = @""; break; case NSOrderedAscending: view.textField.stringValue = [NSString stringWithFormat:NSLocalizedString(@"PLUGIN_BROWSER_NEWER_VERSION_%@_AVAILABLE", "Status for an outdated plugin version in the plugin browser"), item.currentVersion]; - statusView.actionButton.title = NSLocalizedString(@"PLUGIN_BROWSER_UPDATE_VERSION_BUTTON", "Button to update the Plugin to the current version"); break; case NSOrderedDescending: view.textField.stringValue = [NSString stringWithFormat:NSLocalizedString(@"PLUGIN_BROWSER_UNKNOWN_PLUGIN_VERSION_INSTALLED_%@", "Status for an unkonw plugin version in the plugin browser"), plugin.shortVersionString]; @@ -88,7 +87,6 @@ typedef NS_ENUM(NSUInteger, MPPluginTableColumn) { else { MPPluginStatusTableCellView *statusView = (MPPluginStatusTableCellView *)view; statusView.actionButton.hidden = NO; - statusView.actionButton.title = NSLocalizedString(@"PLUGIN_BROWSER_INSTALL_PLUGIN_BUTTON", "Install plugin"); view.textField.stringValue = [NSString stringWithFormat:NSLocalizedString(@"PLUGIN_BROWSER_PLUGIN_NOT_INSTALLED", "Status for an uninstalled plugin in the plugin browser")]; } } diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index c9aea08e..e0cb6319 100644 --- a/MacPass/en.lproj/Localizable.strings +++ b/MacPass/en.lproj/Localizable.strings @@ -485,8 +485,8 @@ /* Window displayed to the user to pick an amout of characters */ "PICKFIELD_WINDOW_TITLE" = "Field Picker"; -/* Install plugin */ -"PLUGIN_BROWSER_INSTALL_PLUGIN_BUTTON" = "Install"; +/* Button to download the Plugin */ +"PLUGIN_BROWSER_DOWNLOAD_PLUGIN_BUTTON" = "Download"; /* Status for an up-to-date plugin in the plugin browser */ "PLUGIN_BROWSER_LATEST_VERSION_INSTALLED" = "Latest version installed"; @@ -500,9 +500,6 @@ /* Status for an unkonw plugin version in the plugin browser */ "PLUGIN_BROWSER_UNKNOWN_PLUGIN_VERSION_INSTALLED_%@" = "Unknown version %@ installed"; -/* Button to update the Plugin to the current version */ -"PLUGIN_BROWSER_UPDATE_VERSION_BUTTON" = "Update"; - /* Error for a plugin that is disabled. */ "PLUGIN_ERROR_DISABLED_PLUGIN" = "The plugin is disabled by the user";