diff --git a/.travis.yml b/.travis.yml index 5c84f0a4eb..88266e89f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,3 @@ install: before_install: grep -v '^#' assets/src/main/resources/META-INF/services/bisq.asset.Asset | sort --check --dictionary-order --ignore-case - -notifications: - slack: - on_success: change - on_failure: always - rooms: - - secure: EzlqWTBuhb3FCfApjUXaShWgsWOVDwMXI7ISMiVBkcl2VFISYs/lc/7Qjr7rdy4iqQOQXMcUPHdwMUp0diX+GxiSjLARjUpKIvNOPswZWBL+3Z1h28jyOwtHRviZbM1EU0BZROrr+ODyTNz2lf+L1iXTkpSvk50o5JAnAkumsPw= diff --git a/build.gradle b/build.gradle index d009a6256a..c82ff3336a 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ configure(subprojects) { javaxAnnotationVersion = '1.2' jcsvVersion = '1.4.0' jetbrainsAnnotationsVersion = '13.0' - jfoenixVersion = '9.0.10' + jfoenixVersion = '9.0.6' joptVersion = '5.0.4' jsonsimpleVersion = '1.1.1' junitVersion = '4.12' diff --git a/common/src/main/java/bisq/common/config/CompositeOptionSet.java b/common/src/main/java/bisq/common/config/CompositeOptionSet.java index f6a28ee3a6..0b3f39687b 100644 --- a/common/src/main/java/bisq/common/config/CompositeOptionSet.java +++ b/common/src/main/java/bisq/common/config/CompositeOptionSet.java @@ -4,6 +4,8 @@ import joptsimple.ArgumentAcceptingOptionSpec; import joptsimple.OptionSet; import joptsimple.OptionSpec; +import com.google.common.annotations.VisibleForTesting; + import java.util.ArrayList; import java.util.List; @@ -17,6 +19,7 @@ import java.util.List; * the command line with those provided via config file, such that those provided at the * command line take precedence over those provided in the config file. */ +@VisibleForTesting public class CompositeOptionSet { private final List optionSets = new ArrayList<>(); diff --git a/common/src/main/java/bisq/common/config/Config.java b/common/src/main/java/bisq/common/config/Config.java index fb5f16659e..2fb76613cd 100644 --- a/common/src/main/java/bisq/common/config/Config.java +++ b/common/src/main/java/bisq/common/config/Config.java @@ -68,6 +68,7 @@ public class Config { public static final String BASE_CURRENCY_NETWORK = "baseCurrencyNetwork"; public static final String REFERRAL_ID = "referralId"; public static final String USE_DEV_MODE = "useDevMode"; + public static final String USE_DEV_MODE_HEADER = "useDevModeHeader"; public static final String TOR_DIR = "torDir"; public static final String STORAGE_DIR = "storageDir"; public static final String KEY_STORAGE_DIR = "keyStorageDir"; @@ -159,6 +160,7 @@ public class Config { public final boolean daoActivated; public final String referralId; public final boolean useDevMode; + public final boolean useDevModeHeader; public final boolean useDevPrivilegeKeys; public final boolean dumpStatistics; public final boolean ignoreDevMsg; @@ -356,6 +358,13 @@ public class Config { .ofType(boolean.class) .defaultsTo(false); + ArgumentAcceptingOptionSpec useDevModeHeaderOpt = + parser.accepts(USE_DEV_MODE_HEADER, + "Use dev mode css scheme to distinguish dev instances.") + .withRequiredArg() + .ofType(boolean.class) + .defaultsTo(false); + ArgumentAcceptingOptionSpec useDevPrivilegeKeysOpt = parser.accepts(USE_DEV_PRIVILEGE_KEYS, "If set to true all privileged features requiring a private " + "key to be enabled are overridden by a dev key pair (This is for developers only!)") @@ -706,6 +715,7 @@ public class Config { this.torStreamIsolation = options.has(torStreamIsolationOpt); this.referralId = options.valueOf(referralIdOpt); this.useDevMode = options.valueOf(useDevModeOpt); + this.useDevModeHeader = options.valueOf(useDevModeHeaderOpt); this.useDevPrivilegeKeys = options.valueOf(useDevPrivilegeKeysOpt); this.dumpStatistics = options.valueOf(dumpStatisticsOpt); this.ignoreDevMsg = options.valueOf(ignoreDevMsgOpt); diff --git a/common/src/main/java/bisq/common/util/InvalidVersionException.java b/common/src/main/java/bisq/common/util/InvalidVersionException.java new file mode 100644 index 0000000000..d63bc31af0 --- /dev/null +++ b/common/src/main/java/bisq/common/util/InvalidVersionException.java @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +package bisq.common.util; + +public class InvalidVersionException extends Exception { + public InvalidVersionException(String msg) { + super(msg); + } +} diff --git a/common/src/main/java/bisq/common/util/Utilities.java b/common/src/main/java/bisq/common/util/Utilities.java index 6cdd3bf342..291baa6843 100644 --- a/common/src/main/java/bisq/common/util/Utilities.java +++ b/common/src/main/java/bisq/common/util/Utilities.java @@ -17,8 +17,6 @@ package bisq.common.util; -import bisq.common.crypto.LimitedKeyStrengthException; - import org.bitcoinj.core.Utils; import com.google.gson.ExclusionStrategy; @@ -71,6 +69,7 @@ import lombok.extern.slf4j.Slf4j; import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static java.awt.Desktop.Action; import static java.awt.Desktop.getDesktop; @@ -182,6 +181,34 @@ public class Utilities { return System.getProperty("os.name").toLowerCase(Locale.US); } + public static String getOSVersion() { + return System.getProperty("os.version").toLowerCase(Locale.US); + } + + public static int getMinorVersion() throws InvalidVersionException { + String version = getOSVersion(); + String[] tokens = version.split("\\."); + try { + checkArgument(tokens.length > 1); + return Integer.parseInt(tokens[1]); + } catch (IllegalArgumentException e) { + printSysInfo(); + throw new InvalidVersionException("Version is not in expected format. Version=" + version); + } + } + + public static int getMajorVersion() throws InvalidVersionException { + String version = getOSVersion(); + String[] tokens = version.split("\\."); + try { + checkArgument(tokens.length > 0); + return Integer.parseInt(tokens[0]); + } catch (IllegalArgumentException e) { + printSysInfo(); + throw new InvalidVersionException("Version is not in expected format. Version=" + version); + } + } + public static String getOSArchitecture() { String osArch = System.getProperty("os.arch"); if (isWindows()) { @@ -462,4 +489,5 @@ public class Utilities { Map map = new ConcurrentHashMap<>(); return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; } + } diff --git a/core/src/main/java/bisq/core/api/CoreApi.java b/core/src/main/java/bisq/core/api/CoreApi.java index 7041404ce5..30cedeb3b9 100644 --- a/core/src/main/java/bisq/core/api/CoreApi.java +++ b/core/src/main/java/bisq/core/api/CoreApi.java @@ -31,6 +31,7 @@ import bisq.common.app.Version; import org.bitcoinj.core.Coin; import javax.inject.Inject; +import javax.inject.Singleton; import java.util.ArrayList; import java.util.List; @@ -42,6 +43,7 @@ import lombok.extern.slf4j.Slf4j; * Provides high level interface to functionality of core Bisq features. * E.g. useful for different APIs to access data of different domains of Bisq. */ +@Singleton @Slf4j public class CoreApi { diff --git a/core/src/main/java/bisq/core/app/BisqExecutable.java b/core/src/main/java/bisq/core/app/BisqExecutable.java index e52aa07edb..2cb4760f38 100644 --- a/core/src/main/java/bisq/core/app/BisqExecutable.java +++ b/core/src/main/java/bisq/core/app/BisqExecutable.java @@ -164,6 +164,7 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet protected void setupDevEnv() { DevEnv.setDevMode(config.useDevMode); + DevEnv.setDevMode(config.useDevModeHeader); DevEnv.setDaoActivated(config.daoActivated); } diff --git a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java index 9307e25b92..b93d169788 100644 --- a/core/src/main/java/bisq/core/app/BisqHeadlessApp.java +++ b/core/src/main/java/bisq/core/app/BisqHeadlessApp.java @@ -97,6 +97,7 @@ public class BisqHeadlessApp implements HeadlessApp { bisqSetup.setRejectedTxErrorMessageHandler(errorMessage -> log.warn("setRejectedTxErrorMessageHandler. errorMessage={}", errorMessage)); bisqSetup.setShowPopupIfInvalidBtcConfigHandler(() -> log.error("onShowPopupIfInvalidBtcConfigHandler")); bisqSetup.setRevolutAccountsUpdateHandler(revolutAccountList -> log.info("setRevolutAccountsUpdateHandler: revolutAccountList={}", revolutAccountList)); + bisqSetup.setOsxKeyLoggerWarningHandler(() -> log.info("setOsxKeyLoggerWarningHandler")); //TODO move to bisqSetup corruptedDatabaseFilesHandler.getCorruptedDatabaseFiles().ifPresent(files -> log.warn("getCorruptedDatabaseFiles. files={}", files)); diff --git a/core/src/main/java/bisq/core/app/BisqSetup.java b/core/src/main/java/bisq/core/app/BisqSetup.java index 764b427f66..9440a98559 100644 --- a/core/src/main/java/bisq/core/app/BisqSetup.java +++ b/core/src/main/java/bisq/core/app/BisqSetup.java @@ -80,6 +80,7 @@ import bisq.common.crypto.CryptoException; import bisq.common.crypto.KeyRing; import bisq.common.crypto.SealedAndSigned; import bisq.common.proto.ProtobufferException; +import bisq.common.util.InvalidVersionException; import bisq.common.util.Utilities; import org.bitcoinj.core.Coin; @@ -225,6 +226,9 @@ public class BisqSetup { @Setter @Nullable private Consumer> revolutAccountsUpdateHandler; + @Setter + @Nullable + private Runnable osxKeyLoggerWarningHandler; @Getter final BooleanProperty newVersionAvailableProperty = new SimpleBooleanProperty(false); @@ -347,6 +351,7 @@ public class BisqSetup { readMapsFromResources(this::step3); checkCryptoSetup(); checkForCorrectOSArchitecture(); + checkOSXVersion(); } private void step3() { @@ -655,6 +660,19 @@ public class BisqSetup { } } + private void checkOSXVersion() { + if (Utilities.isOSX() && osxKeyLoggerWarningHandler != null) { + try { + // Seems it was introduced at 10.14: https://github.com/wesnoth/wesnoth/issues/4109 + if (Utilities.getMajorVersion() >= 10 && Utilities.getMinorVersion() >= 14) { + osxKeyLoggerWarningHandler.run(); + } + } catch (InvalidVersionException | NumberFormatException e) { + log.warn(e.getMessage()); + } + } + } + private void initDomainServices() { log.info("initDomainServices"); diff --git a/core/src/main/java/bisq/core/app/CoreModule.java b/core/src/main/java/bisq/core/app/CoreModule.java index 1f058e123a..e207ae033b 100644 --- a/core/src/main/java/bisq/core/app/CoreModule.java +++ b/core/src/main/java/bisq/core/app/CoreModule.java @@ -75,6 +75,7 @@ public class CoreModule extends AppModule { bindConstant().annotatedWith(named(USE_DEV_PRIVILEGE_KEYS)).to(config.useDevPrivilegeKeys); bindConstant().annotatedWith(named(USE_DEV_MODE)).to(config.useDevMode); + bindConstant().annotatedWith(named(USE_DEV_MODE_HEADER)).to(config.useDevModeHeader); bindConstant().annotatedWith(named(REFERRAL_ID)).to(config.referralId); // ordering is used for shut down sequence diff --git a/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java b/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java index aa76144c0d..4ffdb7f79c 100644 --- a/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java +++ b/core/src/main/java/bisq/core/app/misc/ModuleForAppWithP2p.java @@ -79,6 +79,7 @@ public class ModuleForAppWithP2p extends AppModule { bindConstant().annotatedWith(named(USE_DEV_PRIVILEGE_KEYS)).to(config.useDevPrivilegeKeys); bindConstant().annotatedWith(named(USE_DEV_MODE)).to(config.useDevMode); + bindConstant().annotatedWith(named(USE_DEV_MODE_HEADER)).to(config.useDevModeHeader); bindConstant().annotatedWith(named(REFERRAL_ID)).to(config.referralId); // ordering is used for shut down sequence diff --git a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java index 3136652542..369180bfee 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java @@ -61,7 +61,6 @@ import com.google.common.util.concurrent.ListenableFuture; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Proxy; -import java.net.UnknownHostException; import java.nio.channels.FileLock; @@ -482,14 +481,7 @@ public class WalletConfig extends AbstractIdleService { } void setPeerNodesForLocalHost() { - try { - setPeerNodes(new PeerAddress(InetAddress.getLocalHost(), params.getPort())); - } catch (UnknownHostException e) { - log.error(e.toString()); - e.printStackTrace(); - // Borked machine with no loopback adapter configured properly. - throw new RuntimeException(e); - } + setPeerNodes(new PeerAddress(InetAddress.getLoopbackAddress(), params.getPort())); } private Wallet createOrLoadWallet(File walletFile, diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index cd947f25a1..1474fb0628 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1003,7 +1003,7 @@ support.tab.legacyArbitration.support=Legacy Arbitration support.tab.ArbitratorsSupportTickets={0}'s tickets support.filter=Search disputes support.filter.prompt=Enter trade ID, date, onion address or account data -support.reOpenByTrader.prompt=Are you sure you want to re-open the dispute? +support.reOpenByTrader.prompt=Are you sure you want to re-open the dispute? support.reOpenButton.label=Re-open dispute support.sendNotificationButton.label=Send private notification support.reportButton.label=Generate report @@ -1290,6 +1290,7 @@ setting.info.msg=When selling BTC for XMR you can use the auto-confirm feature t account.tab.arbitratorRegistration=Arbitrator registration account.tab.mediatorRegistration=Mediator registration account.tab.refundAgentRegistration=Refund agent registration +account.tab.signing=Signing account.tab.account=Account account.info.headline=Welcome to your Bisq Account account.info.msg=Here you can add trading accounts for national currencies & altcoins and create a backup of your wallet & account data.\n\n\ @@ -2637,6 +2638,12 @@ error.closedTradeWithNoDepositTx=The deposit transaction of the closed trade wit Please restart the application to clean up the closed trades list. popup.warning.walletNotInitialized=The wallet is not initialized yet +popup.warning.osxKeyLoggerWarning=Due to stricter security measures in macOS 10.14 and above, launching a Java application \ + (Bisq uses Java) causes a popup warning in macOS ('Bisq would like to receive keystrokes from any application').\n\n\ + To avoid that issue please open your 'macOS Settings' and go to 'Security & Privacy' -> 'Privacy' -> \ + 'Input Monitoring' and Remove 'Bisq' from the list on the right side.\n\n\ + Bisq will upgrade to a newer Java version to avoid that issue as soon the technical limitations \ + (Java packager for the required Java version is not shipped yet) are resolved. popup.warning.wrongVersion=You probably have the wrong Bisq version for this computer.\n\ Your computer''s architecture is: {0}.\n\ The Bisq binary you installed is: {1}.\n\ diff --git a/desktop/src/main/java/bisq/desktop/app/BisqApp.java b/desktop/src/main/java/bisq/desktop/app/BisqApp.java index f8d35763ed..1202a1eb1f 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqApp.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqApp.java @@ -169,7 +169,7 @@ public class BisqApp extends Application implements UncaughtExceptionHandler { if (scene == null) { log.warn("Scene not available yet, we create a new scene. The bug might be caused by an exception in a constructor or by a circular dependency in Guice. throwable=" + throwable.toString()); scene = new Scene(new StackPane(), 1000, 650); - CssTheme.loadSceneStyles(scene, CssTheme.CSS_THEME_LIGHT); + CssTheme.loadSceneStyles(scene, CssTheme.CSS_THEME_LIGHT, false); stage.setScene(scene); stage.show(); } @@ -221,10 +221,11 @@ public class BisqApp extends Application implements UncaughtExceptionHandler { addSceneKeyEventHandler(scene, injector); Preferences preferences = injector.getInstance(Preferences.class); + var config = injector.getInstance(Config.class); preferences.getCssThemeProperty().addListener((ov) -> { - CssTheme.loadSceneStyles(scene, preferences.getCssTheme()); + CssTheme.loadSceneStyles(scene, preferences.getCssTheme(), config.useDevModeHeader); }); - CssTheme.loadSceneStyles(scene, preferences.getCssTheme()); + CssTheme.loadSceneStyles(scene, preferences.getCssTheme(), config.useDevModeHeader); return scene; } diff --git a/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java b/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java index ed5d5c86d1..d02c6e11c6 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java @@ -62,7 +62,6 @@ public class BisqAppMain extends BisqExecutable { log.debug("onSetupComplete"); } - /////////////////////////////////////////////////////////////////////////////////////////// // First synchronous execution tasks /////////////////////////////////////////////////////////////////////////////////////////// @@ -87,7 +86,6 @@ public class BisqAppMain extends BisqExecutable { Application.launch(BisqApp.class); } - /////////////////////////////////////////////////////////////////////////////////////////// // As application is a JavaFX application we need to wait for onApplicationLaunched /////////////////////////////////////////////////////////////////////////////////////////// @@ -123,21 +121,13 @@ public class BisqAppMain extends BisqExecutable { @Override protected void startApplication() { - // We need to be in user thread! We mapped at launchApplication already... - - // Once the UI is ready we get onApplicationStarted called and start the setup there + // We need to be in user thread! We mapped at launchApplication already. Once + // the UI is ready we get onApplicationStarted called and start the setup there. application.startApplication(this::onApplicationStarted); } @Override protected void onApplicationStarted() { super.onApplicationStarted(); - - /* - if (runWithGrpcApi()) { - CoreApi coreApi = injector.getInstance(CoreApi.class); - bisqGrpcServer = new BisqGrpcServer(coreApi); - } - */ } } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java index 9ddd087419..6ad54d9433 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java @@ -100,7 +100,7 @@ public class RevolutForm extends PaymentMethodForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.userName"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); diff --git a/desktop/src/main/java/bisq/desktop/main/MainView.java b/desktop/src/main/java/bisq/desktop/main/MainView.java index 03a5869908..0784ff1085 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainView.java +++ b/desktop/src/main/java/bisq/desktop/main/MainView.java @@ -77,6 +77,7 @@ import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.text.TextAlignment; @@ -190,10 +191,6 @@ public class MainView extends InitializableView JFXBadge portfolioButtonWithBadge = new JFXBadge(portfolioButton); JFXBadge supportButtonWithBadge = new JFXBadge(supportButton); - JFXBadge daoButtonWithBadge = new JFXBadge(daoButton); - daoButtonWithBadge.getStyleClass().add("new"); - JFXBadge accountButtonWithBadge = new JFXBadge(accountButton); - accountButtonWithBadge.getStyleClass().add("new"); JFXBadge settingsButtonWithBadge = new JFXBadge(settingsButton); settingsButtonWithBadge.getStyleClass().add("new"); @@ -326,9 +323,8 @@ public class MainView extends InitializableView primaryNav.getStyleClass().add("nav-primary"); HBox.setHgrow(primaryNav, Priority.SOMETIMES); - HBox secondaryNav = new HBox(supportButtonWithBadge, getNavigationSeparator(), - settingsButtonWithBadge, getNavigationSeparator(), accountButtonWithBadge, - getNavigationSeparator(), daoButtonWithBadge); + HBox secondaryNav = new HBox(supportButtonWithBadge, getNavigationSpacer(), settingsButtonWithBadge, + getNavigationSpacer(), accountButton, getNavigationSpacer(), daoButton); secondaryNav.getStyleClass().add("nav-secondary"); HBox.setHgrow(secondaryNav, Priority.SOMETIMES); @@ -371,8 +367,6 @@ public class MainView extends InitializableView setupBadge(portfolioButtonWithBadge, model.getNumPendingTrades(), model.getShowPendingTradesNotification()); setupBadge(supportButtonWithBadge, model.getNumOpenSupportTickets(), model.getShowOpenSupportTicketsNotification()); - setupBadge(daoButtonWithBadge, new SimpleStringProperty(Res.get("shared.new")), model.getShowDaoUpdatesNotification()); - setupBadge(accountButtonWithBadge, new SimpleStringProperty(Res.get("shared.new")), model.getShowAccountUpdatesNotification()); setupBadge(settingsButtonWithBadge, new SimpleStringProperty(Res.get("shared.new")), model.getShowSettingsUpdatesNotification()); navigation.addListener(viewPath -> { @@ -443,6 +437,13 @@ public class MainView extends InitializableView return separator; } + @NotNull + private Region getNavigationSpacer() { + final Region spacer = new Region(); + HBox.setHgrow(spacer, Priority.ALWAYS); + return spacer; + } + private Tuple2 getBalanceBox(String text) { Label balanceDisplay = new Label(); balanceDisplay.getStyleClass().add("nav-balance-display"); diff --git a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java index 0f92d6954c..6f468f7012 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/MainViewModel.java @@ -25,7 +25,6 @@ import bisq.desktop.main.overlays.Overlay; import bisq.desktop.main.overlays.notifications.NotificationCenter; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.windows.DisplayAlertMessageWindow; -import bisq.desktop.main.overlays.windows.NewTradeProtocolLaunchWindow; import bisq.desktop.main.overlays.windows.TacWindow; import bisq.desktop.main.overlays.windows.TorNetworkSettingsWindow; import bisq.desktop.main.overlays.windows.UpdateRevolutAccountWindow; @@ -282,7 +281,6 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener { // in MainView showAppScreen handler notificationCenter.onAllServicesAndViewsInitialized(); - maybeAddNewTradeProtocolLaunchWindowToQueue(); maybeShowPopupsFromQueue(); } @@ -390,7 +388,11 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener { // We copy the array as we will mutate it later showRevolutAccountUpdateWindow(new ArrayList<>(revolutAccountList)); }); - + bisqSetup.setOsxKeyLoggerWarningHandler(() -> { + new Popup().warning(Res.get("popup.warning.osxKeyLoggerWarning")) + .closeButtonText(Res.get("shared.iUnderstand")) + .show(); + }); corruptedDatabaseFilesHandler.getCorruptedDatabaseFiles().ifPresent(files -> new Popup() .warning(Res.get("popup.warning.incompatibleDB", files.toString(), config.appDataDir)) @@ -683,26 +685,10 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener { return daoPresentation.getShowDaoUpdatesNotification(); } - public BooleanProperty getShowAccountUpdatesNotification() { - return accountPresentation.getShowAccountUpdatesNotification(); - } - public BooleanProperty getShowSettingsUpdatesNotification() { return settingsPresentation.getShowSettingsUpdatesNotification(); } - private void maybeAddNewTradeProtocolLaunchWindowToQueue() { - String newTradeProtocolWithAccountSigningLaunchPopupKey = "newTradeProtocolWithAccountSigningLaunchPopup"; - if (DontShowAgainLookup.showAgain(newTradeProtocolWithAccountSigningLaunchPopupKey)) { - NewTradeProtocolLaunchWindow newTradeProtocolLaunchWindow = new NewTradeProtocolLaunchWindow() - .headLine(Res.get("popup.news.launch.headline")); - newTradeProtocolLaunchWindow.setDisplayOrderPriority(1); - popupQueue.add(newTradeProtocolLaunchWindow); - - DontShowAgainLookup.dontShowAgain(newTradeProtocolWithAccountSigningLaunchPopupKey, true); - } - } - private void maybeShowPopupsFromQueue() { if (!popupQueue.isEmpty()) { Overlay overlay = popupQueue.poll(); diff --git a/desktop/src/main/java/bisq/desktop/main/account/AccountView.java b/desktop/src/main/java/bisq/desktop/main/account/AccountView.java index b49610fb2b..71cc582257 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/AccountView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/AccountView.java @@ -33,6 +33,7 @@ import bisq.desktop.main.account.content.seedwords.SeedWordsView; import bisq.desktop.main.account.register.arbitrator.ArbitratorRegistrationView; import bisq.desktop.main.account.register.mediator.MediatorRegistrationView; import bisq.desktop.main.account.register.refundagent.RefundAgentRegistrationView; +import bisq.desktop.main.account.register.signing.SigningView; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.presentation.AccountPresentation; @@ -77,6 +78,7 @@ public class AccountView extends ActivatableView { private Tab arbitratorRegistrationTab; private Tab mediatorRegistrationTab; private Tab refundAgentRegistrationTab; + private Tab signingTab; private ArbitratorRegistrationView arbitratorRegistrationView; private MediatorRegistrationView mediatorRegistrationView; private RefundAgentRegistrationView refundAgentRegistrationView; @@ -110,6 +112,8 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } else if (refundAgentRegistrationTab == null && viewPath.get(2).equals(RefundAgentRegistrationView.class)) { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); + } else if (signingTab == null && viewPath.get(2).equals(SigningView.class)) { + navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } else { loadView(viewPath.tip()); } @@ -120,27 +124,23 @@ public class AccountView extends ActivatableView { keyEventEventHandler = event -> { if (Utilities.isAltOrCtrlPressed(KeyCode.D, event) && mediatorRegistrationTab == null) { - if (arbitratorRegistrationTab != null) { - root.getTabs().remove(arbitratorRegistrationTab); - } - if (refundAgentRegistrationTab != null) { - root.getTabs().remove(refundAgentRegistrationTab); - } + closeOtherExtraTabs(mediatorRegistrationTab); mediatorRegistrationTab = new Tab(Res.get("account.tab.mediatorRegistration").toUpperCase()); mediatorRegistrationTab.setClosable(true); root.getTabs().add(mediatorRegistrationTab); navigation.navigateTo(MainView.class, AccountView.class, MediatorRegistrationView.class); } else if (Utilities.isAltOrCtrlPressed(KeyCode.N, event) && refundAgentRegistrationTab == null) { - if (arbitratorRegistrationTab != null) { - root.getTabs().remove(arbitratorRegistrationTab); - } - if (mediatorRegistrationTab != null) { - root.getTabs().remove(mediatorRegistrationTab); - } + closeOtherExtraTabs(refundAgentRegistrationTab); refundAgentRegistrationTab = new Tab(Res.get("account.tab.refundAgentRegistration").toUpperCase()); refundAgentRegistrationTab.setClosable(true); root.getTabs().add(refundAgentRegistrationTab); navigation.navigateTo(MainView.class, AccountView.class, RefundAgentRegistrationView.class); + } else if (Utilities.isAltOrCtrlPressed(KeyCode.I, event) && signingTab == null) { + closeOtherExtraTabs(signingTab); + signingTab = new Tab(Res.get("account.tab.signing").toUpperCase()); + signingTab.setClosable(true); + root.getTabs().add(signingTab); + navigation.navigateTo(MainView.class, AccountView.class, SigningView.class); } }; @@ -151,6 +151,8 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, MediatorRegistrationView.class); } else if (refundAgentRegistrationTab != null && selectedTab != refundAgentRegistrationTab) { navigation.navigateTo(MainView.class, AccountView.class, RefundAgentRegistrationView.class); + } else if (signingTab != null && !selectedTab.equals(signingTab)) { + navigation.navigateTo(MainView.class, AccountView.class, SigningView.class); } else if (newValue == fiatAccountsTab && selectedTab != fiatAccountsTab) { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } else if (newValue == altcoinAccountsTab && selectedTab != altcoinAccountsTab) { @@ -177,9 +179,27 @@ public class AccountView extends ActivatableView { if (removedTabs.size() == 1 && removedTabs.get(0).equals(refundAgentRegistrationTab)) onRefundAgentRegistrationTabRemoved(); + + if (removedTabs.size() == 1 && removedTabs.get(0).equals(signingTab)) + onSigningTabRemoved(); }; } + private void closeOtherExtraTabs(Tab newTab) { + if (arbitratorRegistrationTab != null && !arbitratorRegistrationTab.equals(newTab)) { + root.getTabs().remove(arbitratorRegistrationTab); + } + if (mediatorRegistrationTab != null && !mediatorRegistrationTab.equals(newTab)) { + root.getTabs().remove(mediatorRegistrationTab); + } + if (refundAgentRegistrationTab != null && !refundAgentRegistrationTab.equals(newTab)) { + root.getTabs().remove(refundAgentRegistrationTab); + } + if (signingTab != null && !signingTab.equals(newTab)) { + root.getTabs().remove(signingTab); + } + } + private void onArbitratorRegistrationTabRemoved() { arbitratorRegistrationTab = null; navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); @@ -195,6 +215,11 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); } + private void onSigningTabRemoved() { + signingTab = null; + navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); + } + @Override protected void activate() { // Hide account new badge if user saw this section @@ -216,6 +241,8 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, MediatorRegistrationView.class); else if (refundAgentRegistrationTab != null) navigation.navigateTo(MainView.class, AccountView.class, RefundAgentRegistrationView.class); + else if (signingTab != null) + navigation.navigateTo(MainView.class, AccountView.class, SigningView.class); else if (root.getSelectionModel().getSelectedItem() == fiatAccountsTab) navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class); else if (root.getSelectionModel().getSelectedItem() == altcoinAccountsTab) @@ -274,6 +301,10 @@ public class AccountView extends ActivatableView { refundAgentRegistrationView = (RefundAgentRegistrationView) view; refundAgentRegistrationView.onTabSelection(true); } + } else if (view instanceof SigningView) { + if (signingTab != null) { + selectedTab = signingTab; + } } else if (view instanceof FiatAccountsView) { selectedTab = fiatAccountsTab; } else if (view instanceof AltCoinAccountsView) { diff --git a/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.fxml b/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.fxml new file mode 100644 index 0000000000..6abee607e4 --- /dev/null +++ b/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.fxml @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.java b/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.java new file mode 100644 index 0000000000..6291b5c3fa --- /dev/null +++ b/desktop/src/main/java/bisq/desktop/main/account/register/signing/SigningView.java @@ -0,0 +1,79 @@ +/* + * 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 . + */ + +package bisq.desktop.main.account.register.signing; + + +import bisq.desktop.common.view.ActivatableView; +import bisq.desktop.common.view.FxmlView; +import bisq.desktop.main.overlays.windows.SignPaymentAccountsWindow; +import bisq.desktop.main.overlays.windows.SignSpecificWitnessWindow; +import bisq.desktop.main.overlays.windows.SignUnsignedPubKeysWindow; + +import bisq.common.util.Utilities; + +import javax.inject.Inject; + +import javafx.scene.Scene; +import javafx.scene.input.KeyCode; +import javafx.scene.input.KeyEvent; +import javafx.scene.layout.AnchorPane; + +import javafx.event.EventHandler; + +@FxmlView +public class SigningView extends ActivatableView { + + private final SignPaymentAccountsWindow signPaymentAccountsWindow; + private final SignSpecificWitnessWindow signSpecificWitnessWindow; + private final SignUnsignedPubKeysWindow signUnsignedPubKeysWindow; + private EventHandler keyEventEventHandler; + private Scene scene; + + @Inject + public SigningView(SignPaymentAccountsWindow signPaymentAccountsWindow, + SignSpecificWitnessWindow signSpecificWitnessWindow, + SignUnsignedPubKeysWindow signUnsignedPubKeysWindow) { + this.signPaymentAccountsWindow = signPaymentAccountsWindow; + this.signSpecificWitnessWindow = signSpecificWitnessWindow; + this.signUnsignedPubKeysWindow = signUnsignedPubKeysWindow; + keyEventEventHandler = this::handleKeyPressed; + } + + @Override + protected void activate() { + scene = root.getScene(); + if (scene != null) + scene.addEventHandler(KeyEvent.KEY_RELEASED, keyEventEventHandler); + } + + @Override + protected void deactivate() { + if (scene != null) + scene.removeEventHandler(KeyEvent.KEY_RELEASED, keyEventEventHandler); + } + + protected void handleKeyPressed(KeyEvent event) { + if (Utilities.isAltOrCtrlPressed(KeyCode.S, event)) { + signPaymentAccountsWindow.show(); + } else if (Utilities.isAltOrCtrlPressed(KeyCode.P, event)) { + signSpecificWitnessWindow.show(); + } else if (Utilities.isAltOrCtrlPressed(KeyCode.O, event)) { + signUnsignedPubKeysWindow.show(); + } + } +} diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java deleted file mode 100644 index 646791a687..0000000000 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/NewTradeProtocolLaunchWindow.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 . - */ - -package bisq.desktop.main.overlays.windows; - -import bisq.desktop.app.BisqAppMain; -import bisq.desktop.components.AutoTooltipLabel; -import bisq.desktop.components.ExternalHyperlink; -import bisq.desktop.components.HyperlinkWithIcon; -import bisq.desktop.main.overlays.Overlay; -import bisq.desktop.util.FormBuilder; -import bisq.desktop.util.GUIUtil; - -import bisq.core.locale.Res; -import bisq.core.user.DontShowAgainLookup; - -import de.jensd.fx.fontawesome.AwesomeIcon; -import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; - -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.control.Separator; -import javafx.scene.image.ImageView; -import javafx.scene.layout.GridPane; -import javafx.scene.layout.HBox; -import javafx.scene.layout.Priority; -import javafx.scene.layout.VBox; -import javafx.scene.text.TextAlignment; - -import javafx.geometry.HPos; -import javafx.geometry.Insets; -import javafx.geometry.Orientation; -import javafx.geometry.Pos; - -import lombok.extern.slf4j.Slf4j; - -import org.jetbrains.annotations.NotNull; - -import static bisq.desktop.util.FormBuilder.addLabel; - -@Slf4j -public class NewTradeProtocolLaunchWindow extends Overlay { - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Public API - /////////////////////////////////////////////////////////////////////////////////////////// - - @Override - public void show() { - width = 680; - hideCloseButton(); - super.show(); - } - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Protected - /////////////////////////////////////////////////////////////////////////////////////////// - - @Override - protected void createGridPane() { - super.createGridPane(); - gridPane.setVgap(10); - gridPane.getColumnConstraints().get(0).setHalignment(HPos.CENTER); - gridPane.setPadding(new Insets(84)); - } - - @Override - protected void addHeadLine() { - - Label versionNumber = new AutoTooltipLabel(BisqAppMain.DEFAULT_APP_NAME + " v1.2"); - versionNumber.getStyleClass().add("news-version"); - HBox.setHgrow(versionNumber, Priority.ALWAYS); - versionNumber.setMaxWidth(Double.MAX_VALUE); - - Button closeButton = FormBuilder.getIconButton(MaterialDesignIcon.CLOSE, - "close-icon", "1.231em"); - closeButton.setOnAction(event -> hide()); - HBox.setHgrow(closeButton, Priority.NEVER); - - HBox header = new HBox(versionNumber, closeButton); - - GridPane.setRowIndex(header, ++rowIndex); - GridPane.setColumnSpan(header, 2); - gridPane.getChildren().add(header); - - headLineLabel = addLabel(gridPane, ++rowIndex, headLine); - headLineLabel.getStyleClass().add("popup-headline-information"); - headlineIcon = new Label(); - headlineIcon.getStyleClass().add("popup-icon-information"); - headlineIcon.setManaged(true); - headlineIcon.setVisible(true); - FormBuilder.getIconForLabel(AwesomeIcon.INFO_SIGN, headlineIcon, "1em"); - - headLineLabel.setGraphic(headlineIcon); - GridPane.setHalignment(headLineLabel, HPos.LEFT); - GridPane.setColumnSpan(headLineLabel, 2); - } - - @Override - protected void addMessage() { - createContent(); - } - - @Override - protected void onShow() { - display(); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Private - /////////////////////////////////////////////////////////////////////////////////////////// - - private void createContent() { - HBox content = new HBox(); - content.setMinWidth(680); - content.setAlignment(Pos.TOP_LEFT); - content.setSpacing(40); - - VBox accountSigning = getFeatureBox(Res.get("popup.news.launch.accountSigning.headline"), - Res.get("popup.news.launch.accountSigning.description"), - "image-account-signing-screenshot", - "https://docs.bisq.network/payment-methods#account-signing"); - - VBox newTradeProtocol = getFeatureBox(Res.get("popup.news.launch.ntp.headline"), - Res.get("popup.news.launch.ntp.description"), - "image-new-trade-protocol-screenshot", - "https://docs.bisq.network/trading-rules"); - - content.getChildren().addAll(accountSigning, new Separator(Orientation.VERTICAL), newTradeProtocol); - - GridPane.setMargin(content, new Insets(10, 0, 0, 0)); - GridPane.setRowIndex(content, ++rowIndex); - GridPane.setColumnSpan(content, 2); - GridPane.setHgrow(content, Priority.ALWAYS); - gridPane.getChildren().add(content); - } - - @NotNull - private VBox getFeatureBox(String title, String description, String imageId, String url) { - Label featureTitle = new Label(title); - featureTitle.setTextAlignment(TextAlignment.LEFT); - featureTitle.getStyleClass().add("news-feature-headline"); - - ImageView sectionScreenshot = new ImageView(); - sectionScreenshot.setId(imageId); - - HBox imageContainer = new HBox(sectionScreenshot); - imageContainer.getStyleClass().add("news-feature-image"); - - Label featureDescription = new Label(description); - featureDescription.setTextAlignment(TextAlignment.LEFT); - featureDescription.getStyleClass().add("news-feature-description"); - featureDescription.setWrapText(true); - - HyperlinkWithIcon learnMore = new ExternalHyperlink(Res.get("shared.learnMore"), "highlight"); - learnMore.setOnAction(event -> { - - if (DontShowAgainLookup.showAgain(GUIUtil.OPEN_WEB_PAGE_KEY)) { - hide(); - GUIUtil.openWebPage(url, true, () -> { - this.rowIndex = -1; - this.show(); - }); - } else { - GUIUtil.openWebPage(url); - } - }); - - VBox vBox = new VBox(featureTitle, imageContainer, featureDescription, learnMore); - vBox.setAlignment(Pos.CENTER_LEFT); - vBox.setSpacing(20); - vBox.setMaxWidth(300); - return vBox; - } -} diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/SignPaymentAccountsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/SignPaymentAccountsWindow.java index 79183a31ba..bab6e7e1c2 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/SignPaymentAccountsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/SignPaymentAccountsWindow.java @@ -29,6 +29,7 @@ import bisq.core.support.dispute.Dispute; import bisq.core.support.dispute.arbitration.ArbitrationManager; import bisq.core.support.dispute.arbitration.TraderDataItem; import bisq.core.support.dispute.arbitration.arbitrator.ArbitratorManager; +import bisq.core.support.dispute.mediation.MediationManager; import bisq.core.util.FormattingUtils; import bisq.common.config.Config; @@ -88,18 +89,24 @@ public class SignPaymentAccountsWindow extends Overlay disputesAsObservableList = arbitrationManager.getDisputesAsObservableList(); + ObservableList disputesAsObservableList = useDevPrivilegeKeys ? + mediationManager.getDisputesAsObservableList() + : arbitrationManager.getDisputesAsObservableList(); long safeDate = datePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC) * 1000; List traderDataItemList; StringBuilder sb = new StringBuilder("Summary for ").append(appName).append("\n"); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java index 7c0973d6bc..3776b3f1a7 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -102,6 +102,7 @@ public class PendingTradesView extends ActivatableViewAndModel tableView; @@ -141,13 +142,15 @@ public class PendingTradesView extends ActivatableViewAndModel { if (ev.getCode() == KeyCode.ESCAPE) { ev.consume(); diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/arbitration/ArbitratorView.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/arbitration/ArbitratorView.java index 90e1ceb093..dcb33c6112 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/arbitration/ArbitratorView.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/arbitration/ArbitratorView.java @@ -17,14 +17,9 @@ package bisq.desktop.main.support.dispute.agent.arbitration; -import bisq.common.config.Config; -import bisq.common.util.Utilities; import bisq.desktop.common.view.FxmlView; import bisq.desktop.main.overlays.windows.ContractWindow; import bisq.desktop.main.overlays.windows.DisputeSummaryWindow; -import bisq.desktop.main.overlays.windows.SignPaymentAccountsWindow; -import bisq.desktop.main.overlays.windows.SignSpecificWitnessWindow; -import bisq.desktop.main.overlays.windows.SignUnsignedPubKeysWindow; import bisq.desktop.main.overlays.windows.TradeDetailsWindow; import bisq.desktop.main.support.dispute.agent.DisputeAgentView; @@ -39,21 +34,15 @@ import bisq.core.trade.TradeManager; import bisq.core.util.FormattingUtils; import bisq.core.util.coin.CoinFormatter; +import bisq.common.config.Config; import bisq.common.crypto.KeyRing; -import javax.inject.Named; -import javafx.scene.input.KeyCode; -import javafx.scene.input.KeyEvent; - import javax.inject.Inject; +import javax.inject.Named; @FxmlView public class ArbitratorView extends DisputeAgentView { - private final SignPaymentAccountsWindow signPaymentAccountsWindow; - private final SignSpecificWitnessWindow signSpecificWitnessWindow; - private final SignUnsignedPubKeysWindow signUnsignedPubKeysWindow; - @Inject public ArbitratorView(ArbitrationManager arbitrationManager, KeyRing keyRing, @@ -64,10 +53,7 @@ public class ArbitratorView extends DisputeAgentView { ContractWindow contractWindow, TradeDetailsWindow tradeDetailsWindow, AccountAgeWitnessService accountAgeWitnessService, - @Named(Config.USE_DEV_PRIVILEGE_KEYS) boolean useDevPrivilegeKeys, - SignPaymentAccountsWindow signPaymentAccountsWindow, - SignSpecificWitnessWindow signSpecificWitnessWindow, - SignUnsignedPubKeysWindow signUnsignedPubKeysWindow) { + @Named(Config.USE_DEV_PRIVILEGE_KEYS) boolean useDevPrivilegeKeys) { super(arbitrationManager, keyRing, tradeManager, @@ -78,9 +64,6 @@ public class ArbitratorView extends DisputeAgentView { tradeDetailsWindow, accountAgeWitnessService, useDevPrivilegeKeys); - this.signPaymentAccountsWindow = signPaymentAccountsWindow; - this.signSpecificWitnessWindow = signSpecificWitnessWindow; - this.signUnsignedPubKeysWindow = signUnsignedPubKeysWindow; } @Override @@ -92,15 +75,4 @@ public class ArbitratorView extends DisputeAgentView { protected DisputeSession getConcreteDisputeChatSession(Dispute dispute) { return new ArbitrationSession(dispute, disputeManager.isTrader(dispute)); } - - @Override - protected void handleKeyPressed(KeyEvent event) { - if (Utilities.isAltOrCtrlPressed(KeyCode.S, event)) { - signPaymentAccountsWindow.show(); - } else if (Utilities.isAltOrCtrlPressed(KeyCode.P, event)) { - signSpecificWitnessWindow.show(); - } else if (Utilities.isAltOrCtrlPressed(KeyCode.O, event)) { - signUnsignedPubKeysWindow.show(); - } - } } diff --git a/desktop/src/main/java/bisq/desktop/theme-dev.css b/desktop/src/main/java/bisq/desktop/theme-dev.css new file mode 100644 index 0000000000..5d3852ba1b --- /dev/null +++ b/desktop/src/main/java/bisq/desktop/theme-dev.css @@ -0,0 +1,4 @@ +.root { + -bs-rd-nav-background: #841413; + -bs-rd-nav-primary-background: #841413; +} diff --git a/desktop/src/main/java/bisq/desktop/util/CssTheme.java b/desktop/src/main/java/bisq/desktop/util/CssTheme.java index 7bfe602127..0698f0fbde 100644 --- a/desktop/src/main/java/bisq/desktop/util/CssTheme.java +++ b/desktop/src/main/java/bisq/desktop/util/CssTheme.java @@ -24,12 +24,14 @@ public class CssTheme { public static final int CSS_THEME_DARK = 1; private static int currentCSSTheme; + private static boolean useDevHeader; - public static void loadSceneStyles(Scene scene, int cssTheme) { + public static void loadSceneStyles(Scene scene, int cssTheme, boolean devHeader) { String cssThemeFolder = "/bisq/desktop/"; String cssThemeFile = ""; currentCSSTheme = cssTheme; + useDevHeader = devHeader; switch (cssTheme) { @@ -52,6 +54,8 @@ public class CssTheme { // load theme last to allow override cssThemeFolder + cssThemeFile ); + if (useDevHeader) + scene.getStylesheets().add(cssThemeFolder + "theme-dev.css"); } public static boolean isDarkTheme() { diff --git a/gradle/witness/gradle-witness.gradle b/gradle/witness/gradle-witness.gradle index 856355e473..08f74f9f51 100644 --- a/gradle/witness/gradle-witness.gradle +++ b/gradle/witness/gradle-witness.gradle @@ -42,7 +42,7 @@ dependencyVerification { 'com.google.zxing:core:11aae8fd974ab25faa8208be50468eb12349cd239e93e7c797377fa13e381729', 'com.google.zxing:javase:0ec23e2ec12664ddd6347c8920ad647bb3b9da290f897a88516014b56cc77eb9', 'com.googlecode.jcsv:jcsv:73ca7d715e90c8d2c2635cc284543b038245a34f70790660ed590e157b8714a2', - 'com.jfoenix:jfoenix:8060235fec5eb49617ec8d81d379e8c945f6cc722d0645e97190045100de2084', + 'com.jfoenix:jfoenix:4739e37a05e67c3bc9d5b391a1b93717b5a48fa872992616b0964d3f827f8fe6', 'com.lambdaworks:scrypt:9a82d218099fb14c10c0e86e7eefeebd8c104de920acdc47b8b4b7a686fb73b4', 'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f', 'com.nativelibs4java:bridj:101bcd9b6637e6bc16e56deb3daefba62b1f5e8e9e37e1b3e56e3b5860d659cf',