mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
save webcam device unique id instead of name to config
This commit is contained in:
parent
3c5fa58a16
commit
80105aee62
2 changed files with 5 additions and 1 deletions
|
|
@ -188,7 +188,7 @@ public class QRScanDialog extends Dialog<QRScanDialog.Result> {
|
|||
}
|
||||
});
|
||||
webcamDeviceProperty.addListener((_, _, newValue) -> {
|
||||
Config.get().setWebcamDevice(newValue.getName());
|
||||
Config.get().setWebcamDevice(newValue.getUniqueId());
|
||||
if(!Objects.equals(webcamService.getDevice(), newValue)) {
|
||||
webcamService.cancel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ public class WebcamService extends ScheduledService<Image> {
|
|||
}
|
||||
} else if(Config.get().getWebcamDevice() != null) {
|
||||
for(CaptureDevice webcam : availableDevices) {
|
||||
if(webcam.getUniqueId().equals(Config.get().getWebcamDevice())) {
|
||||
selectedDevice = webcam;
|
||||
break;
|
||||
}
|
||||
if(webcam.getName().equals(Config.get().getWebcamDevice())) {
|
||||
selectedDevice = webcam;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue