|
Lines 14-92
Link Here
|
| 14 |
* @return symbol |
14 |
* @return symbol |
| 15 |
*/ |
15 |
*/ |
| 16 |
define symbol LanguageDialog() { |
16 |
define symbol LanguageDialog() { |
| 17 |
import "Language"; |
17 |
return (symbol) |
| 18 |
string language = AutoinstGeneral::language; |
18 |
WFM::CallFunction( "language_auto", [ GetInstArgs::Buttons(true,true) ] ); |
| 19 |
|
|
|
| 20 |
boolean use_utf8 = true; // utf8 is default |
| 21 |
|
| 22 |
map ui = UI::GetDisplayInfo(); |
| 23 |
if (!ui["HasFullUtf8Support"]:true) |
| 24 |
{ |
| 25 |
use_utf8 = false; // fallback to ascii |
| 26 |
} |
| 27 |
|
| 28 |
if (language=="") |
| 29 |
{ |
| 30 |
language = Language::language; |
| 31 |
} |
| 32 |
map<string, list> languageselsort = mapmap(string lang_code, list lang_info, Language::Selection(), |
| 33 |
``{ |
| 34 |
string a = lang_info[1]:"xxx"; |
| 35 |
return( |
| 36 |
$[ a: [lang_info[use_utf8?0:1]:"", lang_code] ]); |
| 37 |
}); |
| 38 |
|
| 39 |
term languagesel = |
| 40 |
`SelectionBox(`id(`language), "", |
| 41 |
maplist (string name, list codelist, languageselsort, |
| 42 |
``( |
| 43 |
`item(`id(codelist[1]:""), codelist[0]:"", |
| 44 |
(language == codelist[1]:"") |
| 45 |
) |
| 46 |
) |
| 47 |
) |
| 48 |
); |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
term contents = `VBox( |
| 53 |
|
| 54 |
`HBox( |
| 55 |
`HWeight( 25, `HStretch() ), |
| 56 |
`HWeight( 50, |
| 57 |
`VBox ( |
| 58 |
`Left( `Label ( _("Select your language:") ) ), |
| 59 |
languagesel |
| 60 |
) |
| 61 |
), |
| 62 |
`HWeight( 25, `HStretch() ) |
| 63 |
), |
| 64 |
`VSpacing(2) |
| 65 |
); |
| 66 |
string help_text = _("<p> |
| 67 |
Choose the new <b>language</b> for your &product; system. |
| 68 |
</p>\n"); |
| 69 |
|
| 70 |
|
| 71 |
Wizard::SetContents( _("Language selection"), contents, help_text, true, true); |
| 72 |
// Get the user input. |
| 73 |
// |
| 74 |
|
| 75 |
Wizard::HideAbortButton(); |
| 76 |
symbol ret = `none; |
| 77 |
|
| 78 |
UI::SetFocus(`id(`language)); |
| 79 |
|
| 80 |
repeat |
| 81 |
{ |
| 82 |
ret = (symbol)Wizard::UserInput(); |
| 83 |
if ( ret == `next || ret == `language ) |
| 84 |
{ |
| 85 |
AutoinstGeneral::language = (string) UI::QueryWidget(`id(`language), `CurrentItem); |
| 86 |
} |
| 87 |
} |
| 88 |
until ( ret == `next || ret == `back || ret == `abort ); |
| 89 |
return ret; |
| 90 |
} |
19 |
} |
| 91 |
|
20 |
|
| 92 |
/** |
21 |
/** |
|
Lines 94-105
Link Here
|
| 94 |
* @return symbol |
23 |
* @return symbol |
| 95 |
*/ |
24 |
*/ |
| 96 |
define symbol KeyboardDialog() ``{ |
25 |
define symbol KeyboardDialog() ``{ |
| 97 |
|
26 |
return (symbol) |
| 98 |
// create the wizard dialog |
27 |
WFM::CallFunction( "keyboard_auto", [ GetInstArgs::Buttons(true,true) ] ); |
| 99 |
// |
|
|
| 100 |
Wizard::CreateDialog(); |
| 101 |
symbol result = (symbol)WFM::CallFunction( "inst_keyboard", [ GetInstArgs::Buttons(true,true) ] ); |
| 102 |
return result; |
| 103 |
} |
28 |
} |
| 104 |
|
29 |
|
| 105 |
|
30 |
|
|
Lines 108-134
Link Here
|
| 108 |
* @return symbol |
33 |
* @return symbol |
| 109 |
*/ |
34 |
*/ |
| 110 |
define symbol TimezoneDialog() ``{ |
35 |
define symbol TimezoneDialog() ``{ |
| 111 |
import "Timezone"; |
36 |
return (symbol) |
| 112 |
|
37 |
WFM::CallFunction( "timezone_auto", [ GetInstArgs::Buttons(true,true) ]); |
| 113 |
string tz = AutoinstGeneral::Clock["timezone"]:""; |
|
|
| 114 |
if ( tz == "") |
| 115 |
{ |
| 116 |
import "Misc"; |
| 117 |
tz = Misc::SysconfigRead(.sysconfig.clock.TIMEZONE, "" ); |
| 118 |
|
| 119 |
if ( tz == "") |
| 120 |
{ |
| 121 |
tz = Timezone::GetTimezoneForLanguage(AutoinstGeneral::language, "en_US"); |
| 122 |
} |
| 123 |
AutoinstGeneral::Clock["timezone"] = tz; |
| 124 |
} |
| 125 |
|
| 126 |
// create the wizard dialog |
| 127 |
// |
| 128 |
Wizard::CreateDialog(); |
| 129 |
any result = WFM::CallFunction( "inst_timezone", [ GetInstArgs::Buttons(true,true) ]); |
| 130 |
Wizard::CloseDialog(); |
| 131 |
return (symbol)result; |
| 132 |
} |
38 |
} |
| 133 |
|
39 |
|
| 134 |
|
40 |
|