Rev 266 | Rev 269 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 266 | Rev 267 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | 37 | ||
38 | String act_input_str=" "; |
38 | String act_input_str=" "; |
39 | // for dual use of states |
39 | // for dual use of states |
Line -... | Line 40... | ||
- | 40 | boolean select_paramset4edit; |
|
- | 41 | ||
- | 42 | ||
- | 43 | ||
- | 44 | ||
- | 45 | //#if jsr179=="on" |
|
- | 46 | ||
- | 47 | ||
- | 48 | javax.microedition.location.Criteria cr= null; |
|
- | 49 | ||
- | 50 | javax.microedition.location.LocationProvider lp= null; |
|
- | 51 | ||
- | 52 | ||
- | 53 | ||
Line 40... | Line 54... | ||
40 | boolean select_paramset4edit; |
54 | //#endif |
41 | 55 | ||
Line 265... | Line 279... | ||
265 | // only navi |
279 | // only navi |
266 | if ( mk.ufo_prober.is_navi()) |
280 | if ( mk.ufo_prober.is_navi()) |
267 | { |
281 | { |
268 | if (settings.dev_mode) tmp_menu_add("Follow Me",ACTIONID_SHOWPHONEGPS); |
282 | if (settings.dev_mode) tmp_menu_add("Follow Me",ACTIONID_SHOWPHONEGPS); |
269 | tmp_menu_add(l(STRINGID_VIEW_GPS),ACTIONID_GPSDATA); |
283 | tmp_menu_add(l(STRINGID_VIEW_GPS),ACTIONID_GPSDATA); |
270 | if (last_navi_error!=0) tmp_menu_add(l(STRINGID_VIEW_ERRORS),ACTIONID_NC_ERRORS); |
284 | if (mk.gps_position.ErrorCode!=0) tmp_menu_add(l(STRINGID_VIEW_ERRORS),ACTIONID_NC_ERRORS); |
271 | tmp_menu_add(l(STRINGID_SWITCH_FC),ACTIONID_SWITCH_FC); |
285 | tmp_menu_add(l(STRINGID_SWITCH_FC),ACTIONID_SWITCH_FC); |
272 | tmp_menu_add(l(STRINGID_SWITCH_MK3MAG),ACTIONID_SWITCH_MK3MAG); |
286 | tmp_menu_add(l(STRINGID_SWITCH_MK3MAG),ACTIONID_SWITCH_MK3MAG); |
Line 273... | Line 287... | ||
273 | 287 | ||
Line 294... | Line 308... | ||
294 | } |
308 | } |
Line 295... | Line 309... | ||
295 | 309 | ||
296 | 310 | ||
297 | public void setup_menu(String[] items , byte[] actions) |
311 | public void setup_menu(String[] items , byte[] actions) |
298 | { |
312 | { |
299 | if ((menu_items==null)||(act_menu_select>menu_items.length)) |
313 | if ((menu_items==null)||(act_menu_select>=menu_items.length)) |
300 | act_menu_select=0; |
314 | act_menu_select=0; |
301 | menu_items=items; |
315 | menu_items=items; |
Line 572... | Line 586... | ||
572 | // construct |
586 | // construct |
573 | public DUBwiseCanvas(DUBwise _root) |
587 | public DUBwiseCanvas(DUBwise _root) |
574 | { |
588 | { |
575 | load_strings(); |
589 | load_strings(); |
Line 576... | Line -... | ||
576 | - | ||
577 | - | ||
578 | - | ||
579 | - | ||
580 | 590 | ||
581 | act_menu_select_bak=new int[STATEID_COUNT]; |
591 | act_menu_select_bak=new int[STATEID_COUNT]; |
582 | for (int i=0;i<STATEID_COUNT;i++) |
592 | for (int i=0;i<STATEID_COUNT;i++) |
583 | act_menu_select_bak[i]=0; |
593 | act_menu_select_bak[i]=0; |
584 | //#if fileapi=="on" |
594 | //#if fileapi=="on" |
Line 617... | Line 627... | ||
617 | 627 | ||
618 | if (settings.connection_url!="") |
628 | if (settings.connection_url!="") |
619 | connect_mk(settings.connection_url,settings.connection_name); |
629 | connect_mk(settings.connection_url,settings.connection_name); |
Line -... | Line 630... | ||
- | 630 | } |
|
- | 631 | ||
- | 632 | public void refresh_dynamic_menues() |
|
- | 633 | { |
|
- | 634 | if (state==STATEID_MAINMENU) |
|
- | 635 | chg_state(STATEID_MAINMENU); // reload mainmenu ( changed content ) |
|
- | 636 | if (state==STATEID_CONN_DETAILS) |
|
Line 620... | Line 637... | ||
620 | } |
637 | chg_state(STATEID_CONN_DETAILS); // reload mainmenu ( changed content ) |
621 | 638 | } |
|
622 | 639 | ||
623 | /****************************** Thread ******************/ |
640 | /****************************** Thread ******************/ |
Line 641... | Line 658... | ||
641 | 658 | ||
642 | // handle Device Change |
659 | // handle Device Change |
643 | if (mk.ufo_prober.change_notify) |
660 | if (mk.ufo_prober.change_notify) |
644 | { |
661 | { |
645 | mk.ufo_prober.change_notify=false; |
662 | mk.ufo_prober.change_notify=false; |
646 | if (mk.ufo_prober.is_incompatible()) |
663 | if ((mk.ufo_prober.is_incompatible())&&(settings.instant_error_show)) |
647 | { |
664 | { |
648 | mk.error_str=l(STRINGID_INCOMPATIBLEDEVICE); |
665 | mk.error_str=l(STRINGID_INCOMPATIBLEDEVICE); |
649 | chg_state(STATEID_ERROR_MSG); |
666 | chg_state(STATEID_ERROR_MSG); |
650 | } |
667 | } |
651 | else |
- | |
652 | { |
668 | else |
653 | if (state==STATEID_MAINMENU) |
- | |
654 | chg_state(STATEID_MAINMENU); // reload mainmenu ( changed content ) |
- | |
655 | if (state==STATEID_CONN_DETAILS) |
- | |
- | 669 | refresh_dynamic_menues(); |
|
656 | chg_state(STATEID_CONN_DETAILS); // reload mainmenu ( changed content ) |
670 | |
657 | } |
671 | |
Line 658... | Line 672... | ||
658 | } |
672 | } |
659 | 673 | ||
660 | if (mk.disconnect_notify) |
674 | if (mk.disconnect_notify) |
- | 675 | { |
|
- | 676 | mk.disconnect_notify=false; |
|
- | 677 | ||
661 | { |
678 | if (settings.instant_error_show) |
662 | mk.disconnect_notify=false; |
679 | { |
663 | nextstate=STATEID_MAINMENU; |
680 | nextstate=STATEID_MAINMENU; |
- | 681 | mk.error_str=l(STRINGID_DISCONNECT); |
|
664 | mk.error_str=l(STRINGID_DISCONNECT); |
682 | chg_state( STATEID_ERROR_MSG); |
665 | chg_state( STATEID_ERROR_MSG); |
683 | } |
666 | if (settings.do_vibra) |
684 | if (settings.do_vibra) |
- | 685 | root.vibrate(100); |
|
667 | root.vibrate(100); |
686 | } |
668 | } |
687 | |
669 | if (mk.ufo_prober.is_navi()) |
688 | if (mk.ufo_prober.is_navi()) |
670 | { |
689 | { |
671 | if ((last_navi_error==0)&&(mk.gps_position.ErrorCode!=0)) |
690 | if ((last_navi_error==0)&&(mk.gps_position.ErrorCode!=0)) |
- | 691 | { |
|
- | 692 | ||
672 | { |
693 | if (settings.instant_error_show) |
673 | 694 | { |
|
674 | nextstate=state; |
695 | nextstate=state; |
675 | 696 | ||
- | 697 | mk.error_str=null; |
|
676 | mk.error_str=null; |
698 | chg_state( STATEID_ERROR_MSG); |
677 | chg_state( STATEID_ERROR_MSG); |
699 | } |
678 | if (settings.do_vibra) |
700 | if (settings.do_vibra) |
679 | root.vibrate(100); |
701 | root.vibrate(100); |
680 | } |
702 | } |
Line 687... | Line 709... | ||
687 | } |
709 | } |
Line 688... | Line 710... | ||
688 | 710 | ||
689 | 711 | ||
690 | switch(state) |
712 | switch(state) |
Line 691... | Line 713... | ||
691 | { |
713 | { |
692 | 714 | ||
693 | 715 | ||
694 | //#if jsr179=="on" |
716 | //#if jsr179=="on" |
695 | case STATEID_SHOWPHONEGPS: |
717 | case STATEID_SHOWPHONEGPS: |
696 | 718 | ||
Line -... | Line 719... | ||
- | 719 | try |
|
- | 720 | { |
|
697 | try |
721 | Class.forName("javax.microedition.location.LocationProvider"); |
698 | { |
722 | |
699 | Class.forName("javax.microedition.location.LocationProvider"); |
- | |
700 | - | ||
701 | javax.microedition.location.Criteria cr= new javax.microedition.location.Criteria(); |
- | |
Line -... | Line 723... | ||
- | 723 | if ((cr==null)||(lp==null)) |
|
- | 724 | { |
|
- | 725 | javax.microedition.location.Criteria cr= new javax.microedition.location.Criteria(); |
|
702 | cr.setHorizontalAccuracy(500); |
726 | cr.setHorizontalAccuracy(500); |
- | 727 | ||
- | 728 | // Get an instance of the provider |
|
703 | 729 | javax.microedition.location.LocationProvider lp= javax.microedition.location.LocationProvider.getInstance(cr); |
|
704 | // Get an instance of the provider |
730 | } |
705 | javax.microedition.location.LocationProvider lp= javax.microedition.location.LocationProvider.getInstance(cr); |
731 | // Request the location, setting a one-minute timeout |
Line 706... | Line 732... | ||
706 | 732 | ||
Line 707... | Line 733... | ||
707 | // Request the location, setting a one-minute timeout |
733 |