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 #3322

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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 @@ -97,14 +98,22 @@
@FxmlView
public class PreferencesView extends ActivatableViewAndModel<GridPane, PreferencesViewModel> {

private final Preferences preferences;
private final FeeService feeService;
//private final ReferralIdService referralIdService;
private final AssetService assetService;
private final FilterManager filterManager;
//private ComboBox<BaseCurrencyNetwork> selectBaseCurrencyNetworkComboBox;
private final DaoFacade daoFacade;
private final BSFormatter formatter;
private final boolean daoOptionsSet;
private final boolean displayStandbyModeFeature;
Comment on lines +101 to +110
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not commit non-changes. makes it hard to review and introduces unnecessary big change sets.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Are the non-changes you mentioned references to the comments (lines 103, 106)? Those were there from previous commits (before this PR). I did not add these comments. Should I delete them?

Or, are you referring to the Intellij code reformatting which rearranged the order of field definitions? I have been reformatting files I touch, using the IDE code style versioned in git. Should I not do that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, are you referring to the Intellij code reformatting which rearranged the order of field definitions? I have been reformatting files I touch, using the IDE code style versioned in git. Should I not do that?

that is what I meant. please only commit changes that have something to do with the topic of your PR. Thanks!

// not supported yet
//private ComboBox<String> btcDenominationComboBox;
private ComboBox<BlockChainExplorer> blockChainExplorerComboBox;
private ComboBox<String> userLanguageComboBox;
private ComboBox<Country> userCountryComboBox;
private ComboBox<TradeCurrency> preferredTradeCurrencyComboBox;
//private ComboBox<BaseCurrencyNetwork> selectBaseCurrencyNetworkComboBox;

private ToggleButton showOwnOffersInOfferBook, useAnimations, useDarkMode, sortMarketCurrenciesNumerically,
avoidStandbyMode, useCustomFee;
private int gridRow = 0;
Expand All @@ -114,16 +123,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
private ToggleButton isDaoFullNodeToggleButton;
private PasswordTextField rpcPwTextField;
private TitledGroupBg daoOptionsTitledGroupBg;

private ChangeListener<Boolean> transactionFeeFocusedListener;
private final Preferences preferences;
private final FeeService feeService;
//private final ReferralIdService referralIdService;
private final AssetService assetService;
private final FilterManager filterManager;
private final DaoFacade daoFacade;
private final BSFormatter formatter;

private ListView<FiatCurrency> fiatCurrenciesListView;
private ComboBox<FiatCurrency> fiatCurrenciesComboBox;
private ListView<CryptoCurrency> cryptoCurrenciesListView;
Expand All @@ -144,7 +144,6 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
private ChangeListener<Boolean> deviationFocusedListener;
private ChangeListener<Boolean> useCustomFeeCheckboxListener;
private ChangeListener<Number> transactionFeeChangeListener;
private final boolean daoOptionsSet;


///////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -170,10 +169,11 @@ public PreferencesView(PreferencesViewModel model,
this.filterManager = filterManager;
this.daoFacade = daoFacade;
this.formatter = formatter;
daoOptionsSet = fullDaoNode != null && !fullDaoNode.isEmpty() &&
this.daoOptionsSet = fullDaoNode != null && !fullDaoNode.isEmpty() &&
rpcUser != null && !rpcUser.isEmpty() &&
rpcPassword != null && !rpcPassword.isEmpty() &&
rpcBlockNotificationPort != null && !rpcBlockNotificationPort.isEmpty();
this.displayStandbyModeFeature = Utilities.isOSX() || Utilities.isWindows();
}

@Override
Expand Down Expand Up @@ -225,7 +225,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);

// selectBaseCurrencyNetwork
Expand Down Expand Up @@ -367,9 +368,11 @@ public BaseCurrencyNetwork fromString(String string) {
}
};

// 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 @@ -827,8 +830,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()));
}
}

private void activateDaoPreferences() {
Expand Down Expand Up @@ -950,7 +955,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