From 444b3186754fc8faa833945c728c59c3e0102967 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 7 Dec 2024 17:33:11 +0700 Subject: [PATCH] PortfolioListView: Add "Import CSV" context menu item Such is available in AccountListView, but randomly was not available for portfolio list. As for account list, CSV import dialog will have current portfolio and its reference account pre-selected. --- .../name/abuchen/portfolio/ui/views/PortfolioListView.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/PortfolioListView.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/PortfolioListView.java index d57cf1ffd3..fbf840c2a3 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/PortfolioListView.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/PortfolioListView.java @@ -36,6 +36,7 @@ import name.abuchen.portfolio.ui.Images; import name.abuchen.portfolio.ui.Messages; import name.abuchen.portfolio.ui.editor.AbstractFinanceView; +import name.abuchen.portfolio.ui.handlers.ImportCSVHandler; import name.abuchen.portfolio.ui.handlers.ImportPDFHandler; import name.abuchen.portfolio.ui.util.ConfirmAction; import name.abuchen.portfolio.ui.util.DropDown; @@ -300,6 +301,11 @@ private void fillPortfolioContextMenu(IMenuManager manager) if (!portfolio.isRetired()) { manager.add(new Separator()); + + manager.add(new SimpleAction(Messages.AccountMenuImportCSV, a -> ImportCSVHandler.runImport(getPart(), + Display.getDefault().getActiveShell(), getContext(), null, null, + getClient(), portfolio.getReferenceAccount(), portfolio))); + manager.add(new SimpleAction(Messages.AccountMenuImportPDF, a -> ImportPDFHandler.runImport(getPart(), Display.getDefault().getActiveShell(), getClient(), portfolio.getReferenceAccount(), portfolio)));