Skip to content

Commit

Permalink
PortfolioListView: Add "Import CSV" context menu item
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pfalcon committed Dec 7, 2024
1 parent 4b3e78d commit 444b318
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));
Expand Down

0 comments on commit 444b318

Please sign in to comment.