Changeset 939 in josm for trunk/src


Ignore:
Timestamp:
2008-09-09T09:14:27+02:00 (16 years ago)
Author:
stoecker
Message:

reverted checkin conflict

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r889 r939  
    9898                        Collection<OsmPrimitive> sel = Main.ds.getSelected();
    9999                        SearchCompiler.Match matcher = SearchCompiler.compile(search, caseSensitive);
     100                        int foundMatches = 0;
    100101                        for (OsmPrimitive osm : Main.ds.allNonDeletedCompletePrimitives()) {
    101                                 if (mode == SearchMode.replace) {
     102                                if (mode == SearchMode.replace)
     103                                {
    102104                                        if (matcher.match(osm))
     105                                        {
    103106                                                sel.add(osm);
     107                                                ++foundMatches;
     108                                        }
    104109                                        else
    105110                                                sel.remove(osm);
    106                                 } else if (mode == SearchMode.add && !osm.selected && matcher.match(osm))
     111                                }
     112                                else if (mode == SearchMode.add && !osm.selected && matcher.match(osm))
     113                                {
    107114                                        sel.add(osm);
     115                                        ++foundMatches;
     116                                }
    108117                                else if (mode == SearchMode.remove && osm.selected && matcher.match(osm))
     118                                {
    109119                                        sel.remove(osm);
     120                                        ++foundMatches;
     121                                }
    110122                        }
    111123                        Main.ds.setSelected(sel);
     124                        if(foundMatches == 0)
     125                        {
     126                                String msg = null;
     127                                if (mode == SearchMode.replace)
     128                                        msg = tr("No match found for ''{0}''", search);
     129                                else if (mode == SearchMode.add)
     130                                        msg = tr("Nothing added to selection by searching for ''{0}''", search);
     131                                else if (mode == SearchMode.remove)
     132                                        msg = tr("Nothing removed from selection by searching for ''{0}''", search);
     133                                Main.map.statusLine.setHelpText(msg);
     134                                JOptionPane.showMessageDialog(Main.parent, msg);
     135                        }
     136                        else
     137                                Main.map.statusLine.setHelpText(tr("Found {0} matches", foundMatches));
    112138                } catch (SearchCompiler.ParseError e) {
    113139                        JOptionPane.showMessageDialog(Main.parent, e.getMessage());
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r937 r939  
    346346
    347347                String oldPlugins = Main.pref.get("plugins");
    348                 if ((plugins == null && oldPlugins != null) ||
    349             plugins != null && !plugins.equals(oldPlugins)) {
     348                if(oldPlugins == null && plugins == null)
     349                        return;
     350                if(plugins == null || oldPlugins == null || !plugins.equals(oldPlugins))
     351                {
    350352                        Main.pref.put("plugins", plugins);
    351353                        gui.requiresRestart = true;
Note: See TracChangeset for help on using the changeset viewer.