mirror of
https://github.com/octopusYan/alist-gui.git
synced 2024-11-23 20:46:42 +08:00
Compare commits
No commits in common. "a8db7cbf8863207d94237c0097825a3ae5060b35" and "96274f69522a8ec746b0e182c9b83e2514a902d9" have entirely different histories.
a8db7cbf88
...
96274f6952
@ -7,11 +7,11 @@
|
||||
<parent>
|
||||
<groupId>cn.octopusyan</groupId>
|
||||
<artifactId>alist-gui</artifactId>
|
||||
<version>${gui.version}</version>
|
||||
<version>1.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>gui</artifactId>
|
||||
<version>${gui.version}</version>
|
||||
<version>${parent.version}</version>
|
||||
<name>alist-gui</name>
|
||||
|
||||
<properties>
|
||||
@ -21,8 +21,6 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<parent.version>${gui.version}</parent.version>
|
||||
|
||||
<exec.mainClass>cn.octopusyan.alistgui.AppLauncher</exec.mainClass>
|
||||
<cssSrcPath>${project.basedir}/src/main/resources/css</cssSrcPath>
|
||||
<cssTargetPath>${project.basedir}/target/classes/css</cssTargetPath>
|
||||
@ -193,7 +191,7 @@
|
||||
<mainClass>cn.octopusyan.alistgui/${exec.mainClass}</mainClass>
|
||||
<options>
|
||||
<option>--enable-preview</option>
|
||||
<!-- <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005</option>-->
|
||||
<!-- <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005</option>-->
|
||||
</options>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -41,7 +41,7 @@ public class Application extends javafx.application.Application {
|
||||
long delay = 0L;
|
||||
// 更新重启检查
|
||||
File upgradeFile = new File(Constants.DATA_DIR_PATH + File.separator + new Gui().getReleaseFile());
|
||||
// logger.error("{}{}{}", Constants.DATA_DIR_PATH, File.separator, new Gui().getReleaseFile());
|
||||
logger.error("{}{}{}", Constants.DATA_DIR_PATH, File.separator, new Gui().getReleaseFile());
|
||||
if (upgradeFile.exists()) {
|
||||
logger.error("upgradeFile.exists");
|
||||
FileUtil.del(upgradeFile);
|
||||
@ -165,7 +165,7 @@ public class Application extends javafx.application.Application {
|
||||
instanceCheckLatch.countDown();
|
||||
|
||||
while (true) {
|
||||
logger.debug(STR."====\{instanceId}====");
|
||||
logger.error(STR."====\{instanceId}====");
|
||||
try (
|
||||
Socket clientSocket = serverSocket.accept();
|
||||
BufferedReader in = new BufferedReader(
|
||||
|
@ -143,21 +143,24 @@ public class AListManager {
|
||||
ConsoleLog.info(getText("alist.status.stop"));
|
||||
if (!running.get()) {
|
||||
ConsoleLog.warning(getText("alist.status.stop.stopped"));
|
||||
return;
|
||||
}
|
||||
util.destroy();
|
||||
}
|
||||
|
||||
static ChangeListener<Boolean> restartListener = (_, _, run) -> {
|
||||
if (run) return;
|
||||
running.removeListener(AListManager.restartListener);
|
||||
start();
|
||||
};
|
||||
static ChangeListener<Boolean> restartListener;
|
||||
|
||||
public static void restart() {
|
||||
if (!running.get()) {
|
||||
start();
|
||||
} else {
|
||||
stop();
|
||||
|
||||
restartListener = (_, _, run) -> {
|
||||
if (run) return;
|
||||
running.removeListener(restartListener);
|
||||
start();
|
||||
};
|
||||
running.addListener(restartListener);
|
||||
}
|
||||
}
|
||||
@ -191,7 +194,7 @@ public class AListManager {
|
||||
//============================={ private }====================================
|
||||
|
||||
/**
|
||||
* 点击开始时检查 aList 执行文件
|
||||
* TODO 点击开始时检查 aList 执行文件
|
||||
*/
|
||||
private static boolean checkAList() {
|
||||
if (new File(Constants.ALIST_FILE).exists()) return true;
|
||||
@ -213,11 +216,6 @@ public class AListManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始下载AList
|
||||
*
|
||||
* @param version 下载版本号
|
||||
*/
|
||||
private static void showDownload(String version) {
|
||||
String content = STR."""
|
||||
\{getText("msg.alist.download.notfile")}
|
||||
|
@ -17,7 +17,6 @@ import cn.octopusyan.alistgui.view.alert.AlertUtil;
|
||||
import cn.octopusyan.alistgui.view.alert.builder.AlertBuilder;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.*;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
@ -145,13 +144,8 @@ public class AboutViewModule extends BaseViewModel {
|
||||
Platform.runLater(() -> {
|
||||
switch (app) {
|
||||
case AList _ -> {
|
||||
if(AListManager.isRunning()) {
|
||||
AListManager.stop();
|
||||
AListManager.runningProperty().addListener(updateListener);
|
||||
} else {
|
||||
// 下载完成后,解压并删除文件
|
||||
DownloadUtil.unzip(app);
|
||||
}
|
||||
// 设置应用版本
|
||||
aListVersion.setValue(aListNewVersion.getValue());
|
||||
AListManager.restart();
|
||||
@ -169,12 +163,4 @@ public class AboutViewModule extends BaseViewModel {
|
||||
}).execute();
|
||||
});
|
||||
}
|
||||
|
||||
static final ChangeListener<Boolean> updateListener = (_, _, run) -> {
|
||||
if (!run) {
|
||||
// 下载完成后,解压并删除文件
|
||||
DownloadUtil.unzip(ConfigManager.aList());
|
||||
}
|
||||
AListManager.runningProperty().removeListener(AboutViewModule.updateListener);
|
||||
};
|
||||
}
|
||||
|
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.octopusyan</groupId>
|
||||
<artifactId>alist-gui</artifactId>
|
||||
<version>${gui.version}</version>
|
||||
<version>1.0.1</version>
|
||||
<name>alist-gui</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
<gui.version>1.0.3</gui.version>
|
||||
<project.version>1.0.1</project.version>
|
||||
|
||||
<junit.version>5.10.0</junit.version>
|
||||
<javafx.version>21.0.4</javafx.version>
|
||||
|
@ -7,11 +7,11 @@
|
||||
<parent>
|
||||
<groupId>cn.octopusyan</groupId>
|
||||
<artifactId>alist-gui</artifactId>
|
||||
<version>${gui.version}</version>
|
||||
<version>1.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>upgrade</artifactId>
|
||||
<version>${gui.version}</version>
|
||||
<version>${parent.version}</version>
|
||||
<name>upgrade</name>
|
||||
|
||||
<properties>
|
||||
|
Loading…
Reference in New Issue
Block a user