From f454b97e56b8543f1d7ea25f6818a44ac2e34c34 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 3 Jul 2017 17:41:55 +0100 Subject: [PATCH] Projucer: Added an option to the module settings page to set selected modules to use or not use global paths --- .../Source/Project/jucer_ModulesPanel.h | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/extras/Projucer/Source/Project/jucer_ModulesPanel.h b/extras/Projucer/Source/Project/jucer_ModulesPanel.h index d4e0bead24..297540456c 100644 --- a/extras/Projucer/Source/Project/jucer_ModulesPanel.h +++ b/extras/Projucer/Source/Project/jucer_ModulesPanel.h @@ -36,7 +36,7 @@ public: header ("Modules", Icon (getIcons().modules, Colours::transparentBlack)), setCopyModeButton ("Set copy-mode for all modules..."), copyPathButton ("Set paths for all modules..."), - globalPathsButton ("Enable/disable global path for all modules...") + globalPathsButton ("Enable/disable global path for modules...") { listHeader = new ListBoxHeader ( { "Module", "Version", "Make Local Copy", "Paths" }, { 0.25f, 0.2f, 0.2f, 0.35f } ); @@ -234,18 +234,31 @@ private: PopupMenu m; m.addItem (1, "Set all modules to use global paths"); m.addItem (2, "Set all modules to not use global paths"); + m.addItem (3, "Set selected modules to use global paths"); + m.addItem (4, "Set selected modules to not use global paths"); auto res = m.showAt (&globalPathsButton); if (res != 0) { - auto enableGlobalPaths = (res == 1); + auto enableGlobalPaths = (res % 2 == 1); - auto& modules = project.getModules(); - auto moduleIDs = modules.getAllModules(); + auto& moduleList = project.getModules(); - for (auto id : moduleIDs) - modules.shouldUseGlobalPath (id).setValue (enableGlobalPaths); + if (res < 3) + { + auto moduleIDs = moduleList.getAllModules(); + + for (auto id : moduleIDs) + moduleList.shouldUseGlobalPath (id).setValue (enableGlobalPaths); + } + else + { + auto selected = list.getSelectedRows(); + + for (auto i = 0; i < selected.size(); ++i) + moduleList.shouldUseGlobalPath (moduleList.getModuleID (selected[i])).setValue (enableGlobalPaths); + } } }