Skip to content

Commit 0d82b7a

Browse files
authored
Merge pull request #1046 from OpenBCI/filters-ui-team-review
Filters UI team review
2 parents 1c9c8dd + bab4bfa commit 0d82b7a

6 files changed

Lines changed: 174 additions & 55 deletions

File tree

OpenBCI_GUI/Extras.pde

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ public boolean isElevationNeeded(String path) {
7676
if (path != null) {
7777
result = !canWrite(path);
7878
} else {
79+
if (isMac()) {
80+
//Mac user name is never simply "root"
81+
return false;
82+
}
7983
result = !System.getProperty("user.name").equals("root");
8084
}
8185
}
@@ -87,6 +91,9 @@ public boolean isElevationNeeded(String path) {
8791
* @return
8892
*/
8993
public boolean isAdminUser() {
94+
if (isMac()) {
95+
return true;
96+
}
9097
if (isWindows()) {
9198
try {
9299
String NTAuthority = "HKU\\S-1-5-19";

OpenBCI_GUI/FilterEnums.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public enum BFFilter implements FilterSettingsEnum
2727
public enum FilterChannelSelect implements FilterSettingsEnum
2828
{
2929
ALL_CHANNELS (0, "All Channels"),
30-
CUSTOM_CHANNELS (1, "Custom");
30+
CUSTOM_CHANNELS (1, "Per Channel");
3131

3232
private int index;
3333
private String name;

OpenBCI_GUI/FilterSettings.pde

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class FilterSettings {
9696
channelCount = board.getNumEXGChannels();
9797

9898
values = new FilterSettingsValues(channelCount);
99-
defaultValues = values;
99+
defaultValues = new FilterSettingsValues(channelCount);
100100
}
101101

102102
public boolean loadSettingsValues(String filename) {
@@ -143,9 +143,7 @@ class FilterSettings {
143143
}
144144

145145
public void revertAllChannelsToDefaultValues() {
146-
Gson gson = new GsonBuilder().setPrettyPrinting().create();
147-
String defaultValsAsString = gson.toJson(defaultValues);
148-
values = gson.fromJson(defaultValsAsString, FilterSettingsValues.class);
146+
values = new FilterSettingsValues(channelCount);
149147
}
150148

151149
//Called in UI to control number of channels. This is set from the board when this class is instantiated.
@@ -202,4 +200,4 @@ public void storeFilterSettings(File selection) {
202200
outputError("Failed to save Filter Settings.");
203201
}
204202
}
205-
}
203+
}

0 commit comments

Comments
 (0)