Skip to content

Commit

Permalink
browser: move per-package actions to a submenu when selection > 1
Browse files Browse the repository at this point in the history
Closes #20
  • Loading branch information
cfillion committed Jul 17, 2017
1 parent d84bfcf commit 7ec8511
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,18 @@ void Browser::fillMenu(Menu &menu)
menu.addAction(AUTO_STR("&Uninstall selection"), ACTION_UNINSTALL_ALL);
menu.addAction(AUTO_STR("&Clear queued actions"), ACTION_RESET_ALL);
menu.addSeparator();

if(entry) {
Menu pkgMenu = menu.addMenu(AUTO_STR("Package under cursor"));
fillPackageMenu(entry, pkgMenu);
}
}
else if(entry)
fillPackageMenu(entry, menu);
}

void Browser::fillPackageMenu(const Entry *entry, Menu &menu)
{
if(entry->test(InstalledFlag)) {
if(entry->test(OutOfDateFlag)) {
auto_char installLabel[32];
Expand Down
1 change: 1 addition & 0 deletions src/browser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Browser : public Dialog {
void displayButton();
void actionsButton();
void fillMenu(Menu &);
void fillPackageMenu(const Entry *, Menu &);
bool isFiltered(Package::Type) const;
void toggleDescs();
bool hasAction(const Entry *) const;
Expand Down

0 comments on commit 7ec8511

Please sign in to comment.