Skip to content

Commit

Permalink
GPII-4226 Renaming JAWS settings handler option keys to be more meani…
Browse files Browse the repository at this point in the history
…ngful
  • Loading branch information
sgithens committed May 14, 2020
1 parent 09a36cc commit 6f3edbc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
14 changes: 7 additions & 7 deletions gpii/node_modules/settingsHandlers/src/JawsSettingsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ require("./INISettingsHandler.js");

fluid.registerNamespace("gpii.settingsHandlers.JAWSSettingsHandler.parser");

gpii.settingsHandlers.JAWSSettingsHandler.getProfileFileName = function (options) {
gpii.settingsHandlers.JAWSSettingsHandler.getVoiceProfileFileName = function (options) {
var iniPayload = {
"com.freedomscientific.jaws": [{
options: {
"filename": options.filename
"defaultSettingsFilePath": options.defaultSettingsFilePath
},
settings: {
"Voice Profiles.ActiveVoiceProfileName": null
Expand All @@ -36,28 +36,28 @@ gpii.settingsHandlers.JAWSSettingsHandler.getProfileFileName = function (options
};
var response = gpii.settingsHandlers.INISettingsHandler.get(iniPayload);
var solutions = response["com.freedomscientific.jaws"];
var filename = undefined;
var voiceProfileFileName = undefined;

if (Array.isArray(solutions) && solutions.length) {
var solution = solutions[0];
var settingValue = fluid.get(solution, ["settings", "Voice Profiles.ActiveVoiceProfileName"]);

if (settingValue) {
filename = path.join(options.foldername, settingValue + ".VPF");
voiceProfileFileName = path.join(options.voiceProfilesDirPath, settingValue + ".VPF");
} else {
filename = path.join(options.foldername, "Eloquence.VPF");
voiceProfileFileName = path.join(options.voiceProfilesDirPath, "Eloquence.VPF");
}
}

return filename;
return voiceProfileFileName;
};

gpii.settingsHandlers.JAWSSettingsHandler.parser.parse = function (content, options) {
return gpii.iniFile.read(content, options);
};

gpii.settingsHandlers.JAWSSettingsHandler.parser.stringify = function (content, options) {
return gpii.iniFile.writeFromFile(options.filename, content, options);
return gpii.iniFile.writeFromFile(options.defaultSettingsFilePath, content, options);
};

/* PUBLIC API FUNCTIONS */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ var test = {
payload: {
"com.freedomscientific.jaws": [{
options: {
"filename": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
},
settings: {
"ENU-Global.Pitch": 90
Expand All @@ -27,8 +27,8 @@ var test = {
expectedResult: {
"com.freedomscientific.jaws": [{
options: {
"filename": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "C:\\Users\\vagrant\\AppData\\Roaming\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
},
settings: {
"ENU-Global.Pitch": {
Expand Down
4 changes: 2 additions & 2 deletions testData/solutions/win32.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5867,8 +5867,8 @@
"liveness": "manualRestart",
"options": {
// TODO: Create a base grade for JAWS and version-specific variations. Make JAWS 2019 the default. Restart version-detection discussions and "capability" discussions.
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
},
"supportedSettings": {
// -------- Options ----------
Expand Down
8 changes: 4 additions & 4 deletions tests/CloseConflictingAppsTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ gpii.tests.conflictingApps.testDefs = [
// "ENU-MenuAndDialog.Pitch": 11
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down Expand Up @@ -201,8 +201,8 @@ gpii.tests.conflictingApps.testDefs = [
// "ENU-MenuAndDialog.Pitch": 11
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down
20 changes: 10 additions & 10 deletions tests/platform/windows/windows-jaws-testSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ gpii.tests.windows.jaws.testDefs = [
// "ENU-PCCursor.SynthLangString": "Italian"
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down Expand Up @@ -199,8 +199,8 @@ gpii.tests.windows.jaws.testDefs = [
// "ENU-PCCursor.SynthLangString": "Italian"
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down Expand Up @@ -268,8 +268,8 @@ gpii.tests.windows.jaws.testDefs = [
// "ENU-MenuAndDialog.SynthLangString": "French"
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down Expand Up @@ -336,8 +336,8 @@ gpii.tests.windows.jaws.testDefs = [
// "ENU-MenuAndDialog.SynthLangString": "Italian"
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down Expand Up @@ -405,8 +405,8 @@ gpii.tests.windows.jaws.testDefs = [
// "ENU-MenuAndDialog.SynthLangString": "French Canadian"
},
"options": {
"filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"foldername": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
"defaultSettingsFilePath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\enu\\DEFAULT.JCF",
"voiceProfilesDirPath": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\2019\\Settings\\VoiceProfiles"
}
}
]
Expand Down

0 comments on commit 6f3edbc

Please sign in to comment.