mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +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),
|
new ButtonType(AppI18n.get("renameAll"), ButtonBar.ButtonData.OTHER),
|
||||||
FileConflictChoice.RENAME_ALL);
|
FileConflictChoice.RENAME_ALL);
|
||||||
}
|
}
|
||||||
|
var w = multiple ? 700 : 400;
|
||||||
return AppWindowHelper.showBlockingAlert(alert -> {
|
return AppWindowHelper.showBlockingAlert(alert -> {
|
||||||
alert.setTitle(AppI18n.get("fileConflictAlertTitle"));
|
alert.setTitle(AppI18n.get("fileConflictAlertTitle"));
|
||||||
alert.setHeaderText(AppI18n.get("fileConflictAlertHeader"));
|
alert.setHeaderText(AppI18n.get("fileConflictAlertHeader"));
|
||||||
alert.setAlertType(Alert.AlertType.CONFIRMATION);
|
alert.setAlertType(Alert.AlertType.CONFIRMATION);
|
||||||
alert.getButtonTypes().clear();
|
alert.getButtonTypes().clear();
|
||||||
alert.getDialogPane().setContent(AppWindowHelper.alertContentText(AppI18n.get(
|
alert.getDialogPane().setContent(AppWindowHelper.alertContentText(AppI18n.get(
|
||||||
multiple ? "fileConflictAlertContentMultiple" : "fileConflictAlertContent", file), 655));
|
multiple ? "fileConflictAlertContentMultiple" : "fileConflictAlertContent", file), w - 50));
|
||||||
alert.getDialogPane().setMinWidth(705);
|
alert.getDialogPane().setMinWidth(w);
|
||||||
alert.getDialogPane().setPrefWidth(705);
|
alert.getDialogPane().setPrefWidth(w);
|
||||||
alert.getDialogPane().setMaxWidth(705);
|
alert.getDialogPane().setMaxWidth(w);
|
||||||
map.sequencedKeySet()
|
map.sequencedKeySet()
|
||||||
.forEach(buttonType -> alert.getButtonTypes().add(buttonType));
|
.forEach(buttonType -> alert.getButtonTypes().add(buttonType));
|
||||||
})
|
})
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class BrowserFileTransferOperation {
|
||||||
private String renameFile(String target) {
|
private String renameFile(String target) {
|
||||||
var targetFile = new FilePath(target);
|
var targetFile = new FilePath(target);
|
||||||
var name = targetFile.getFileName();
|
var name = targetFile.getFileName();
|
||||||
var pattern = Pattern.compile("(.+?) \\((\\d+)\\)\\.(.+)");
|
var pattern = Pattern.compile("(.+) \\((\\d+)\\)\\.(.+?)");
|
||||||
var matcher = pattern.matcher(name);
|
var matcher = pattern.matcher(name);
|
||||||
if (matcher.matches()) {
|
if (matcher.matches()) {
|
||||||
try {
|
try {
|
||||||
|
@ -209,7 +209,8 @@ public class BrowserFileTransferOperation {
|
||||||
} catch (NumberFormatException e) {}
|
} 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 {
|
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