Browse Source

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

tags/2021-05-28
jules 12 years ago
parent
commit
14ca3470e6
4 changed files with 14 additions and 11 deletions
  1. +1
    -1
      extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp
  2. +1
    -1
      extras/Introjucer/Source/Project/jucer_ModulesPanel.h
  3. +8
    -3
      modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp
  4. +4
    -6
      modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h

+ 1
- 1
extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp 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);


+ 1
- 1
extras/Introjucer/Source/Project/jucer_ModulesPanel.h 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();
}


+ 8
- 3
modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp 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();
}
}
}


+ 4
- 6
modules/juce_gui_basics/filebrowser/juce_FilenameComponent.h 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.
*/


Loading…
Cancel
Save