Rev 316 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 316 | Rev 531 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | 10 | ||
11 | 11 | ||
Line 12... | Line -... | ||
12 | import javax.microedition.lcdui.*; |
- | |
- | 12 | import javax.microedition.lcdui.*; |
|
Line 13... | Line 13... | ||
13 | import javax.microedition.midlet.*; |
13 | import javax.microedition.midlet.*; |
14 | 14 | ||
15 | import javax.microedition.rms.*; |
15 | |
16 | 16 | ||
17 | public class DUBwiseInstaller |
- | |
18 | extends MIDlet |
- | |
19 | implements Runnable,CommandListener |
- | |
Line 20... | Line 17... | ||
20 | { |
17 | public class DUBwiseInstaller |
- | 18 | extends MIDlet |
|
Line -... | Line 19... | ||
- | 19 | implements Runnable,CommandListener |
|
- | 20 | { |
|
- | 21 | ||
- | 22 | ||
- | 23 | public String[] installmethod_strings={"online Install","show Filename"};//,"email URL"}; |
|
Line 21... | Line 24... | ||
21 | public Display display; |
24 | public String[] installoption_strings={"default","full featured","minimal","custom","expert"}; |
22 | public DUBwiseInstallerCanvas canvas; |
25 | |
Line -... | Line 26... | ||
- | 26 | public final static byte INSTALLOPTIONID_DEFAULT=0; |
|
23 | public boolean loaded=false; |
27 | public final static byte INSTALLOPTIONID_FULL=1; |
- | 28 | public final static byte INSTALLOPTIONID_MINIMAL=2; |
|
Line 24... | Line -... | ||
24 | - | ||
25 | 29 | public final static byte INSTALLOPTIONID_CUSTOM=3; |
|
26 | String browser_dest=""; |
- | |
Line 27... | Line -... | ||
27 | - | ||
Line 28... | Line -... | ||
28 | - | ||
29 | public int[][] res_vals = { {480,640},{340,400},{240,320},{200,300},{176,220},{128,128} }; |
30 | public final static byte INSTALLOPTIONID_EXPERT=4; |
Line 30... | Line -... | ||
30 | public String[] res_strings; |
- | |
31 | - | ||
32 | public String[] feature_strings={"Bluetooth","Location API","File Connection","Device Control","Fullscreen","cldc11"}; |
- | |
33 | - | ||
34 | public String[] sound_strings={"en_speedy","en_wav","de_tts","de_wav","de_64kbit_tts","wav","no_voice"}; |
- | |
Line 35... | Line 31... | ||
35 | public String[] firmware_strings={"No Firmwars","All Firmwares","FC&MK3MAF Firmwares"}; |
31 | |
36 | public String[] firmware_clean_strings={"no_firmwares","all_firmwares","fc_mk3mag_firmwares"}; |
32 | public final static byte INSTALLMETHODID_ONLINE=0; |
Line 37... | Line 33... | ||
37 | 33 | public final static byte INSTALLMETHODID_SHOWURL=1; |
|
Line 38... | Line -... | ||
38 | public String[] installmethod_strings={"online Install","show Filename"};//,"email URL"}; |
- | |
39 | 34 | ||
40 | public String[] installsrc_strings={"stable (latest tag)","Bleeding Edge (trunk)"}; |
35 | public Display display; |
- | 36 | public DUBwiseInstallerCanvas canvas; |
|
- | 37 | private DUBwiseProps props; |
|
41 | public String[] installsrc_clean_strings={"tags","trunk"}; |
38 | |
42 | 39 | public boolean app_running=false; // to prevent 2 instances |
|
- | 40 | ||
- | 41 | ||
43 | public int res_select=-1; |
42 | String browser_dest=""; |
Line -... | Line 43... | ||
- | 43 | ||
- | 44 | ||
- | 45 | String helper_url=null; |
|
- | 46 | String download_url=null; |
|
- | 47 | ||
- | 48 | boolean http_possible; |
|
- | 49 | ||
- | 50 | ||
- | 51 | Form installoptions_form; |
|
- | 52 | Form install_form; |
|
Line 44... | Line 53... | ||
44 | public int sound_select=0; |
53 | |
45 | public int firmware_select=0; |
54 | |
46 | public int installsrc_select=0; |
55 | ChoiceGroup installmethod_choice; |
Line 47... | Line 56... | ||
47 | 56 | ChoiceGroup installoption_choice; |
|
48 | 57 | ||
49 | String helper_url=null; |
58 | ChoiceGroup sound_choice; |
Line 50... | Line 59... | ||
50 | String download_url=null; |
59 | ChoiceGroup firmware_choice; |
51 | 60 | ||
52 | boolean http_possible; |
61 | ChoiceGroup optional_features_choice; |
Line 53... | Line -... | ||
53 | - | ||
54 | - | ||
55 | ChoiceGroup res_choice; |
- | |
56 | ChoiceGroup features_choice; |
- | |
57 | ChoiceGroup sound_choice; |
- | |
58 | ChoiceGroup installmethod_choice; |
- | |
59 | ChoiceGroup installsrc_choice; |
- | |
60 | ChoiceGroup firmware_choice; |
- | |
61 | - | ||
62 | - | ||
63 | protected void startApp() |
- | |
64 | throws MIDletStateChangeException |
- | |
65 | { |
- | |
66 | - | ||
67 | if (loaded)return; |
- | |
68 | display = Display.getDisplay(this); |
- | |
69 | canvas=new DUBwiseInstallerCanvas(this); |
- | |
70 | - | ||
71 | // fire up canvas |
- | |
72 | display.setCurrent(canvas); |
- | |
73 | } |
- | |
74 | - | ||
75 | - | ||
76 | public String installsrc_str() |
- | |
77 | { |
- | |
78 | return installsrc_clean_strings[installsrc_select]; |
- | |
79 | } |
- | |
80 | - | ||
81 | public String cldc_str() |
- | |
82 | { |
- | |
83 | if (canvas.cldc11) |
- | |
84 | return "-CLDC11"; |
- | |
85 | else |
- | |
86 | return ""; |
- | |
87 | } |
- | |
88 | - | ||
89 | public String bt_str() |
- | |
90 | { |
- | |
91 | if (canvas.bluetooth) |
- | |
92 | return "-BluetoothAPI"; |
- | |
93 | else |
- | |
94 | return ""; |
- | |
95 | } |
- | |
96 | - | ||
97 | public String fileapi_str() |
- | |
98 | { |
- | |
99 | if (canvas.fileapi) |
- | |
Line 100... | Line 62... | ||
100 | return "-FileAPI"; |
62 | |
101 | else |
63 | |
102 | return ""; |
64 | Form expert_form; |
103 | } |
- | |
104 | - | ||
105 | - | ||
106 | public String firmware_str() |
- | |
107 | { |
- | |
108 | return firmware_clean_strings[firmware_select]; |
65 | |
Line 109... | Line 66... | ||
109 | } |
66 | ChoiceGroup res_choice; |
110 | 67 | ChoiceGroup device_features_choice; |
|
111 | public String devicecontrol_str() |
68 | ChoiceGroup installsrc_choice; |
112 | { |
69 | |
113 | if (canvas.devicecontrol) |
- | |
114 | return "-DeviceControl"; |
70 | |
115 | else |
- | |
116 | return ""; |
- | |
117 | } |
- | |
118 | - | ||
119 | public String sound_str() |
- | |
120 | { |
- | |
121 | return sound_strings[sound_select]; |
- | |
122 | } |
- | |
123 | - | ||
124 | - | ||
125 | public String getURL() |
- | |
126 | { |
- | |
127 | return download_url+installsrc_str()+"/"+getFileName(); |
71 | |
128 | } |
72 | protected void startApp() |
129 | - | ||
130 | public String getFileName() |
73 | throws MIDletStateChangeException |
131 | { |
- | |
132 | return "DUBwise-"+res_str()+"-" + sound_str() + "-" + firmware_str() + cldc_str() + fileapi_str() + bt_str() + devicecontrol_str() +".jad"; |
74 | { |
133 | } |
- | |
134 | - | ||
135 | public boolean url_check() |
75 | |
Line 136... | Line 76... | ||
136 | { |
76 | if (app_running)return; |
137 | return (!InstallHelper.get_http_string(getURL()).equals("err")); |
77 | display = Display.getDisplay(this); |
Line 138... | Line 78... | ||
138 | } |
78 | canvas=new DUBwiseInstallerCanvas(this); |
Line 139... | Line 79... | ||
139 | 79 | ||
140 | public String res_str() |
80 | // fire up canvas |
141 | { |
81 | display.setCurrent(canvas); |
142 | try |
82 | } |
143 | { |
83 | |
144 | return res_strings[res_select]; |
84 | |
Line 145... | Line 85... | ||
145 | } |
85 | |
Line 146... | Line 86... | ||
146 | catch(Exception e) |
86 | |
Line 147... | Line -... | ||
147 | { |
- | |
148 | return res_strings[0]; |
- | |
Line 149... | Line -... | ||
149 | } |
- | |
150 | } |
- | |
151 | - | ||
152 | - | ||
153 | public void run() |
- | |
154 | { |
- | |
155 | - | ||
156 | helper_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/helper_url") ; |
- | |
157 | - | ||
158 | http_possible=((!helper_url.equals("err"))); |
- | |
159 | - | ||
160 | - | ||
161 | download_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/download_url") ; |
- | |
162 | - | ||
163 | if ((download_url==null) || (!download_url.startsWith("http"))) |
- | |
164 | download_url=helper_url+"dl/"; |
- | |
165 | - | ||
166 | if (http_possible) System.out.println(InstallHelper.get_http_string(helper_url+"mail?subject=DUBwiseInstall&text="+InstallHelper.urlEncode( description_str() + "\nDownload OK:" + url_check()+"\n" ))); |
- | |
167 | - | ||
168 | try |
- | |
169 | { |
- | |
170 | Thread.sleep(500); |
- | |
171 | platformRequest(getURL()); |
- | |
172 | } |
- | |
173 | catch ( Exception e) {} |
- | |
Line 174... | Line -... | ||
174 | - | ||
Line -... | Line 87... | ||
- | 87 | public String getURL() |
|
- | 88 | { |
|
Line 175... | Line 89... | ||
175 | notifyDestroyed(); |
89 | return download_url+props.installsrc_str()+"/"+props.getFileName(); |
- | 90 | } |
|
Line 176... | Line -... | ||
176 | - | ||
177 | } |
- | |
178 | - | ||
179 | - | ||
180 | public String description_str() |
- | |
181 | { |
- | |
182 | - | ||
183 | int rms_avail=0; |
- | |
184 | try { |
- | |
185 | RecordStore recStore = RecordStore.openRecordStore("test", true ); |
- | |
186 | rms_avail=recStore.getSizeAvailable(); |
- | |
187 | } |
- | |
188 | catch ( Exception e) {} |
- | |
189 | System.gc(); |
- | |
Line 190... | Line 91... | ||
190 | return |
91 | |
- | 92 | public boolean url_check() |
|
191 | "Screenwidth:" + canvas.canvas_width + "\n" |
93 | { |
192 | +"Screenheight:" + canvas.canvas_height + "\n" |
- | |
- | 94 | return (InstallHelper.get_http_string(getURL()).startsWith("MIDlet-Jar-URL:")); |
|
193 | +"Screenwidth FS:" + canvas.canvas_full_width + "\n" |
95 | } |
Line 194... | Line -... | ||
194 | +"Screenheight FS:" + canvas.canvas_full_height + "\n" |
- | |
195 | +"CLDC1.1:" + canvas.cldc11 + "\n" |
- | |
196 | +"JSR-82:" + canvas.bluetooth + "\n" |
- | |
Line 197... | Line -... | ||
197 | +"JSR-179:" + canvas.locationprovider + "\n" |
- | |
198 | +"FileConn:" + canvas.fileapi + "\n" |
- | |
199 | +"SensorAPI:" + canvas.sensorapi + "\n" |
- | |
200 | +"DeviceControl:" + canvas.devicecontrol + "\n" |
96 | // fire up browser for online install |
201 | +"comports:" + canvas.comports + "\n" |
- | |
Line 202... | Line 97... | ||
202 | 97 | public void run() |
|
203 | +"freeMemory:" + Runtime.getRuntime().freeMemory()+ "\n" |
98 | { |
- | 99 | helper_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/helper_url") ; |
|
Line 204... | Line -... | ||
204 | +"totalMemory:" + Runtime.getRuntime().totalMemory()+ "\n" |
- | |
205 | +"RMSAvail:" + rms_avail+ "\n" |
- | |
206 | +"Download URL:" + getURL() + "\n" |
- | |
207 | +canvas.props; |
- | |
208 | - | ||
Line 209... | Line 100... | ||
209 | } |
100 | http_possible=((!helper_url.equals("err"))); |
Line 210... | Line 101... | ||
210 | 101 | download_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/installer_meta/dl_url") ; |
|
211 | 102 | ||
212 | 103 | if ((download_url==null) || (!download_url.startsWith("http"))) |
|
213 | public void quit() { |
104 | download_url=helper_url+"dl/"; |
214 | 105 | ||
Line 215... | Line 106... | ||
215 | try |
106 | if (http_possible) System.out.println(InstallHelper.get_http_string(helper_url+"mail?subject=DUBwiseInstall&text="+InstallHelper.urlEncode( "Installer Version: 0.8 \nDownload URL:" + getURL() + "\nDownload OK:" + url_check()+ "\nInstall Options:" + installoption_strings[installoption_choice.getSelectedIndex()] + "\n\n------Device Infos---\n" + canvas.description_str() +"\n" ))); |
216 | { |
107 | |
Line 217... | Line 108... | ||
217 | res_strings=new String[res_vals.length]; |
108 | try |
218 | for (int i=0;i<res_vals.length;i++) |
109 | { |
219 | { |
110 | Thread.sleep(500); |
220 | if ((canvas.canvas_width>=res_vals[i][0])&&(res_select==-1)) |
111 | platformRequest(getURL()); |
- | 112 | } |
|
- | 113 | catch ( Exception e) {} |
|
- | 114 | ||
- | 115 | notifyDestroyed(); //quit |
|
- | 116 | ||
- | 117 | } |
|
- | 118 | ||
- | 119 | ||
- | 120 | ||
- | 121 | ||
- | 122 | ||
- | 123 | ||
- | 124 | public void canvas_hw_detect_finish() |
|
- | 125 | { |
|
- | 126 | ||
- | 127 | props=new DUBwiseProps(); |
|
- | 128 | props.set_res_by_screensize(canvas.canvas_width,canvas.canvas_height); |
|
- | 129 | ||
- | 130 | ||
- | 131 | props.bluetooth=canvas.bluetooth; |
|
- | 132 | props.locationprovider=canvas.locationprovider; |
|
- | 133 | props.fileapi=canvas.fileapi; |
|
- | 134 | props.devicecontrol=canvas.devicecontrol; |
|
- | 135 | props.cldc11=canvas.cldc11; |
|
- | 136 | ||
- | 137 | ||
- | 138 | ||
221 | res_select=i; |
139 | // create forms |
Line 222... | Line -... | ||
222 | res_strings[i]=res_vals[i][0]+"x"+res_vals[i][1]; |
- | |
223 | } |
- | |
224 | } |
- | |
225 | catch(Exception e) |
- | |
226 | { |
- | |
227 | res_strings=new String[0]; |
- | |
228 | } |
- | |
Line -... | Line 140... | ||
- | 140 | ||
- | 141 | install_form = new Form("Install DUBwise"); |
|
- | 142 | installoptions_form=new Form("Install Options"); |
|
- | 143 | expert_form=new Form("Expert Settings"); |
|
- | 144 | ||
- | 145 | ||
- | 146 | // create widgets |
|
- | 147 | ||
- | 148 | res_choice = new ChoiceGroup( |
|
- | 149 | "Resolution (Detected " +canvas.canvas_full_width + "x"+ canvas.canvas_full_height+")", |
|
- | 150 | Choice.EXCLUSIVE, |
|
- | 151 | props.res_strings, |
|
- | 152 | null); |
|
- | 153 | ||
- | 154 | res_choice.setSelectedIndex(props.res_select,true); |
|
- | 155 | expert_form.append(res_choice); |
|
- | 156 | ||
- | 157 | ||
- | 158 | device_features_choice = new ChoiceGroup( |
|
- | 159 | "Features ", |
|
- | 160 | Choice.MULTIPLE, |
|
- | 161 | props.feature_strings, |
|
- | 162 | null); |
|
- | 163 | ||
Line 229... | Line 164... | ||
229 | 164 | ||
230 | if (res_select==-1) res_select=0; |
165 | device_features_choice.setSelectedIndex(0,props.bluetooth); |
231 | show_edit_form(); |
166 | device_features_choice.setSelectedIndex(1,props.locationprovider); |
232 | 167 | device_features_choice.setSelectedIndex(2,props.fileapi); |
|
233 | } |
168 | device_features_choice.setSelectedIndex(3,props.devicecontrol); |
Line 234... | Line 169... | ||
234 | 169 | device_features_choice.setSelectedIndex(4,props.cldc11); |
|
235 | - | ||
- | 170 | ||
Line 236... | Line 171... | ||
236 | public void show_edit_form() |
171 | expert_form.append(device_features_choice); |
237 | { |
172 | |
238 | Form form = new Form("Install DUBwise"); |
173 | |
239 | 174 | ||
240 | installsrc_choice = new ChoiceGroup( |
175 | |
Line 241... | Line 176... | ||
241 | "Install Source", |
176 | |
- | 177 | System.out.println("install build"); |
|
- | 178 | /* Install form */ |
|
- | 179 | ||
- | 180 | ||
- | 181 | ||
- | 182 | ||
- | 183 | ||
- | 184 | ||
- | 185 | optional_features_choice = new ChoiceGroup( |
|
- | 186 | "Optional Features ", |
|
- | 187 | Choice.MULTIPLE, |
|
242 | Choice.EXCLUSIVE, |
188 | props.optional_feature_strings, |
- | 189 | null); |
|
Line 243... | Line 190... | ||
243 | installsrc_strings, |
190 | |
244 | null); |
191 | |
Line 245... | Line 192... | ||
245 | 192 | ||
246 | installsrc_choice.setSelectedIndex(installsrc_select,true); |
193 | // |
247 | form.append(installsrc_choice); |
- | |
Line -... | Line 194... | ||
- | 194 | ||
- | 195 | installmethod_choice = new ChoiceGroup( |
|
- | 196 | "Install Method", |
|
- | 197 | Choice.EXCLUSIVE, |
|
- | 198 | installmethod_strings, |
|
- | 199 | null); |
|
- | 200 | ||
- | 201 | ||
- | 202 | ||
- | 203 | installoption_choice = new ChoiceGroup ( |
|
- | 204 | "Install Options", |
|
- | 205 | Choice.EXCLUSIVE, |
|
- | 206 | installoption_strings, |
|
- | 207 | null); |
|
- | 208 | ||
- | 209 | ||
- | 210 | /* device_features_choice = new ChoiceGroup( |
|
- | 211 | "Features ", |
|
- | 212 | Choice.MULTIPLE, |
|
- | 213 | feature_strings, |
|
248 | 214 | null); |
|
Line -... | Line 215... | ||
- | 215 | ||
249 | installmethod_choice = new ChoiceGroup( |
216 | */ |
250 | "Install Method", |
217 | |
Line 251... | Line 218... | ||
251 | Choice.EXCLUSIVE, |
218 | |
252 | installmethod_strings, |
219 | firmware_choice = new ChoiceGroup( |
253 | null); |
220 | "Firmwares:", |
254 | 221 | Choice.EXCLUSIVE, |
|
255 | form.append(installmethod_choice); |
222 | props.firmware_strings, |
- | 223 | null); |
|
256 | 224 | ||
257 | res_choice = new ChoiceGroup( |
225 | firmware_choice.setSelectedIndex(props.firmware_select,true); |
258 | "Resolution (Real " +canvas.canvas_full_width + "x"+ canvas.canvas_full_height+")", |
226 | |
Line 259... | Line 227... | ||
259 | Choice.EXCLUSIVE, |
227 | |
260 | res_strings, |
228 | |
261 | null); |
- | |
262 | - | ||
263 | res_choice.setSelectedIndex(res_select,true); |
- | |
264 | form.append(res_choice); |
- | |
265 | - | ||
266 | - | ||
267 | features_choice = new ChoiceGroup( |
- | |
268 | "Features ", |
- | |
269 | Choice.MULTIPLE, |
- | |
270 | feature_strings, |
- | |
271 | null); |
- | |
Line -... | Line 229... | ||
- | 229 | sound_choice = new ChoiceGroup( |
|
- | 230 | "Sound ", |
|
- | 231 | Choice.EXCLUSIVE, |
|
- | 232 | props.sound_strings, |
|
- | 233 | null); |
|
- | 234 | ||
- | 235 | sound_choice.setSelectedIndex(props.sound_select,true); |
|
- | 236 | ||
- | 237 | ||
- | 238 | ||
- | 239 | ||
Line -... | Line 240... | ||
- | 240 | install_form.append(installmethod_choice); |
|
Line 272... | Line 241... | ||
272 | 241 | install_form.append(installoption_choice); |
|
273 | 242 | ||
- | 243 | installoptions_form.append(optional_features_choice); |
|
274 | features_choice.setSelectedIndex(0,canvas.bluetooth); |
244 | installoptions_form.append(firmware_choice); |
275 | features_choice.setSelectedIndex(1,canvas.locationprovider); |
245 | |
276 | features_choice.setSelectedIndex(2,canvas.fileapi); |
246 | |
277 | features_choice.setSelectedIndex(3,canvas.devicecontrol); |
247 | installoptions_form.append(sound_choice); |
Line 278... | Line 248... | ||
278 | features_choice.setSelectedIndex(4,canvas.fullscreen); |
248 | |
- | 249 | ||
279 | features_choice.setSelectedIndex(5,canvas.cldc11); |
250 | expert_form.addCommand(new Command("OK", Command.OK, 1)); |
280 | form.append(features_choice); |
251 | expert_form.addCommand(new Command("Back", Command.BACK, 2)); |
281 | 252 | ||
Line 282... | Line 253... | ||
282 | 253 | installoptions_form.addCommand(new Command("OK", Command.OK, 1)); |
|
Line 283... | Line 254... | ||
283 | 254 | installoptions_form.addCommand(new Command("Back", Command.BACK, 2)); |
|
284 | firmware_choice = new ChoiceGroup( |
255 | |
- | 256 | ||
- | 257 | install_form.addCommand(new Command("OK", Command.OK, 1)); |
|
Line 285... | Line 258... | ||
285 | "Firmwares:", |
258 | install_form.addCommand(new Command("Exit", Command.EXIT, 2)); |
- | 259 | ||
- | 260 | // set this class as the command listener |
|
- | 261 | installoptions_form.setCommandListener(this); |
|
- | 262 | install_form.setCommandListener(this); |
|
- | 263 | expert_form.setCommandListener(this); |
|
- | 264 | ||
- | 265 | ||
- | 266 | if (!canvas.bluetooth) |
|
- | 267 | { |
|
- | 268 | ||
- | 269 | Alert myAlert = new Alert("Warning", "The Bluetooth API (JSR-82) on your Phone was not found. Without this API DUBwise is not very usefull for most users ( You can only connect via TCP/IP or Serial port ). \n If you have a Windows Mobile Phone this issue can be solved by using DUBwise with a diffrent JRE ( PhoneME or J9 ).\n There is Information in the Internet to show you how to do that - just use your preferred search engine.", null, AlertType.ERROR); |
|
- | 270 | ||
- | 271 | myAlert.setTimeout(Alert.FOREVER); |
|
- | 272 | ||
- | 273 | display.setCurrent( myAlert,install_form ); |
|
- | 274 | } |
|
286 | Choice.EXCLUSIVE, |
275 | else |
287 | firmware_strings, |
276 | display.setCurrent( install_form ); |
288 | null); |
277 | } |
- | 278 | ||
- | 279 | ||
- | 280 | public void show_url_form() |
|
- | 281 | { |
|
- | 282 | ||
- | 283 | Form url_form = new Form("FileName"); |
|
- | 284 | TextField txtField = new TextField( |
|
289 | 285 | "FileName", props.getFileName() , 250, TextField.ANY); |
|
- | 286 | url_form.append(txtField); |
|
- | 287 | url_form.setCommandListener(this); |
|
- | 288 | url_form.addCommand(new Command("Exit", Command.EXIT, 1)); |
|
- | 289 | url_form.addCommand(new Command("Back", Command.BACK, 2)); |
|
- | 290 | display.setCurrent(url_form); |
|
- | 291 | } |
|
- | 292 | ||
- | 293 | public void process_edit_form() |
|
- | 294 | { |
|
290 | firmware_choice.setSelectedIndex(firmware_select,true); |
295 | |
- | 296 | // copy form to props |
|
291 | form.append(firmware_choice); |
297 | props.res_select=res_choice.getSelectedIndex(); |
- | 298 | props.firmware_select=firmware_choice.getSelectedIndex(); |
|
- | 299 | props.sound_select=sound_choice.getSelectedIndex(); |
|
- | 300 | // installsrc_select= installsrc_choice.getSelectedIndex(); |
|
- | 301 | ||
- | 302 | props.bluetooth= device_features_choice.isSelected(0); |
|
- | 303 | props.locationprovider=device_features_choice.isSelected(1); |
|
- | 304 | props.fileapi= device_features_choice.isSelected(2); |
|
- | 305 | props.devicecontrol= device_features_choice.isSelected(3); |
|
292 | 306 | props.cldc11 = device_features_choice.isSelected(4); |
|
- | 307 | ||
- | 308 | props.j2memaps = optional_features_choice.isSelected(0); |
|
- | 309 | ||
- | 310 | switch (installmethod_choice.getSelectedIndex()) |
|
- | 311 | { |
|
- | 312 | ||
- | 313 | case INSTALLMETHODID_ONLINE: |
|
293 | 314 | // online Install -> fire up browser |
|
- | 315 | new Thread(this).start(); |
|
- | 316 | break; |
|
- | 317 | ||
- | 318 | case INSTALLMETHODID_SHOWURL: |
|
- | 319 | // show URL -> fire up browser |
|
- | 320 | show_url_form(); |
|
- | 321 | break; |
|
- | 322 | } |
|
- | 323 | ||
- | 324 | ||
- | 325 | } |
|
- | 326 | ||
Line -... | Line 327... | ||
- | 327 | public void commandAction( Command cmd, Displayable dis) |
|
- | 328 | { |
|
- | 329 | switch(cmd.getCommandType()) |
|
- | 330 | { |
|
- | 331 | ||
- | 332 | case Command.BACK: |
|
- | 333 | if(dis==expert_form) |
|
- | 334 | display.setCurrent(installoptions_form); |
|
- | 335 | else |
|
Line 294... | Line 336... | ||
294 | sound_choice = new ChoiceGroup( |
336 | switch(installoption_choice.getSelectedIndex()) |
295 | "Sound ", |
337 | { |