OSDN Git Service

fix: fixed library check and version check functions.
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Wed, 15 Sep 2021 08:11:25 +0000 (17:11 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Wed, 15 Sep 2021 08:11:25 +0000 (17:11 +0900)
src/com/ranfa/lib/CheckVersion.java
src/com/ranfa/main/DelesteRandomSelector.java

index d4976bc..b013928 100644 (file)
@@ -14,7 +14,7 @@ import com.ranfa.main.DelesteRandomSelector;
 
 public class CheckVersion {
 
-       private final static String URI = "https://raw.githubusercontent.com/hizumiaoba/DelesteRandomSelector/master/version.json";
+       private final static String URI = "https://raw.githubusercontent.com/hizumiaoba/DelesteRandomSelector/CU-k5vk2f_DelesteRandomSelector_hizumiaoba/version.json";
        private final static String RELEASE_STRING = "https://github.com/hizumiaoba/DelesteRandomSelector/releases";
 
        public static void needToBeUpdated() {
index bc5c005..dedfb14 100644 (file)
@@ -144,8 +144,10 @@ public class DelesteRandomSelector extends JFrame {
                };
                getWholeDataFuture.thenAcceptAsync(list -> LimitedLog.println(this.getClass() + ":[INFO]: Scraping data size:" + list.size()), es);
                getFromJsonFuture.thenAcceptAsync(list -> LimitedLog.println(this.getClass() + ":[INFO]: Currently database size:" + list.size()), es);
-               CompletableFuture<Void> updatedFuture = getWholeDataFuture.thenAcceptBothAsync(getFromJsonFuture, updateConsumer, es);
-               updatedFuture.thenRunAsync(setEnabled, es);
+               if(property.isCheckLibraryUpdates()) {
+                       CompletableFuture<Void> updatedFuture = getWholeDataFuture.thenAcceptBothAsync(getFromJsonFuture, updateConsumer, es);
+                       updatedFuture.thenRunAsync(setEnabled, es);
+               }
                LimitedLog.println(this.getClass() + ":[DEBUG]: " + "Version:" + CheckVersion.getVersion());
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                setBounds(100, 100, property.getWindowWidth(), property.getWindowHeight());
@@ -352,11 +354,7 @@ public class DelesteRandomSelector extends JFrame {
                                                                btnExit.addActionListener(new ActionListener() {
                                                                        public void actionPerformed(ActionEvent e) {
                                                                                LimitedLog.println(this.getClass() + ":[INFO]: " +"Requested Exit by Button");
-                                                                               if(updatedFuture.isDone()) {
-                                                                                       System.exit(0);
-                                                                               } else {
-                                                                                       JOptionPane.showMessageDialog(null, "非同期処理が完了していません。少し時間が経ってからやり直してください。");
-                                                                               }
+                                                                               System.exit(0);
                                                                        }
                                                                });
                                                                btnExit.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
@@ -372,7 +370,7 @@ public class DelesteRandomSelector extends JFrame {
 
                scrollPane = new JScrollPane(textArea);
                panelCentre.add(scrollPane, BorderLayout.CENTER);
-               if(isFirst)
+               if(isFirst || !property.isCheckLibraryUpdates())
                        setEnabled.run();
        }