From 48d155400c816970e38b5b9fe1df6ed7c0f4229b Mon Sep 17 00:00:00 2001 From: crschnick Date: Sat, 20 May 2023 17:35:59 +0000 Subject: [PATCH] Small bug fixes --- .../main/java/io/xpipe/app/browser/BrowserFileListComp.java | 3 +++ app/src/main/java/io/xpipe/app/util/TerminalHelper.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFileListComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserFileListComp.java index 0bd6cddc..019cfee1 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFileListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFileListComp.java @@ -95,11 +95,13 @@ final class BrowserFileListComp extends SimpleComp { modeCol.setCellValueFactory(param -> new SimpleObjectProperty<>(param.getValue().getRawFileEntry().getMode())); modeCol.setCellFactory(col -> new FileModeCell()); + modeCol.setSortable(false); var table = new TableView(); table.setPlaceholder(new Region()); table.getStyleClass().add(Styles.STRIPED); table.getColumns().setAll(filenameCol, sizeCol, modeCol, mtimeCol); + table.getSortOrder().add(filenameCol); table.setSortPolicy(param -> { var comp = table.getComparator(); if (comp == null) { @@ -315,6 +317,7 @@ final class BrowserFileListComp extends SimpleComp { if (!table.getItems().equals(newItems)) { table.getItems().setAll(newItems); + table.sort(); } var currentDirectory = fileList.getFileSystemModel().getCurrentDirectory(); diff --git a/app/src/main/java/io/xpipe/app/util/TerminalHelper.java b/app/src/main/java/io/xpipe/app/util/TerminalHelper.java index 45ff24ce..5f8fab94 100644 --- a/app/src/main/java/io/xpipe/app/util/TerminalHelper.java +++ b/app/src/main/java/io/xpipe/app/util/TerminalHelper.java @@ -24,7 +24,7 @@ public class TerminalHelper { try { type.launch(title, command, false); } catch (Exception ex) { - throw new IOException("Unable to launch terminal " + type.toTranslatedString() + ". Maybe try to use a different one in the settings.", ex); + throw new IOException("Unable to launch terminal " + type.toTranslatedString() + ": " + ex.getMessage() + ". Maybe try to use a different one in the settings.", ex); } } }