X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=telegps%2FTeleGPSConfigUI.java;h=465916ec81ea0c2efebdc26cef86f9ede96c81f9;hb=91656c9d1d6175e06d4bed8e448ac6773e172de0;hp=1a951309e331cec9644e7cbafd4f9705ead52558;hpb=47f4121ae6596bdf18566295df2fdbe94fe676b8;p=fw%2Faltos diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java index 1a951309..465916ec 100644 --- a/telegps/TeleGPSConfigUI.java +++ b/telegps/TeleGPSConfigUI.java @@ -211,7 +211,7 @@ public class TeleGPSConfigUI Insets il = new Insets(4,4,4,4); Insets ir = new Insets(4,4,4,4); - pane = getContentPane(); + pane = getScrollablePane(); pane.setLayout(new GridBagLayout()); /* Product */ @@ -874,14 +874,18 @@ public class TeleGPSConfigUI return parse_int("flight log max", flight_log_max_value.getSelectedItem().toString(), true); } - public void set_flight_log_max_limit(int new_flight_log_max_limit) { + public void set_flight_log_max_limit(int new_flight_log_max_limit, int new_storage_erase_unit) { flight_log_max_limit = new_flight_log_max_limit; - flight_log_max_value.removeAllItems(); - for (int i = 8; i >= 1; i--) { - int size = flight_log_max_limit / i; - flight_log_max_value.addItem(String.format("%d (%d flights)", size, i)); + if (new_flight_log_max_limit != AltosLib.MISSING) { + flight_log_max_value.removeAllItems(); + for (int i = 8; i >= 1; i--) { + int size = flight_log_max_limit / i; + if (new_storage_erase_unit != 0) + size &= ~(new_storage_erase_unit - 1); + flight_log_max_value.addItem(String.format("%d (%d flights)", size, i)); + } } - if (flight_log_max != 0) + if (flight_log_max != 0 && flight_log_max != AltosLib.MISSING) set_flight_log_max(flight_log_max); }