Browse Source

Added a method PluginListComponent::setScanDialogText() for customising the scan dialog.

tags/2021-05-28
jules 10 years ago
parent
commit
eccfffdc6e
2 changed files with 17 additions and 4 deletions
  1. +12
    -4
      modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp
  2. +5
    -0
      modules/juce_audio_processors/scanning/juce_PluginListComponent.h

+ 12
- 4
modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp View File

@@ -171,6 +171,12 @@ void PluginListComponent::setOptionsButtonText (const String& newText)
resized();
}
void PluginListComponent::setScanDialogText (const String& title, const String& content)
{
dialogTitle = title;
dialogText = content;
}
void PluginListComponent::setNumberOfThreadsForScanning (int num)
{
numThreads = num;
@@ -324,11 +330,11 @@ void PluginListComponent::setLastSearchPath (PropertiesFile& properties, AudioPl
class PluginListComponent::Scanner : private Timer
{
public:
Scanner (PluginListComponent& plc, AudioPluginFormat& format, PropertiesFile* properties, int threads)
Scanner (PluginListComponent& plc, AudioPluginFormat& format, PropertiesFile* properties,
int threads, const String& title, const String& text)
: owner (plc), formatToScan (format), propertiesToUse (properties),
pathChooserWindow (TRANS("Select folders to scan..."), String::empty, AlertWindow::NoIcon),
progressWindow (TRANS("Scanning for plug-ins..."),
TRANS("Searching for all possible plug-in files..."), AlertWindow::NoIcon),
progressWindow (title, text, AlertWindow::NoIcon),
progress (0.0), numThreads (threads), finished (false)
{
FileSearchPath path (formatToScan.getDefaultLocationsToSearch());
@@ -539,7 +545,9 @@ private:
void PluginListComponent::scanFor (AudioPluginFormat& format)
{
currentScanner = new Scanner (*this, format, propertiesToUse, numThreads);
currentScanner = new Scanner (*this, format, propertiesToUse, numThreads,
dialogTitle.isNotEmpty() ? dialogTitle : TRANS("Scanning for plug-ins..."),
dialogText.isNotEmpty() ? dialogText : TRANS("Searching for all possible plug-in files..."));
}
bool PluginListComponent::isScanning() const noexcept


+ 5
- 0
modules/juce_audio_processors/scanning/juce_PluginListComponent.h View File

@@ -55,6 +55,10 @@ public:
/** Changes the text in the panel's options button. */
void setOptionsButtonText (const String& newText);
/** Changes the text in the progress dialog box that is shown when scanning. */
void setScanDialogText (const String& textForProgressWindowTitle,
const String& textForProgressWindowDescription);
/** Sets how many threads to simultaneously scan for plugins.
If this is 0, then all scanning happens on the message thread (this is the default)
*/
@@ -91,6 +95,7 @@ private:
TableListBox table;
TextButton optionsButton;
PropertiesFile* propertiesToUse;
String dialogTitle, dialogText;
int numThreads;
class TableModel;


Loading…
Cancel
Save