diff --git a/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp b/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp index 3db1cab674..860b0d29ee 100644 --- a/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp +++ b/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp @@ -216,7 +216,7 @@ void JuceUpdater::updateInstallButtonStatus() void JuceUpdater::filenameComponentChanged (FilenameComponent*) { moduleList.rescan (filenameComp.getCurrentFile()); - filenameComp.setCurrentFile (moduleList.getModulesFolder(), true, false); + filenameComp.setCurrentFile (moduleList.getModulesFolder(), true, dontSendNotification); if (! ModuleList::isModulesFolder (moduleList.getModulesFolder())) currentVersionLabel.setText ("(Not a Juce folder)", false); diff --git a/extras/Introjucer/Source/Project/jucer_ModulesPanel.h b/extras/Introjucer/Source/Project/jucer_ModulesPanel.h index 16c97a5172..6c905fed14 100644 --- a/extras/Introjucer/Source/Project/jucer_ModulesPanel.h +++ b/extras/Introjucer/Source/Project/jucer_ModulesPanel.h @@ -63,7 +63,7 @@ public: void filenameComponentChanged (FilenameComponent*) { moduleList.rescan (modulesLocation.getCurrentFile()); - modulesLocation.setCurrentFile (moduleList.getModulesFolder(), false, false); + modulesLocation.setCurrentFile (moduleList.getModulesFolder(), false, dontSendNotification); ModuleList::setLocalModulesFolder (moduleList.getModulesFolder()); moduleListBox.refresh(); } diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp index f1ddbd29dc..a38c4a6fd9 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp @@ -47,7 +47,7 @@ FilenameComponent::FilenameComponent (const String& name, setBrowseButtonText ("..."); - setCurrentFile (currentFile, true); + setCurrentFile (currentFile, true, dontSendNotification); } FilenameComponent::~FilenameComponent() @@ -163,7 +163,7 @@ File FilenameComponent::getCurrentFile() const void FilenameComponent::setCurrentFile (File newFile, const bool addToRecentlyUsedList, - const bool sendChangeNotification) + NotificationType notification) { if (enforcedSuffix.isNotEmpty()) newFile = newFile.withFileExtension (enforcedSuffix); @@ -177,8 +177,13 @@ void FilenameComponent::setCurrentFile (File newFile, filenameBox.setText (lastFilename, true); - if (sendChangeNotification) + if (notification != dontSendNotification) + { triggerAsyncUpdate(); + + if (notification == sendNotificationSync) + handleUpdateNowIfNeeded(); + } } } diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h index 724a6ac3df..4b1ca94e9c 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h @@ -111,15 +111,13 @@ public: /** 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, bool addToRecentlyUsedList, - bool sendChangeNotification = true); + NotificationType notification = sendNotificationAsync); /** Changes whether the use can type into the filename box. */