mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-30 02:50:05 +00:00
Added a method PluginListComponent::setScanDialogText() for customising the scan dialog.
This commit is contained in:
parent
9da6f51439
commit
eccfffdc6e
2 changed files with 17 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue