commit 4b631eec6da2938fab0aa8548bcc68db9a5c563b
parent 5a90504a1bccf7d4fbd0215b353f7c2783c18c3b
Author: cfillion <cfillion@users.noreply.github.com>
Date: Fri, 8 Apr 2016 15:18:54 -0400
add Select all/Unselect all actions in the config dialog's empty area context menu
Diffstat:
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/manager.cpp b/src/manager.cpp
@@ -30,7 +30,7 @@
using namespace std;
enum { ACTION_ENABLE = 80, ACTION_DISABLE, ACTION_UNINSTALL, ACTION_ABOUT,
- ACTION_AUTOINSTALL };
+ ACTION_AUTOINSTALL, ACTION_SELECT, ACTION_UNSELECT };
Manager::Manager(ReaPack *reapack)
: Dialog(IDD_CONFIG_DIALOG),
@@ -64,6 +64,9 @@ void Manager::onCommand(const int id, int)
case IDC_IMPORT:
m_reapack->importRemote();
break;
+ case IDC_OPTIONS:
+ options();
+ break;
case ACTION_ENABLE:
setRemoteEnabled(true);
break;
@@ -77,8 +80,13 @@ void Manager::onCommand(const int id, int)
m_autoInstall = !m_autoInstall.value_or(m_config->autoInstall());
enable(m_apply);
break;
- case IDC_OPTIONS:
- options();
+ case ACTION_SELECT:
+ m_list->selectAll();
+ SetFocus(m_list->handle());
+ break;
+ case ACTION_UNSELECT:
+ m_list->unselectAll();
+ SetFocus(m_list->handle());
break;
case IDOK:
case IDAPPLY:
@@ -114,11 +122,16 @@ void Manager::onContextMenu(HWND target, const int x, const int y)
const int index = m_list->itemUnderMouse();
const Remote &remote = getRemote(index);
- if(remote.isNull())
- return;
Menu menu;
+ if(remote.isNull()) {
+ menu.addAction(AUTO_STR("&Select all"), ACTION_SELECT);
+ menu.addAction(AUTO_STR("&Unselect all"), ACTION_UNSELECT);
+ menu.show(x, y, handle());
+ return;
+ }
+
const UINT enableAction =
menu.addAction(AUTO_STR("&Enable"), ACTION_ENABLE);
const UINT disableAction =
@@ -141,15 +154,13 @@ void Manager::onContextMenu(HWND target, const int x, const int y)
menu.disable(disableAction);
menu.disable(uninstallAction);
- if(!remote.isNull()) {
- if(isRemoteEnabled(remote))
- menu.enable(disableAction);
- else
- menu.enable(enableAction);
+ if(isRemoteEnabled(remote))
+ menu.enable(disableAction);
+ else
+ menu.enable(enableAction);
- if(!remote.isProtected())
- menu.enable(uninstallAction);
- }
+ if(!remote.isProtected())
+ menu.enable(uninstallAction);
menu.show(x, y, handle());
}