mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 02:28:17 +00:00
Added simple support for import Plugins via plugin API
This commit is contained in:
@@ -284,7 +284,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
return;
|
||||
}
|
||||
NSMenuItem *menuItem = sender;
|
||||
if(![menuItem.representedObject isKindOfClass:NSDictionary.class]) {
|
||||
if(![menuItem.representedObject isKindOfClass:NSString.class]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,8 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
if(!sheetWindow) {
|
||||
return;
|
||||
}
|
||||
MPPlugin<MPImportPlugin> *importPlugin;
|
||||
NSString *bundleIdentifier = menuItem.representedObject;
|
||||
MPPlugin<MPImportPlugin> *importPlugin = (MPPlugin<MPImportPlugin> *)[MPPluginHost.sharedHost pluginWithBundleIdentifier:bundleIdentifier];
|
||||
NSOpenPanel *openPanel = NSOpenPanel.openPanel;
|
||||
[importPlugin prepareOpenPanel:openPanel];
|
||||
[openPanel beginSheetModalForWindow:sheetWindow completionHandler:^(NSModalResponse result) {
|
||||
|
||||
Reference in New Issue
Block a user