Changeset 8463 in josm for trunk/src/org


Ignore:
Timestamp:
2015-06-04T00:15:53+02:00 (9 years ago)
Author:
Don-vip
Message:

see #11209 - switch input method as soon as option selected + detect potential errors and implement fallbacks and logs

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r8444 r8463  
    520520                @Override
    521521                public void actionPerformed(ActionEvent e) {
    522                     boolean sel=((JCheckBoxMenuItem) e.getSource()).getState();
    523                     PROPERTY_FIX_TAG_LOCALE.put(sel);
     522                    boolean use=((JCheckBoxMenuItem) e.getSource()).getState();
     523                    PROPERTY_FIX_TAG_LOCALE.put(use);
     524                    keys.setFixedLocale(use);
    524525                }
    525526            });
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r8461 r8463  
    314314        useFixedLocale = f;
    315315        if (useFixedLocale) {
    316             privateInputContext.selectInputMethod(new Locale("en", "US"));
     316            Locale oldLocale = privateInputContext.getLocale();
     317            Main.info("Using English input method");
     318            if (!privateInputContext.selectInputMethod(new Locale("en", "US"))) {
     319                // Unable to use English keyboard layout, disable the feature
     320                Main.warn("Unable to use English input method");
     321                useFixedLocale = false;
     322                if (oldLocale != null) {
     323                    Main.info("Restoring input method to " + oldLocale);
     324                    if (!privateInputContext.selectInputMethod(oldLocale)) {
     325                        Main.warn("Unable to restore input method to " + oldLocale);
     326                    }
     327                }
     328            }
    317329        }
    318330    }
Note: See TracChangeset for help on using the changeset viewer.