Rev 316 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 316 | Rev 531 | ||
---|---|---|---|
1 | /*********************************************************************** |
1 | /*********************************************************************** |
2 | * |
2 | * |
3 | * DUBwise == Digital UFO Broadcasting with intelligent service equipment |
3 | * DUBwise == Digital UFO Broadcasting with intelligent service equipment |
4 | * main MIDLet Source file |
4 | * main MIDLet Source file |
5 | * |
5 | * |
6 | * Author: Marcus -LiGi- Bueschleb |
6 | * Author: Marcus -LiGi- Bueschleb |
7 | * Mailto: LiGi @at@ LiGi DOTT de |
7 | * Mailto: LiGi @at@ LiGi DOTT de |
8 | * |
8 | * |
9 | ************************************************************************/ |
9 | ************************************************************************/ |
10 | 10 | ||
11 | 11 | ||
12 | import javax.microedition.lcdui.*; |
12 | import javax.microedition.lcdui.*; |
13 | import javax.microedition.midlet.*; |
13 | import javax.microedition.midlet.*; |
14 | - | ||
- | 14 | ||
15 | import javax.microedition.rms.*; |
15 | |
16 | 16 | ||
17 | public class DUBwiseInstaller |
17 | public class DUBwiseInstaller |
18 | extends MIDlet |
18 | extends MIDlet |
19 | implements Runnable,CommandListener |
19 | implements Runnable,CommandListener |
20 | { |
20 | { |
21 | public Display display; |
- | |
22 | public DUBwiseInstallerCanvas canvas; |
- | |
23 | public boolean loaded=false; |
- | |
24 | 21 | ||
- | 22 | ||
- | 23 | public String[] installmethod_strings={"online Install","show Filename"};//,"email URL"}; |
|
- | 24 | public String[] installoption_strings={"default","full featured","minimal","custom","expert"}; |
|
- | 25 | ||
- | 26 | public final static byte INSTALLOPTIONID_DEFAULT=0; |
|
- | 27 | public final static byte INSTALLOPTIONID_FULL=1; |
|
25 | 28 | public final static byte INSTALLOPTIONID_MINIMAL=2; |
|
26 | String browser_dest=""; |
29 | public final static byte INSTALLOPTIONID_CUSTOM=3; |
- | 30 | public final static byte INSTALLOPTIONID_EXPERT=4; |
|
27 | 31 | ||
- | 32 | public final static byte INSTALLMETHODID_ONLINE=0; |
|
28 | - | ||
29 | public int[][] res_vals = { {480,640},{340,400},{240,320},{200,300},{176,220},{128,128} }; |
33 | public final static byte INSTALLMETHODID_SHOWURL=1; |
30 | public String[] res_strings; |
- | |
31 | - | ||
32 | public String[] feature_strings={"Bluetooth","Location API","File Connection","Device Control","Fullscreen","cldc11"}; |
- | |
33 | 34 | ||
34 | public String[] sound_strings={"en_speedy","en_wav","de_tts","de_wav","de_64kbit_tts","wav","no_voice"}; |
- | |
35 | public String[] firmware_strings={"No Firmwars","All Firmwares","FC&MK3MAF Firmwares"}; |
- | |
36 | public String[] firmware_clean_strings={"no_firmwares","all_firmwares","fc_mk3mag_firmwares"}; |
- | |
37 | - | ||
38 | public String[] installmethod_strings={"online Install","show Filename"};//,"email URL"}; |
- | |
39 | 35 | public Display display; |
|
40 | public String[] installsrc_strings={"stable (latest tag)","Bleeding Edge (trunk)"}; |
36 | public DUBwiseInstallerCanvas canvas; |
41 | public String[] installsrc_clean_strings={"tags","trunk"}; |
37 | private DUBwiseProps props; |
42 | 38 | ||
43 | public int res_select=-1; |
39 | public boolean app_running=false; // to prevent 2 instances |
44 | public int sound_select=0; |
40 | |
45 | public int firmware_select=0; |
41 | |
46 | public int installsrc_select=0; |
42 | String browser_dest=""; |
47 | 43 | ||
48 | 44 | ||
49 | String helper_url=null; |
45 | String helper_url=null; |
50 | String download_url=null; |
46 | String download_url=null; |
51 | 47 | ||
52 | boolean http_possible; |
48 | boolean http_possible; |
53 | 49 | ||
54 | - | ||
55 | ChoiceGroup res_choice; |
50 | |
56 | ChoiceGroup features_choice; |
51 | Form installoptions_form; |
- | 52 | Form install_form; |
|
- | 53 | ||
57 | ChoiceGroup sound_choice; |
54 | |
58 | ChoiceGroup installmethod_choice; |
55 | ChoiceGroup installmethod_choice; |
- | 56 | ChoiceGroup installoption_choice; |
|
- | 57 | ||
59 | ChoiceGroup installsrc_choice; |
58 | ChoiceGroup sound_choice; |
- | 59 | ChoiceGroup firmware_choice; |
|
- | 60 | ||
- | 61 | ChoiceGroup optional_features_choice; |
|
- | 62 | ||
- | 63 | ||
- | 64 | Form expert_form; |
|
- | 65 | ||
- | 66 | ChoiceGroup res_choice; |
|
- | 67 | ChoiceGroup device_features_choice; |
|
- | 68 | ChoiceGroup installsrc_choice; |
|
60 | ChoiceGroup firmware_choice; |
69 | |
61 | 70 | ||
62 | 71 | ||
63 | protected void startApp() |
72 | protected void startApp() |
64 | throws MIDletStateChangeException |
73 | throws MIDletStateChangeException |
65 | { |
74 | { |
66 | 75 | ||
67 | if (loaded)return; |
76 | if (app_running)return; |
68 | display = Display.getDisplay(this); |
77 | display = Display.getDisplay(this); |
69 | canvas=new DUBwiseInstallerCanvas(this); |
78 | canvas=new DUBwiseInstallerCanvas(this); |
70 | 79 | ||
71 | // fire up canvas |
80 | // fire up canvas |
72 | display.setCurrent(canvas); |
81 | display.setCurrent(canvas); |
73 | } |
82 | } |
74 | 83 | ||
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) |
- | |
100 | return "-FileAPI"; |
- | |
101 | else |
- | |
102 | return ""; |
- | |
103 | } |
- | |
104 | - | ||
105 | - | ||
106 | public String firmware_str() |
- | |
107 | { |
- | |
108 | return firmware_clean_strings[firmware_select]; |
- | |
109 | } |
- | |
110 | - | ||
111 | public String devicecontrol_str() |
- | |
112 | { |
- | |
113 | if (canvas.devicecontrol) |
- | |
114 | return "-DeviceControl"; |
- | |
115 | else |
- | |
116 | return ""; |
- | |
117 | } |
- | |
118 | - | ||
119 | public String sound_str() |
- | |
120 | { |
- | |
121 | return sound_strings[sound_select]; |
- | |
122 | } |
84 | |
123 | 85 | ||
124 | 86 | ||
125 | public String getURL() |
87 | public String getURL() |
126 | { |
88 | { |
127 | return download_url+installsrc_str()+"/"+getFileName(); |
89 | return download_url+props.installsrc_str()+"/"+props.getFileName(); |
128 | } |
- | |
129 | - | ||
130 | public String getFileName() |
- | |
131 | { |
- | |
132 | return "DUBwise-"+res_str()+"-" + sound_str() + "-" + firmware_str() + cldc_str() + fileapi_str() + bt_str() + devicecontrol_str() +".jad"; |
- | |
133 | } |
90 | } |
134 | 91 | ||
135 | public boolean url_check() |
92 | public boolean url_check() |
136 | { |
93 | { |
137 | return (!InstallHelper.get_http_string(getURL()).equals("err")); |
94 | return (InstallHelper.get_http_string(getURL()).startsWith("MIDlet-Jar-URL:")); |
138 | } |
95 | } |
139 | - | ||
140 | public String res_str() |
96 | // fire up browser for online install |
141 | { |
- | |
142 | try |
- | |
143 | { |
- | |
144 | return res_strings[res_select]; |
- | |
145 | } |
- | |
146 | catch(Exception e) |
- | |
147 | { |
- | |
148 | return res_strings[0]; |
- | |
149 | } |
- | |
150 | } |
- | |
151 | - | ||
152 | - | ||
153 | public void run() |
97 | public void run() |
154 | { |
98 | { |
155 | - | ||
156 | helper_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/helper_url") ; |
99 | 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"))); |
100 | 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") ; |
101 | download_url=InstallHelper.get_http_string("http://mikrocontroller.cco-ev.de/mikrosvn/Projects/DUBwise/trunk/misc/installer_meta/dl_url") ; |
162 | 102 | ||
163 | if ((download_url==null) || (!download_url.startsWith("http"))) |
103 | if ((download_url==null) || (!download_url.startsWith("http"))) |
164 | download_url=helper_url+"dl/"; |
104 | download_url=helper_url+"dl/"; |
165 | 105 | ||
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" ))); |
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" ))); |
167 | 107 | ||
168 | try |
108 | try |
169 | { |
109 | { |
170 | Thread.sleep(500); |
110 | Thread.sleep(500); |
171 | platformRequest(getURL()); |
111 | platformRequest(getURL()); |
172 | } |
112 | } |
173 | catch ( Exception e) {} |
113 | catch ( Exception e) {} |
174 | 114 | ||
175 | notifyDestroyed(); |
115 | notifyDestroyed(); //quit |
176 | 116 | ||
177 | } |
117 | } |
178 | 118 | ||
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(); |
- | |
190 | return |
- | |
191 | "Screenwidth:" + canvas.canvas_width + "\n" |
- | |
192 | +"Screenheight:" + canvas.canvas_height + "\n" |
- | |
193 | +"Screenwidth FS:" + canvas.canvas_full_width + "\n" |
- | |
194 | +"Screenheight FS:" + canvas.canvas_full_height + "\n" |
- | |
195 | +"CLDC1.1:" + canvas.cldc11 + "\n" |
- | |
196 | +"JSR-82:" + canvas.bluetooth + "\n" |
- | |
197 | +"JSR-179:" + canvas.locationprovider + "\n" |
- | |
198 | +"FileConn:" + canvas.fileapi + "\n" |
- | |
199 | +"SensorAPI:" + canvas.sensorapi + "\n" |
- | |
200 | +"DeviceControl:" + canvas.devicecontrol + "\n" |
- | |
201 | +"comports:" + canvas.comports + "\n" |
- | |
202 | - | ||
203 | +"freeMemory:" + Runtime.getRuntime().freeMemory()+ "\n" |
- | |
204 | +"totalMemory:" + Runtime.getRuntime().totalMemory()+ "\n" |
- | |
205 | +"RMSAvail:" + rms_avail+ "\n" |
- | |
206 | +"Download URL:" + getURL() + "\n" |
- | |
- | 119 | ||
- | 120 | ||
207 | +canvas.props; |
121 | |
- | 122 | ||
208 | - | ||
209 | } |
- | |
210 | - | ||
211 | - | ||
212 | - | ||
213 | public void quit() { |
- | |
214 | - | ||
215 | try |
- | |
216 | { |
- | |
217 | res_strings=new String[res_vals.length]; |
- | |
218 | for (int i=0;i<res_vals.length;i++) |
- | |
219 | { |
- | |
220 | if ((canvas.canvas_width>=res_vals[i][0])&&(res_select==-1)) |
- | |
221 | res_select=i; |
- | |
222 | res_strings[i]=res_vals[i][0]+"x"+res_vals[i][1]; |
123 | |
- | 124 | public void canvas_hw_detect_finish() |
|
223 | } |
125 | { |
224 | } |
- | |
- | 126 | ||
225 | catch(Exception e) |
127 | props=new DUBwiseProps(); |
226 | { |
- | |
227 | res_strings=new String[0]; |
- | |
228 | } |
- | |
229 | - | ||
230 | if (res_select==-1) res_select=0; |
- | |
231 | show_edit_form(); |
- | |
232 | 128 | props.set_res_by_screensize(canvas.canvas_width,canvas.canvas_height); |
|
233 | } |
- | |
234 | 129 | ||
235 | 130 | ||
- | 131 | props.bluetooth=canvas.bluetooth; |
|
236 | public void show_edit_form() |
- | |
237 | { |
- | |
238 | Form form = new Form("Install DUBwise"); |
- | |
239 | - | ||
240 | installsrc_choice = new ChoiceGroup( |
- | |
241 | "Install Source", |
132 | props.locationprovider=canvas.locationprovider; |
242 | Choice.EXCLUSIVE, |
133 | props.fileapi=canvas.fileapi; |
243 | installsrc_strings, |
134 | props.devicecontrol=canvas.devicecontrol; |
244 | null); |
135 | props.cldc11=canvas.cldc11; |
245 | 136 | ||
246 | installsrc_choice.setSelectedIndex(installsrc_select,true); |
137 | |
247 | form.append(installsrc_choice); |
138 | |
248 | 139 | // create forms |
|
249 | installmethod_choice = new ChoiceGroup( |
140 | |
250 | "Install Method", |
141 | install_form = new Form("Install DUBwise"); |
251 | Choice.EXCLUSIVE, |
142 | installoptions_form=new Form("Install Options"); |
252 | installmethod_strings, |
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 | ||
- | 164 | ||
- | 165 | device_features_choice.setSelectedIndex(0,props.bluetooth); |
|
- | 166 | device_features_choice.setSelectedIndex(1,props.locationprovider); |
|
- | 167 | device_features_choice.setSelectedIndex(2,props.fileapi); |
|
- | 168 | device_features_choice.setSelectedIndex(3,props.devicecontrol); |
|
- | 169 | device_features_choice.setSelectedIndex(4,props.cldc11); |
|
- | 170 | ||
253 | null); |
171 | expert_form.append(device_features_choice); |
254 | 172 | ||
255 | form.append(installmethod_choice); |
173 | |
256 | 174 | ||
257 | res_choice = new ChoiceGroup( |
175 | |
258 | "Resolution (Real " +canvas.canvas_full_width + "x"+ canvas.canvas_full_height+")", |
176 | |
259 | Choice.EXCLUSIVE, |
177 | System.out.println("install build"); |
260 | res_strings, |
178 | /* Install form */ |
261 | null); |
179 | |
262 | 180 | ||
263 | res_choice.setSelectedIndex(res_select,true); |
181 | |
264 | form.append(res_choice); |
182 | |
265 | 183 | ||
266 | 184 | ||
267 | features_choice = new ChoiceGroup( |
185 | optional_features_choice = new ChoiceGroup( |
268 | "Features ", |
186 | "Optional Features ", |
269 | Choice.MULTIPLE, |
187 | Choice.MULTIPLE, |
270 | feature_strings, |
188 | props.optional_feature_strings, |
271 | null); |
189 | null); |
272 | 190 | ||
273 | - | ||
274 | features_choice.setSelectedIndex(0,canvas.bluetooth); |
- | |
275 | features_choice.setSelectedIndex(1,canvas.locationprovider); |
- | |
276 | features_choice.setSelectedIndex(2,canvas.fileapi); |
- | |
277 | features_choice.setSelectedIndex(3,canvas.devicecontrol); |
- | |
278 | features_choice.setSelectedIndex(4,canvas.fullscreen); |
- | |
279 | features_choice.setSelectedIndex(5,canvas.cldc11); |
- | |
- | 191 | ||
- | 192 | ||
- | 193 | // |
|
- | 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, |
|
- | 214 | null); |
|
280 | form.append(features_choice); |
215 | |
281 | 216 | */ |
|
282 | 217 | ||
283 | 218 | ||
284 | firmware_choice = new ChoiceGroup( |
219 | firmware_choice = new ChoiceGroup( |
285 | "Firmwares:", |
220 | "Firmwares:", |
286 | Choice.EXCLUSIVE, |
221 | Choice.EXCLUSIVE, |
287 | firmware_strings, |
222 | props.firmware_strings, |
288 | null); |
223 | null); |
289 | 224 | ||
290 | firmware_choice.setSelectedIndex(firmware_select,true); |
- | |
- | 225 | firmware_choice.setSelectedIndex(props.firmware_select,true); |
|
291 | form.append(firmware_choice); |
226 | |
292 | 227 | ||
293 | 228 | ||
294 | sound_choice = new ChoiceGroup( |
229 | sound_choice = new ChoiceGroup( |
295 | "Sound ", |
230 | "Sound ", |
296 | Choice.EXCLUSIVE, |
231 | Choice.EXCLUSIVE, |
297 | sound_strings, |
232 | props.sound_strings, |
298 | null); |
233 | null); |
299 | 234 | ||
- | 235 | sound_choice.setSelectedIndex(props.sound_select,true); |
|
- | 236 | ||
- | 237 | ||
- | 238 | ||
- | 239 | ||
- | 240 | install_form.append(installmethod_choice); |
|
- | 241 | install_form.append(installoption_choice); |
|
- | 242 | ||
- | 243 | installoptions_form.append(optional_features_choice); |
|
- | 244 | installoptions_form.append(firmware_choice); |
|
- | 245 | ||
300 | sound_choice.setSelectedIndex(sound_select,true); |
246 | |
- | 247 | installoptions_form.append(sound_choice); |
|
301 | form.append(sound_choice); |
248 | |
302 | 249 | ||
303 | form.addCommand(new Command("OK", Command.OK, 1)); |
250 | expert_form.addCommand(new Command("OK", Command.OK, 1)); |
304 | form.addCommand(new Command("Exit", Command.EXIT, 2)); |
251 | expert_form.addCommand(new Command("Back", Command.BACK, 2)); |
305 | - | ||
- | 252 | ||
- | 253 | installoptions_form.addCommand(new Command("OK", Command.OK, 1)); |
|
- | 254 | installoptions_form.addCommand(new Command("Back", Command.BACK, 2)); |
|
- | 255 | ||
- | 256 | ||
- | 257 | install_form.addCommand(new Command("OK", Command.OK, 1)); |
|
- | 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); |
|
306 | // set itself as the command listener |
272 | |
- | 273 | display.setCurrent( myAlert,install_form ); |
|
307 | form.setCommandListener(this); |
274 | } |
308 | display.setCurrent(form); |
275 | else |
309 | 276 | display.setCurrent( install_form ); |
|
310 | 277 | } |
|
311 | } |
278 | |
312 | 279 | ||
313 | public void show_url_form() |
280 | public void show_url_form() |
314 | { |
281 | { |
315 | 282 | ||
316 | Form url_form = new Form("FileName"); |
283 | Form url_form = new Form("FileName"); |
317 | TextField txtField = new TextField( |
284 | TextField txtField = new TextField( |
318 | "FileName", getFileName() , 250, TextField.ANY); |
285 | "FileName", props.getFileName() , 250, TextField.ANY); |
319 | url_form.append(txtField); |
286 | url_form.append(txtField); |
320 | url_form.setCommandListener(this); |
287 | url_form.setCommandListener(this); |
- | 288 | url_form.addCommand(new Command("Exit", Command.EXIT, 1)); |
|
321 | url_form.addCommand(new Command("Back", Command.OK, 2)); |
289 | url_form.addCommand(new Command("Back", Command.BACK, 2)); |
322 | display.setCurrent(url_form); |
290 | display.setCurrent(url_form); |
323 | } |
291 | } |
324 | 292 | ||
325 | public void process_edit_form() |
293 | public void process_edit_form() |
326 | { |
294 | { |
327 | res_select=res_choice.getSelectedIndex(); |
- | |
328 | firmware_select=firmware_choice.getSelectedIndex(); |
- | |
329 | sound_select=sound_choice.getSelectedIndex(); |
- | |
330 | installsrc_select= installsrc_choice.getSelectedIndex(); |
- | |
331 | - | ||
332 | canvas.bluetooth= features_choice.isSelected(0); |
- | |
333 | canvas.locationprovider=features_choice.isSelected(1); |
- | |
334 | canvas.fileapi= features_choice.isSelected(2); |
- | |
335 | canvas.devicecontrol= features_choice.isSelected(3); |
- | |
336 | canvas.fullscreen= features_choice.isSelected(4); |
- | |
337 | canvas.cldc11 = features_choice.isSelected(5); |
- | |
- | 295 | ||
- | 296 | // copy form to props |
|
- | 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); |
|
- | 306 | props.cldc11 = device_features_choice.isSelected(4); |
|
338 | 307 | ||
339 | 308 | props.j2memaps = optional_features_choice.isSelected(0); |
|
340 | 309 | ||
341 | switch (installmethod_choice.getSelectedIndex()) |
310 | switch (installmethod_choice.getSelectedIndex()) |
342 | { |
311 | { |
- | 312 | ||
343 | case 0: |
313 | case INSTALLMETHODID_ONLINE: |
344 | // browser_dest= getURL(); |
314 | // online Install -> fire up browser |
345 | new Thread(this).start(); |
315 | new Thread(this).start(); |
346 | break; |
316 | break; |
347 | 317 | ||
- | 318 | case INSTALLMETHODID_SHOWURL: |
|
348 | case 1: |
319 | // show URL -> fire up browser |
349 | show_url_form(); |
320 | show_url_form(); |
350 | break; |
321 | break; |
351 | } |
322 | } |
352 | 323 | ||
353 | 324 | ||
354 | } |
325 | } |
355 | 326 | ||
356 | public void commandAction( Command com, Displayable dis) |
327 | public void commandAction( Command cmd, Displayable dis) |
- | 328 | { |
|
- | 329 | switch(cmd.getCommandType()) |
|
357 | { |
330 | { |
- | 331 | ||
- | 332 | case Command.BACK: |
|
- | 333 | if(dis==expert_form) |
|
- | 334 | display.setCurrent(installoptions_form); |
|
- | 335 | else |
|
- | 336 | switch(installoption_choice.getSelectedIndex()) |
|
- | 337 | { |
|
- | 338 | case INSTALLOPTIONID_CUSTOM: |
|
- | 339 | display.setCurrent(installoptions_form); |
|
- | 340 | case INSTALLOPTIONID_EXPERT: |
|
- | 341 | display.setCurrent(expert_form); |
|
- | 342 | break; |
|
- | 343 | default: |
|
- | 344 | display.setCurrent(install_form); |
|
- | 345 | } |
|
- | 346 | ||
358 | 347 | break; |
|
359 | String label = com.getLabel(); |
348 | |
360 | 349 | ||
- | 350 | case Command.EXIT: |
|
- | 351 | notifyDestroyed(); |
|
- | 352 | break; |
|
- | 353 | ||
- | 354 | case Command.ITEM: |
|
- | 355 | display.setCurrent(expert_form); |
|
- | 356 | break; |
|
361 | if("Exit".equals(label)) |
357 | |
- | 358 | case Command.OK: |
|
- | 359 | if (dis==install_form) |
|
- | 360 | ||
- | 361 | switch(installoption_choice.getSelectedIndex()) |
|
- | 362 | { |
|
- | 363 | case INSTALLOPTIONID_DEFAULT: |
|
- | 364 | firmware_choice.setSelectedIndex(0,true); |
|
- | 365 | sound_choice.setSelectedIndex(1,true); |
|
- | 366 | ||
362 | notifyDestroyed(); |
367 | |
- | 368 | ||
363 | else if("OK".equals(label)) |
369 | process_edit_form(); |
- | 370 | break; |
|
- | 371 | case INSTALLOPTIONID_MINIMAL: |
|
- | 372 | firmware_choice.setSelectedIndex(0,true); |
|
- | 373 | sound_choice.setSelectedIndex(0,true); |
|
- | 374 | process_edit_form(); |
|
- | 375 | break; |
|
- | 376 | ||
- | 377 | case INSTALLOPTIONID_FULL: |
|
364 | process_edit_form(); |
378 | firmware_choice.setSelectedIndex(1,true); |
- | 379 | sound_choice.setSelectedIndex(1,true); |
|
- | 380 | process_edit_form(); |
|
- | 381 | break; |
|
- | 382 | ||
- | 383 | ||
- | 384 | case INSTALLOPTIONID_CUSTOM: |
|
- | 385 | case INSTALLOPTIONID_EXPERT: |
|
365 | else if("Back".equals(label)) |
386 | display.setCurrent(installoptions_form); |
- | 387 | break; |
|
- | 388 | } |
|
- | 389 | else if (dis==installoptions_form) |
|
- | 390 | { |
|
- | 391 | ||
- | 392 | switch(installoption_choice.getSelectedIndex()) |
|
- | 393 | { |
|
- | 394 | ||
- | 395 | case INSTALLOPTIONID_CUSTOM: |
|
- | 396 | process_edit_form(); |
|
- | 397 | break; |
|
- | 398 | case INSTALLOPTIONID_EXPERT: |
|
- | 399 | display.setCurrent(expert_form); |
|
- | 400 | break; |
|
- | 401 | ||
- | 402 | } |
|
- | 403 | ||
- | 404 | } |
|
- | 405 | else if (dis==expert_form) |
|
- | 406 | process_edit_form(); |
|
- | 407 | break; |
|
366 | show_edit_form(); |
408 | } |
367 | } |
409 | |
368 | 410 | } |
|
369 | 411 | ||
370 | 412 | ||
371 | protected void pauseApp() {} // not needed right now |
413 | protected void pauseApp() {} // not needed right now |
372 | protected void destroyApp(boolean arg0) { } |
414 | protected void destroyApp(boolean arg0) { } |
373 | 415 | ||
374 | 416 | ||
375 | 417 | ||
376 | 418 | ||
377 | } |
419 | } |
378 | 420 |