Various fixes

This commit is contained in:
crschnick 2024-04-18 22:20:32 +00:00
parent b298d3cb81
commit 7bb5c2a441
7 changed files with 43 additions and 20 deletions

View file

@ -30,7 +30,7 @@ public interface ExternalPasswordManager extends PrefsChoiceValue {
@Override @Override
public String getId() { public String getId() {
return "1Password"; return "1password";
} }
}; };
@ -42,7 +42,7 @@ public interface ExternalPasswordManager extends PrefsChoiceValue {
@Override @Override
public String getId() { public String getId() {
return "Dashlane"; return "dashlane";
} }
}; };
@ -54,7 +54,7 @@ public interface ExternalPasswordManager extends PrefsChoiceValue {
@Override @Override
public String getId() { public String getId() {
return "LastPass"; return "lastpass";
} }
}; };
@ -66,7 +66,7 @@ public interface ExternalPasswordManager extends PrefsChoiceValue {
@Override @Override
public String getId() { public String getId() {
return "macOS keychain"; return "macosKeychain";
} }
@Override @Override

View file

@ -4,10 +4,10 @@ import io.xpipe.app.comp.store.StoreEntryWrapper;
import io.xpipe.app.fxcomps.util.BindingsHelper; import io.xpipe.app.fxcomps.util.BindingsHelper;
import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStorage;
import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.core.process.ShellDialects;
import io.xpipe.core.process.ShellStoreState; import io.xpipe.core.process.ShellStoreState;
import io.xpipe.core.store.DataStore; import io.xpipe.core.store.DataStore;
import io.xpipe.core.store.ShellStore; import io.xpipe.core.store.ShellStore;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import java.util.function.IntFunction; import java.util.function.IntFunction;
@ -28,15 +28,20 @@ public class DataStoreFormatter {
public static ObservableValue<String> shellInformation(StoreEntryWrapper w) { public static ObservableValue<String> shellInformation(StoreEntryWrapper w) {
return BindingsHelper.map(w.getPersistentState(), o -> { return BindingsHelper.map(w.getPersistentState(), o -> {
if (o instanceof ShellStoreState s) { if (o instanceof ShellStoreState s) {
if (!s.isInitialized()) { if (s.getRunning() == null) {
return null; return null;
} }
if (s.getShellDialect() != null if (s.getShellDialect() != null && !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) {
&& !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) { if (s.getOsName() != null) {
return s.getOsName() != null return formattedOsName(s.getOsName());
? formattedOsName(s.getOsName()) }
: s.getShellDialect().getDisplayName();
if (s.getShellDialect().equals(ShellDialects.UNSUPPORTED)) {
return null;
}
return s.getShellDialect().getDisplayName();
} }
return s.isRunning() ? formattedOsName(s.getOsName()) : "Connection failed"; return s.isRunning() ? formattedOsName(s.getOsName()) : "Connection failed";

View file

@ -6,15 +6,12 @@ import io.xpipe.core.util.NewLine;
import io.xpipe.core.util.SecretValue; import io.xpipe.core.util.SecretValue;
import io.xpipe.core.util.StreamCharset; import io.xpipe.core.util.StreamCharset;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Stream; import java.util.stream.Stream;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
public interface ShellDialect { public interface ShellDialect {
CommandBuilder launchAsnyc(CommandBuilder cmd); CommandBuilder launchAsnyc(CommandBuilder cmd);

View file

@ -21,10 +21,6 @@ public class ShellStoreState extends DataStoreState implements OsNameState {
ShellDialect shellDialect; ShellDialect shellDialect;
Boolean running; Boolean running;
public boolean isInitialized() {
return running != null;
}
public boolean isRunning() { public boolean isRunning() {
return running != null ? running : false; return running != null ? running : false;
} }

View file

@ -49,6 +49,9 @@ public class CoreJacksonModule extends SimpleModule {
addSerializer(Charset.class, new CharsetSerializer()); addSerializer(Charset.class, new CharsetSerializer());
addDeserializer(Charset.class, new CharsetDeserializer()); addDeserializer(Charset.class, new CharsetDeserializer());
addSerializer(ShellDialect.class, new ShellDialectSerializer());
addDeserializer(ShellDialect.class, new ShellDialectDeserializer());
addSerializer(StreamCharset.class, new StreamCharsetSerializer()); addSerializer(StreamCharset.class, new StreamCharsetSerializer());
addDeserializer(StreamCharset.class, new StreamCharsetDeserializer()); addDeserializer(StreamCharset.class, new StreamCharsetDeserializer());
@ -84,6 +87,22 @@ public class CoreJacksonModule extends SimpleModule {
} }
} }
public static class ShellDialectSerializer extends JsonSerializer<ShellDialect> {
@Override
public void serialize(ShellDialect value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeString(value.getId());
}
}
public static class ShellDialectDeserializer extends JsonDeserializer<ShellDialect> {
@Override
public ShellDialect deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
return ShellDialects.byNameIfPresent(p.getValueAsString()).orElse(null);
}
}
public static class NewLineSerializer extends JsonSerializer<NewLine> { public static class NewLineSerializer extends JsonSerializer<NewLine> {
@Override @Override

View file

@ -22,6 +22,8 @@ This concept will be refined over the next updates.
- Tunneled and X11-forwarded custom SSH connections are now properly detected and can be toggled on and off to run in the background as normal tunnels - Tunneled and X11-forwarded custom SSH connections are now properly detected and can be toggled on and off to run in the background as normal tunnels
- A host key acceptance notification is now displayed properly in case your system doesn't automatically accept new host keys
## SSH X11 Forwarding on Windows via WSL ## SSH X11 Forwarding on Windows via WSL
You can now enable X11 forwarding for an SSH connection. You can now enable X11 forwarding for an SSH connection.
@ -42,7 +44,7 @@ Furthermore, the kitty terminal is now fully supported with tabs on both Linux a
## Password manager improvements ## Password manager improvements
The password manager handling has been improved and some potential sources of errors and confusion have been eliminated. There are also now a few command templates available for established password managers to quickly get started.
## Improved keyboard control ## Improved keyboard control
@ -54,7 +56,7 @@ The application logo has been improved with of regards to contrast and visibilit
## Other changes ## Other changes
- Fix macOS app failing to automatically restart after update
- The window title will now reflect which edition you use - The window title will now reflect which edition you use
- Fix macOS app failing to automatically restart after update
- Fix file names not being properly adjusted when transferred across file systems and some characters were not supported on the target system - Fix file names not being properly adjusted when transferred across file systems and some characters were not supported on the target system
- Fix macOS desktop shortcuts not having an icon associated with them - Fix macOS desktop shortcuts not having an icon associated with them

View file

@ -58,3 +58,7 @@ mstsc=Microsoft Terminal Services Client (MSTSC)
remmina=Remmina remmina=Remmina
microsoftRemoteDesktopApp=Microsoft Remote Desktop.app microsoftRemoteDesktopApp=Microsoft Remote Desktop.app
bitwarden=Bitwarden bitwarden=Bitwarden
1password=1Password
dashlane=Dashlane
lastpass=LastPass
macosKeychain=macOS keychain