mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-11 09:08:02 +00:00
followup
This commit is contained in:
@@ -188,7 +188,8 @@ public class QRScanDialog extends Dialog<QRScanDialog.Result> {
|
||||
}
|
||||
});
|
||||
webcamDeviceProperty.addListener((_, _, newValue) -> {
|
||||
Config.get().setWebcamDevice(newValue.getUniqueId());
|
||||
Config.get().setWebcamDevice(newValue.getName());
|
||||
Config.get().setWebcamDeviceId(newValue.getUniqueId());
|
||||
if(!Objects.equals(webcamService.getDevice(), newValue)) {
|
||||
webcamService.cancel();
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class WebcamService extends ScheduledService<Image> {
|
||||
}
|
||||
} else if(Config.get().getWebcamDevice() != null) {
|
||||
for(CaptureDevice webcam : availableDevices) {
|
||||
if(webcam.getUniqueId().equals(Config.get().getWebcamDevice())) {
|
||||
if(webcam.getUniqueId().equals(Config.get().getWebcamDeviceId())) {
|
||||
selectedDevice = webcam;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public class Config {
|
||||
private boolean mirrorCapture = true;
|
||||
private boolean useZbar = true;
|
||||
private String webcamDevice;
|
||||
private String webcamDeviceId;
|
||||
private ServerType serverType;
|
||||
private Server publicElectrumServer;
|
||||
private Server coreServer;
|
||||
@@ -437,6 +438,15 @@ public class Config {
|
||||
flush();
|
||||
}
|
||||
|
||||
public String getWebcamDeviceId() {
|
||||
return webcamDeviceId;
|
||||
}
|
||||
|
||||
public void setWebcamDeviceId(String webcamDeviceId) {
|
||||
this.webcamDeviceId = webcamDeviceId;
|
||||
flush();
|
||||
}
|
||||
|
||||
public ServerType getServerType() {
|
||||
return serverType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user