From 4d51545bfca29ae36873a179a2554917adfdce0f Mon Sep 17 00:00:00 2001 From: dyedgreen Date: Mon, 27 Jun 2016 18:12:41 +0200 Subject: [PATCH] dictation error added * now there is a custom dictation error * going towards 1.3 * upcoming: clay config for custom places --- package.json | 8 +++++++- resources/images/error_voice.png | Bin 0 -> 1079 bytes src/directions_window.c | 2 +- src/error_window.c | 7 ++++++- src/error_window.h | 4 +++- src/js/app.js | 6 +++++- 6 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 resources/images/error_voice.png diff --git a/package.json b/package.json index b3014ae..dd4b044 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pebble-directions", "author": "Dyedgreen", - "version": "1.1.0", + "version": "1.3.0", "keywords": ["navigation", "maps", "directions"], "private": true, "dependencies": {}, @@ -68,6 +68,12 @@ "targetPlatforms": null, "type": "bitmap" }, + { + "file": "images/error_voice.png", + "name": "ICON_ERROR_DICTATION", + "targetPlatforms": null, + "type": "bitmap" + }, { "file": "images/error_other.png", "name": "ICON_ERROR_OTHER", diff --git a/resources/images/error_voice.png b/resources/images/error_voice.png new file mode 100644 index 0000000000000000000000000000000000000000..2cb84e837d503f3644cb5d597068d05ca9497a60 GIT binary patch literal 1079 zcmV-71jze|P)5XTcA5o<-zCRQqf;8(a{5epH)3xZ$3P81QW6zqLe ziLIsSEk)$oq!Sez1wkw%VA`Wg{Q*-Do+6>c64c!ee{#r5GD2`%v`` z8pCkyDF(&bIC+4IU7=FWmKDj(ChW0>2w-NVH-I%nM@+GLElbs-2^5OZor>kM!(7&xcz08R(24vMk4-q=%)h4UyD%Zk%io8PXlE| zkK>-9@xl26{am2fYZvCaD3l7m6ClI;nV8oC#9ZqTPej2}=$AaQy((hS0eNg2YkPZ} zcP{m{5c*bpfhH3Vp+85=y$%GDwPTppA*y~FL)R$!B|_hlq2xURT|uM!KO3pdu3J>p z2@HNfOLl;x{sw->(X1qM>T(WNG3sEv%ECDItam+q*Bv4k89Gmn8w6g}f7Y~tK?Ran zPyG1t04oh%D)W6rtCg?z#tz%F|e{d`BIFWEQ8n-cvQ3xJcdj$ z7K#a?0!;sUF#?RKGU!y_6o@N3g_ps@+ze(@ATB)pd+rA(~0&PFWLFg_wt! zgU2Qckx3YO1E7?(!G@qaN!1Tjosx8Q0<4@XJz!Wg4nt>%xkc(aAa_@+8%vS4F+3-L xO?;HYAPQ@fkh71zjO2Af2`B+2pac>E{{T3{qi0k~sKfvO002ovPDHLkV1l0O@$>)y literal 0 HcmV?d00001 diff --git a/src/directions_window.c b/src/directions_window.c index d840820..7986b08 100644 --- a/src/directions_window.c +++ b/src/directions_window.c @@ -140,7 +140,7 @@ static void dictation_session_start_handler() { DictationSessionStatus dictation_status = dictation_session_start(dictation_session); if (dictation_status != DictationSessionStatusSuccess) { // Display error - window_display_error(Network); + window_display_error(Dictation); } } diff --git a/src/error_window.c b/src/error_window.c index 0424bf4..ab9beac 100644 --- a/src/error_window.c +++ b/src/error_window.c @@ -43,8 +43,13 @@ static void window_load() { icon_error = gbitmap_create_with_resource(RESOURCE_ID_ICON_ERROR_API); text_error = "No route could be found"; break; - // Other / Undefined + // Dictation case 2: + icon_error = gbitmap_create_with_resource(RESOURCE_ID_ICON_ERROR_DICTATION); + text_error = "Could not start dictation"; + break; + // Other / Undefined + default: icon_error = gbitmap_create_with_resource(RESOURCE_ID_ICON_ERROR_OTHER); text_error = "Something went wrong"; break; diff --git a/src/error_window.h b/src/error_window.h index 791a716..318630f 100644 --- a/src/error_window.h +++ b/src/error_window.h @@ -9,8 +9,10 @@ enum ErrorType { Network = 0, // Error response from api Api = 1, + // Error when trying to start the dictation + Dictation = 2, // Something simply went wrong - Other = 2 + Other = 3 }; void error_window_push(enum ErrorType); diff --git a/src/js/app.js b/src/js/app.js index 5e150c1..d01c9a6 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -25,7 +25,11 @@ * * About the step icon data string * ––– -* Chars map to the following icons: type: 'a', forward: 'b', right: 'c', left: 'd', uRight: 'e', uLeft: 'f', attr: 'g' +* Chars map to the following icons: type: 'a', forward: 'b', right: 'c', left: 'd', uRight: 'e', uLeft: 'f', attr: 'g', final: 'h' +* +* About the config of 'named addresses' +* ––– +* The config stores an array of these name / address pairs, every time a search request hits the phone, */