Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions owlplug-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.owlplug</groupId>
<artifactId>owlplug</artifactId>
<version>1.33.0</version>
<version>1.33.1</version>
</parent>

<artifactId>owlplug-client</artifactId>
Expand All @@ -35,17 +35,17 @@
<dependency>
<groupId>com.owlplug</groupId>
<artifactId>owlplug-host</artifactId>
<version>1.33.0</version>
<version>1.33.1</version>
</dependency>
<dependency>
<groupId>com.owlplug</groupId>
<artifactId>owlplug-controls</artifactId>
<version>1.33.0</version>
<version>1.33.1</version>
</dependency>
<dependency>
<groupId>com.owlplug</groupId>
<artifactId>owlplug-parsers</artifactId>
<version>1.33.0</version>
<version>1.33.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public class ApplicationDefaults {
public static final String LV2_EXTRA_DIRECTORY_KEY = "LV2_EXTRA_DIRECTORY_KEY";
public static final String NATIVE_HOST_ENABLED_KEY = "NATIVE_HOST_ENABLED_KEY";
public static final String PREFERRED_NATIVE_LOADER = "PREFERRED_NATIVE_LOADER";
public static final String NATIVE_LOADER_TIMEOUT_KEY = "NATIVE_LOADER_TIMEOUT_KEY";
public static final String SELECTED_ACCOUNT_KEY = "SELECTED_ACCOUNT_KEY";
public static final String SYNC_PLUGINS_STARTUP_KEY = "SYNC_PLUGINS_STARTUP_KEY";
public static final String STORE_DIRECTORY_ENABLED_KEY = "STORE_DIRECTORY_ENABLED_KEY";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class OptionsController extends BaseController {
@FXML
private ComboBox<NativePluginLoader> pluginNativeComboBox;
@FXML
private TextField loaderTimeoutTextField;
@FXML
private CheckBox syncPluginsCheckBox;
@FXML
private CheckBox syncFileStatCheckbox;
Expand Down Expand Up @@ -155,6 +157,7 @@ public void initialize() {
pluginNativeCheckbox.selectedProperty().addListener((observable, oldValue, newValue) -> {
this.getPreferences().putBoolean(ApplicationDefaults.NATIVE_HOST_ENABLED_KEY, newValue);
this.pluginNativeComboBox.setDisable(!newValue);
updateScannerTimeoutFieldState();
});

ObservableList<NativePluginLoader> pluginLoaders = FXCollections.observableArrayList(
Expand All @@ -163,8 +166,27 @@ public void initialize() {

pluginNativeComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
this.getPreferences().put(ApplicationDefaults.PREFERRED_NATIVE_LOADER,newValue.getId());
this.getPreferences().put(ApplicationDefaults.PREFERRED_NATIVE_LOADER, newValue.getId());
nativeHostService.setCurrentPluginLoader(newValue);
updateScannerTimeoutFieldState();
}
});

loaderTimeoutTextField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.matches("\\d*")) {
loaderTimeoutTextField.setText(newValue.replaceAll("[^\\d]", ""));
return;
}
try {
long timeout = Long.parseLong(newValue);
if (timeout >= 0 && timeout <= 3600) {
this.getPreferences().putLong(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, timeout);
nativeHostService.setScannerTimeout(timeout);
} else {
loaderTimeoutTextField.setText(oldValue);
}
} catch (NumberFormatException ignored) {
// Ignore in case of invalid values (empty string)
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
});

Expand Down Expand Up @@ -265,6 +287,13 @@ public void initialize() {
refreshView();
}

private void updateScannerTimeoutFieldState() {
NativePluginLoader selected = pluginNativeComboBox.getSelectionModel().getSelectedItem();
boolean isOwlPlugScanner = selected != null && "owlplug-scanner".equals(selected.getId());
boolean nativeEnabled = pluginNativeCheckbox.isSelected() && !pluginNativeCheckbox.isDisable();
loaderTimeoutTextField.setDisable(!nativeEnabled || !isOwlPlugScanner);
}

