Using button view to retrieve model index. Removed unused localizations

This commit is contained in:
Michael Starke
2019-01-15 11:32:18 +01:00
parent 28f86fb45b
commit d022fa2500
3 changed files with 5 additions and 8 deletions

View File

@@ -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];

View File

@@ -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")];
}
}

View File

@@ -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";