Skip to content

Commit

Permalink
Temporary delete QR code scanner
Browse files Browse the repository at this point in the history
used for mobile notification pairing because of missing current macOS support by currently used webcam library
  • Loading branch information
ripcurlx committed Apr 20, 2021
1 parent f862fc2 commit b5beea5
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 228 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ configure(subprojects) {
protocVersion = protobufVersion
pushyVersion = '0.13.2'
qrgenVersion = '1.3'
sarxosVersion = '0.3.12'
slf4jVersion = '1.7.30'
sparkVersion = '2.5.2'
springBootVersion = '1.5.10.RELEASE'
Expand Down Expand Up @@ -412,7 +411,6 @@ configure(project(':desktop')) {
compile "de.jensd:fontawesomefx-materialdesignfont:$fontawesomefxMaterialdesignfontVersion"
compile "com.google.guava:guava:$guavaVersion"
compile "com.googlecode.jcsv:jcsv:$jcsvVersion"
compile "com.github.sarxos:webcam-capture:$sarxosVersion"
compile "org.openjfx:javafx-controls:$javafxVersion:$os"
compile "org.openjfx:javafx-fxml:$javafxVersion:$os"
compile "org.openjfx:javafx-swing:$javafxVersion:$os"
Expand Down
4 changes: 1 addition & 3 deletions desktop/package/package.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ task packageInstallers {
" libprism_es2.dylib" +
" libdecora_sse.dylib" +
" libprism_sw.dylib" +
" org/bridj/lib/darwin_universal/libbridj.dylib" +
" META-INF/native/libio_grpc_netty_shaded_netty_tcnative_osx_x86_64.jnilib" +
" com/github/sarxos/webcam/ds/buildin/lib/darwin_universal/libOpenIMAJGrabber.dylib"
" META-INF/native/libio_grpc_netty_shaded_netty_tcnative_osx_x86_64.jnilib"
)

// macOS step 1: Sign dylibs and replace them in the shadow jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import bisq.desktop.components.InputTextField;
import bisq.desktop.main.PriceUtil;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.overlays.windows.WebCamWindow;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Layout;
Expand Down Expand Up @@ -90,15 +89,12 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
private final MarketAlerts marketAlerts;
private final MobileNotificationService mobileNotificationService;

private WebCamWindow webCamWindow;
private QrCodeReader qrCodeReader;

private TextField tokenInputTextField;
private InputTextField priceAlertHighInputTextField, priceAlertLowInputTextField, marketAlertTriggerInputTextField;
private ToggleButton useSoundToggleButton, tradeToggleButton, marketToggleButton, priceToggleButton;
private ComboBox<TradeCurrency> currencyComboBox;
private ComboBox<PaymentAccount> paymentAccountsComboBox;
private Button downloadButton, webCamButton, noWebCamButton, eraseButton, setPriceAlertButton,
private Button downloadButton, eraseButton, setPriceAlertButton,
removePriceAlertButton, addMarketAlertButton, manageAlertsButton /*,testMsgButton*/;

private ChangeListener<Boolean> useSoundCheckBoxListener, tradeCheckBoxListener, marketCheckBoxListener,
Expand Down Expand Up @@ -149,8 +145,6 @@ protected void activate() {
// setup
tokenInputTextField.textProperty().addListener(tokenInputTextFieldListener);
downloadButton.setOnAction(e -> onDownload());
webCamButton.setOnAction(e -> onOpenWebCam());
noWebCamButton.setOnAction(e -> onNoWebCam());
// testMsgButton.setOnAction(e -> onSendTestMsg());
eraseButton.setOnAction(e -> onErase());

Expand Down Expand Up @@ -203,8 +197,6 @@ protected void deactivate() {
// setup
tokenInputTextField.textProperty().removeListener(tokenInputTextFieldListener);
downloadButton.setOnAction(null);
webCamButton.setOnAction(null);
noWebCamButton.setOnAction(null);
//testMsgButton.setOnAction(null);
eraseButton.setOnAction(null);

Expand Down Expand Up @@ -243,45 +235,6 @@ private void onDownload() {
GUIUtil.openWebPage("https://bisq.network/downloads");
}

private void onOpenWebCam() {
webCamButton.setDisable(true);
log.info("Start WebCamLauncher");
new WebCamLauncher(webCam -> {
log.info("webCam available");
webCamWindow = new WebCamWindow(webCam.getViewSize().width, webCam.getViewSize().height)
.onClose(() -> {
webCamButton.setDisable(false);
qrCodeReader.close();
});
webCamWindow.show();

qrCodeReader = new QrCodeReader(webCam, webCamWindow.getImageView(), qrCode -> {
log.info("Qr code available");
webCamWindow.hide();
webCamButton.setDisable(false);
reset();
tokenInputTextField.setText(qrCode);
updateMarketAlertFields();
updatePriceAlertFields();
});
}, throwable -> {
if (throwable instanceof NoWebCamFoundException) {
new Popup().warning(Res.get("account.notifications.noWebCamFound.warning")).show();
webCamButton.setDisable(false);
onNoWebCam();
} else {
log.error(throwable.toString());
new Popup().error(throwable.toString()).show();
}
});
}

private void onNoWebCam() {
setPairingTokenFieldsVisible();
noWebCamButton.setManaged(false);
noWebCamButton.setVisible(false);
}

private void onErase() {
try {
mobileNotificationService.sendEraseMessage();
Expand Down Expand Up @@ -401,18 +354,10 @@ private void createSetupFields() {
Res.get("account.notifications.download.label"),
Layout.TWICE_FIRST_ROW_DISTANCE);

Tuple3<Label, Button, Button> tuple = addTopLabel2Buttons(root, ++gridRow,
Res.get("account.notifications.webcam.label"),
Res.get("account.notifications.webcam.button"), Res.get("account.notifications.noWebcam.button"), 0);
webCamButton = tuple.second;
noWebCamButton = tuple.third;

tokenInputTextField = addInputTextField(root, ++gridRow,
Res.get("account.notifications.email.label"));
tokenInputTextField.setPromptText(Res.get("account.notifications.email.prompt"));
tokenInputTextFieldListener = (observable, oldValue, newValue) -> applyKeyAndToken(newValue);
tokenInputTextField.setManaged(false);
tokenInputTextField.setVisible(false);

/*testMsgButton = FormBuilder.addTopLabelButton(root, ++gridRow, Res.get("account.notifications.testMsg.label"),
Res.get("account.notifications.testMsg.title")).second;
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions gradle/witness/gradle-witness.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencyVerification {
'com.github.bisq-network:bitcoinj:65ed08fa5777ea4a08599bdd575e7dc1f4ba2d4d5835472551439d6f6252e68a',
'com.github.bisq-network:jsonrpc4j:842b4a660440ef53cd436da2e21c3e1fed939b620a3fc7542307deb3e77fdeb6',
'com.github.ravn:jsocks:3c71600af027b2b6d4244e4ad14d98ff2352a379410daebefff5d8cd48d742a4',
'com.github.sarxos:webcam-capture:d960b7ea8ec3ddf2df0725ef214c3fccc9699ea7772df37f544e1f8e4fd665f6',
'com.google.android:annotations:ba734e1e84c09d615af6a09d33034b4f0442f8772dec120efb376d86a565ae15',
'com.google.api.grpc:proto-google-common-protos:bd60cd7a423b00fb824c27bdd0293aaf4781be1daba6ed256311103fb4b84108',
'com.google.code.findbugs:jsr305:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7',
Expand All @@ -47,7 +46,6 @@ dependencyVerification {
'com.google.zxing:javase:0ec23e2ec12664ddd6347c8920ad647bb3b9da290f897a88516014b56cc77eb9',
'com.googlecode.jcsv:jcsv:73ca7d715e90c8d2c2635cc284543b038245a34f70790660ed590e157b8714a2',
'com.jfoenix:jfoenix:8060235fec5eb49617ec8d81d379e8c945f6cc722d0645e97190045100de2084',
'com.nativelibs4java:bridj:101bcd9b6637e6bc16e56deb3daefba62b1f5e8e9e37e1b3e56e3b5860d659cf',
'commons-codec:commons-codec:61f7a3079e92b9fdd605238d0295af5fd11ac411a0a0af48deace1f6c5ffa072',
'commons-io:commons-io:f877d304660ac2a142f3865badfc971dec7ed73c747c7f8d5d2f5139ca736513',
'commons-logging:commons-logging:daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636',
Expand Down

0 comments on commit b5beea5

Please sign in to comment.