Ignore:
Timestamp:
2009-10-05T21:39:15+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3653: History for anonymous users should not be clickable
fixed #3518: Provide a new feature for uploading the currently selected primitives

File:
1 edited

Legend:

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

    r2198 r2250  
    152152    }
    153153
     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
    154176    public void actionPerformed(ActionEvent e) {
    155177        if (!isEnabled())
     
    164186            return;
    165187        }
    166 
    167188        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);
    187190    }
    188191
Note: See TracChangeset for help on using the changeset viewer.