Changeset 31449 in osm for applications/editors/josm


Ignore:
Timestamp:
2015-08-05T11:45:17+02:00 (9 years ago)
Author:
nokutu
Message:

Improved status bar behaviour.

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31445 r31449  
    1111import org.openstreetmap.josm.plugins.mapillary.mode.JoinMode;
    1212import org.openstreetmap.josm.plugins.mapillary.mode.SelectMode;
     13import org.openstreetmap.josm.plugins.mapillary.utils.PluginState;
    1314import org.openstreetmap.josm.Main;
    1415import org.openstreetmap.josm.gui.layer.Layer;
     
    604605  public void updateHelpText() {
    605606    String ret = "";
    606     if (this.data.size() > 0)
     607    if (PluginState.isDownloading())
     608      ret += tr("Downloading");
     609    else if (this.data.size() > 0)
    607610      ret += tr("Total images: {0}", this.data.size());
    608611    else
     
    610613    if (this.mode != null)
    611614      ret += " -- " + tr(this.mode.toString());
     615    if (PluginState.isUploading())
     616      ret += " -- " + PluginState.getUploadString();
    612617    Main.map.statusLine.setHelpText(ret);
    613618  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryUploadAction.java

    r31446 r31449  
    66import java.awt.event.ActionEvent;
    77import java.awt.event.KeyEvent;
    8 import java.io.UnsupportedEncodingException;
    9 import java.security.InvalidKeyException;
    10 import java.security.NoSuchAlgorithmException;
    118
    129import javax.swing.JDialog;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java

    r31445 r31449  
    11package org.openstreetmap.josm.plugins.mapillary.downloads;
    2 
    3 import static org.openstreetmap.josm.tools.I18n.tr;
    42
    53import java.util.concurrent.ThreadPoolExecutor;
     
    1614import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog;
    1715import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
     16import org.openstreetmap.josm.plugins.mapillary.utils.PluginState;
    1817
    1918/**
     
    7372  @Override
    7473  public void run() {
    75     Main.map.statusLine.setHelpText(tr("Downloading images from Mapillary"));
    7674    try {
     75      PluginState.startDownload();
     76      MapillaryLayer.getInstance().updateHelpText();
    7777      downloadSequences();
    78       Main.map.statusLine.setHelpText(tr("Downloading image's information"));
    7978      completeImages();
    8079      MapillaryMainDialog.getInstance().updateTitle();
    81       Main.map.statusLine.setHelpText(tr("Downloading traffic signs"));
    8280      downloadSigns();
    8381    } catch (InterruptedException e) {
    8482      Main.error("Mapillary download interrupted (probably because of closing the layer).");
     83    } finally {
     84      PluginState.finishDownload();
     85      MapillaryLayer.getInstance().updateHelpText();
    8586    }
    8687    this.layer.updateHelpText();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java

    r31447 r31449  
    4949import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
    5050import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
     51import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
    5152import org.openstreetmap.josm.plugins.mapillary.MapillarySequence;
     53import org.openstreetmap.josm.plugins.mapillary.utils.PluginState;
    5254
    5355/**
     
    164166
    165167    HttpResponse response = httpClient.execute(httpPost);
    166     if (response.getStatusLine().toString().contains("204"))
     168    if (response.getStatusLine().toString().contains("204")) {
    167169      System.out.println("Succesfully uploaded image");
     170      PluginState.imageUploaded();
     171    }
    168172    file.delete();
     173    MapillaryLayer.getInstance().updateHelpText();
    169174  }
    170175
     
    194199    @Override
    195200    public void run() {
     201      PluginState.startUpload();
     202      PluginState.imagesToUpload(this.images.size());
     203      MapillaryLayer.getInstance().updateHelpText();
    196204      for (MapillaryAbstractImage img : this.images) {
    197205        if (!(img instanceof MapillaryImportedImage))
     
    201209            this.uuid));
    202210      }
     211      this.ex.shutdown();
     212      PluginState.finishUpload();
    203213    }
    204214  }
Note: See TracChangeset for help on using the changeset viewer.