View | Details | Raw Unified | Return to bug 145513
Collapse All | Expand All

(-)YaST2.org/include/phone-services/answering_machine.ycp (-9 / +25 lines)
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 */
(-)YaST2.org/include/phone-services/fax.ycp (-9 / +25 lines)
Lines 18-23 Link Here
18
import "Label";
18
import "Label";
19
import "Popup";
19
import "Popup";
20
20
21
map<string,string> actionmap = $[
22
				"MailAndSave" : _("MailAndSaveYY"),
23
				"SaveOnly"    : _("SaveOnlyXX")
24
				];
25
26
21
define map Fax_UserEditDialog(string uname, map uconf);
27
define map Fax_UserEditDialog(string uname, map uconf);
22
28
23
/**
29
/**
Lines 108-114 Link Here
108
	    k,
114
	    k,
109
	    m["fax_numbers"]:"",
115
	    m["fax_numbers"]:"",
110
	    m["outgoing_MSN"]:"",
116
	    m["outgoing_MSN"]:"",
111
	    m["fax_action"]:"",
117
	    actionmap[m["fax_action"]:""]:"",
112
	    m["fax_stationID"]:"",
118
	    m["fax_stationID"]:"",
113
	    m["fax_headline"]:"");
119
	    m["fax_headline"]:"");
114
	table_items = add(table_items, item);
120
	table_items = add(table_items, item);
Lines 238-244 Link Here
238
		    k,
244
		    k,
239
		    m["fax_numbers"]:"",
245
		    m["fax_numbers"]:"",
240
		    m["outgoing_MSN"]:"",
246
		    m["outgoing_MSN"]:"",
241
		    m["fax_action"]:"",
247
		    actionmap[m["fax_action"]:""]:"",
242
		    m["fax_stationID"]:"",
248
		    m["fax_stationID"]:"",
243
		    m["fax_headline"]:"");
249
		    m["fax_headline"]:"");
244
		table_items = add(table_items, item);
250
		table_items = add(table_items, item);
Lines 290-296 Link Here
290
    }
296
    }
291
297
292
    y2debug("uc=%1", uc);
298
    y2debug("uc=%1", uc);
293
    list actions = [ "MailAndSave", "SaveOnly" ];
294
299
295
    UI::OpenDialog(`opt(`decorated),`HBox(
300
    UI::OpenDialog(`opt(`decorated),`HBox(
296
	`HSpacing(2),
301
	`HSpacing(2),
Lines 311-317 Link Here
311
	    `TextEntry(`id(`headline), _("&Headline"), uc["fax_headline"]:""),
316
	    `TextEntry(`id(`headline), _("&Headline"), uc["fax_headline"]:""),
312
	    `VSpacing(0.5),
317
	    `VSpacing(0.5),
313
	    /* ComboBox label */
318
	    /* ComboBox label */
314
	    `ComboBox(`id(`action), `opt(`hstretch), _("&Action"), actions),
319
	    `ComboBox(`id(`action), `opt(`hstretch), _("&Action"), [
320
			`item(`id(`MailAndSave),actionmap["MailAndSave"]:""),
321
			`item(`id(`SaveOnly),actionmap["SaveOnly"]:"")
322
323
		]),
315
	    `VSpacing(1),
324
	    `VSpacing(1),
316
	    `HBox(
325
	    `HBox(
317
		`PushButton(`id(`ok), `opt(`default), Label::OKButton()),
326
		`PushButton(`id(`ok), `opt(`default), Label::OKButton()),
Lines 326-338 Link Here
326
	UI::ChangeWidget(`id(`user), `Value, uname);
335
	UI::ChangeWidget(`id(`user), `Value, uname);
327
    UI::ChangeWidget(`id(`phone), `ValidChars, "0123456789#*,");
336
    UI::ChangeWidget(`id(`phone), `ValidChars, "0123456789#*,");
328
    UI::ChangeWidget(`id(`station), `ValidChars, "0123456789+ ");
337
    UI::ChangeWidget(`id(`station), `ValidChars, "0123456789+ ");
329
    UI::ChangeWidget(`id(`action), `Value, uc["fax_action"]:"MailAndSave");
338
    if (uc["fax_action"]:"" == "MailAndSave")
339
    	UI::ChangeWidget(`id(`action), `Value, `MailAndSave);
340
    else
341
	UI::ChangeWidget(`id(`action), `Value, `SaveOnly);
342
	
330
    UI::SetFocus(`id(`user));
343
    UI::SetFocus(`id(`user));
331
344
332
    any ret = nil;
345
    any ret = nil;
333
    string user = "";
346
    string user = "";
334
    string sval = "";
347
    string sval = "";
335
    string oval = "";
348
    string oval = "";
349
    any aval = nil;
336
350
337
    while(true) {
351
    while(true) {
338
	ret = UI::UserInput();
352
	ret = UI::UserInput();
Lines 384-397 Link Here
384
	}
398
	}
385
	uc = add(uc, "fax_headline", sval);
399
	uc = add(uc, "fax_headline", sval);
386
400
387
	sval = (string) UI::QueryWidget(`id(`action), `Value);
401
	aval =  UI::QueryWidget(`id(`action), `Value);
388
	if(sval == nil || sval == "") {
402
	if(aval == nil) {
389
	    /* Popup::Error text */
403
	    /* Popup::Error text */
390
	    Popup::Error(_("Action is invalid."));
404
	    Popup::Error(_("Action is invalid."));
391
	    UI::SetFocus(`id(`action));
405
	    UI::SetFocus(`id(`action));
392
	    continue;
406
	    continue;
393
	}
407
	} else if (aval == `MailAndSave)
394
	uc = add(uc, "fax_action", sval);
408
	    uc = add(uc, "fax_action", "MailAndSave");
409
	else if (aval == `SaveOnly)
410
	    uc = add(uc, "fax_action", "SaveOnly");
395
411
396
	break;
412
	break;
397
    }
413
    }

Return to bug 145513