mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Small file transfer fixes [stage]
This commit is contained in:
parent
2191ccbfcc
commit
2680066c7f
3 changed files with 9 additions and 7 deletions
|
@ -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));
|
||||
})
|
||||
|
|
|
@ -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 {
|
||||
|
|
2
version
2
version
|
@ -1 +1 @@
|
|||
12.2-3
|
||||
12.2-4
|
||||
|
|
Loading…
Reference in a new issue