mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Small fixes
This commit is contained in:
parent
edd4656e3a
commit
c86cc138c0
5 changed files with 22 additions and 13 deletions
|
@ -79,7 +79,10 @@ final class FileContextMenu extends ContextMenu {
|
||||||
execute.setOnAction(event -> {
|
execute.setOnAction(event -> {
|
||||||
ThreadHelper.runFailableAsync(() -> {
|
ThreadHelper.runFailableAsync(() -> {
|
||||||
ShellControl pc = model.getFileSystem().getShell().orElseThrow();
|
ShellControl pc = model.getFileSystem().getShell().orElseThrow();
|
||||||
pc.executeBooleanSimpleCommand(pc.getShellDialect().getMakeExecutableCommand(entry.getPath()));
|
var e = pc.getShellDialect().getMakeExecutableCommand(entry.getPath());
|
||||||
|
if (e != null) {
|
||||||
|
pc.executeBooleanSimpleCommand(e);
|
||||||
|
}
|
||||||
var cmd = pc.command("\"" + entry.getPath() + "\"").prepareTerminalOpen();
|
var cmd = pc.command("\"" + entry.getPath() + "\"").prepareTerminalOpen();
|
||||||
TerminalHelper.open(FilenameUtils.getBaseName(entry.getPath()), cmd);
|
TerminalHelper.open(FilenameUtils.getBaseName(entry.getPath()), cmd);
|
||||||
});
|
});
|
||||||
|
@ -91,7 +94,10 @@ final class FileContextMenu extends ContextMenu {
|
||||||
executeInBackground.setOnAction(event -> {
|
executeInBackground.setOnAction(event -> {
|
||||||
ThreadHelper.runFailableAsync(() -> {
|
ThreadHelper.runFailableAsync(() -> {
|
||||||
ShellControl pc = model.getFileSystem().getShell().orElseThrow();
|
ShellControl pc = model.getFileSystem().getShell().orElseThrow();
|
||||||
pc.executeBooleanSimpleCommand(pc.getShellDialect().getMakeExecutableCommand(entry.getPath()));
|
var e = pc.getShellDialect().getMakeExecutableCommand(entry.getPath());
|
||||||
|
if (e != null) {
|
||||||
|
pc.executeBooleanSimpleCommand(e);
|
||||||
|
}
|
||||||
var cmd = ScriptHelper.createDetachCommand(pc, "\"" + entry.getPath() + "\"");
|
var cmd = ScriptHelper.createDetachCommand(pc, "\"" + entry.getPath() + "\"");
|
||||||
pc.executeBooleanSimpleCommand(cmd);
|
pc.executeBooleanSimpleCommand(cmd);
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,7 +23,6 @@ public class SentryErrorHandler {
|
||||||
options.setEnableUncaughtExceptionHandler(false);
|
options.setEnableUncaughtExceptionHandler(false);
|
||||||
options.setAttachServerName(false);
|
options.setAttachServerName(false);
|
||||||
// options.setDebug(true);
|
// options.setDebug(true);
|
||||||
options.setDist(XPipeDistributionType.get().getId());
|
|
||||||
options.setRelease(AppProperties.get().getVersion());
|
options.setRelease(AppProperties.get().getVersion());
|
||||||
options.setEnableShutdownHook(false);
|
options.setEnableShutdownHook(false);
|
||||||
options.setProguardUuid(AppProperties.get().getBuildUuid().toString());
|
options.setProguardUuid(AppProperties.get().getBuildUuid().toString());
|
||||||
|
@ -87,6 +86,7 @@ public class SentryErrorHandler {
|
||||||
.toList();
|
.toList();
|
||||||
atts.forEach(attachment -> s.addAttachment(attachment));
|
atts.forEach(attachment -> s.addAttachment(attachment));
|
||||||
|
|
||||||
|
s.setTag("dist", XPipeDistributionType.get().getId());
|
||||||
s.setTag("developerMode", AppPrefs.get() != null ? AppPrefs.get().developerMode().getValue().toString() : "false");
|
s.setTag("developerMode", AppPrefs.get() != null ? AppPrefs.get().developerMode().getValue().toString() : "false");
|
||||||
s.setTag("terminal", Boolean.toString(ee.isTerminal()));
|
s.setTag("terminal", Boolean.toString(ee.isTerminal()));
|
||||||
s.setTag("omitted", Boolean.toString(ee.isOmitted()));
|
s.setTag("omitted", Boolean.toString(ee.isOmitted()));
|
||||||
|
|
|
@ -98,8 +98,10 @@ public class ScriptHelper {
|
||||||
|
|
||||||
// processControl.executeSimpleCommand(type.getFileTouchCommand(file), "Failed to create script " + file);
|
// processControl.executeSimpleCommand(type.getFileTouchCommand(file), "Failed to create script " + file);
|
||||||
processControl.getShellDialect().createTextFileWriteCommand(processControl, content, file).execute();
|
processControl.getShellDialect().createTextFileWriteCommand(processControl, content, file).execute();
|
||||||
processControl.executeSimpleCommand(
|
var e = type.getMakeExecutableCommand(file);
|
||||||
type.getMakeExecutableCommand(file), "Failed to make script " + file + " executable");
|
if (e != null) {
|
||||||
|
processControl.executeSimpleCommand(e, "Failed to make script " + file + " executable");
|
||||||
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ import java.util.function.Consumer;
|
||||||
public class JacksonMapper {
|
public class JacksonMapper {
|
||||||
|
|
||||||
private static final ObjectMapper BASE = new ObjectMapper();
|
private static final ObjectMapper BASE = new ObjectMapper();
|
||||||
private static final ObjectMapper DEFAULT;
|
private static final ObjectMapper INSTANCE;
|
||||||
private static ObjectMapper INSTANCE = new ObjectMapper();
|
|
||||||
private static boolean init = false;
|
private static boolean init = false;
|
||||||
|
|
||||||
public static <T> T parse(String s, Class<T> c) throws JsonProcessingException {
|
public static <T> T parse(String s, Class<T> c) throws JsonProcessingException {
|
||||||
|
@ -40,11 +39,7 @@ public class JacksonMapper {
|
||||||
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE)
|
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE)
|
||||||
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));
|
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE));
|
||||||
|
|
||||||
var modules = findModules(ModuleLayer.boot());
|
|
||||||
objectMapper.registerModules(modules);
|
|
||||||
|
|
||||||
INSTANCE = BASE.copy();
|
INSTANCE = BASE.copy();
|
||||||
DEFAULT = BASE.copy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized void configure(Consumer<ObjectMapper> mapper) {
|
public static synchronized void configure(Consumer<ObjectMapper> mapper) {
|
||||||
|
@ -76,15 +71,17 @@ public class JacksonMapper {
|
||||||
*/
|
*/
|
||||||
public static ObjectMapper newMapper() {
|
public static ObjectMapper newMapper() {
|
||||||
if (!JacksonMapper.isInit()) {
|
if (!JacksonMapper.isInit()) {
|
||||||
return DEFAULT;
|
return BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return INSTANCE.copy();
|
return INSTANCE.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ObjectMapper getDefault() {
|
public static ObjectMapper getDefault() {
|
||||||
if (!JacksonMapper.isInit()) {
|
if (!JacksonMapper.isInit()) {
|
||||||
return DEFAULT;
|
return BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,10 @@ public class DeleteStoreChildrenAction implements ActionProvider {
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
DataStorage.get().getStoreChildren(store,true).forEach(entry -> {
|
DataStorage.get().getStoreChildren(store,true).forEach(entry -> {
|
||||||
|
if (!entry.getConfiguration().isDeletable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DataStorage.get().deleteStoreEntry(entry);
|
DataStorage.get().deleteStoreEntry(entry);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue