-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account Signing: Improve signed state notificaton (#3388)
* Remove new badge from Altcoin instant feature * Remove new badge from percentage user deposit feature * Fix line break issues in received payment confirmation popup * Check if received payload fulfills signing state condition and not any personal witness * Show additional badge for account sections to guide user to check out new signing states
- Loading branch information
Showing
9 changed files
with
121 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
desktop/src/main/java/bisq/desktop/main/presentation/AccountPresentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.desktop.main.presentation; | ||
|
||
import bisq.desktop.main.overlays.popups.Popup; | ||
|
||
import bisq.core.locale.Res; | ||
import bisq.core.user.DontShowAgainLookup; | ||
import bisq.core.user.Preferences; | ||
|
||
import bisq.common.app.DevEnv; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
|
||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
|
||
import javafx.collections.MapChangeListener; | ||
|
||
|
||
@Singleton | ||
public class AccountPresentation { | ||
|
||
public static final String ACCOUNT_NEWS = "accountNews"; | ||
|
||
private Preferences preferences; | ||
|
||
private final SimpleBooleanProperty showNotification = new SimpleBooleanProperty(false); | ||
|
||
@Inject | ||
public AccountPresentation(Preferences preferences) { | ||
|
||
this.preferences = preferences; | ||
|
||
preferences.getDontShowAgainMapAsObservable().addListener((MapChangeListener<? super String, ? super Boolean>) change -> { | ||
if (change.getKey().equals(ACCOUNT_NEWS)) { | ||
showNotification.set(!change.wasAdded()); | ||
} | ||
}); | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////// | ||
// Public | ||
/////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
public BooleanProperty getShowAccountUpdatesNotification() { | ||
return showNotification; | ||
} | ||
|
||
public void setup() { | ||
showNotification.set(preferences.showAgain(ACCOUNT_NEWS)); | ||
} | ||
|
||
public void showOneTimeAccountSigningPopup(String key, String s) { | ||
if (!DevEnv.isDevMode()) { | ||
|
||
DontShowAgainLookup.dontShowAgain(ACCOUNT_NEWS, false); | ||
showNotification.set(true); | ||
|
||
DontShowAgainLookup.dontShowAgain(key, true); | ||
new Popup<>().information(Res.get(s, | ||
Res.get("popup.accountSigning.generalInformation"))) | ||
.show(); | ||
} | ||
} | ||
} |