telegps: Disable tracker config when not available
[fw/altos] / telegps / TeleGPSConfig.java
index 22e6a3ac134477dcdc571502b9300ec35e2347e9..e607a5a5510f0c52e173ca2fa9756c55d5fd7729 100644 (file)
@@ -22,8 +22,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.text.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
 
 public class TeleGPSConfig implements ActionListener {
 
@@ -221,20 +221,20 @@ public class TeleGPSConfig implements ActionListener {
 
        void save_data() {
 
-               /* bounds check stuff */
-               if (config_ui.flight_log_max() > data.log_limit()) {
-                       JOptionPane.showMessageDialog(owner,
-                                                     String.format("Requested flight log, %dk, is larger than the available space, %dk.\n",
-                                                                   config_ui.flight_log_max(),
-                                                                   data.log_limit()),
-                                                     "Maximum Flight Log Too Large",
-                                                     JOptionPane.ERROR_MESSAGE);
-                       return;
-               }
+               try {
+                       /* bounds check stuff */
+                       if (config_ui.flight_log_max() > data.log_space()/1024) {
+                               JOptionPane.showMessageDialog(owner,
+                                                             String.format("Requested flight log, %dk, is larger than the available space, %dk.\n",
+                                                                           config_ui.flight_log_max(),
+                                                                           data.log_space()/1024),
+                                                             "Maximum Flight Log Too Large",
+                                                             JOptionPane.ERROR_MESSAGE);
+                               return;
+                       }
 
-               /* Pull data out of the UI and stuff back into our local data record */
+                       /* Pull data out of the UI and stuff back into our local data record */
 
-               try {
                        data.get_values(config_ui);
                        run_serial_thread(serial_mode_save);
                } catch (AltosConfigDataException ae) {