summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
Diffstat (limited to 'altosui')
-rw-r--r--altosui/.gitignore2
-rw-r--r--altosui/Altos.java4
-rw-r--r--altosui/AltosAscent.java4
-rw-r--r--altosui/AltosCompanionInfo.java4
-rw-r--r--altosui/AltosConfig.java4
-rw-r--r--altosui/AltosConfigPyroUI.java4
-rw-r--r--altosui/AltosConfigTD.java4
-rw-r--r--altosui/AltosConfigTDUI.java34
-rw-r--r--altosui/AltosConfigUI.java62
-rw-r--r--altosui/AltosConfigureUI.java2
-rw-r--r--altosui/AltosDescent.java4
-rw-r--r--altosui/AltosFlightStatus.java4
-rw-r--r--altosui/AltosFlightStatusTableModel.java2
-rw-r--r--altosui/AltosFlightStatusUpdate.java2
-rw-r--r--altosui/AltosFlightUI.java61
-rw-r--r--altosui/AltosGraphUI.java4
-rw-r--r--altosui/AltosIdleMonitorUI.java20
-rw-r--r--altosui/AltosIgniteUI.java4
-rw-r--r--altosui/AltosIgnitor.java4
-rw-r--r--altosui/AltosLanded.java4
-rw-r--r--altosui/AltosLaunch.java2
-rw-r--r--altosui/AltosLaunchUI.java2
-rw-r--r--altosui/AltosPad.java4
-rw-r--r--altosui/AltosUI.java19
-rw-r--r--altosui/AltosUIPreferencesBackend.java2
-rw-r--r--altosui/Info.plist.in29
-rw-r--r--altosui/Instdrv/NSIS/Includes/java.nsh50
-rw-r--r--altosui/Instdrv/NSIS/Includes/refresh-sh.nsh14
-rw-r--r--altosui/Makefile.am59
-rw-r--r--altosui/altos-windows.nsi.in177
-rw-r--r--altosui/altusmetrum-altosui.desktop.in (renamed from altosui/altos.desktop.in)5
31 files changed, 395 insertions, 201 deletions
diff --git a/altosui/.gitignore b/altosui/.gitignore
index 10b600e4..b0c8264b 100644
--- a/altosui/.gitignore
+++ b/altosui/.gitignore
@@ -17,7 +17,7 @@ Altos-Linux-*.tar.bz2
Altos-Linux-*.sh
Altos-Mac-*.zip
Altos-Windows-*.exe
-altos.desktop
+altusmetrum-altosui.desktop
*.dll
*.dylib
*.so
diff --git a/altosui/Altos.java b/altosui/Altos.java
index 28038ad6..74b45f1c 100644
--- a/altosui/Altos.java
+++ b/altosui/Altos.java
@@ -20,8 +20,8 @@ package altosui;
import java.awt.*;
import libaltosJNI.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class Altos extends AltosUILib {
diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java
index 3bc80406..24fc362f 100644
--- a/altosui/AltosAscent.java
+++ b/altosui/AltosAscent.java
@@ -21,8 +21,8 @@ import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosAscent extends AltosUIFlightTab {
JLabel cur, max;
diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java
index e7b335ac..7ac53dd8 100644
--- a/altosui/AltosCompanionInfo.java
+++ b/altosui/AltosCompanionInfo.java
@@ -19,8 +19,8 @@ package altosui;
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosCompanionInfo extends JTable implements AltosFlightDisplay {
private AltosFlightInfoTableModel model;
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java
index 6eb7d40c..40f7ebec 100644
--- a/altosui/AltosConfig.java
+++ b/altosui/AltosConfig.java
@@ -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 AltosConfig implements ActionListener {
diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java
index f0b4f0f9..dd4fb505 100644
--- a/altosui/AltosConfigPyroUI.java
+++ b/altosui/AltosConfigPyroUI.java
@@ -21,8 +21,8 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosConfigPyroUI
extends AltosUIDialog
diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java
index bfbd2c77..2976657c 100644
--- a/altosui/AltosConfigTD.java
+++ b/altosui/AltosConfigTD.java
@@ -21,8 +21,8 @@ import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosConfigTD implements ActionListener {
diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java
index 22b3384d..ca365718 100644
--- a/altosui/AltosConfigTDUI.java
+++ b/altosui/AltosConfigTDUI.java
@@ -21,8 +21,8 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosConfigTDUI
extends AltosUIDialog
@@ -44,6 +44,7 @@ public class AltosConfigTDUI
JLabel product_value;
JLabel version_value;
JLabel serial_value;
+ JMenuBar radio_frequency_menu_bar;
AltosFreqList radio_frequency_value;
JLabel radio_calibration_value;
@@ -166,9 +167,11 @@ public class AltosConfigTDUI
c.anchor = GridBagConstraints.LINE_START;
c.insets = ir;
c.ipady = 5;
- radio_frequency_value = new AltosFreqList();
+ radio_frequency_value = new AltosFreqList(false);
radio_frequency_value.addItemListener(this);
- pane.add(radio_frequency_value, c);
+ radio_frequency_menu_bar = new JMenuBar();
+ radio_frequency_menu_bar.add(radio_frequency_value);
+ pane.add(radio_frequency_menu_bar, c);
radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
/* Radio Calibration */
@@ -308,28 +311,7 @@ public class AltosConfigTDUI
}
public void set_radio_frequency(double new_radio_frequency) {
- int i;
- for (i = 0; i < radio_frequency_value.getItemCount(); i++) {
- AltosFrequency f = (AltosFrequency) radio_frequency_value.getItemAt(i);
-
- if (f.close(new_radio_frequency)) {
- radio_frequency_value.setSelectedIndex(i);
- return;
- }
- }
- for (i = 0; i < radio_frequency_value.getItemCount(); i++) {
- AltosFrequency f = (AltosFrequency) radio_frequency_value.getItemAt(i);
-
- if (new_radio_frequency < f.frequency)
- break;
- }
- String description = String.format("%s serial %s",
- product_value.getText(),
- serial_value.getText());
- AltosFrequency new_frequency = new AltosFrequency(new_radio_frequency, description);
- AltosPreferences.add_common_frequency(new_frequency);
- radio_frequency_value.insertItemAt(new_frequency, i);
- radio_frequency_value.setSelectedIndex(i);
+ radio_frequency_value.set_frequency(new_radio_frequency);
}
public double radio_frequency() {
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index 1b5ff988..6e1b47c2 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -21,8 +21,8 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosConfigUI
extends AltosUIDialog
@@ -41,6 +41,7 @@ public class AltosConfigUI
JLabel radio_frequency_label;
JLabel radio_enable_label;
JLabel aprs_interval_label;
+ JLabel aprs_ssid_label;
JLabel flight_log_max_label;
JLabel ignite_mode_label;
JLabel pad_orientation_label;
@@ -62,6 +63,7 @@ public class AltosConfigUI
JTextField radio_calibration_value;
JRadioButton radio_enable_value;
JComboBox<String> aprs_interval_value;
+ JComboBox<Integer> aprs_ssid_value;
JComboBox<String> flight_log_max_value;
JComboBox<String> ignite_mode_value;
JComboBox<String> pad_orientation_value;
@@ -113,6 +115,10 @@ public class AltosConfigUI
"10"
};
+ static Integer[] aprs_ssid_values = {
+ 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+ };
+
static String[] beep_values = {
"3750",
"4000",
@@ -201,6 +207,15 @@ public class AltosConfigUI
aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
}
+ void set_aprs_ssid_tool_tip() {
+ if (aprs_ssid_value.isEnabled())
+ aprs_interval_value.setToolTipText("Set the APRS SSID (secondary station identifier)");
+ else if (aprs_interval_value.isEnabled())
+ aprs_interval_value.setToolTipText("Software version doesn't support setting the APRS SSID");
+ else
+ aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
+ }
+
void set_flight_log_max_tool_tip() {
if (flight_log_max_value.isEnabled())
flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
@@ -419,7 +434,10 @@ public class AltosConfigUI
c.ipady = 5;
radio_frequency_value = new AltosFreqList();
radio_frequency_value.addItemListener(this);
- pane.add(radio_frequency_value, c);
+
+ JMenuBar menu_bar = new JMenuBar();
+ menu_bar.add(radio_frequency_value);
+ pane.add(menu_bar, c);
radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
row++;
@@ -501,6 +519,33 @@ public class AltosConfigUI
set_aprs_interval_tool_tip();
row++;
+ /* APRS SSID */
+ c = new GridBagConstraints();
+ c.gridx = 0; c.gridy = row;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = il;
+ c.ipady = 5;
+ aprs_ssid_label = new JLabel("APRS SSID:");
+ pane.add(aprs_ssid_label, c);
+
+ c = new GridBagConstraints();
+ c.gridx = 4; c.gridy = row;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.HORIZONTAL;
+ c.weightx = 1;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = ir;
+ c.ipady = 5;
+ aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values);
+ aprs_ssid_value.setEditable(false);
+ aprs_ssid_value.addItemListener(this);
+ aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length);
+ pane.add(aprs_ssid_value, c);
+ set_aprs_ssid_tool_tip();
+ row++;
+
/* Callsign */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = row;
@@ -1177,4 +1222,15 @@ public class AltosConfigUI
return 0;
return parse_int("aprs interval", s, false);
}
+
+ public void set_aprs_ssid(int new_aprs_ssid) {
+ aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid));
+ aprs_ssid_value.setVisible(new_aprs_ssid >= 0);
+ set_aprs_ssid_tool_tip();
+ }
+
+ public int aprs_ssid() throws AltosConfigDataException {
+ Integer i = (Integer) aprs_ssid_value.getSelectedItem();
+ return i;
+ }
}
diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java
index e61a4a5b..80d6d341 100644
--- a/altosui/AltosConfigureUI.java
+++ b/altosui/AltosConfigureUI.java
@@ -22,7 +22,7 @@ import java.awt.event.*;
import java.beans.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosConfigureUI
extends AltosUIConfigure
diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java
index 36fc1613..e38b35ed 100644
--- a/altosui/AltosDescent.java
+++ b/altosui/AltosDescent.java
@@ -21,8 +21,8 @@ import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosDescent extends AltosUIFlightTab {
diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java
index 46c0b387..7e7efa64 100644
--- a/altosui/AltosFlightStatus.java
+++ b/altosui/AltosFlightStatus.java
@@ -19,8 +19,8 @@ package altosui;
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosFlightStatus extends JComponent implements AltosFlightDisplay {
GridBagLayout layout;
diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java
index b33f40a4..336b44aa 100644
--- a/altosui/AltosFlightStatusTableModel.java
+++ b/altosui/AltosFlightStatusTableModel.java
@@ -27,7 +27,7 @@ import java.util.*;
import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.LinkedBlockingQueue;
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_5.*;
public class AltosFlightStatusTableModel extends AbstractTableModel {
private String[] columnNames = {
diff --git a/altosui/AltosFlightStatusUpdate.java b/altosui/AltosFlightStatusUpdate.java
index 0daec04e..3ba78c19 100644
--- a/altosui/AltosFlightStatusUpdate.java
+++ b/altosui/AltosFlightStatusUpdate.java
@@ -18,7 +18,7 @@
package altosui;
import java.awt.event.*;
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_5.*;
public class AltosFlightStatusUpdate implements ActionListener {
diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java
index 43deb631..5aff1817 100644
--- a/altosui/AltosFlightUI.java
+++ b/altosui/AltosFlightUI.java
@@ -22,8 +22,8 @@ import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
AltosVoice voice;
@@ -170,13 +170,17 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
}
Container bag;
- AltosFreqList frequencies;
- JComboBox<String> telemetries;
- JLabel telemetry;
+
+ JMenuBar menu_bar;
+ AltosFreqList frequencies;
+ AltosUITelemetryMenu telemetries;
+ JLabel telemetry;
ActionListener show_timer;
public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) {
+ super();
+
AltosUIPreferences.set_component(this);
displays = new LinkedList<AltosFlightDisplay>();
@@ -193,6 +197,10 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
/* Stick channel selector at top of table for telemetry monitoring */
if (serial >= 0) {
+
+ menu_bar = new JMenuBar();
+ setJMenuBar(menu_bar);
+
// Channel menu
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
@@ -208,43 +216,19 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
reader.save_frequency();
}
});
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0;
- c.weighty = 0;
- c.insets = new Insets(3, 3, 3, 3);
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.WEST;
- bag.add (frequencies, c);
+ menu_bar.add (frequencies);
// Telemetry format menu
- if (reader.supports_telemetry(Altos.ao_telemetry_standard)) {
- telemetries = new JComboBox<String>();
- for (int i = 1; i <= Altos.ao_telemetry_max; i++)
- telemetries.addItem(Altos.telemetry_name(i));
- int telemetry = AltosPreferences.telemetry(serial);
- if (telemetry <= Altos.ao_telemetry_off ||
- telemetry > Altos.ao_telemetry_max)
- telemetry = Altos.ao_telemetry_standard;
- telemetries.setSelectedIndex(telemetry - 1);
- telemetries.setMaximumRowCount(Altos.ao_telemetry_max);
- telemetries.setPreferredSize(null);
- telemetries.revalidate();
+ if (reader.supports_telemetry(AltosLib.ao_telemetry_standard)) {
+ telemetries = new AltosUITelemetryMenu(serial);
telemetries.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- int telemetry = telemetries.getSelectedIndex() + 1;
+ int telemetry = telemetries.get_selected();
reader.set_telemetry(telemetry);
reader.save_telemetry();
}
});
- c.gridx = 1;
- c.gridy = 0;
- c.weightx = 0;
- c.weighty = 0;
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.WEST;
- bag.add (telemetries, c);
- c.insets = new Insets(0, 0, 0, 0);
+ menu_bar.add(telemetries);
} else {
String version;
@@ -256,14 +240,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
version = "Telemetry: None";
telemetry = new JLabel(version);
- c.gridx = 1;
- c.gridy = 0;
- c.weightx = 0;
- c.weighty = 0;
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.WEST;
- bag.add (telemetry, c);
- c.insets = new Insets(0, 0, 0, 0);
+ menu_bar.add(telemetry);
}
}
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java
index 07fe9317..ddd281a6 100644
--- a/altosui/AltosGraphUI.java
+++ b/altosui/AltosGraphUI.java
@@ -23,8 +23,8 @@ import java.util.ArrayList;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java
index 042111ec..63d86291 100644
--- a/altosui/AltosIdleMonitorUI.java
+++ b/altosui/AltosIdleMonitorUI.java
@@ -24,8 +24,8 @@ import javax.swing.event.*;
import java.io.*;
import java.util.concurrent.*;
import java.util.Arrays;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
AltosDevice device;
@@ -33,9 +33,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
AltosPad pad;
AltosInfoTable flightInfo;
AltosFlightStatus flightStatus;
+ AltosIgnitor ignitor;
AltosIdleMonitor thread;
int serial;
boolean remote;
+ boolean has_ignitor;
void stop_display() {
if (thread != null) {
@@ -70,10 +72,22 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
public void show(AltosState state, AltosListenerState listener_state) {
status_update.saved_state = state;
+ if (ignitor.should_show(state)) {
+ if (!has_ignitor) {
+ pane.add("Ignitor", ignitor);
+ has_ignitor = true;
+ }
+ } else {
+ if (has_ignitor) {
+ pane.remove(ignitor);
+ has_ignitor = false;
+ }
+ }
// try {
pad.show(state, listener_state);
flightStatus.show(state, listener_state);
flightInfo.show(state, listener_state);
+ ignitor.show(state, listener_state);
// } catch (Exception e) {
// System.out.print("Show exception " + e);
// }
@@ -222,6 +236,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
flightInfo = new AltosInfoTable();
pane.add("Table", new JScrollPane(flightInfo));
+ ignitor = new AltosIgnitor();
+
/* Make the tabbed pane use the rest of the window space */
bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));
diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java
index c251bbe2..15a81e57 100644
--- a/altosui/AltosIgniteUI.java
+++ b/altosui/AltosIgniteUI.java
@@ -24,8 +24,8 @@ import java.io.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosIgniteUI
extends AltosUIDialog
diff --git a/altosui/AltosIgnitor.java b/altosui/AltosIgnitor.java
index 990a87e6..117def09 100644
--- a/altosui/AltosIgnitor.java
+++ b/altosui/AltosIgnitor.java
@@ -20,8 +20,8 @@ package altosui;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosIgnitor extends AltosUIFlightTab {
diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java
index dd5cf9ab..50c1ea31 100644
--- a/altosui/AltosLanded.java
+++ b/altosui/AltosLanded.java
@@ -21,8 +21,8 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosLanded extends AltosUIFlightTab implements ActionListener {
diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java
index 9ac1e44c..17178616 100644
--- a/altosui/AltosLaunch.java
+++ b/altosui/AltosLaunch.java
@@ -20,7 +20,7 @@ package altosui;
import java.io.*;
import java.util.concurrent.*;
import java.awt.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosLaunch {
AltosDevice device;
diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java
index cc082542..3320e675 100644
--- a/altosui/AltosLaunchUI.java
+++ b/altosui/AltosLaunchUI.java
@@ -23,7 +23,7 @@ import javax.swing.*;
import java.io.*;
import java.text.*;
import java.util.concurrent.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altosuilib_3.*;
class FireButton extends JButton {
protected void processMouseEvent(MouseEvent e) {
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java
index 6b5fd150..5c33fd16 100644
--- a/altosui/AltosPad.java
+++ b/altosui/AltosPad.java
@@ -18,8 +18,8 @@
package altosui;
import java.util.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosPad extends AltosUIFlightTab {
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java
index 6137487c..0aa5d03c 100644
--- a/altosui/AltosUI.java
+++ b/altosui/AltosUI.java
@@ -22,8 +22,8 @@ import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class AltosUI extends AltosUIFrame {
public AltosVoice voice = new AltosVoice();
@@ -99,10 +99,25 @@ public class AltosUI extends AltosUIFrame {
return b;
}
+ /* OSXAdapter interfaces */
+ public void macosx_file_handler(String path) {
+ process_graph(new File(path));
+ }
+
+ public void macosx_quit_handler() {
+ System.exit(0);
+ }
+
+ public void macosx_preferences_handler() {
+ ConfigureAltosUI();
+ }
+
public AltosUI() {
load_library(null);
+ register_for_macosx_events();
+
AltosUIPreferences.set_component(this);
pane = getContentPane();
diff --git a/altosui/AltosUIPreferencesBackend.java b/altosui/AltosUIPreferencesBackend.java
index 28047086..b229d7b2 100644
--- a/altosui/AltosUIPreferencesBackend.java
+++ b/altosui/AltosUIPreferencesBackend.java
@@ -19,7 +19,7 @@ package altosui;
import java.io.File;
import java.util.prefs.*;
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_5.*;
import javax.swing.filechooser.FileSystemView;
public class AltosUIPreferencesBackend implements AltosPreferencesBackend {
diff --git a/altosui/Info.plist.in b/altosui/Info.plist.in
index 46dea171..8dc797d6 100644
--- a/altosui/Info.plist.in
+++ b/altosui/Info.plist.in
@@ -23,7 +23,34 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
- <string>AltosUIIcon.icns</string>
+ <string>altusmetrum-altosui.icns</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Telemetry</string>
+ <key>CFBundleTypeIconFile</key>
+ <string>application-vnd.altusmetrum.telemetry.icns</string>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>telem</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Eeprom</string>
+ <key>CFBundleTypeIconFile</key>
+ <string>application-vnd.altusmetrum.eeprom.icns</string>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>eeprom</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ </array>
<key>Java</key>
<dict>
<key>MainClass</key>
diff --git a/altosui/Instdrv/NSIS/Includes/java.nsh b/altosui/Instdrv/NSIS/Includes/java.nsh
new file mode 100644
index 00000000..ebf1c5b9
--- /dev/null
+++ b/altosui/Instdrv/NSIS/Includes/java.nsh
@@ -0,0 +1,50 @@
+!include WordFunc.nsh
+
+; Definitions for Java Detection
+
+!define JRE_VERSION "1.6"
+!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52247&/jre-6u27-windows-i586.exe"
+!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52249&/jre-6u27-windows-x64.exe"
+
+Var JavaDownload
+Var JavaBits
+
+Function GetJRE
+ ${If} ${RunningX64}
+ StrCpy $JavaDownload ${JRE64_URL}
+ StrCpy $JavaBits "64"
+ ${Else}
+ StrCpy $JavaDownload ${JRE32_URL}
+ StrCpy $JavaBits "32"
+ ${EndIf}
+
+ MessageBox MB_OK "This product uses Java ${JRE_VERSION}, \
+ $JavaBits bits, it will now \
+ be downloaded and installed"
+
+ StrCpy $2 "$TEMP\Java Runtime Environment.exe"
+ nsisdl::download /TIMEOUT=30000 $JavaDownload $2
+ Pop $R0 ;Get the return value
+ StrCmp $R0 "success" +3
+ MessageBox MB_OK "Download failed: $R0"
+ Quit
+ ExecWait $2
+ Delete $2
+FunctionEnd
+
+Function DetectJRE
+ ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
+ "CurrentVersion"
+
+ DetailPrint "Desired Java version ${JRE_VERSION}"
+ DetailPrint "Actual Java version $2"
+
+ ${VersionCompare} $2 ${JRE_VERSION} $3
+
+ IntCmp $3 1 done done
+
+ Call GetJRE
+
+done:
+
+FunctionEnd
diff --git a/altosui/Instdrv/NSIS/Includes/refresh-sh.nsh b/altosui/Instdrv/NSIS/Includes/refresh-sh.nsh
new file mode 100644
index 00000000..23d8e5e4
--- /dev/null
+++ b/altosui/Instdrv/NSIS/Includes/refresh-sh.nsh
@@ -0,0 +1,14 @@
+!define SHCNE_ASSOCCHANGED 0x08000000
+!define SHCNF_IDLIST 0
+
+Function RefreshShellIcons
+ ; By jerome tremblay - april 2003
+ ${DisableX64FSRedirection}
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+FunctionEnd
+
+Function un.RefreshShellIcons
+ ; By jerome tremblay - april 2003
+ ${DisableX64FSRedirection}
+ System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+FunctionEnd
diff --git a/altosui/Makefile.am b/altosui/Makefile.am
index 98a5e193..45d75699 100644
--- a/altosui/Makefile.am
+++ b/altosui/Makefile.am
@@ -64,7 +64,7 @@ LIBALTOS= \
altos.dll
desktopdir = $(datadir)/applications
-desktop_file = altos.desktop
+desktop_file = altusmetrum-altosui.desktop
desktop_SCRIPTS = $(desktop_file)
JAR=altosui.jar
@@ -72,26 +72,37 @@ JAR=altosui.jar
FATJAR=altosui-fat.jar
# Icons
-ICONDIR=$(top_srcdir)/icon
+ICONDIR=../icon
JAVA_ICONS=\
- $(ICONDIR)/altus-metrum-16.png \
- $(ICONDIR)/altus-metrum-32.png \
- $(ICONDIR)/altus-metrum-48.png \
- $(ICONDIR)/altus-metrum-64.png \
- $(ICONDIR)/altus-metrum-128.png \
- $(ICONDIR)/altus-metrum-256.png
+ $(ICONDIR)/altusmetrum-altosui-16.png \
+ $(ICONDIR)/altusmetrum-altosui-32.png \
+ $(ICONDIR)/altusmetrum-altosui-48.png \
+ $(ICONDIR)/altusmetrum-altosui-64.png \
+ $(ICONDIR)/altusmetrum-altosui-128.png\
+ $(ICONDIR)/altusmetrum-altosui-256.png
# icon base names for jar
-ICONJAR= -C $(ICONDIR) altus-metrum-16.png \
- -C $(ICONDIR) altus-metrum-32.png \
- -C $(ICONDIR) altus-metrum-48.png \
- -C $(ICONDIR) altus-metrum-64.png \
- -C $(ICONDIR) altus-metrum-128.png \
- -C $(ICONDIR) altus-metrum-256.png
-
-WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico
-MACOSX_ICON=$(ICONDIR)/AltosUIIcon.icns
+ICONJAR= \
+ -C $(ICONDIR) altusmetrum-altosui-16.png \
+ -C $(ICONDIR) altusmetrum-altosui-32.png \
+ -C $(ICONDIR) altusmetrum-altosui-48.png \
+ -C $(ICONDIR) altusmetrum-altosui-64.png \
+ -C $(ICONDIR) altusmetrum-altosui-128.png\
+ -C $(ICONDIR) altusmetrum-altosui-256.png
+
+WINDOWS_ICONS =\
+ $(ICONDIR)/altusmetrum-altosui.ico \
+ $(ICONDIR)/altusmetrum-altosui.exe
+ $(ICONDIR)/application-vnd.altusmetrum.eeprom.ico \
+ $(ICONDIR)/application-vnd.altusmetrum.eeprom.exe \
+ $(ICONDIR)/application-vnd.altusmetrum.telemetry.ico \
+ $(ICONDIR)/application-vnd.altusmetrum.telemetry.exe
+
+MACOSX_ICONS =\
+ $(ICONDIR)/altusmetrum-altosui.icns \
+ $(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \
+ $(ICONDIR)/application-vnd.altusmetrum.telemetry.icns
# Firmware
FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx
@@ -100,7 +111,8 @@ FIRMWARE_TD=$(FIRMWARE_TD_0_2)
FIRMWARE_TM_1_0=$(top_srcdir)/src/telemetrum-v1.0/telemetrum-v1.0-$(VERSION).ihx
FIRMWARE_TM_1_1=$(top_srcdir)/src/telemetrum-v1.1/telemetrum-v1.1-$(VERSION).ihx
FIRMWARE_TM_1_2=$(top_srcdir)/src/telemetrum-v1.2/telemetrum-v1.2-$(VERSION).ihx
-FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2)
+FIRMWARE_TM_2_0=$(top_srcdir)/src/telemetrum-v2.0/telemetrum-v2.0-$(VERSION).ihx
+FIRMWARE_TM=$(FIRMWARE_TM_1_0) $(FIRMWARE_TM_1_1) $(FIRMWARE_TM_1_2) $(FIRMWARE_TM_2_0)
FIRMWARE_TELEMINI_1_0=$(top_srcdir)/src/telemini-v1.0/telemini-v1.0-$(VERSION).ihx
FIRMWARE_TELEMINI=$(FIRMWARE_TELEMINI_1_0)
@@ -140,14 +152,14 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR
LINUX_LIBS=libaltos32.so libaltos64.so
-LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) altos.desktop.in ../icon/altusmetrum.svg
+LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(ICONDIR)/altusmetrum-altosui.svg
LINUX_EXTRA=altosui-fat
MACOSX_INFO_PLIST=Info.plist
-MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICON)
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS)
MACOSX_EXTRA=$(FIRMWARE)
-WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICON)
+WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICONS)
all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb
@@ -160,7 +172,7 @@ clean-local:
EXTRA_DIST = $(desktop_file).in
$(desktop_file): $(desktop_file).in
- sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/altos.desktop.in > $@
+ sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@
chmod +x $@
if FATINSTALL
@@ -194,7 +206,6 @@ else
fat: $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) $(WINDOWS_DIST)
endif
-
altosuidir=$(datadir)/java
install-altosuiJAVA: altosui.jar
@@ -324,7 +335,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
cp -a $(DOC) macosx/Doc
cp -p Info.plist macosx/AltosUI.app/Contents
mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java
- cp -p $(MACOSX_ICON) macosx/AltosUI.app/Contents/Resources
+ cp -p $(MACOSX_ICONS) macosx/AltosUI.app/Contents/Resources
cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar
cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java
cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java
diff --git a/altosui/altos-windows.nsi.in b/altosui/altos-windows.nsi.in
index b72772e2..07de5b13 100644
--- a/altosui/altos-windows.nsi.in
+++ b/altosui/altos-windows.nsi.in
@@ -1,19 +1,25 @@
!addplugindir Instdrv/NSIS/Plugins
+!addincludedir Instdrv/NSIS/Includes
!include x64.nsh
-; Definitions for Java 1.7 Detection
-!define JRE_VERSION "1.7"
-!define JRE_ALTERNATE "1.6"
-!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383&/jre-7u51-windows-i586.exe"
-!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385&/jre-7u51-windows-x64.exe"
-!define PRODUCT_NAME "Altus Metrum Windows Software"
+!include java.nsh
+!include refresh-sh.nsh
-Name "Altus Metrum Installer"
+!define REG_NAME "Altus Metrum"
+!define PROG_ID_TELEM "altusmetrum.altosui.telem.1"
+!define PROG_ID_EEPROM "altusmetrum.altosui.eeprom.1"
+!define FAT_NAME "altosui-fat.jar"
+!define WIN_APP_ICON "altusmetrum-altosui.ico"
+!define WIN_APP_EXE "altusmetrum-altosui.exe"
+!define WIN_TELEM_EXE "application-vnd.altusmetrum.telemetry.exe"
+!define WIN_EEPROM_EXE "application-vnd.altusmetrum.eeprom.exe"
+
+Name "${REG_NAME} Installer"
; Default install directory
InstallDir "$PROGRAMFILES\AltusMetrum"
; Tell the installer where to re-install a new version
-InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir"
+InstallDirRegKey HKLM "Software\${REG_NAME}" "Install_Dir"
LicenseText "GNU General Public License Version 2"
LicenseData "../COPYING"
@@ -23,7 +29,7 @@ RequestExecutionLevel admin
ShowInstDetails Show
-ComponentText "Altus Metrum Software and Driver Installer"
+ComponentText "${REG_NAME} Software and Driver Installer"
Function .onInit
DetailPrint "Checking host operating system"
@@ -35,43 +41,14 @@ Function .onInit
${EndIf}
FunctionEnd
-Var JavaDownload
-Var JavaBits
-
-Function GetJRE
+Function un.onInit
+ DetailPrint "Checking host operating system"
${If} ${RunningX64}
- StrCpy $JavaDownload ${JRE64_URL}
- StrCpy $JavaBits "64"
- ${Else}
- StrCpy $JavaDownload ${JRE32_URL}
- StrCpy $JavaBits "32"
+ DetailPrint "Installer running on 64-bit host"
+ SetRegView 64
+ StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum"
+ ${DisableX64FSRedirection}
${EndIf}
-
- MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, \
- $JavaBits bits, it will now \
- be downloaded and installed"
-
- StrCpy $2 "$TEMP\Java Runtime Environment.exe"
- nsisdl::download /TIMEOUT=30000 $JavaDownload $2
- Pop $R0 ;Get the return value
- StrCmp $R0 "success" +3
- MessageBox MB_OK "Download failed: $R0"
- Quit
- ExecWait $2
- Delete $2
-FunctionEnd
-
-Function DetectJRE
- ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
- "CurrentVersion"
-
- StrCmp $2 ${JRE_VERSION} done
-
- StrCmp $2 ${JRE_ALTERNATE} done
-
- Call GetJRE
-
- done:
FunctionEnd
; Pages to present
@@ -109,12 +86,12 @@ done:
SectionEnd
-Section "AltosUI Application"
+Section "${REG_NAME} Application"
Call DetectJRE
SetOutPath $INSTDIR
- File "altosui-fat.jar"
+ File "${FAT_NAME}"
File "altoslib_@ALTOSLIB_VERSION@.jar"
File "altosuilib_@ALTOSUILIB_VERSION@.jar"
File "cmudict04.jar"
@@ -129,13 +106,13 @@ Section "AltosUI Application"
File "*.dll"
- File "../icon/*.ico"
+ File "../icon/${WIN_APP_ICON}"
- CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$SYSDIR\javaw.exe" "-jar altosui-fat.jar" "$INSTDIR\altus-metrum.ico"
+ CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}"
SectionEnd
-Section "AltosUI Desktop Shortcut"
- CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico"
+Section "${REG_NAME} Desktop Shortcut"
+ CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}"
SectionEnd
Section "TeleMetrum, TeleDongle and TeleBT Firmware"
@@ -145,6 +122,7 @@ Section "TeleMetrum, TeleDongle and TeleBT Firmware"
File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
File "../src/telemetrum-v1.1/telemetrum-v1.1-${VERSION}.ihx"
File "../src/telemetrum-v1.2/telemetrum-v1.2-${VERSION}.ihx"
+ File "../src/telemetrum-v2.0/telemetrum-v2.0-${VERSION}.ihx"
File "../src/telemini-v1.0/telemini-v1.0-${VERSION}.ihx"
File "../src/telegps-v1.0/telegps-v1.0-${VERSION}.ihx"
File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
@@ -167,38 +145,105 @@ Section "Documentation"
File "../doc/telemini.pdf"
SectionEnd
+Section "File Associations"
+
+ ${DisableX64FSRedirection}
+
+ SetOutPath $INSTDIR
+
+ File "../icon/${WIN_APP_EXE}"
+ File "../icon/${WIN_TELEM_EXE}"
+ File "../icon/${WIN_EEPROM_EXE}"
+
+ DeleteRegKey HKCR "${PROG_ID_TELEM}"
+ DeleteRegKey HKCR "${PROG_ID_EEPROM}"
+
+ DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}"
+ DeleteRegKey HKCR ".telem\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_EEPROM}"
+
+ ; .eeprom elements
+
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "FriendlyTypeName" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\CurVer" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\DefaultIcon" "" '"$INSTDIR\${WIN_EEPROM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_EEPROM}\shell\open\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+
+ WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File"
+ WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom"
+
+ WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" ""
+ WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}"
+
+ ; .telem elements
+
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "FriendlyTypeName" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\CurVer" "" "${PROG_ID_TELEM}"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\DefaultIcon" "" '"$INSTDIR\${WIN_TELEM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_TELEM}\shell\open\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+
+ WriteRegStr HKCR ".telem" "" "${PROG_ID_TELEM}"
+ WriteRegStr HKCR ".telem" "PerceivedType" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR ".telem" "Content Type" "application/vnd.altusmetrum.telemetry"
+
+ WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" ""
+ WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${REG_NAME}"
+
+ Call RefreshShellIcons
+SectionEnd
+
Section "Uninstaller"
; Deal with the uninstaller
+ ${DisableX64FSRedirection}
SetOutPath $INSTDIR
; Write the install path to the registry
- WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
+ WriteRegStr HKLM "SOFTWARE\${REG_NAME}" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for windows
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "DisplayName" "${REG_NAME}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "UninstallString" '"$INSTDIR\uninstall-${REG_NAME}.exe"'
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoModify" "1"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoRepair" "1"
- WriteUninstaller "uninstall.exe"
+ WriteUninstaller "uninstall-${REG_NAME}.exe"
SectionEnd
Section "Uninstall"
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
- DeleteRegKey HKLM "Software\AltusMetrum"
- Delete "$INSTDIR\*.*"
- RMDir "$INSTDIR"
+ ${DisableX64FSRedirection}
- ; Remove devices
- InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
- InstDrv::DeleteOemInfFiles /NOUNLOAD
- InstDrv::RemoveAllDevices
+ DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}"
+ DeleteRegKey HKLM "SOFTWARE\${REG_NAME}"
+
+ DetailPrint "Delete uninstall reg entries"
+
+ DeleteRegKey HKCR "${PROG_ID_EEPROM}"
+ DeleteRegKey HKCR "${PROG_ID_TELEM}"
+
+ DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}"
+
+ DeleteRegKey HKCR ".telem\${PROG_ID_TELEM}"
+ DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}"
+
+ DetailPrint "Delete file association reg entries"
+
+ Delete "$INSTDIR\${FAT_NAME}"
+ Delete "$INSTDIR\uninstall-${REG_NAME}.exe"
+
+ Delete "$INSTDIR\${WIN_APP_ICON}"
+ Delete "$INSTDIR\${WIN_APP_EXE}"
; Remove shortcuts, if any
- Delete "$SMPROGRAMS\AltusMetrum.lnk"
- Delete "$DESKTOP\AltusMetrum.lnk"
+ Delete "$SMPROGRAMS\${REG_NAME}.lnk"
+ Delete "$DESKTOP\${REG_NAME}.lnk"
+ Call un.RefreshShellIcons
SectionEnd
diff --git a/altosui/altos.desktop.in b/altosui/altusmetrum-altosui.desktop.in
index 66114348..10fd9e9d 100644
--- a/altosui/altos.desktop.in
+++ b/altosui/altusmetrum-altosui.desktop.in
@@ -1,10 +1,11 @@
[Desktop Entry]
Type=Application
+Version=1.0
Name=AltOS UI
GenericName=Altus Metrum Ground Station
Comment=View and log downlink data from Altus Metrum products
-Icon=%icondir%/altusmetrum.svg
+Icon=%icondir%/altusmetrum-altosui.svg
Exec=%bindir%/altosui %f
Terminal=false
-MimeType=text/plain;
+MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom
Categories=Education;Electronics;Science;