|
Lines 18-23
Link Here
|
| 18 |
import "Label"; |
18 |
import "Label"; |
| 19 |
import "Popup"; |
19 |
import "Popup"; |
| 20 |
|
20 |
|
|
|
21 |
|
| 22 |
map<string,string> actionmap = $[ |
| 23 |
"MailAndSave" : _("MailAndSave"), |
| 24 |
"SaveOnly" : _("SaveOnly") |
| 25 |
]; |
| 26 |
|
| 21 |
define map AM_UserEditDialog(string uname, map uconf); |
27 |
define map AM_UserEditDialog(string uname, map uconf); |
| 22 |
|
28 |
|
| 23 |
/** |
29 |
/** |
|
Lines 96-102
Link Here
|
| 96 |
m["voice_numbers"]:"", |
102 |
m["voice_numbers"]:"", |
| 97 |
m["voice_delay"]:"", |
103 |
m["voice_delay"]:"", |
| 98 |
m["record_length"]:"", |
104 |
m["record_length"]:"", |
| 99 |
m["voice_action"]:""); |
105 |
actionmap[m["voice_action"]:""]:""); |
| 100 |
table_items = add(table_items, item); |
106 |
table_items = add(table_items, item); |
| 101 |
items = items + 1; |
107 |
items = items + 1; |
| 102 |
}); |
108 |
}); |
|
Lines 209-215
Link Here
|
| 209 |
m["voice_numbers"]:"", |
215 |
m["voice_numbers"]:"", |
| 210 |
m["voice_delay"]:"", |
216 |
m["voice_delay"]:"", |
| 211 |
m["record_length"]:"", |
217 |
m["record_length"]:"", |
| 212 |
m["voice_action"]:""); |
218 |
actionmap[m["voice_action"]:""]:""); |
| 213 |
table_items = add(table_items, item); |
219 |
table_items = add(table_items, item); |
| 214 |
items = items + 1; |
220 |
items = items + 1; |
| 215 |
}); |
221 |
}); |
|
Lines 264-270
Link Here
|
| 264 |
} |
270 |
} |
| 265 |
|
271 |
|
| 266 |
y2debug("uc=%1", uc); |
272 |
y2debug("uc=%1", uc); |
| 267 |
list actions = [ "None", "MailAndSave", "SaveOnly" ]; |
|
|
| 268 |
|
273 |
|
| 269 |
UI::OpenDialog(`opt(`decorated),`VBox( |
274 |
UI::OpenDialog(`opt(`decorated),`VBox( |
| 270 |
`HSpacing(1), |
275 |
`HSpacing(1), |
|
Lines 278-284
Link Here
|
| 278 |
/* ComboBox label */ |
283 |
/* ComboBox label */ |
| 279 |
`ComboBox(`id(`duration), `opt(`editable, `hstretch), _("D&uration"), rlength_val), |
284 |
`ComboBox(`id(`duration), `opt(`editable, `hstretch), _("D&uration"), rlength_val), |
| 280 |
/* ComboBox label */ |
285 |
/* ComboBox label */ |
| 281 |
`ComboBox(`id(`action), `opt(`hstretch), _("&Action"), actions), |
286 |
`ComboBox(`id(`action), `opt(`hstretch), _("&Action"), [ |
|
|
287 |
`item(`id(`MailAndSave),actionmap["MailAndSave"]:""), |
| 288 |
`item(`id(`SaveOnly),actionmap["SaveOnly"]:"") |
| 289 |
|
| 290 |
]), |
| 282 |
/* TextEntry label */ |
291 |
/* TextEntry label */ |
| 283 |
`TextEntry(`id(`pin), _("P&in"), uc["pin"]:"") |
292 |
`TextEntry(`id(`pin), _("P&in"), uc["pin"]:"") |
| 284 |
), |
293 |
), |
|
Lines 293-299
Link Here
|
| 293 |
UI::ChangeWidget(`id(`user), `Value, uname); |
302 |
UI::ChangeWidget(`id(`user), `Value, uname); |
| 294 |
UI::ChangeWidget(`id(`delay), `Value, uc["voice_delay"]:"10"); |
303 |
UI::ChangeWidget(`id(`delay), `Value, uc["voice_delay"]:"10"); |
| 295 |
UI::ChangeWidget(`id(`duration), `Value, uc["record_length"]:"60"); |
304 |
UI::ChangeWidget(`id(`duration), `Value, uc["record_length"]:"60"); |
| 296 |
UI::ChangeWidget(`id(`action), `Value, uc["voice_action"]:"MailAndSave"); |
305 |
if (uc["voice_action"]:"" == "MailAndSave") |
|
|
306 |
UI::ChangeWidget(`id(`action), `Value, `MailAndSave); |
| 307 |
else |
| 308 |
UI::ChangeWidget(`id(`action), `Value, `SaveOnly); |
| 309 |
|
| 297 |
UI::ChangeWidget(`id(`phone), `ValidChars, "0123456789#*,"); |
310 |
UI::ChangeWidget(`id(`phone), `ValidChars, "0123456789#*,"); |
| 298 |
UI::ChangeWidget(`id(`delay), `ValidChars, "0123456789"); |
311 |
UI::ChangeWidget(`id(`delay), `ValidChars, "0123456789"); |
| 299 |
UI::ChangeWidget(`id(`duration), `ValidChars, "0123456789"); |
312 |
UI::ChangeWidget(`id(`duration), `ValidChars, "0123456789"); |
|
Lines 303-308
Link Here
|
| 303 |
any ret = nil; |
316 |
any ret = nil; |
| 304 |
string user = ""; |
317 |
string user = ""; |
| 305 |
string sval = ""; |
318 |
string sval = ""; |
|
|
319 |
any aval = nil; |
| 306 |
|
320 |
|
| 307 |
while(true) { |
321 |
while(true) { |
| 308 |
ret = UI::UserInput(); |
322 |
ret = UI::UserInput(); |
|
Lines 339-352
Link Here
|
| 339 |
/* Duration "" is OK, default value */ |
353 |
/* Duration "" is OK, default value */ |
| 340 |
uc = add(uc, "record_length", sval); |
354 |
uc = add(uc, "record_length", sval); |
| 341 |
|
355 |
|
| 342 |
sval = (string) UI::QueryWidget(`id(`action), `Value); |
356 |
aval = UI::QueryWidget(`id(`action), `Value); |
| 343 |
if(sval == nil || sval == "") { |
357 |
if(aval == nil) { |
| 344 |
/* Popup::Error text */ |
358 |
/* Popup::Error text */ |
| 345 |
Popup::Error(_("Action is invalid.")); |
359 |
Popup::Error(_("Action is invalid.")); |
| 346 |
UI::SetFocus(`id(`action)); |
360 |
UI::SetFocus(`id(`action)); |
| 347 |
continue; |
361 |
continue; |
| 348 |
} |
362 |
} else if (aval == `MailAndSave) |
| 349 |
uc = add(uc, "voice_action", sval); |
363 |
uc = add(uc, "voice_action", "MailAndSave"); |
|
|
364 |
else if (aval == `SaveOnly) |
| 365 |
uc = add(uc, "voice_action", "SaveOnly"); |
| 350 |
|
366 |
|
| 351 |
sval = (string) UI::QueryWidget(`id(`pin), `Value); |
367 |
sval = (string) UI::QueryWidget(`id(`pin), `Value); |
| 352 |
/* Pin "" is OK, no remote control */ |
368 |
/* Pin "" is OK, no remote control */ |