mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactor: Move AvoidStandbyModeService from BisqApp to BisqExecutable.setupAvoidStandbyMode
This commit is contained in:
parent
4f9a6ea436
commit
bb99eef059
@ -131,6 +131,7 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||
CommonSetup.setupUncaughtExceptionHandler(this);
|
||||
|
||||
setupGuice();
|
||||
setupAvoidStandbyMode();
|
||||
startApplication();
|
||||
}
|
||||
|
||||
@ -170,6 +171,9 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||
}
|
||||
}
|
||||
|
||||
protected void setupAvoidStandbyMode() {
|
||||
}
|
||||
|
||||
protected abstract void startApplication();
|
||||
|
||||
// Once the application is ready we get that callback and we start the setup
|
||||
|
@ -32,7 +32,6 @@ import bisq.desktop.main.overlays.windows.ShowWalletDataWindow;
|
||||
import bisq.desktop.util.CssTheme;
|
||||
import bisq.desktop.util.ImageUtil;
|
||||
|
||||
import bisq.core.app.AvoidStandbyModeService;
|
||||
import bisq.core.btc.wallet.BtcWalletService;
|
||||
import bisq.core.btc.wallet.WalletsManager;
|
||||
import bisq.core.dao.governance.voteresult.MissingDataRequestService;
|
||||
@ -90,7 +89,6 @@ import static bisq.desktop.util.Layout.MIN_WINDOW_WIDTH;
|
||||
|
||||
@Slf4j
|
||||
public class BisqApp extends Application implements UncaughtExceptionHandler {
|
||||
private static final long LOG_MEMORY_PERIOD_MIN = 10;
|
||||
@Setter
|
||||
private static Consumer<Application> appLaunchedHandler;
|
||||
@Getter
|
||||
@ -132,8 +130,6 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
||||
mainView.setOnApplicationStartedHandler(onApplicationStartedHandler);
|
||||
scene = createAndConfigScene(mainView, injector);
|
||||
setupStage(scene);
|
||||
|
||||
injector.getInstance(AvoidStandbyModeService.class).init();
|
||||
} catch (Throwable throwable) {
|
||||
log.error("Error during app init", throwable);
|
||||
handleUncaughtException(throwable, false);
|
||||
|
@ -21,6 +21,7 @@ import bisq.desktop.common.UITimer;
|
||||
import bisq.desktop.common.view.guice.InjectorViewFactory;
|
||||
import bisq.desktop.setup.DesktopPersistedDataHost;
|
||||
|
||||
import bisq.core.app.AvoidStandbyModeService;
|
||||
import bisq.core.app.BisqExecutable;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
@ -121,6 +122,11 @@ public class BisqAppMain extends BisqExecutable {
|
||||
PersistedDataHost.apply(DesktopPersistedDataHost.getPersistedDataHosts(injector));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupAvoidStandbyMode() {
|
||||
injector.getInstance(AvoidStandbyModeService.class).init();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startApplication() {
|
||||
// We need to be in user thread! We mapped at launchApplication already. Once
|
||||
|
Loading…
Reference in New Issue
Block a user