projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix up 'make fat' to build all libs and micropeak too
[fw/altos]
/
altosui
/
AltosBTKnown.java
diff --git
a/altosui/AltosBTKnown.java
b/altosui/AltosBTKnown.java
index 95830637407fa5d5aedc83af5422f36eb9166242..606c0349fe526ccf41ccfc008ce70c0af1af53d8 100644
(file)
--- a/
altosui/AltosBTKnown.java
+++ b/
altosui/AltosBTKnown.java
@@
-16,22
+16,20
@@
*/
package altosui;
*/
package altosui;
-import java.lang.*;
import java.util.*;
import java.util.*;
-import
libaltosJNI
.*;
-import
java.util.prefs
.*;
+import
org.altusmetrum.AltosLib
.*;
+import
org.altusmetrum.altosuilib
.*;
public class AltosBTKnown implements Iterable<AltosBTDevice> {
LinkedList<AltosBTDevice> devices = new LinkedList<AltosBTDevice>();
public class AltosBTKnown implements Iterable<AltosBTDevice> {
LinkedList<AltosBTDevice> devices = new LinkedList<AltosBTDevice>();
-
Preferences bt_pref = Altos
Preferences.bt_devices();
+
AltosPreferencesBackend bt_pref = AltosUI
Preferences.bt_devices();
private String get_address(String name) {
private String get_address(String name) {
- return bt_pref.get(name, "");
+ return bt_pref.get
String
(name, "");
}
private void set_address(String name, String addr) {
}
private void set_address(String name, String addr) {
- bt_pref.put(name, addr);
- System.out.printf("saving known %s %s\n", name, addr);
+ bt_pref.putString(name, addr);
}
private void remove(String name) {
}
private void remove(String name) {
@@
-44,10
+42,8
@@
public class AltosBTKnown implements Iterable<AltosBTDevice> {
for (int i = 0; i < names.length; i++) {
String name = names[i];
String addr = get_address(name);
for (int i = 0; i < names.length; i++) {
String name = names[i];
String addr = get_address(name);
- System.out.printf("Known device %s %s\n", name, addr);
devices.add(new AltosBTDevice(name, addr));
}
devices.add(new AltosBTDevice(name, addr));
}
- } catch (BackingStoreException be) {
} catch (IllegalStateException ie) {
}
}
} catch (IllegalStateException ie) {
}
}
@@
-57,7
+53,7
@@
public class AltosBTKnown implements Iterable<AltosBTDevice> {
}
private void flush() {
}
private void flush() {
- AltosPreferences.flush_preferences();
+ Altos
UI
Preferences.flush_preferences();
}
public void set(Iterable<AltosBTDevice> new_devices) {
}
public void set(Iterable<AltosBTDevice> new_devices) {
@@
-91,7
+87,15
@@
public class AltosBTKnown implements Iterable<AltosBTDevice> {
public AltosBTKnown() {
devices = new LinkedList<AltosBTDevice>();
public AltosBTKnown() {
devices = new LinkedList<AltosBTDevice>();
- bt_pref = AltosPreferences.bt_devices();
+ bt_pref = Altos
UI
Preferences.bt_devices();
load();
}
load();
}
-}
\ No newline at end of file
+
+ static AltosBTKnown known;
+
+ static public AltosBTKnown bt_known() {
+ if (known == null)
+ known = new AltosBTKnown();
+ return known;
+ }
+}