Skip to content

Commit eb685a1

Browse files
committed
update launcher
1 parent 079c5f3 commit eb685a1

File tree

9 files changed

+19
-112
lines changed

9 files changed

+19
-112
lines changed

build.gradle

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ plugins {
1515
}
1616

1717
group 'org.glavo'
18-
version '3.5'
18+
version '3.6'
1919

2020
modularity.mixedJavaRelease 8
2121

@@ -61,29 +61,11 @@ jlink {
6161
'--compress', '1',
6262
'--no-header-files',
6363
'--no-man-pages'
64-
65-
if (file("launcher/${jforeign.Platform.PLATFORM}").exists()) {
64+
if (jforeign.Platform.isWindows()) {
65+
addOptions '--strip-native-commands'
6666
project.tasks.getByName('jlink').doLast {
67-
delete {
68-
delete "$imageDir/bin/ClassViewer",
69-
"$imageDir/bin/ClassViewer.bat"
70-
}
71-
copy {
72-
from "launcher/${jforeign.Platform.PLATFORM}"
73-
into "$imageDir/bin"
74-
}
75-
}
76-
77-
} else {
78-
launcher {
79-
name = 'ClassViewer'
80-
}
81-
if(!jforeign.Platform.isWindows()) {
82-
project.tasks.getByName('jlink').doLast {
83-
delete {
84-
delete "$imageDir/bin/ClassViewer.bat"
85-
}
86-
}
67+
delete "$imageDir/bin/ClassViewer"
68+
delete "$imageDir/bin/ClassViewer.bat"
8769
}
8870
}
89-
}
71+
}

launcher/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

launcher/build.bat

Lines changed: 0 additions & 10 deletions
This file was deleted.

launcher/launcher.rc.in

Lines changed: 0 additions & 24 deletions
This file was deleted.

launcher/launcher_win32.c

Lines changed: 0 additions & 29 deletions
This file was deleted.
-56.5 KB
Binary file not shown.

src/main/java/org/glavo/viewer/gui/Options.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.*;
1313

1414
public final class Options {
15-
public static boolean color = true;
15+
public static boolean color = false;
1616
public static boolean debug = false;
1717
public static boolean useSystemTilteBar = true;
1818
public static String skin = null;
@@ -49,6 +49,7 @@ public static void init() {
4949
}
5050

5151
RecentFiles.init();
52+
Log.info("loading finished");
5253
}
5354

5455
public static void init(Properties... properties) {

src/main/java/org/glavo/viewer/gui/RecentFiles.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
public final class RecentFiles {
1818

19-
public static final RecentFiles Instance = new RecentFiles();
19+
public static RecentFiles Instance = null;
2020

2121
public static void init() {
22-
22+
Instance = new RecentFiles();
2323
}
2424

2525
private final List<RecentFile> list = Collections.synchronizedList(new LinkedList<>());
@@ -115,7 +115,7 @@ private void load() {
115115
Path p = Options.path.resolve("recentfiles");
116116

117117
if (Files.notExists(p)) {
118-
Log.warning("Recent files not exists");
118+
Log.info("Recent files not exists");
119119
return;
120120
}
121121
Log.info("Load recent files from file: " + p);
@@ -132,8 +132,8 @@ private void load() {
132132
});
133133
}
134134

135-
} catch (IOException e) {
136-
ViewerAlert.logAndShowExceptionAlert(e);
135+
} catch (Throwable e) {
136+
Log.error(e);
137137
}
138138
}
139139
}

src/main/java/org/glavo/viewer/gui/Viewer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public final class Viewer extends Application {
2525

2626
public static void main(String[] args) {
2727
Options.init();
28+
Log.info("launch application");
2829
Application.launch(Viewer.class, args);
2930
}
3031

@@ -38,6 +39,7 @@ public static void main(String[] args) {
3839
@Override
3940
public void init() throws Exception {
4041
Application.setUserAgentStylesheet(Options.skin);
42+
Log.info("info " + this);
4143
}
4244

4345
@Override
@@ -82,6 +84,10 @@ public void start(Stage stage) {
8284
javafx.application.Platform.runLater(() -> openFiles(files));
8385
}
8486
stage.show();
87+
stage.setOnCloseRequest(event -> {
88+
Log.info("close " + this);
89+
});
90+
Log.info("show " + this);
8591
}
8692

8793
public void openFile() {

0 commit comments

Comments
 (0)