Ignore:
Timestamp:
2009-10-25T12:05:31+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3762: Deleted relation still referenced when deleting former member
Clean up of Delete command. New: only one confirmation dialog for all parent relations of deleted objects, see help.
Improved infrastructure for context-sensitive help, improved internal help browser.

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
5 edited

Legend:

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

    r2081 r2308  
    9393    static public void setUserAgent() {
    9494        Properties sysProp = System.getProperties();
    95         sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+LanguageInfo.getLanguageCode()+")");
     95        sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+LanguageInfo.getJOSMLocaleCode()+")");
    9696        System.setProperties(sysProp);
    9797    }
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r2273 r2308  
    107107        TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways);
    108108
    109 
    110109        // try to build a new way which includes all the combined
    111110        // ways
  • trunk/src/org/openstreetmap/josm/actions/HelpAction.java

    r2274 r2308  
    99
    1010import javax.swing.AbstractAction;
    11 import javax.swing.AbstractButton;
    12 import javax.swing.Action;
    13 import javax.swing.JComponent;
    14 import javax.swing.JMenu;
    1511import javax.swing.SwingUtilities;
    1612
    1713import org.openstreetmap.josm.Main;
    1814import org.openstreetmap.josm.gui.help.HelpBrowserProxy;
    19 import org.openstreetmap.josm.gui.help.Helpful;
     15import org.openstreetmap.josm.gui.help.HelpUtil;
    2016import org.openstreetmap.josm.tools.ImageProvider;
    2117
     
    2319 * Open a help browser and displays lightweight online help.
    2420 *
    25  * @author imi
    2621 */
    2722public class HelpAction extends AbstractAction {
    28 
    29 
    30     private String pathhelp = Main.pref.get("help.pathhelp", "Help/");
    31     private String pathmenu = Main.pref.get("help.pathmenu", "Menu/");
    3223
    3324    public HelpAction() {
     
    4334                if (mouse != null) {
    4435                    c = SwingUtilities.getDeepestComponentAt(c, mouse.x, mouse.y);
    45                     topic = contextSensitiveHelp(c);
     36                    topic = HelpUtil.getContextSpecificHelpTopic(c);
    4637                } else {
    4738                    topic = null;
     
    4940            } else {
    5041                Point mouse = Main.parent.getMousePosition();
    51                 topic = contextSensitiveHelp(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y));
     42                topic = HelpUtil.getContextSpecificHelpTopic(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y));
    5243            }
    5344            if (topic == null) {
    54                 HelpBrowserProxy.getInstance().setUrlForHelpTopic("Help");
     45                HelpBrowserProxy.getInstance().setUrlForHelpTopic("/");
    5546            } else {
    56                 help(topic);
     47                HelpBrowserProxy.getInstance().setUrlForHelpTopic(topic);
    5748            }
    5849        } else {
    59             HelpBrowserProxy.getInstance().setUrlForHelpTopic("Help");
     50            HelpBrowserProxy.getInstance().setUrlForHelpTopic("/");
    6051        }
    6152    }
    62 
    63     /**
    64      * @return The topic of the help. <code>null</code> for "don't know"
    65      */
    66     private String contextSensitiveHelp(Object c) {
    67         if (c == null)
    68             return null;
    69         if (c instanceof Helpful)
    70             return ((Helpful)c).helpTopic();
    71         if (c instanceof JMenu) {
    72             JMenu b = (JMenu)c;
    73             if (b.getClientProperty("help") != null)
    74                 return (String)b.getClientProperty("help");
    75             return pathmenu+b.getText();
    76         }
    77         if (c instanceof AbstractButton) {
    78             AbstractButton b = (AbstractButton)c;
    79             if (b.getClientProperty("help") != null)
    80                 return (String)b.getClientProperty("help");
    81             return contextSensitiveHelp(((AbstractButton)c).getAction());
    82         }
    83         if (c instanceof Action)
    84             return (String)((Action)c).getValue("help");
    85         if (c instanceof JComponent && ((JComponent)c).getClientProperty("help") != null)
    86             return (String)((JComponent)c).getClientProperty("help");
    87         if (c instanceof Component)
    88             return contextSensitiveHelp(((Component)c).getParent());
    89         return null;
    90     }
    91 
    92     /**
    93      * Displays the help (or browse on the already open help) on the online page
    94      * with the given help topic. Use this for larger help descriptions.
    95      */
    96     public void help(String topic) {
    97         HelpBrowserProxy.getInstance().setUrlForHelpTopic(pathhelp + topic);
    98     }
    9953}
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r2285 r2308  
    9191                tr("Close dialog and cancel downloading")
    9292        });
    93         dialog.configureContextsensitiveHelp("Help/Action/OpenLocation", true /* show help button */);
     93        dialog.configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */);
    9494        dialog.showDialog();
    9595        if (dialog.getValue() != 1) return;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r2181 r2308  
    142142            c = DeleteCommand.deleteWithReferences(getEditLayer(),getCurrentDataSet().getSelected());
    143143        } else {
    144             c = DeleteCommand.delete(getEditLayer(),getCurrentDataSet().getSelected(), !alt);
     144            c = DeleteCommand.delete(getEditLayer(),getCurrentDataSet().getSelected(), !alt /* also delete nodes in way */);
    145145        }
    146146        if (c != null) {
     
    309309     * @param e MouseEvent from which modifiers and position are taken
    310310     * @param int modifiers For explanation: @see updateCursor
    311      * @param Simulate Set to true if the user should be bugged with additional
     311     * @param silet Set to true if the user should not be bugged with additional
    312312     *        dialogs
    313313     * @return
    314314     */
    315     private Command buildDeleteCommands(MouseEvent e, int modifiers, boolean simulate) {
     315    private Command buildDeleteCommands(MouseEvent e, int modifiers, boolean silent) {
    316316        // Note: CTRL is the only modifier that is checked in MouseMove, don't
    317317        // forget updating it there
     
    330330                    c = DeleteCommand.deleteWithReferences(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way),true);
    331331                } else {
    332                     c = DeleteCommand.delete(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way), !alt, simulate);
     332                    c = DeleteCommand.delete(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way), !alt, silent);
    333333                }
    334334            }
     
    336336            c = DeleteCommand.deleteWithReferences(getEditLayer(),Collections.singleton(sel));
    337337        } else {
    338             c = DeleteCommand.delete(getEditLayer(),Collections.singleton(sel), !alt, simulate);
     338            c = DeleteCommand.delete(getEditLayer(),Collections.singleton(sel), !alt, silent);
    339339        }
    340340
Note: See TracChangeset for help on using the changeset viewer.