Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide avoid standby mode feature on *nux OS #3563

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import bisq.common.UserThread;
import bisq.common.app.DevEnv;
import bisq.common.util.Tuple3;
import bisq.common.util.Utilities;

import org.bitcoinj.core.Coin;

Expand Down Expand Up @@ -144,7 +145,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
private ChangeListener<Boolean> useCustomFeeCheckboxListener;
private ChangeListener<Number> transactionFeeChangeListener;
private final boolean daoOptionsSet;

private final boolean displayStandbyModeFeature;

///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, initialisation
Expand Down Expand Up @@ -173,6 +174,7 @@ public PreferencesView(PreferencesViewModel model,
rpcUser != null && !rpcUser.isEmpty() &&
rpcPassword != null && !rpcPassword.isEmpty() &&
rpcBlockNotificationPort != null && !rpcBlockNotificationPort.isEmpty();
this.displayStandbyModeFeature = Utilities.isOSX() || Utilities.isWindows();
}

@Override
Expand Down Expand Up @@ -224,7 +226,8 @@ protected void deactivate() {
///////////////////////////////////////////////////////////////////////////////////////////

private void initializeGeneralOptions() {
TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 8, Res.get("setting.preferences.general"));
int titledGroupBgRowSpan = displayStandbyModeFeature ? 8 : 7;
TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, titledGroupBgRowSpan, Res.get("setting.preferences.general"));
GridPane.setColumnSpan(titledGroupBg, 1);

userLanguageComboBox = addComboBox(root, gridRow,
Expand Down Expand Up @@ -346,9 +349,11 @@ private void initializeGeneralOptions() {
}
};

// AvoidStandbyModeService
avoidStandbyMode = addSlideToggleButton(root, ++gridRow,
Res.get("setting.preferences.avoidStandbyMode"));
if (displayStandbyModeFeature) {
// AvoidStandbyModeService feature works only on OSX & Windows
avoidStandbyMode = addSlideToggleButton(root, ++gridRow,
Res.get("setting.preferences.avoidStandbyMode"));
}
}

private void initializeSeparator() {
Expand Down Expand Up @@ -806,8 +811,10 @@ private void activateDisplayPreferences() {

// We use opposite property (useStandbyMode) in preferences to have the default value (false) set as we want it,
// so users who update gets set avoidStandbyMode=true (useStandbyMode=false)
avoidStandbyMode.setSelected(!preferences.isUseStandbyMode());
avoidStandbyMode.setOnAction(e -> preferences.setUseStandbyMode(!avoidStandbyMode.isSelected()));
if (displayStandbyModeFeature) {
avoidStandbyMode.setSelected(!preferences.isUseStandbyMode());
avoidStandbyMode.setOnAction(e -> preferences.setUseStandbyMode(!avoidStandbyMode.isSelected()));
}
ghubstan marked this conversation as resolved.
Show resolved Hide resolved
}

private void activateDaoPreferences() {
Expand Down Expand Up @@ -929,7 +936,9 @@ private void deactivateDisplayPreferences() {
sortMarketCurrenciesNumerically.setOnAction(null);
showOwnOffersInOfferBook.setOnAction(null);
resetDontShowAgainButton.setOnAction(null);
avoidStandbyMode.setOnAction(null);
if (displayStandbyModeFeature) {
avoidStandbyMode.setOnAction(null);
}
}

private void deactivateDaoPreferences() {
Expand Down