reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 3f8b0c2f4b3e80b48bf2ba38859eb5a1f687be7e
parent 2b7fb71bf66b401a59def55192d3d054de80a080
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun, 17 Apr 2016 00:32:53 -0400

remove the Actions button from the browser, use the context menu instead

Diffstat:
Msrc/browser.cpp | 34++++------------------------------
Msrc/browser.hpp | 2--
Msrc/resource.hpp | 14++++++--------
Msrc/resource.rc | 1-
4 files changed, 10 insertions(+), 41 deletions(-)

diff --git a/src/browser.cpp b/src/browser.cpp @@ -117,9 +117,6 @@ void Browser::onCommand(const int id, const int event) m_list->unselectAll(); SetFocus(m_list->handle()); break; - case IDC_ACTIONS: - actionsButton(); - break; case ACTION_LATEST: installLatest(m_currentIndex); break; @@ -200,7 +197,10 @@ void Browser::onContextMenu(HWND target, const int x, const int y) return; } else if(m_list->selectionSize() > 1) { - selectionMenu(menu); + menu.addAction(AUTO_STR("&Install/update selection"), ACTION_LATEST_ALL); + menu.addAction(AUTO_STR("&Reinstall selection"), ACTION_REINSTALL_ALL); + menu.addAction(AUTO_STR("&Uninstall selection"), ACTION_UNINSTALL_ALL); + menu.addAction(AUTO_STR("&Clear queued action"), ACTION_RESET_ALL); menu.addSeparator(); } @@ -277,32 +277,6 @@ void Browser::onContextMenu(HWND target, const int x, const int y) menu.show(x, y, handle()); } -void Browser::selectionMenu(Menu &menu) const -{ - menu.addAction(AUTO_STR("&Install/update selection"), ACTION_LATEST_ALL); - menu.addAction(AUTO_STR("&Reinstall selection"), ACTION_REINSTALL_ALL); - menu.addAction(AUTO_STR("&Uninstall selection"), ACTION_UNINSTALL_ALL); - menu.addAction(AUTO_STR("&Clear queued action"), ACTION_RESET_ALL); -} - -void Browser::actionsButton() -{ - RECT rect; - GetWindowRect(getControl(IDC_ACTIONS), &rect); - - const Entry *entry = nullptr; - if(m_list->selectionSize() == 1) - entry = getEntry(m_list->currentIndex()); - - Menu menu; - selectionMenu(menu); - - if(!m_list->hasSelection()) - menu.disableAll(); - - menu.show(rect.left, rect.bottom - 1, handle()); -} - void Browser::displayButton() { RECT rect; diff --git a/src/browser.hpp b/src/browser.hpp @@ -99,8 +99,6 @@ private: std::string getValue(Column, const Entry &entry) const; ListView::Row makeRow(const Entry &) const; const Entry *getEntry(int) const; - void selectionMenu(Menu &) const; - void actionsButton(); void displayButton(); bool isFiltered(Package::Type) const; void toggleFiltered(Package::Type); diff --git a/src/resource.hpp b/src/resource.hpp @@ -57,13 +57,11 @@ #define IDC_PACKAGES 220 #define IDC_GROUPBOX 221 #define IDC_URL 222 -#define IDC_SCRIPTS 223 -#define IDC_FILTER 224 -#define IDC_CLEAR 225 -#define IDC_DISPLAY 226 -#define IDC_SELECT 227 -#define IDC_UNSELECT 228 -#define IDC_ACTIONS 229 -#define IDC_OPTIONS 230 +#define IDC_FILTER 223 +#define IDC_CLEAR 224 +#define IDC_DISPLAY 225 +#define IDC_SELECT 226 +#define IDC_UNSELECT 227 +#define IDC_OPTIONS 228 #endif diff --git a/src/resource.rc b/src/resource.rc @@ -93,7 +93,6 @@ BEGIN WS_BORDER | WS_TABSTOP, 5, 22, 490, 204 PUSHBUTTON "&Select all", IDC_SELECT, 5, 230, 45, 14 PUSHBUTTON "&Unselect all", IDC_UNSELECT, 53, 230, 45, 14 - PUSHBUTTON "&Actions...", IDC_ACTIONS, 101, 230, 45, 14 DEFPUSHBUTTON "&OK", IDOK, 369, 230, 40, 14 PUSHBUTTON "&Cancel", IDCANCEL, 412, 230, 40, 14 PUSHBUTTON "&Apply", IDAPPLY, 455, 230, 40, 14