Browse Source

followup to test taskbar api platform support

master
Craig Raw 2 years ago
parent
commit
f2b0f8ca9e
  1. 7
      src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java
  2. 7
      src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java
  3. 8
      src/main/java/com/sparrowwallet/sparrow/soroban/SorobanController.java

7
src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java

@ -32,7 +32,6 @@ import org.controlsfx.glyphfont.Glyph;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.Taskbar;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@ -248,7 +247,7 @@ public class CounterpartyController extends SorobanController {
.subscribeOn(Schedulers.io())
.observeOn(JavaFxScheduler.platform())
.subscribe(responseMessage -> {
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
if(accepted) {
startCounterpartyCollaboration(counterpartyCahootsWallet, paymentCodeInitiator, cahootsType);
followPaymentCode(paymentCodeInitiator);
@ -256,12 +255,12 @@ public class CounterpartyController extends SorobanController {
}, error -> {
log.error("Error sending meeting response", error);
mixingPartner.setVisible(false);
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
});
}, error -> {
log.error("Failed to receive meeting request", error);
mixingPartner.setVisible(false);
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
});
} catch(Exception e) {
log.error("Error sending meeting response", e);

7
src/main/java/com/sparrowwallet/sparrow/soroban/InitiatorController.java

@ -56,7 +56,6 @@ import org.controlsfx.validation.decoration.StyleClassValidationDecoration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.Taskbar;
import java.util.*;
import java.util.function.UnaryOperator;
@ -424,7 +423,7 @@ public class InitiatorController extends SorobanController {
.subscribeOn(Schedulers.io())
.observeOn(JavaFxScheduler.platform())
.subscribe(sorobanResponse -> {
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
if(sorobanResponse.isAccept()) {
sorobanProgressBar.setProgress(0.1);
sorobanProgressLabel.setText("Mix partner accepted!");
@ -438,14 +437,14 @@ public class InitiatorController extends SorobanController {
step2Desc.setText(getErrorMessage(error));
sorobanProgressLabel.setVisible(false);
meetingFail.setVisible(true);
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
});
}, error -> {
log.error("Error sending meeting request", error);
step2Desc.setText(getErrorMessage(error));
sorobanProgressLabel.setVisible(false);
meetingFail.setVisible(true);
Taskbar.getTaskbar().requestUserAttention(true, false);
requestUserAttention();
});
} catch(Exception e) {
log.error("Error sending meeting request", e);

8
src/main/java/com/sparrowwallet/sparrow/soroban/SorobanController.java

@ -15,8 +15,8 @@ import com.sparrowwallet.sparrow.net.ElectrumServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.awt.Taskbar;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class SorobanController {
@ -120,4 +120,10 @@ public class SorobanController {
return feeAmt;
}
protected void requestUserAttention() {
if(Taskbar.isTaskbarSupported()) {
Taskbar.getTaskbar().requestUserAttention(true, false);
}
}
}

Loading…
Cancel
Save