summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosConfigUI.java3
-rw-r--r--altosui/AltosConfigureUI.java8
-rw-r--r--altosui/AltosLanded.java6
-rw-r--r--altosui/Makefile.am10
-rw-r--r--altosui/linux-install.sh79
5 files changed, 67 insertions, 39 deletions
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java
index 043cb876..9fcace61 100644
--- a/altosui/AltosConfigUI.java
+++ b/altosui/AltosConfigUI.java
@@ -926,6 +926,9 @@ public class AltosConfigUI
serial_value.setText(String.format("%d", serial));
}
+ public void set_altitude_32(int altitude_32) {
+ }
+
public void set_main_deploy(int new_main_deploy) {
main_deploy_value.setSelectedItem(AltosConvert.height.say(new_main_deploy));
main_deploy_value.setEnabled(new_main_deploy >= 0);
diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java
index 80d6d341..85a3f6c0 100644
--- a/altosui/AltosConfigureUI.java
+++ b/altosui/AltosConfigureUI.java
@@ -89,6 +89,8 @@ public class AltosConfigureUI
row++;
}
+ boolean has_bluetooth;
+
public void add_bluetooth() {
JButton manage_bluetooth = new JButton("Manage Bluetooth");
manage_bluetooth.addActionListener(new ActionListener() {
@@ -98,6 +100,7 @@ public class AltosConfigureUI
});
pane.add(manage_bluetooth, constraints(0, 2));
/* in the same row as add_frequencies, so don't bump row */
+ has_bluetooth = true;
}
public void add_frequencies() {
@@ -108,7 +111,10 @@ public class AltosConfigureUI
}
});
manage_frequencies.setToolTipText("Configure which values are shown in frequency menus");
- pane.add(manage_frequencies, constraints(2, 1));
+ if (has_bluetooth)
+ pane.add(manage_frequencies, constraints(2, 1));
+ else
+ pane.add(manage_frequencies, constraints(0, 3));
row++;
}
diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java
index 50c1ea31..7c50adac 100644
--- a/altosui/AltosLanded.java
+++ b/altosui/AltosLanded.java
@@ -151,6 +151,12 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener {
return "Landed";
}
+ public void show(AltosState state, AltosListenerState listener_state) {
+ super.show(state, listener_state);
+ if (reader.backing_file() != null)
+ graph.setEnabled(true);
+ }
+
public AltosLanded(AltosFlightReader in_reader) {
reader = in_reader;
diff --git a/altosui/Makefile.am b/altosui/Makefile.am
index c79e27c0..44258fd2 100644
--- a/altosui/Makefile.am
+++ b/altosui/Makefile.am
@@ -104,6 +104,14 @@ MACOSX_ICONS =\
$(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \
$(ICONDIR)/application-vnd.altusmetrum.telemetry.icns
+LINUX_ICONS =\
+ $(ICONDIR)/altusmetrum-altosui.svg \
+ $(ICONDIR)/application-vnd.altusmetrum.eeprom.svg \
+ $(ICONDIR)/application-vnd.altusmetrum.telemetry.svg
+
+LINUX_MIMETYPE =\
+ $(ICONDIR)/org-altusmetrum-mimetypes.xml
+
# Firmware
FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx
FIRMWARE_TD=$(FIRMWARE_TD_0_2)
@@ -152,7 +160,7 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR
LINUX_LIBS=libaltos32.so libaltos64.so
-LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(ICONDIR)/altusmetrum-altosui.svg
+LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE)
LINUX_EXTRA=altosui-fat
MACOSX_INFO_PLIST=Info.plist
diff --git a/altosui/linux-install.sh b/altosui/linux-install.sh
index 957b1aad..2e44c2aa 100644
--- a/altosui/linux-install.sh
+++ b/altosui/linux-install.sh
@@ -130,6 +130,7 @@ esac
#
# Create the .desktop file by editing the paths
#
+
case "$target" in
/*)
target_abs="$target"
@@ -149,43 +150,46 @@ for infile in "$target"/AltOS/*.desktop.in; do
done
#
-# Figure out where to install the .desktop files. If we can, write it
-# to the public /usr/share/applications, otherwise, write it to the
-# per-user ~/.local/share/applications
+# Install the .desktop file
#
-public=/usr/share/applications
-private=$HOME/.local/share/applications
-apps=""
+for desktop in "$target"/AltOS/*.desktop; do
+ case `id -u` in
+ 0)
+ xdg-desktop-menu install --mode system "$desktop"
+ ;;
+ *)
+ xdg-desktop-menu install --mode user "$desktop"
+ ;;
+ esac
+done
-if [ -d "$public" -a -w "$public" ]; then
- apps="$public"
-else
- mkdir -p "$private" >/dev/null 2>&1
- if [ -d "$private" -a -w "$private" ]; then
- apps="$private"
- fi
-fi
-
-case "$apps" in
-"")
- echo "Cannot install application icon"
- finish 1
- ;;
-esac
+#
+# Install mime type file
+#
+
+for mimetype in "$target"/AltOS/*-mimetypes.xml; do
+ case `id -u` in
+ 0)
+ xdg-mime install --mode system "$mimetype"
+ ;;
+ *)
+ xdg-mime install --mode user "$mimetype"
+ ;;
+ esac
+done
-echo -n "Installing .desktop files to $apps..."
+#
+# Install icons
+#
-cp "$target"/AltOS/*.desktop "$apps"
+for icon_dir in /usr/share/icons/hicolor/scalable/mimetypes "$HOME/.icons" "$HOME/.kde/share/icons"; do
+ if [ -w "$icon_dir" ]; then
+ cp "$target"/AltOS/*.svg "$icon_dir"
+ update-icon-caches "$icon_dir"
+ fi
+done
-case "$?" in
-0)
- echo " done."
- ;;
-*)
- echo " failed."
- ;;
-esac
#
# Install icon to desktop if desired
@@ -222,13 +226,14 @@ if [ -d $HOME/Desktop ]; then
esac
done
- echo -n "Installing desktop icons..."
case "$do_desktop" in
- [yY]*)
- for d in "$target"/AltOS/*.desktop; do
- ln -f -s "$d" "$HOME/Desktop/"
- done
- ;;
+ [yY]*)
+ echo -n "Installing desktop icons..."
+ for d in "$target"/AltOS/*.desktop; do
+ base=`basename $d`
+ cp --remove-destination "$d" "$HOME/Desktop/"
+ done
+ ;;
esac
echo " done."