diff --git a/app/src/main/java/io/xpipe/app/prefs/LoggingCategory.java b/app/src/main/java/io/xpipe/app/prefs/LoggingCategory.java index 5b466e9ad..9c4d9353b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/LoggingCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/LoggingCategory.java @@ -6,6 +6,7 @@ import io.xpipe.app.core.AppProperties; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.util.DesktopHelper; +import io.xpipe.app.util.LicenseProvider; import io.xpipe.app.util.OptionsBuilder; import java.io.IOException; @@ -21,11 +22,19 @@ public class LoggingCategory extends AppPrefsCategory { @Override protected Comp create() { var prefs = AppPrefs.get(); + var supported = LicenseProvider.get() + .getFeature("logging") + .isSupported(); + var title = AppI18n.observable("sessionLogging") + .map(s -> s + (supported + ? "" + : " (Pro)")); return new OptionsBuilder() - .addTitle("sessionLogging") + .addTitle(title) .sub(new OptionsBuilder() .nameAndDescription("enableTerminalLogging") .addToggle(prefs.enableTerminalLogging) + .disable(!supported) .nameAndDescription("terminalLoggingDirectory") .addComp(new ButtonComp(AppI18n.observable("openSessionLogs"), () -> { var dir = AppProperties.get().getDataDir().resolve("sessions"); diff --git a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java index aab915af7..9ff1561e3 100644 --- a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java +++ b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java @@ -96,7 +96,10 @@ public class TerminalLauncher { var launcherScript = d.terminalLauncherScript(request, adjustedTitle); var preparationScript = ScriptHelper.createLocalExecScript(launcherScript); - if (!AppPrefs.get().enableTerminalLogging().get()) { + var supported = LicenseProvider.get() + .getFeature("logging") + .isSupported(); + if (!AppPrefs.get().enableTerminalLogging().get() || !supported) { var config = new ExternalTerminalType.LaunchConfiguration( entry != null ? color : null, adjustedTitle, cleanTitle, preparationScript, d); return config;