mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-06-30 20:10:57 +12:00
Add setting to debug local shell
This commit is contained in:
parent
e8566ea137
commit
af8904ea7a
|
@ -231,35 +231,35 @@ public class AppPrefs {
|
||||||
.editable(System.getProperty(DEVELOPER_MODE_PROP) == null)
|
.editable(System.getProperty(DEVELOPER_MODE_PROP) == null)
|
||||||
.render(() -> new CustomToggleControl());
|
.render(() -> new CustomToggleControl());
|
||||||
|
|
||||||
private final BooleanProperty developerDisableUpdateVersionCheck =
|
final BooleanProperty developerDisableUpdateVersionCheck =
|
||||||
typed(new SimpleBooleanProperty(false), Boolean.class);
|
typed(new SimpleBooleanProperty(false), Boolean.class);
|
||||||
private final BooleanField developerDisableUpdateVersionCheckField =
|
final BooleanField developerDisableUpdateVersionCheckField =
|
||||||
BooleanField.ofBooleanType(developerDisableUpdateVersionCheck).render(() -> new CustomToggleControl());
|
BooleanField.ofBooleanType(developerDisableUpdateVersionCheck).render(() -> new CustomToggleControl());
|
||||||
private final ObservableBooleanValue developerDisableUpdateVersionCheckEffective =
|
private final ObservableBooleanValue developerDisableUpdateVersionCheckEffective =
|
||||||
bindDeveloperTrue(developerDisableUpdateVersionCheck);
|
bindDeveloperTrue(developerDisableUpdateVersionCheck);
|
||||||
|
|
||||||
private final BooleanProperty developerDisableGuiRestrictions =
|
final BooleanProperty developerDisableGuiRestrictions =
|
||||||
typed(new SimpleBooleanProperty(false), Boolean.class);
|
typed(new SimpleBooleanProperty(false), Boolean.class);
|
||||||
private final BooleanField developerDisableGuiRestrictionsField =
|
final BooleanField developerDisableGuiRestrictionsField =
|
||||||
BooleanField.ofBooleanType(developerDisableGuiRestrictions).render(() -> new CustomToggleControl());
|
BooleanField.ofBooleanType(developerDisableGuiRestrictions).render(() -> new CustomToggleControl());
|
||||||
private final ObservableBooleanValue developerDisableGuiRestrictionsEffective =
|
private final ObservableBooleanValue developerDisableGuiRestrictionsEffective =
|
||||||
bindDeveloperTrue(developerDisableGuiRestrictions);
|
bindDeveloperTrue(developerDisableGuiRestrictions);
|
||||||
|
|
||||||
private final BooleanProperty developerShowHiddenProviders = typed(new SimpleBooleanProperty(false), Boolean.class);
|
final BooleanProperty developerShowHiddenProviders = typed(new SimpleBooleanProperty(false), Boolean.class);
|
||||||
private final BooleanField developerShowHiddenProvidersField =
|
final BooleanField developerShowHiddenProvidersField =
|
||||||
BooleanField.ofBooleanType(developerShowHiddenProviders).render(() -> new CustomToggleControl());
|
BooleanField.ofBooleanType(developerShowHiddenProviders).render(() -> new CustomToggleControl());
|
||||||
private final ObservableBooleanValue developerShowHiddenProvidersEffective =
|
private final ObservableBooleanValue developerShowHiddenProvidersEffective =
|
||||||
bindDeveloperTrue(developerShowHiddenProviders);
|
bindDeveloperTrue(developerShowHiddenProviders);
|
||||||
|
|
||||||
private final BooleanProperty developerShowHiddenEntries = typed(new SimpleBooleanProperty(false), Boolean.class);
|
final BooleanProperty developerShowHiddenEntries = typed(new SimpleBooleanProperty(false), Boolean.class);
|
||||||
private final BooleanField developerShowHiddenEntriesField =
|
final BooleanField developerShowHiddenEntriesField =
|
||||||
BooleanField.ofBooleanType(developerShowHiddenEntries).render(() -> new CustomToggleControl());
|
BooleanField.ofBooleanType(developerShowHiddenEntries).render(() -> new CustomToggleControl());
|
||||||
private final ObservableBooleanValue developerShowHiddenEntriesEffective =
|
private final ObservableBooleanValue developerShowHiddenEntriesEffective =
|
||||||
bindDeveloperTrue(developerShowHiddenEntries);
|
bindDeveloperTrue(developerShowHiddenEntries);
|
||||||
|
|
||||||
private final BooleanProperty developerDisableConnectorInstallationVersionCheck =
|
final BooleanProperty developerDisableConnectorInstallationVersionCheck =
|
||||||
typed(new SimpleBooleanProperty(false), Boolean.class);
|
typed(new SimpleBooleanProperty(false), Boolean.class);
|
||||||
private final BooleanField developerDisableConnectorInstallationVersionCheckField = BooleanField.ofBooleanType(
|
final BooleanField developerDisableConnectorInstallationVersionCheckField = BooleanField.ofBooleanType(
|
||||||
developerDisableConnectorInstallationVersionCheck)
|
developerDisableConnectorInstallationVersionCheck)
|
||||||
.render(() -> new CustomToggleControl());
|
.render(() -> new CustomToggleControl());
|
||||||
private final ObservableBooleanValue developerDisableConnectorInstallationVersionCheckEffective =
|
private final ObservableBooleanValue developerDisableConnectorInstallationVersionCheckEffective =
|
||||||
|
@ -627,28 +627,7 @@ public class AppPrefs {
|
||||||
.applyVisibility(VisibilityProperty.of(
|
.applyVisibility(VisibilityProperty.of(
|
||||||
terminalType.isEqualTo(ExternalTerminalType.CUSTOM))),
|
terminalType.isEqualTo(ExternalTerminalType.CUSTOM))),
|
||||||
Setting.of("preferTerminalTabs", preferTerminalTabsField, preferTerminalTabs))),
|
Setting.of("preferTerminalTabs", preferTerminalTabsField, preferTerminalTabs))),
|
||||||
Category.of(
|
new DeveloperCategory(this).create(),
|
||||||
"developer",
|
|
||||||
Setting.of(
|
|
||||||
"developerDisableUpdateVersionCheck",
|
|
||||||
developerDisableUpdateVersionCheckField,
|
|
||||||
developerDisableUpdateVersionCheck),
|
|
||||||
Setting.of(
|
|
||||||
"developerDisableGuiRestrictions",
|
|
||||||
developerDisableGuiRestrictionsField,
|
|
||||||
developerDisableGuiRestrictions),
|
|
||||||
Setting.of(
|
|
||||||
"developerDisableConnectorInstallationVersionCheck",
|
|
||||||
developerDisableConnectorInstallationVersionCheckField,
|
|
||||||
developerDisableConnectorInstallationVersionCheck),
|
|
||||||
Setting.of(
|
|
||||||
"developerShowHiddenEntries",
|
|
||||||
developerShowHiddenEntriesField,
|
|
||||||
developerShowHiddenEntries),
|
|
||||||
Setting.of(
|
|
||||||
"developerShowHiddenProviders",
|
|
||||||
developerShowHiddenProvidersField,
|
|
||||||
developerShowHiddenProviders)),
|
|
||||||
Category.of("troubleshoot", Group.of(troubleshoot))));
|
Category.of("troubleshoot", Group.of(troubleshoot))));
|
||||||
|
|
||||||
categories.get(categories.size() - 2).setVisibilityProperty(VisibilityProperty.of(developerMode()));
|
categories.get(categories.size() - 2).setVisibilityProperty(VisibilityProperty.of(developerMode()));
|
||||||
|
|
81
app/src/main/java/io/xpipe/app/prefs/DeveloperCategory.java
Normal file
81
app/src/main/java/io/xpipe/app/prefs/DeveloperCategory.java
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
package io.xpipe.app.prefs;
|
||||||
|
|
||||||
|
import atlantafx.base.theme.Styles;
|
||||||
|
import com.dlsc.preferencesfx.model.Category;
|
||||||
|
import com.dlsc.preferencesfx.model.Group;
|
||||||
|
import com.dlsc.preferencesfx.model.Setting;
|
||||||
|
import io.xpipe.app.comp.base.ButtonComp;
|
||||||
|
import io.xpipe.app.fxcomps.impl.HorizontalComp;
|
||||||
|
import io.xpipe.app.fxcomps.impl.TextFieldComp;
|
||||||
|
import io.xpipe.app.util.LocalShell;
|
||||||
|
import io.xpipe.app.util.ThreadHelper;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.geometry.Insets;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import org.kordamp.ikonli.javafx.FontIcon;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DeveloperCategory extends AppPrefsCategory {
|
||||||
|
|
||||||
|
public DeveloperCategory(AppPrefs prefs) {
|
||||||
|
super(prefs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SneakyThrows
|
||||||
|
public Category create() {
|
||||||
|
var localCommand = new SimpleStringProperty();
|
||||||
|
Runnable test = () -> {
|
||||||
|
prefs.save();
|
||||||
|
var cmd = localCommand.get();
|
||||||
|
if (cmd == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadHelper.runFailableAsync(() -> {
|
||||||
|
LocalShell.getShell().executeSimpleStringCommandAndCheck(cmd);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var runLocalCommand = lazyNode(
|
||||||
|
"shellCommandTest",
|
||||||
|
new HorizontalComp(List.of(
|
||||||
|
new TextFieldComp(localCommand)
|
||||||
|
.apply(struc -> struc.get().setPromptText("Local command"))
|
||||||
|
.styleClass(Styles.LEFT_PILL)
|
||||||
|
.grow(false, true),
|
||||||
|
new ButtonComp(null, new FontIcon("mdi2p-play"), test)
|
||||||
|
.styleClass(Styles.RIGHT_PILL)
|
||||||
|
.grow(false, true)))
|
||||||
|
.padding(new Insets(15, 0, 0, 0))
|
||||||
|
.apply(struc -> struc.get().setAlignment(Pos.CENTER_LEFT))
|
||||||
|
.apply(struc -> struc.get().setFillHeight(true)),
|
||||||
|
null);
|
||||||
|
return Category.of(
|
||||||
|
"developer", Group.of(
|
||||||
|
Setting.of(
|
||||||
|
"developerDisableUpdateVersionCheck",
|
||||||
|
prefs.developerDisableUpdateVersionCheckField,
|
||||||
|
prefs.developerDisableUpdateVersionCheck),
|
||||||
|
Setting.of(
|
||||||
|
"developerDisableGuiRestrictions",
|
||||||
|
prefs.developerDisableGuiRestrictionsField,
|
||||||
|
prefs.developerDisableGuiRestrictions),
|
||||||
|
Setting.of(
|
||||||
|
"developerDisableConnectorInstallationVersionCheck",
|
||||||
|
prefs.developerDisableConnectorInstallationVersionCheckField,
|
||||||
|
prefs.developerDisableConnectorInstallationVersionCheck),
|
||||||
|
Setting.of(
|
||||||
|
"developerShowHiddenEntries",
|
||||||
|
prefs.developerShowHiddenEntriesField,
|
||||||
|
prefs.developerShowHiddenEntries),
|
||||||
|
Setting.of(
|
||||||
|
"developerShowHiddenProviders",
|
||||||
|
prefs.developerShowHiddenProvidersField,
|
||||||
|
prefs.developerShowHiddenProviders)),
|
||||||
|
Group.of("shellCommandTest",
|
||||||
|
runLocalCommand)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -108,6 +108,7 @@ developerShowHiddenProviders=Show hidden providers
|
||||||
developerShowHiddenProvidersDescription=Controls whether hidden and internal connection and data source providers will be shown in the creation dialog.
|
developerShowHiddenProvidersDescription=Controls whether hidden and internal connection and data source providers will be shown in the creation dialog.
|
||||||
developerDisableConnectorInstallationVersionCheck=Disable Connector Version Check
|
developerDisableConnectorInstallationVersionCheck=Disable Connector Version Check
|
||||||
developerDisableConnectorInstallationVersionCheckDescription=Controls whether the update checker will ignore the version number when inspecting the version of an XPipe connector installed on a remote machine.
|
developerDisableConnectorInstallationVersionCheckDescription=Controls whether the update checker will ignore the version number when inspecting the version of an XPipe connector installed on a remote machine.
|
||||||
|
shellCommandTest=Shell Command Test
|
||||||
konsole=Konsole
|
konsole=Konsole
|
||||||
xfce=Xfce 4
|
xfce=Xfce 4
|
||||||
elementaryTerminal=Elementary Terminal
|
elementaryTerminal=Elementary Terminal
|
||||||
|
|
Loading…
Reference in a new issue