1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00

Changed the parameters of FilenameComponent::setCurrentFile() to use a NotificationType.

This commit is contained in:
jules 2013-03-18 21:44:29 +00:00
parent 76ae8fe523
commit 14ca3470e6
4 changed files with 14 additions and 11 deletions

View file

@ -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);

View file

@ -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();
}

View file

@ -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();
}
}
}

View file

@ -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.
*/