mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 12:26:45 +00:00
show warning if data is too large for display as static qr
This commit is contained in:
parent
fad960c192
commit
af89be96e5
1 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,7 @@ import com.sparrowwallet.hummingbird.LegacyUREncoder;
|
||||||
import com.sparrowwallet.hummingbird.registry.RegistryType;
|
import com.sparrowwallet.hummingbird.registry.RegistryType;
|
||||||
import com.sparrowwallet.sparrow.AppServices;
|
import com.sparrowwallet.sparrow.AppServices;
|
||||||
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
|
import com.sparrowwallet.sparrow.glyphfont.FontAwesome5;
|
||||||
|
import com.sparrowwallet.sparrow.glyphfont.GlyphUtils;
|
||||||
import com.sparrowwallet.sparrow.io.Config;
|
import com.sparrowwallet.sparrow.io.Config;
|
||||||
import com.sparrowwallet.sparrow.io.ImportException;
|
import com.sparrowwallet.sparrow.io.ImportException;
|
||||||
import com.sparrowwallet.hummingbird.UR;
|
import com.sparrowwallet.hummingbird.UR;
|
||||||
|
@ -169,6 +170,11 @@ public class QRDisplayDialog extends Dialog<ButtonType> {
|
||||||
dialogPane.setContent(Borders.wrap(stackPane).lineBorder().buildAll());
|
dialogPane.setContent(Borders.wrap(stackPane).lineBorder().buildAll());
|
||||||
qrImageView.setImage(getQrCode(data));
|
qrImageView.setImage(getQrCode(data));
|
||||||
|
|
||||||
|
if(qrImageView.getImage() == null) {
|
||||||
|
Label warning = new Label("Message is too long for display as a QR code");
|
||||||
|
stackPane.getChildren().add(warning);
|
||||||
|
}
|
||||||
|
|
||||||
final ButtonType cancelButtonType = new javafx.scene.control.ButtonType("Close", ButtonBar.ButtonData.CANCEL_CLOSE);
|
final ButtonType cancelButtonType = new javafx.scene.control.ButtonType("Close", ButtonBar.ButtonData.CANCEL_CLOSE);
|
||||||
dialogPane.getButtonTypes().addAll(cancelButtonType);
|
dialogPane.getButtonTypes().addAll(cancelButtonType);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue