better handling of multiple verification file drop

This commit is contained in:
Craig Raw 2024-03-06 14:11:37 +02:00
parent 4cb2e1ef9f
commit c034dbe89e

View file

@ -291,9 +291,7 @@ public class AppController implements Initializable {
Dragboard db = event.getDragboard(); Dragboard db = event.getDragboard();
boolean success = false; boolean success = false;
if(db.hasFiles()) { if(db.hasFiles()) {
for(File file : db.getFiles()) { openFiles(db.getFiles());
openFile(file);
}
success = true; success = true;
} }
event.setDropCompleted(success); event.setDropCompleted(success);
@ -998,15 +996,21 @@ public class AppController implements Initializable {
} }
} }
public void openFile(File file) { public void openFiles(List<File> files) {
boolean verifyOpened = false;
for(File file : files) {
if(isWalletFile(file)) { if(isWalletFile(file)) {
openWalletFile(file, true); openWalletFile(file, true);
} else if(isVerifyDownloadFile(file)) { } else if(isVerifyDownloadFile(file)) {
if(!verifyOpened) {
verifyDownload(new ActionEvent(file, rootStack)); verifyDownload(new ActionEvent(file, rootStack));
verifyOpened = true;
}
} else { } else {
openTransactionFile(file); openTransactionFile(file);
} }
} }
}
private void setServerToggleTooltip(Integer currentBlockHeight) { private void setServerToggleTooltip(Integer currentBlockHeight) {
Tooltip tooltip = new Tooltip(getServerToggleTooltipText(currentBlockHeight)); Tooltip tooltip = new Tooltip(getServerToggleTooltipText(currentBlockHeight));