Changeset 4146 in josm


Ignore:
Timestamp:
Jun 19, 2011 5:17:43 PM (2 years ago)
Author:
stoecker
Message:

fix #6480 - toolbar cleanups

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

Legend:

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

    r4139 r4146  
    4141                tr("Show status report with useful information that can be attached to bugs"), 
    4242                Shortcut.registerShortcut("help:showstatusreport", tr("Help: {0}", 
    43                         tr("Show Status Report")), KeyEvent.VK_R, Shortcut.GROUP_NONE), true); 
     43                        tr("Show Status Report")), KeyEvent.VK_R, Shortcut.GROUP_NONE), false); 
    4444 
    4545        putValue("help", ht("/Action/ShowStatusReport")); 
    4646        putValue("toolbar", "help/showstatusreport"); 
     47        Main.toolbar.register(this); 
    4748    } 
    4849 
  • trunk/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java

    r3758 r4146  
    5858                    putValue(NAME, file); 
    5959                    putValue("help", ht("/Action/OpenRecent")); 
     60                    putValue("toolbar", false); 
    6061                } 
    6162                @Override 
     
    8384            putValue(SHORT_DESCRIPTION, tr("Clear the list of recently opened files")); 
    8485            putValue("help", ht("/Action/OpenRecent")); 
     86            putValue("toolbar", "recentlyopenedfiles/clear"); 
    8587        } 
    8688 
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r4139 r4146  
    490490            int index = selectedList.getSelectedIndex(); 
    491491            upButton.setEnabled(index > 0); 
    492             downButton.setEnabled(index < selectedList.getModel().getSize() - 1); 
     492            downButton.setEnabled(index != -1 && index < selectedList.getModel().getSize() - 1); 
    493493            removeButton.setEnabled(index != -1); 
    494494            addButton.setEnabled(actionsTree.getSelectionCount() > 0); 
     
    788788                    Action action = menuItem.getAction(); 
    789789                    userObject = action; 
    790                     String toolbar = (String) action.getValue("toolbar"); 
    791                     if(toolbar == null) { 
     790                    Object tb = action.getValue("toolbar"); 
     791                    if(tb == null) { 
    792792                        System.out.println(tr("Toolbar action without name: {0}", 
    793793                        action.getClass().getName())); 
     794                        continue; 
     795                    } else if (!(tb instanceof String)) { 
     796                        if(!(tb instanceof Boolean) || (Boolean)tb) { 
     797                            System.out.println(tr("Strange toolbar value: {0}", 
     798                            action.getClass().getName())); 
     799                        } 
     800                        continue; 
    794801                    } else { 
     802                        String toolbar = (String) tb; 
    795803                        Action r = actions.get(toolbar); 
    796804                        if(r != null &&  r != action) { 
     
    798806                            toolbar, r.getClass().getName(), action.getClass().getName())); 
    799807                        } 
    800                     } 
    801                     actions.put(toolbar, action); 
     808                        actions.put(toolbar, action); 
     809                    } 
    802810                } else { 
    803811                    userObject = menuItem.getText(); 
Note: See TracChangeset for help on using the changeset viewer.