@@ -216,7 +216,7 @@ void JuceUpdater::updateInstallButtonStatus() | |||||
void JuceUpdater::filenameComponentChanged (FilenameComponent*) | void JuceUpdater::filenameComponentChanged (FilenameComponent*) | ||||
{ | { | ||||
moduleList.rescan (filenameComp.getCurrentFile()); | moduleList.rescan (filenameComp.getCurrentFile()); | ||||
filenameComp.setCurrentFile (moduleList.getModulesFolder(), true, false); | |||||
filenameComp.setCurrentFile (moduleList.getModulesFolder(), true, dontSendNotification); | |||||
if (! ModuleList::isModulesFolder (moduleList.getModulesFolder())) | if (! ModuleList::isModulesFolder (moduleList.getModulesFolder())) | ||||
currentVersionLabel.setText ("(Not a Juce folder)", false); | currentVersionLabel.setText ("(Not a Juce folder)", false); | ||||
@@ -63,7 +63,7 @@ public: | |||||
void filenameComponentChanged (FilenameComponent*) | void filenameComponentChanged (FilenameComponent*) | ||||
{ | { | ||||
moduleList.rescan (modulesLocation.getCurrentFile()); | moduleList.rescan (modulesLocation.getCurrentFile()); | ||||
modulesLocation.setCurrentFile (moduleList.getModulesFolder(), false, false); | |||||
modulesLocation.setCurrentFile (moduleList.getModulesFolder(), false, dontSendNotification); | |||||
ModuleList::setLocalModulesFolder (moduleList.getModulesFolder()); | ModuleList::setLocalModulesFolder (moduleList.getModulesFolder()); | ||||
moduleListBox.refresh(); | moduleListBox.refresh(); | ||||
} | } | ||||
@@ -47,7 +47,7 @@ FilenameComponent::FilenameComponent (const String& name, | |||||
setBrowseButtonText ("..."); | setBrowseButtonText ("..."); | ||||
setCurrentFile (currentFile, true); | |||||
setCurrentFile (currentFile, true, dontSendNotification); | |||||
} | } | ||||
FilenameComponent::~FilenameComponent() | FilenameComponent::~FilenameComponent() | ||||
@@ -163,7 +163,7 @@ File FilenameComponent::getCurrentFile() const | |||||
void FilenameComponent::setCurrentFile (File newFile, | void FilenameComponent::setCurrentFile (File newFile, | ||||
const bool addToRecentlyUsedList, | const bool addToRecentlyUsedList, | ||||
const bool sendChangeNotification) | |||||
NotificationType notification) | |||||
{ | { | ||||
if (enforcedSuffix.isNotEmpty()) | if (enforcedSuffix.isNotEmpty()) | ||||
newFile = newFile.withFileExtension (enforcedSuffix); | newFile = newFile.withFileExtension (enforcedSuffix); | ||||
@@ -177,8 +177,13 @@ void FilenameComponent::setCurrentFile (File newFile, | |||||
filenameBox.setText (lastFilename, true); | filenameBox.setText (lastFilename, true); | ||||
if (sendChangeNotification) | |||||
if (notification != dontSendNotification) | |||||
{ | |||||
triggerAsyncUpdate(); | triggerAsyncUpdate(); | ||||
if (notification == sendNotificationSync) | |||||
handleUpdateNowIfNeeded(); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -111,15 +111,13 @@ public: | |||||
/** Changes the current filename. | /** Changes the current filename. | ||||
If addToRecentlyUsedList is true, the filename will also be added to the | |||||
drop-down list of recent files. | |||||
If sendChangeNotification is false, then the listeners won't be told of the | |||||
change. | |||||
@param addToRecentlyUsedList if true, the filename will also be added to the | |||||
drop-down list of recent files. | |||||
@param notification whether to send a notification of the change to listeners | |||||
*/ | */ | ||||
void setCurrentFile (File newFile, | void setCurrentFile (File newFile, | ||||
bool addToRecentlyUsedList, | bool addToRecentlyUsedList, | ||||
bool sendChangeNotification = true); | |||||
NotificationType notification = sendNotificationAsync); | |||||
/** Changes whether the use can type into the filename box. | /** Changes whether the use can type into the filename box. | ||||
*/ | */ | ||||