Changeset 2250 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-10-05T21:39:15+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 1 added
- 2 edited
-
HelpAction.java (modified) (3 diffs)
-
UploadAction.java (modified) (2 diffs)
-
UploadSelectionAction.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r2163 r2250 123 123 } else if (e.getActionCommand() == null) { 124 124 String topic = null; 125 Point mouse = Main.parent.getMousePosition(); 126 if (mouse != null) { 125 if (e.getSource() instanceof Component) { 126 Component c = SwingUtilities.getRoot((Component)e.getSource()); 127 Point mouse = c.getMousePosition(); 128 c = SwingUtilities.getDeepestComponentAt(c, mouse.x, mouse.y); 129 topic = contextSensitiveHelp(c); 130 } else { 131 Point mouse = Main.parent.getMousePosition(); 127 132 topic = contextSensitiveHelp(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y)); 128 133 } … … 143 148 */ 144 149 private String contextSensitiveHelp(Object c) { 150 if (c == null) 151 return null; 145 152 if (c instanceof Helpful) 146 153 return ((Helpful)c).helpTopic(); … … 159 166 if (c instanceof Action) 160 167 return (String)((Action)c).getValue("help"); 168 if (c instanceof JComponent && ((JComponent)c).getClientProperty("help") != null) 169 return (String)((JComponent)c).getClientProperty("help"); 161 170 if (c instanceof Component) 162 171 return contextSensitiveHelp(((Component)c).getParent()); -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2198 r2250 152 152 } 153 153 154 public void uploadData(OsmDataLayer layer, APIDataSet apiData) { 155 if (apiData.isEmpty()) { 156 JOptionPane.showMessageDialog( 157 Main.parent, 158 tr("No changes to upload."), 159 tr("Warning"), 160 JOptionPane.INFORMATION_MESSAGE 161 ); 162 return; 163 } 164 if (!checkPreUploadConditions(layer, apiData)) 165 return; 166 Main.worker.execute( 167 createUploadTask( 168 layer, 169 apiData.getPrimitives(), 170 UploadDialog.getUploadDialog().getChangeset(), 171 UploadDialog.getUploadDialog().isDoCloseAfterUpload() 172 ) 173 ); 174 } 175 154 176 public void actionPerformed(ActionEvent e) { 155 177 if (!isEnabled()) … … 164 186 return; 165 187 } 166 167 188 APIDataSet apiData = new APIDataSet(Main.main.getCurrentDataSet()); 168 if (apiData.isEmpty()) { 169 JOptionPane.showMessageDialog( 170 Main.parent, 171 tr("No changes to upload."), 172 tr("Warning"), 173 JOptionPane.INFORMATION_MESSAGE 174 ); 175 return; 176 } 177 if (!checkPreUploadConditions(Main.map.mapView.getEditLayer(), apiData)) 178 return; 179 Main.worker.execute( 180 createUploadTask( 181 Main.map.mapView.getEditLayer(), 182 apiData.getPrimitives(), 183 UploadDialog.getUploadDialog().getChangeset(), 184 UploadDialog.getUploadDialog().isDoCloseAfterUpload() 185 ) 186 ); 189 uploadData(Main.map.mapView.getEditLayer(), apiData); 187 190 } 188 191
Note:
See TracChangeset
for help on using the changeset viewer.
