diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserAlerts.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserAlerts.java index 03d652798..9bf622a41 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserAlerts.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserAlerts.java @@ -36,16 +36,17 @@ public class BrowserAlerts { new ButtonType(AppI18n.get("renameAll"), ButtonBar.ButtonData.OTHER), FileConflictChoice.RENAME_ALL); } + var w = multiple ? 700 : 400; return AppWindowHelper.showBlockingAlert(alert -> { alert.setTitle(AppI18n.get("fileConflictAlertTitle")); alert.setHeaderText(AppI18n.get("fileConflictAlertHeader")); alert.setAlertType(Alert.AlertType.CONFIRMATION); alert.getButtonTypes().clear(); alert.getDialogPane().setContent(AppWindowHelper.alertContentText(AppI18n.get( - multiple ? "fileConflictAlertContentMultiple" : "fileConflictAlertContent", file), 655)); - alert.getDialogPane().setMinWidth(705); - alert.getDialogPane().setPrefWidth(705); - alert.getDialogPane().setMaxWidth(705); + multiple ? "fileConflictAlertContentMultiple" : "fileConflictAlertContent", file), w - 50)); + alert.getDialogPane().setMinWidth(w); + alert.getDialogPane().setPrefWidth(w); + alert.getDialogPane().setMaxWidth(w); map.sequencedKeySet() .forEach(buttonType -> alert.getButtonTypes().add(buttonType)); }) diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java index 8662924f4..a471d38e6 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java @@ -199,7 +199,7 @@ public class BrowserFileTransferOperation { private String renameFile(String target) { var targetFile = new FilePath(target); var name = targetFile.getFileName(); - var pattern = Pattern.compile("(.+?) \\((\\d+)\\)\\.(.+)"); + var pattern = Pattern.compile("(.+) \\((\\d+)\\)\\.(.+?)"); var matcher = pattern.matcher(name); if (matcher.matches()) { try { @@ -209,7 +209,8 @@ public class BrowserFileTransferOperation { } catch (NumberFormatException e) {} } - return targetFile.getBaseName() + " (" + 1 + ")." + targetFile.getExtension(); + var noExt = targetFile.getFileName().equals(targetFile.getExtension()); + return targetFile.getBaseName() + " (" + 1 + ")" + (noExt ? "" : "." + targetFile.getExtension()); } private void handleSingleAcrossFileSystems(FileEntry source) throws Exception { diff --git a/version b/version index 52821fbfd..ae235f1e0 100644 --- a/version +++ b/version @@ -1 +1 @@ -12.2-3 +12.2-4