Ticket #17526: 17526patch-ver2.diff

File 17526patch-ver2.diff, 7.0 KB (added by Hb---, 6 years ago)

untested patch for gui/dialogs/SearchDialog.java

  • .java

    SearchDialog.java
    =================
    
    old new  
    5252    private final SearchSetting searchSettings;
    5353
    5454    private final HistoryComboBox hcbSearchString = new HistoryComboBox();
    55     private final JCheckBox addOnToolbar = new JCheckBox(tr("add toolbar button"), false);
     55    private final JCheckBox addOnToolbar;
    5656
    5757    private JCheckBox caseSensitive;
    5858    private JCheckBox allElements;
     
    7575    public SearchDialog(SearchSetting initialValues, List<String> searchExpressionHistory, boolean expertMode) {
    7676        super(MainApplication.getMainFrame(),
    7777                initialValues instanceof Filter ? tr("Filter") : tr("Search"),
    78                 initialValues instanceof Filter ? tr("Submit filter") : tr("Start Search"),
     78                initialValues instanceof Filter ? tr("Submit filter") : tr("Search"),
    7979                tr("Cancel"));
    8080        this.searchSettings = new SearchSetting(initialValues);
    8181        setButtonIcons("dialogs/search", "cancel");
     
    9898        hcbSearchString.setPreferredSize(new Dimension(40, hcbSearchString.getPreferredSize().height));
    9999        label.setLabelFor(hcbSearchString);
    100100
    101         replace = new JRadioButton(tr("replace selection"), searchSettings.mode == SearchMode.replace);
     101        replace = new JRadioButton(tr("select"), searchSettings.mode == SearchMode.replace);
    102102        add = new JRadioButton(tr("add to selection"), searchSettings.mode == SearchMode.add);
    103103        remove = new JRadioButton(tr("remove from selection"), searchSettings.mode == SearchMode.remove);
    104104        inSelection = new JRadioButton(tr("find in selection"), searchSettings.mode == SearchMode.in_selection);
     
    111111        caseSensitive = new JCheckBox(tr("case sensitive"), searchSettings.caseSensitive);
    112112        allElements = new JCheckBox(tr("all objects"), searchSettings.allElements);
    113113        allElements.setToolTipText(tr("Also include incomplete and deleted objects in search."));
     114                addOnToolbar = new JCheckBox(tr("add toolbar button"), false);
     115                addOnToolbar.setToolTipText(tr("Add a button with this search expression to the toolbar."));
    114116
    115117        standardSearch = new JRadioButton(tr("standard"), !searchSettings.regexSearch && !searchSettings.mapCSSSearch);
    116118        regexSearch = new JRadioButton(tr("regular expression"), searchSettings.regexSearch);
     
    121123        bg2.add(mapCSSSearch);
    122124
    123125        JPanel selectionSettings = new JPanel(new GridBagLayout());
    124         selectionSettings.setBorder(BorderFactory.createTitledBorder(tr("Selection settings")));
     126        selectionSettings.setBorder(BorderFactory.createTitledBorder(tr("Results")));
    125127        selectionSettings.add(replace, GBC.eol().anchor(GBC.WEST).fill(GBC.HORIZONTAL));
    126128        selectionSettings.add(add, GBC.eol());
    127129        selectionSettings.add(remove, GBC.eol());
    128130        selectionSettings.add(inSelection, GBC.eop());
    129131
    130132        JPanel additionalSettings = new JPanel(new GridBagLayout());
    131         additionalSettings.setBorder(BorderFactory.createTitledBorder(tr("Additional settings")));
     133        additionalSettings.setBorder(BorderFactory.createTitledBorder(tr("Options")));
    132134        additionalSettings.add(caseSensitive, GBC.eol().anchor(GBC.WEST).fill(GBC.HORIZONTAL));
    133135
    134136        JPanel left = new JPanel(new GridBagLayout());
     
    266268
    267269    private static JPanel buildHintsSection(HistoryComboBox hcbSearchString, boolean expertMode) {
    268270        JPanel hintPanel = new JPanel(new GridBagLayout());
    269         hintPanel.setBorder(BorderFactory.createTitledBorder(tr("Search hints")));
     271        hintPanel.setBorder(BorderFactory.createTitledBorder(tr("Hints")));
    270272
    271273        hintPanel.add(new SearchKeywordRow(hcbSearchString)
    272274                .addTitle(tr("basics"))
    273275                .addKeyword(tr("Baker Street"), null, tr("''Baker'' and ''Street'' in any key"))
    274276                .addKeyword(tr("\"Baker Street\""), "\"\"", tr("''Baker Street'' in any key"))
    275277                .addKeyword("<i>key</i>:<i>valuefragment</i>", null,
    276                         tr("''valuefragment'' anywhere in ''key''"), "name:str matches name=Bakerstreet")
     278                        tr("''valuefragment'' anywhere in ''key''"), tr("name:str matches name=Bakerstreet"))
    277279                .addKeyword("-<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' nowhere in ''key''")),
    278280                GBC.eol());
    279281        hintPanel.add(new SearchKeywordRow(hcbSearchString)
     
    286288                .addKeyword("\"key\"=\"value\"", "\"\"=\"\"",
    287289                        tr("to quote operators.<br>Within quoted strings the <b>\"</b> and <b>\\</b> characters need to be escaped " +
    288290                                "by a preceding <b>\\</b> (e.g. <b>\\\"</b> and <b>\\\\</b>)."),
     291                                                tr("\"Baker Street\""),
    289292                        "\"addr:street\""),
    290293                GBC.eol().anchor(GBC.CENTER));
    291294        hintPanel.add(new SearchKeywordRow(hcbSearchString)
    292295                .addTitle(tr("combinators"))
    293                 .addKeyword("<i>expr</i> <i>expr</i>", null, tr("logical and (both expressions have to be satisfied)"))
     296                .addKeyword("<i>expr</i> <i>expr</i>", null, tr("logical and (both expressions have to be satisfied)"),
     297                                                tr("Baker Street"))
    294298                .addKeyword("<i>expr</i> | <i>expr</i>", "| ", tr("logical or (at least one expression has to be satisfied)"))
    295299                .addKeyword("<i>expr</i> OR <i>expr</i>", "OR ", tr("logical or (at least one expression has to be satisfied)"))
    296300                .addKeyword("-<i>expr</i>", null, tr("logical not"))
     
    314318                    GBC.eol().anchor(GBC.CENTER));
    315319            hintPanel.add(new SearchKeywordRow(hcbSearchString)
    316320                .addTitle(tr("metadata"))
    317                 .addKeyword("user:", "user:", tr("objects changed by user", "user:anonymous"))
    318                 .addKeyword("id:", "id:", tr("objects with given ID"), "id:0 (new objects)")
    319                 .addKeyword("version:", "version:", tr("objects with given version"), "version:0 (objects without an assigned version)")
     321                .addKeyword("user:", "user:", tr("objects changed by user"), tr("user:anonymous"))
     322                .addKeyword("id:", "id:", tr("objects with given ID"), tr("id:0 (new objects)"))
     323                .addKeyword("version:", "version:", tr("objects with given version"), tr("version:0 (objects without an assigned version)"))
    320324                .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID"),
    321                         "changeset:0 (objects without an assigned changeset)")
     325                        tr("changeset:0 (objects without an assigned changeset)"))
    322326                .addKeyword("timestamp:", "timestamp:", tr("objects with last modification timestamp within range"), "timestamp:2012/",
    323327                        "timestamp:2008/2011-02-04T12"),
    324328                GBC.eol());