diff --git a/README.md b/README.md index 0eeef8ca..f57b7069 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ It comes with the following main features: - Automatically login into a shell in your favourite terminal with one click (no need to fill password prompts, etc.) - Works for all kinds of shells. This includes command shells (e.g. bash, PowerShell, cmd, etc.) and database shells (e.g. PSQL Shell) -- Comes with integrations for all commonly used terminals in Windows and Linux +- Comes with integrations for all commonly used terminals for all operating systems - Exclusively uses established CLI tools and therefore works out of the box on most systems and doesn't require any additional setup - Allows you to customize the launched shell's init environment @@ -42,7 +42,8 @@ It comes with the following main features: - Easily create and manage all kinds of remote connections at one location - Securely stores all information exclusively on your computer and encrypts all secret information -- Allows you to share connection configurations to any other trusted party through shareable URLs +- Share connection configurations to any other trusted party through shareable URLs +- Create desktop shortcuts to open your connections drawing diff --git a/app/build.gradle b/app/build.gradle index ceb6bb1b..288f3dfb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -131,7 +131,7 @@ application { run { systemProperty 'io.xpipe.app.mode', 'gui' - systemProperty 'io.xpipe.app.dataDir', "$projectDir/local/" + systemProperty 'io.xpipe.app.dataDir', "$projectDir/local_stage/" systemProperty 'io.xpipe.app.writeLogs', "true" systemProperty 'io.xpipe.app.writeSysOut', "true" systemProperty 'io.xpipe.app.developerMode', "true" diff --git a/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java b/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java index 6632e649..807e0af2 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/IntegratedTextAreaComp.java @@ -18,11 +18,13 @@ public class IntegratedTextAreaComp extends SimpleComp { private final Property value; private final boolean lazy; private final String identifier; + private final String fileType; - public IntegratedTextAreaComp(Property value, boolean lazy, String identifier) { + public IntegratedTextAreaComp(Property value, boolean lazy, String identifier, String fileType) { this.value = value; this.lazy = lazy; this.identifier = identifier; + this.fileType = fileType; } @Override @@ -44,7 +46,7 @@ public class IntegratedTextAreaComp extends SimpleComp { private Region createOpenButton(Region container) { var button = new IconButtonComp("mdal-edit", () -> EditorState.get() - .startEditing(identifier, this, value.getValue(), (s) -> { + .startEditing(identifier, fileType, this, value.getValue(), (s) -> { Platform.runLater(() -> value.setValue(s)); })).createRegion(); return button; diff --git a/app/src/main/java/io/xpipe/app/editor/EditorState.java b/app/src/main/java/io/xpipe/app/editor/EditorState.java index 26986d0f..fd24c24d 100644 --- a/app/src/main/java/io/xpipe/app/editor/EditorState.java +++ b/app/src/main/java/io/xpipe/app/editor/EditorState.java @@ -124,6 +124,7 @@ public class EditorState { public void startEditing( String keyName, + String fileType, Object key, String input, Consumer output) { @@ -132,7 +133,7 @@ public class EditorState { } String s = input; - startEditing(keyName, key, () -> new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8)), () -> new ByteArrayOutputStream(s.length()) { + startEditing(keyName, fileType, key, () -> new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8)), () -> new ByteArrayOutputStream(s.length()) { @Override public void close() throws IOException { super.close(); @@ -143,6 +144,7 @@ public class EditorState { public void startEditing( String keyName, + String fileType, Object key, Charsetter.FailableSupplier input, Charsetter.FailableSupplier output) { @@ -152,7 +154,7 @@ public class EditorState { return; } - var name = keyName + " - " + UUID.randomUUID().toString().substring(0, 6) + ".txt"; + var name = keyName + " - " + UUID.randomUUID().toString().substring(0, 6) + "." + (fileType != null ? fileType : "txt"); Path file = TEMP.resolve(name); try { FileUtils.forceMkdirParent(file.toFile()); diff --git a/app/src/main/java/io/xpipe/app/grid/AppDownloads.java b/app/src/main/java/io/xpipe/app/grid/AppDownloads.java index c9cb2c59..82e2c00c 100644 --- a/app/src/main/java/io/xpipe/app/grid/AppDownloads.java +++ b/app/src/main/java/io/xpipe/app/grid/AppDownloads.java @@ -1,5 +1,6 @@ package io.xpipe.app.grid; +import io.xpipe.app.prefs.AppPrefs; import io.xpipe.extension.event.ErrorEvent; import io.xpipe.extension.event.TrackEvent; import io.xpipe.extension.util.HttpHelper; @@ -81,6 +82,12 @@ public class AppDownloads { public static Optional getLatestSuitableRelease() { try { var repo = getRepository(); + + // Always choose most up-to-date release as we assume that there are only full releases and prereleases + if (AppPrefs.get().updateToPrereleases().get()) { + return Optional.ofNullable(repo.listReleases().iterator().next()); + } + return Optional.ofNullable(repo.getLatestRelease()); } catch (IOException e) { ErrorEvent.fromThrowable(e).omit().handle(); diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 23c157a6..a1485d7b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -8,7 +8,6 @@ import com.dlsc.preferencesfx.model.Category; import com.dlsc.preferencesfx.model.Group; import com.dlsc.preferencesfx.model.Setting; import com.dlsc.preferencesfx.util.VisibilityProperty; -import io.xpipe.extension.util.XPipeDistributionType; import io.xpipe.app.core.AppProperties; import io.xpipe.app.core.AppStyle; import io.xpipe.extension.event.ErrorEvent; @@ -16,6 +15,7 @@ import io.xpipe.extension.fxcomps.util.SimpleChangeListener; import io.xpipe.extension.prefs.PrefsChoiceValue; import io.xpipe.extension.prefs.PrefsHandler; import io.xpipe.extension.prefs.PrefsProvider; +import io.xpipe.extension.util.XPipeDistributionType; import javafx.beans.property.*; import javafx.beans.value.ObservableBooleanValue; import javafx.beans.value.ObservableValue; @@ -114,14 +114,17 @@ public class AppPrefs { private final SingleSelectionField externalStartupBehaviourControl = Field.ofSingleSelectionType(externalStartupBehaviourList, externalStartupBehaviour) .render(() -> new TranslatableComboBoxControl<>()); + // Automatically update // ==================== private final BooleanProperty automaticallyUpdate = typed(new SimpleBooleanProperty(XPipeDistributionType.get().supportsUpdate()), Boolean.class); - private final BooleanField automaticallyUpdateField = BooleanField.ofBooleanType(automaticallyUpdate) - .editable(XPipeDistributionType.get().supportsUpdate()) - .render(() -> new ToggleControl()); - private final BooleanProperty updateToPrereleases = typed(new SimpleBooleanProperty(true), Boolean.class); + private final BooleanField automaticallyUpdateField = + BooleanField.ofBooleanType(automaticallyUpdate).render(() -> new ToggleControl()); + private final BooleanProperty updateToPrereleases = typed(new SimpleBooleanProperty(false), Boolean.class); + private final BooleanField updateToPrereleasesField = + BooleanField.ofBooleanType(updateToPrereleases).render(() -> new ToggleControl()); + private final BooleanProperty confirmDeletions = typed(new SimpleBooleanProperty(true), Boolean.class); // External startup behaviour @@ -383,11 +386,20 @@ public class AppPrefs { Setting.of( "externalStartupBehaviour", externalStartupBehaviourControl, - externalStartupBehaviour), + externalStartupBehaviour + ), Setting.of("closeBehaviour", closeBehaviourControl, closeBehaviour), - Setting.of("automaticallyUpdate", automaticallyUpdateField, automaticallyUpdate), + Setting.of("automaticallyUpdate", automaticallyUpdateField, automaticallyUpdate) + .applyVisibility(VisibilityProperty.of(new SimpleBooleanProperty( + XPipeDistributionType.get().supportsUpdate()))), + Setting.of("updateToPrereleases", updateToPrereleasesField, updateToPrereleases) + .applyVisibility(VisibilityProperty.of(new SimpleBooleanProperty( + XPipeDistributionType.get().supportsUpdate()))), Setting.of("storageDirectory", storageDirectoryControl, internalStorageDirectory), - Setting.of("logLevel", logLevelField, internalLogLevel))), + Setting.of("logLevel", logLevelField, internalLogLevel), + Setting.of("developerMode", developerModeField, internalDeveloperMode) + ) + ), Category.of( "appearance", Group.of( @@ -396,8 +408,10 @@ public class AppPrefs { Setting.of("theme", themeControl, themeInternal), Setting.of("useSystemFont", useSystemFontInternal), Setting.of("tooltipDelay", tooltipDelayInternal, tooltipDelayMin, tooltipDelayMax), - Setting.of("fontSize", fontSizeInternal, fontSizeMin, fontSizeMax)), - Group.of("windowOptions", Setting.of("saveWindowLocation", saveWindowLocationInternal))), + Setting.of("fontSize", fontSizeInternal, fontSizeMin, fontSizeMax) + ), + Group.of("windowOptions", Setting.of("saveWindowLocation", saveWindowLocationInternal)) + ), Category.of( "integrations", Group.of( @@ -410,30 +424,41 @@ public class AppPrefs { "editorReloadTimeout", editorReloadTimeout, editorReloadTimeoutMin, - editorReloadTimeoutMax))), + editorReloadTimeoutMax + ) + ) + ), Category.of( "developer", - Setting.of("developerMode", developerModeField, internalDeveloperMode), Setting.of( "developerDisableUpdateVersionCheck", developerDisableUpdateVersionCheckField, - developerDisableUpdateVersionCheck), + developerDisableUpdateVersionCheck + ), Setting.of( "developerDisableGuiRestrictions", developerDisableGuiRestrictionsField, - developerDisableGuiRestrictions), + developerDisableGuiRestrictions + ), Setting.of( "developerDisableConnectorInstallationVersionCheck", developerDisableConnectorInstallationVersionCheckField, - developerDisableConnectorInstallationVersionCheck), + developerDisableConnectorInstallationVersionCheck + ), Setting.of( "developerShowHiddenEntries", developerShowHiddenEntriesField, - developerShowHiddenEntries), + developerShowHiddenEntries + ), Setting.of( "developerShowHiddenProviders", developerShowHiddenProvidersField, - developerShowHiddenProviders)))); + developerShowHiddenProviders + ) + ) + )); + + categories.get(categories.size() - 1).setVisibilityProperty(VisibilityProperty.of(developerMode())); var handler = new PrefsHandlerImpl(categories); PrefsProvider.getAll().forEach(prov -> prov.addPrefs(handler)); diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties index 2ab4b39c..25491f8d 100644 --- a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties +++ b/app/src/main/resources/io/xpipe/app/resources/lang/preferences_en.properties @@ -10,6 +10,7 @@ windowOptions=Window Options saveWindowLocation=Save window location on exit startupShutdown=Startup / Shutdown system=System +updateToPrereleases=Update to prereleases storage=Storage runOnStartup=Run on startup closeBehaviour=Close behaviour diff --git a/dist/changelogs/0.4.27.md b/dist/changelogs/0.4.27.md index 7c7caba0..17fa4634 100644 --- a/dist/changelogs/0.4.27.md +++ b/dist/changelogs/0.4.27.md @@ -1,3 +1,3 @@ - Add ability to create desktop shortcuts for shell connections -- Improve terminal integration on MacOS +- Improve terminal integration on macOS - Many bug fixes \ No newline at end of file diff --git a/ext/base/src/main/java/io/xpipe/ext/base/actions/FileEditAction.java b/ext/base/src/main/java/io/xpipe/ext/base/actions/FileEditAction.java index ba080b20..25815429 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/actions/FileEditAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/actions/FileEditAction.java @@ -36,7 +36,7 @@ public class FileEditAction implements DataStoreActionProvider { EditorState.get().openInEditor(store.getFile()); } else { EditorState.get() - .startEditing(store.getFileName(), store, () -> store.openInput(), () -> store.openOutput()); + .startEditing(store.getFileName(), store.getFileExtension(), store, () -> store.openInput(), () -> store.openOutput()); } } } diff --git a/gradle/gradle_scripts/extension.gradle b/gradle/gradle_scripts/extension.gradle index cb78fcae..046644ae 100644 --- a/gradle/gradle_scripts/extension.gradle +++ b/gradle/gradle_scripts/extension.gradle @@ -1,7 +1,7 @@ task copyRuntimeLibs(type: Copy) { into project.jar.destinationDirectory from configurations.runtimeClasspath - exclude "${project.name}.jar" + exclude "${project.name}.jar", "${project.name.substring(0, project.name.length() - 1)}.jar" duplicatesStrategy(DuplicatesStrategy.EXCLUDE) } copyRuntimeLibs.dependsOn(addDependenciesModuleInfo)