|
@@ -34,7 +34,8 @@ public: |
|
|
modulesValueTree (p.getModules().state),
|
|
|
modulesValueTree (p.getModules().state),
|
|
|
addWebModuleButton ("Download and add a module..."),
|
|
|
addWebModuleButton ("Download and add a module..."),
|
|
|
updateModuleButton ("Install updates to modules..."),
|
|
|
updateModuleButton ("Install updates to modules..."),
|
|
|
setCopyModeButton ("Set copy-mode for all modules...")
|
|
|
|
|
|
|
|
|
setCopyModeButton ("Set copy-mode for all modules..."),
|
|
|
|
|
|
copyPathButton ("Set paths for all modules...")
|
|
|
{
|
|
|
{
|
|
|
table.getHeader().addColumn ("Module", nameCol, 180, 100, 400, TableHeaderComponent::notSortable);
|
|
|
table.getHeader().addColumn ("Module", nameCol, 180, 100, 400, TableHeaderComponent::notSortable);
|
|
|
table.getHeader().addColumn ("Installed Version", versionCol, 100, 100, 100, TableHeaderComponent::notSortable);
|
|
|
table.getHeader().addColumn ("Installed Version", versionCol, 100, 100, 100, TableHeaderComponent::notSortable);
|
|
@@ -51,11 +52,14 @@ public: |
|
|
addAndMakeVisible (&addWebModuleButton);
|
|
|
addAndMakeVisible (&addWebModuleButton);
|
|
|
addAndMakeVisible (&updateModuleButton);
|
|
|
addAndMakeVisible (&updateModuleButton);
|
|
|
addAndMakeVisible (&setCopyModeButton);
|
|
|
addAndMakeVisible (&setCopyModeButton);
|
|
|
|
|
|
addAndMakeVisible (©PathButton);
|
|
|
addWebModuleButton.addListener (this);
|
|
|
addWebModuleButton.addListener (this);
|
|
|
updateModuleButton.addListener (this);
|
|
|
updateModuleButton.addListener (this);
|
|
|
updateModuleButton.setEnabled (false);
|
|
|
updateModuleButton.setEnabled (false);
|
|
|
setCopyModeButton.addListener (this);
|
|
|
setCopyModeButton.addListener (this);
|
|
|
setCopyModeButton.setTriggeredOnMouseDown (true);
|
|
|
setCopyModeButton.setTriggeredOnMouseDown (true);
|
|
|
|
|
|
copyPathButton.addListener (this);
|
|
|
|
|
|
copyPathButton.setTriggeredOnMouseDown (true);
|
|
|
|
|
|
|
|
|
modulesValueTree.addListener (this);
|
|
|
modulesValueTree.addListener (this);
|
|
|
lookAndFeelChanged();
|
|
|
lookAndFeelChanged();
|
|
@@ -80,7 +84,11 @@ public: |
|
|
buttonRow.removeFromLeft (8);
|
|
|
buttonRow.removeFromLeft (8);
|
|
|
updateModuleButton.setBounds (buttonRow.removeFromLeft (jmin (260, r.getWidth() / 3)));
|
|
|
updateModuleButton.setBounds (buttonRow.removeFromLeft (jmin (260, r.getWidth() / 3)));
|
|
|
buttonRow.removeFromLeft (8);
|
|
|
buttonRow.removeFromLeft (8);
|
|
|
|
|
|
|
|
|
|
|
|
buttonRow = r.removeFromTop (34).removeFromBottom (28);
|
|
|
setCopyModeButton.setBounds (buttonRow.removeFromLeft (jmin (260, r.getWidth() / 3)));
|
|
|
setCopyModeButton.setBounds (buttonRow.removeFromLeft (jmin (260, r.getWidth() / 3)));
|
|
|
|
|
|
buttonRow.removeFromLeft (8);
|
|
|
|
|
|
copyPathButton.setBounds (buttonRow.removeFromLeft (jmin (260, r.getWidth() / 3)));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
int getNumRows() override
|
|
|
int getNumRows() override
|
|
@@ -178,7 +186,8 @@ public: |
|
|
{
|
|
|
{
|
|
|
if (b == &addWebModuleButton) showAddModuleMenu();
|
|
|
if (b == &addWebModuleButton) showAddModuleMenu();
|
|
|
else if (b == &updateModuleButton) showUpdateModulesMenu();
|
|
|
else if (b == &updateModuleButton) showUpdateModulesMenu();
|
|
|
else if (b == &setCopyModeButton) showCopyModeMenu();
|
|
|
|
|
|
|
|
|
else if (b == &setCopyModeButton) showCopyModeMenu();
|
|
|
|
|
|
else if (b == ©PathButton) showSetPathsMenu();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private:
|
|
|
private:
|
|
@@ -194,7 +203,7 @@ private: |
|
|
Project& project;
|
|
|
Project& project;
|
|
|
ValueTree modulesValueTree;
|
|
|
ValueTree modulesValueTree;
|
|
|
TableListBox table;
|
|
|
TableListBox table;
|
|
|
TextButton addWebModuleButton, updateModuleButton, setCopyModeButton;
|
|
|
|
|
|
|
|
|
TextButton addWebModuleButton, updateModuleButton, setCopyModeButton, copyPathButton;
|
|
|
ScopedPointer<ModuleList> listFromWebsite;
|
|
|
ScopedPointer<ModuleList> listFromWebsite;
|
|
|
|
|
|
|
|
|
void valueTreePropertyChanged (ValueTree&, const Identifier&) override { itemChanged(); }
|
|
|
void valueTreePropertyChanged (ValueTree&, const Identifier&) override { itemChanged(); }
|
|
@@ -327,6 +336,44 @@ private: |
|
|
project.getModules().setLocalCopyModeForAllModules (res == 1);
|
|
|
project.getModules().setLocalCopyModeForAllModules (res == 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void showSetPathsMenu()
|
|
|
|
|
|
{
|
|
|
|
|
|
EnabledModuleList& moduleList = project.getModules();
|
|
|
|
|
|
|
|
|
|
|
|
const String moduleToCopy (moduleList.getModuleID (table.getSelectedRow()));
|
|
|
|
|
|
|
|
|
|
|
|
if (moduleToCopy.isNotEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
PopupMenu m;
|
|
|
|
|
|
m.addItem (1, "Copy the paths from the module '" + moduleToCopy + "' to all other modules");
|
|
|
|
|
|
|
|
|
|
|
|
int res = m.showAt (©PathButton);
|
|
|
|
|
|
|
|
|
|
|
|
if (res != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (Project::ExporterIterator exporter (project); exporter.next();)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < moduleList.getNumModules(); ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
String modID = moduleList.getModuleID (i);
|
|
|
|
|
|
|
|
|
|
|
|
if (modID != moduleToCopy)
|
|
|
|
|
|
exporter->getPathForModuleValue (modID) = exporter->getPathForModuleValue (moduleToCopy).getValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
table.repaint();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
PopupMenu m;
|
|
|
|
|
|
m.addItem (1, "Copy the paths from the selected module to all other modules", false);
|
|
|
|
|
|
|
|
|
|
|
|
m.showAt (©PathButton);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
struct WebsiteUpdateFetchThread : private Thread,
|
|
|
struct WebsiteUpdateFetchThread : private Thread,
|
|
|
private AsyncUpdater
|
|
|
private AsyncUpdater
|
|
|
{
|
|
|
{
|
|
|