Skip to content

Commit

Permalink
Refactor duplicate XMR subaddress popup code
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Feb 5, 2025
1 parent 5e04336 commit 861f655
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,7 @@ public void addFormForAddAccount() {
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();

new Popup()
.headLine(Res.get("account.altcoin.popup.xmr.dataDirWarningHeadline"))
.backgroundInfo(Res.get("account.altcoin.popup.xmr.dataDirWarning"))
.dontShowAgainId("accountSubAddressInfo")
.width(700)
.show();
showXmrSubAddressPopup();
}

void setFieldManagement(boolean useSubAddresses) {
Expand Down Expand Up @@ -369,6 +364,15 @@ public void updateAllInputsValid() {
}
}

public static void showXmrSubAddressPopup() {
new Popup()
.headLine(Res.get("account.altcoin.popup.xmr.dataDirWarningHeadline"))
.backgroundInfo(Res.get("account.altcoin.popup.xmr.dataDirWarning"))
.dontShowAgainId("accountSubAddressInfo")
.width(700)
.show();
}

private void maybeShowXmrSubAddressInfo() {
String key = "xmrSubAddressInfo";
if (DontShowAgainLookup.showAgain(key)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
package bisq.desktop.main.account.content.altcoinaccounts;

import bisq.desktop.common.model.ActivatableDataModel;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.components.paymentmethods.XmrForm;
import bisq.desktop.util.GUIUtil;

import bisq.core.locale.CryptoCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.offer.OpenOfferManager;
import bisq.core.payment.AssetAccount;
Expand Down Expand Up @@ -85,12 +84,7 @@ protected void activate() {
.filter(e -> e.getSingleTradeCurrency().getCode().equals("XMR"))
.forEach(e -> {
if (!xmrAccountUsesSubAddresses(e)) {
new Popup()
.headLine(Res.get("account.altcoin.popup.xmr.dataDirWarningHeadline"))
.backgroundInfo(Res.get("account.altcoin.popup.xmr.dataDirWarning"))
.dontShowAgainId("accountSubAddressInfo")
.width(700)
.show();
XmrForm.showXmrSubAddressPopup();
}
});
}
Expand Down

0 comments on commit 861f655

Please sign in to comment.