public void refreshView() {

vst2PluginPathFragment.refresh();
Expand All @@ -287,6 +316,10 @@ public void refreshView() {
NativePluginLoader pluginLoader = nativeHostService.getCurrentPluginLoader();
pluginNativeComboBox.getSelectionModel().select(pluginLoader);

long timeout = this.getPreferences().getLong(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, 10L);
loaderTimeoutTextField.setText(String.valueOf(timeout));
updateScannerTimeoutFieldState();

if (!storeDirectoryCheckBox.isSelected()) {
storeDirectoryTextField.setVisible(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private void initialize() {
if (prefs.get(ApplicationDefaults.STORE_SUBDIRECTORY_ENABLED, null) == null) {
prefs.putBoolean(ApplicationDefaults.STORE_SUBDIRECTORY_ENABLED, Boolean.TRUE);
}
if (prefs.get(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, null) == null) {
prefs.putLong(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, 10L);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
Expand Down Expand Up @@ -111,6 +110,8 @@ public class PluginInfoController extends BaseController {
private ListView<PluginComponent> pluginComponentListView;
@FXML
private ToggleSwitch nativeDiscoveryToggleButton;
@FXML
private Label lastScanErrorLabel;

private final ObjectProperty<Plugin> pluginProperty = new SimpleObjectProperty<Plugin>();
private final ArrayList<String> knownPluginImages = new ArrayList<>();
Expand Down Expand Up @@ -157,6 +158,8 @@ public void initialize() {
});

pluginComponentListView.setCellFactory(new PluginComponentCellFactory(this.getApplicationDefaults()));
lastScanErrorLabel.managedProperty().bind(lastScanErrorLabel.visibleProperty());
lastScanErrorLabel.setVisible(false);

nativeDiscoveryToggleButton.selectedProperty().addListener((observable, oldValue, newValue) -> {
Plugin plugin = pluginProperty.get();
Expand All @@ -175,8 +178,6 @@ public void refresh() {
return;
}

// All reads below come from already-loaded in-memory fields — safe to run
// on the FX thread without risk of blocking.
pluginFormatIcon.setImage(this.getApplicationDefaults().getPluginFormatIcon(plugin.getFormat()));
pluginFormatLabel.setText(plugin.getFormat().getText() + " Plugin");
pluginTitleLabel.setText(plugin.getName());
Expand All @@ -202,6 +203,11 @@ public void refresh() {

if (plugin.getFootprint() != null) {
nativeDiscoveryToggleButton.setSelected(plugin.getFootprint().isNativeDiscoveryEnabled());
String scanError = plugin.getFootprint().getLastScanStatus();
lastScanErrorLabel.setText(scanError != null ? scanError : "");
lastScanErrorLabel.setVisible(scanError != null);
} else {
lastScanErrorLabel.setVisible(false);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

setPluginImage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.owlplug.core.utils.FileUtils;
import com.owlplug.core.utils.PlatformUtils;
import com.owlplug.plugin.controllers.dialogs.DisablePluginDialogController;
import com.owlplug.plugin.model.IPlugin;
import com.owlplug.plugin.model.Plugin;
import com.owlplug.plugin.model.PluginFormat;
import com.owlplug.plugin.model.PluginState;
Expand Down Expand Up @@ -63,9 +64,9 @@ public class PluginTableController extends BaseController {
private PluginService pluginService;

private final SimpleStringProperty search = new SimpleStringProperty();
private final TableView<Plugin> tableView;
private final TableView<IPlugin> tableView;

private final ObservableList<Plugin> pluginList;
private final ObservableList<IPlugin> pluginList;


public PluginTableController() {
Expand All @@ -75,7 +76,7 @@ public PluginTableController() {
createColumns();

tableView.setRowFactory(tv -> {
TableRow<Plugin> row = new TableRow<>();
TableRow<IPlugin> row = new TableRow<>();
row.itemProperty().addListener((obs, oldItem, newItem) -> {
if (newItem != null) {
row.setContextMenu(createPluginContextMenu(newItem));
Expand All @@ -88,7 +89,7 @@ public PluginTableController() {
pluginList = FXCollections.observableArrayList();
// Wraps an ObservableList and filters its content using the provided Predicate.
// All changes in the ObservableList are propagated immediately to the FilteredList.
FilteredList<Plugin> filteredPluginList = new FilteredList<>(pluginList);
FilteredList<IPlugin> filteredPluginList = new FilteredList<>(pluginList);

filteredPluginList.predicateProperty().bind(Bindings.createObjectBinding(() -> {
if (search.getValue() == null || search.getValue().isEmpty()) {
Expand All @@ -99,17 +100,17 @@ public PluginTableController() {
search.getValue().toLowerCase()));
}, search));

SortedList<Plugin> sortedPluginList = new SortedList<>(filteredPluginList);
SortedList<IPlugin> sortedPluginList = new SortedList<>(filteredPluginList);
tableView.setItems(sortedPluginList);
sortedPluginList.comparatorProperty().bind(tableView.comparatorProperty());

}

private void createColumns() {
TableColumn<Plugin, String> nameColumn = new TableColumn<>("Name");
TableColumn<IPlugin, String> nameColumn = new TableColumn<>("Name");
nameColumn.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getName()));
TableColumn<Plugin, PluginFormat> formatColumn = new TableColumn<>("Format");
formatColumn.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().getFormat()));
TableColumn<IPlugin, PluginFormat> formatColumn = new TableColumn<>("Format");
formatColumn.setCellValueFactory(cellData -> new SimpleObjectProperty<>(cellData.getValue().asPlugin().getFormat()));
formatColumn.setCellFactory(e -> new TableCell<>() {
@Override
public void updateItem(PluginFormat item, boolean empty) {
Expand All @@ -123,17 +124,17 @@ public void updateItem(PluginFormat item, boolean empty) {
}
}
});
TableColumn<Plugin, String> manufacturerColumn = new TableColumn<>("Manufacturer");
TableColumn<IPlugin, String> manufacturerColumn = new TableColumn<>("Manufacturer");
manufacturerColumn.setCellValueFactory(cellData ->
new SimpleStringProperty(cellData.getValue().getManufacturerName()));
TableColumn<Plugin, String> versionColumn = new TableColumn<>("Version");
TableColumn<IPlugin, String> versionColumn = new TableColumn<>("Version");
versionColumn.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getVersion()));
TableColumn<Plugin, String> categoryColumn = new TableColumn<>("Category");
TableColumn<IPlugin, String> categoryColumn = new TableColumn<>("Category");
categoryColumn.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getCategory()));
// Directory Column
TableColumn<Plugin, String> directoryColumn = new TableColumn<>("Directory");
TableColumn<IPlugin, String> directoryColumn = new TableColumn<>("Directory");
directoryColumn.setCellValueFactory(cellData -> new SimpleStringProperty(
FileUtils.getParentDirectoryName(cellData.getValue().getPath())));
FileUtils.getParentDirectoryName(cellData.getValue().asPlugin().getPath())));
directoryColumn.setCellFactory(e -> new TableCell<>() {
@Override
public void updateItem(String item, boolean empty) {
Expand All @@ -148,9 +149,9 @@ public void updateItem(String item, boolean empty) {
}
});
// Scan Directory Column
TableColumn<Plugin, String> scanDirectoryColumn = new TableColumn<>("Scan Dir.");
TableColumn<IPlugin, String> scanDirectoryColumn = new TableColumn<>("Scan Dir.");
scanDirectoryColumn.setCellValueFactory(cellData -> new SimpleStringProperty(
FileUtils.getFilename(cellData.getValue().getScanDirectoryPath())));
FileUtils.getFilename(cellData.getValue().asPlugin().getScanDirectoryPath())));
scanDirectoryColumn.setCellFactory(e -> new TableCell<>() {
@Override
public void updateItem(String item, boolean empty) {
Expand All @@ -165,9 +166,9 @@ public void updateItem(String item, boolean empty) {
}
});
// Plugin State Column
TableColumn<Plugin, PluginState> stateColumn = new TableColumn<>("State");
TableColumn<IPlugin, PluginState> stateColumn = new TableColumn<>("State");
stateColumn.setCellValueFactory(cellData -> new SimpleObjectProperty<>(
pluginService.getPluginState(cellData.getValue())));
pluginService.getPluginState(cellData.getValue().asPlugin())));
stateColumn.setCellFactory(e -> new TableCell<>() {
@Override
public void updateItem(PluginState item, boolean empty) {
Expand All @@ -188,10 +189,16 @@ public void updateItem(PluginState item, boolean empty) {

public void setPlugins(Iterable<Plugin> plugins) {
pluginList.clear();
plugins.forEach(pluginList::add);
plugins.forEach(p -> {
pluginList.add(p);
if (p.getComponents().size() > 1) {
pluginList.addAll(p.getComponents());
}
});

}

public TableView<Plugin> getTableView() {
public TableView<IPlugin> getTableView() {
return tableView;
}

Expand All @@ -201,7 +208,8 @@ public void setNodeManaged(boolean isManaged) {
}

public void selectPluginById(long id) {
for (Plugin plugin : pluginList) {
for (IPlugin p : pluginList) {
Plugin plugin = p.asPlugin(); // Get plugin or component parent
if (plugin.getId().equals(id)) {
tableView.getSelectionModel().select(plugin);
break;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand All @@ -217,37 +225,39 @@ public void refresh() {
tableView.refresh();
}

private ContextMenu createPluginContextMenu(Plugin plugin) {
private ContextMenu createPluginContextMenu(IPlugin plugin) {

ContextMenu menu = new ContextMenu();
MenuItem openDirItem = new MenuItem("Reveal in File Explorer");
openDirItem.setOnAction(e -> {
File pluginFile = new File(plugin.getPath());
File pluginFile = new File(plugin.asPlugin().getPath());
PlatformUtils.openFromDesktop(pluginFile.getParentFile());
});

menu.getItems().addAll(openDirItem, new SeparatorMenuItem());

if (plugin.isDisabled()) {
MenuItem enableItem = new MenuItem("Enable plugin");
enableItem.setOnAction(e -> {
Async.run(() -> pluginService.enablePlugin(plugin));
});
menu.getItems().add(enableItem);
} else {
MenuItem disableItem = new MenuItem("Disable plugin");
disableItem.setOnAction(e -> {
if (this.getPreferences().getBoolean(ApplicationDefaults.SHOW_DIALOG_DISABLE_PLUGIN_KEY, true)) {
this.disableController.setPlugin(plugin);
this.disableController.show();
} else {
this.disableController.disablePluginWithoutPrompt(plugin);
}
});
menu.getItems().add(disableItem);
}
if (plugin instanceof Plugin p) {
if (p.isDisabled()) {
MenuItem enableItem = new MenuItem("Enable plugin");
enableItem.setOnAction(e -> {
Async.run(() -> pluginService.enablePlugin(p));
});
menu.getItems().add(enableItem);
} else {
MenuItem disableItem = new MenuItem("Disable plugin");
disableItem.setOnAction(e -> {
if (this.getPreferences().getBoolean(ApplicationDefaults.SHOW_DIALOG_DISABLE_PLUGIN_KEY, true)) {
this.disableController.setPlugin(p);
this.disableController.show();
} else {
this.disableController.disablePluginWithoutPrompt(p);
}
});
menu.getItems().add(disableItem);
}

menu.getItems().add(new SeparatorMenuItem());
menu.getItems().add(new SeparatorMenuItem());
}

MenuItem infoDisplayItem = new MenuItem("Toggle info display");
menu.getItems().add(infoDisplayItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.owlplug.core.controllers.BaseController;
import com.owlplug.core.ui.FilterableTreeItem;
import com.owlplug.plugin.model.IDirectory;
import com.owlplug.plugin.model.IPlugin;
import com.owlplug.plugin.model.Plugin;
import com.owlplug.plugin.model.PluginComponent;
import com.owlplug.plugin.model.PluginDirectory;
Expand Down Expand Up @@ -73,7 +74,7 @@ public PluginTreeViewController() {
return null;
}
return (item) -> {
if (item instanceof Plugin plugin) {
if (item instanceof IPlugin plugin) {
return plugin.getName().toLowerCase().contains(search.getValue().toLowerCase())
|| (plugin.getCategory() != null && plugin.getCategory().toLowerCase().contains(
search.getValue().toLowerCase()));
Expand All @@ -89,7 +90,7 @@ public PluginTreeViewController() {
return null;
}
return (item) -> {
if (item instanceof Plugin plugin) {
if (item instanceof IPlugin plugin) {
return plugin.getName().toLowerCase().contains(search.getValue().toLowerCase())
|| (plugin.getCategory() != null && plugin.getCategory().toLowerCase().contains(search.getValue().toLowerCase()));
} else {
Expand Down
Loading