Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed May 27, 2024
1 parent 0897517 commit a63fabf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
7 changes: 0 additions & 7 deletions application-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.zyneonstudios</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ private void sync(String request) {
// Set the titlebar with the specified title, background, and foreground colors
frame.setTitlebar(title,background,foreground);
} else if(request.equals("exit")) {
frame.getApplication().getModuleLoader().deactivateModules();
System.exit(1);
NexusApplication.stop();
} else if(request.equals("refresh")) {
frame.getBrowser().loadURL(ApplicationConfig.urlBase+ApplicationConfig.language+"/"+ApplicationConfig.startPage);
} else if(request.equals("restart")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.zyneonstudios.application.frame.web;

import com.zyneonstudios.application.main.NexusApplication;
import javafx.application.Platform;
import live.nerotv.shademebaby.ShadeMeBaby;
import me.friwi.jcefmaven.CefAppBuilder;
import me.friwi.jcefmaven.CefInitializationException;
Expand Down Expand Up @@ -78,8 +77,7 @@ private void init(String url, String jcefPath, NexusApplication application) thr
@Override @Deprecated
public void stateHasChanged(CefApp.CefAppState state) {
if (state == CefApp.CefAppState.TERMINATED) {
application.getModuleLoader().deactivateModules();
Platform.exit(); System.exit(0); // Exit JavaFX application when CEF terminates
NexusApplication.stop();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,23 @@ public void restart() {
args.append(arg).append(" ");
}
}
File updater = new File(ApplicationConfig.getApplicationPath().replace("/experimental/","/app.jar"));
if(updater.exists()) {
jarPath = updater.getAbsolutePath();
}
ProcessBuilder pb = new ProcessBuilder("java", "-jar", jarPath, args.toString());
try {
pb.start();
} catch (Exception e) {
logger.error("[APP] Couldn't restart application: "+e.getMessage());
}
getModuleLoader().deactivateModules();
System.exit(0);
stop();
}
System.exit(-1);
}

public static void stop() {
moduleLoader.deactivateModules();
System.exit(0);
}
}

0 comments on commit a63fabf

Please sign in to comment.