Modify

Opened 13 years ago

Closed 13 years ago

#1967 closed defect (fixed)

[Patch?] Supress "No Data Imported Message" in "Download OSM Data Along this track"

Reported by: amenk Owned by: xeen
Priority: minor Milestone:
Component: Core Version: latest
Keywords: Cc: xeen

Description

If the "Download OSM Data Along this track" function is used (popupmenu of gpx layer), the "No data imported message" interrupts the automatic process in cases where for a certain part no data is available yet.

Attachments (3)

supressErrorMessage.patch (6.8 KB) - added by xeen 13 years ago.
Adds low-level boolean silent that supresses all MessageBoxes
NoErrorMstg.patch (26.3 KB) - added by xeen 13 years ago.
NoErrorMstg.2.patch (31.0 KB) - added by xeen 13 years ago.
Forgot removing fixed FIXME comment

Download all attachments as: .zip

Change History (16)

Changed 13 years ago by xeen

Attachment: supressErrorMessage.patch added

Adds low-level boolean silent that supresses all MessageBoxes

comment:1 Changed 13 years ago by xeen

Owner: changed from framm to anonymous
Status: newassigned

The adds a low level boolean silent that if set to true will print all error messages to the console instead of popping up a message box.

This will suppress all HTTP-related messages, too (e.g. "Bounding Box too large") and I'm not sure it's a good idea to do so when the user needs to take action (e.g. by requesting smaller tiles).

Plus, a fix that'd simply supress the no data imported message would be much simpler. I doubt that there will be many use-cases where absolute silence is helpful. Any thoughts?

comment:2 Changed 13 years ago by stoecker

What about
a) suppressing the "nothing downloaded" for silent totally and
b) return an error state

The error state can then be used to print a message like "There have been errors during mass download\nSee console output for more details.".

comment:3 Changed 13 years ago by stoecker

Summary: Supress "No Data Imported Message" in "Download OSM Data Along this track"[PATCH] Supress "No Data Imported Message" in "Download OSM Data Along this track"

comment:4 Changed 13 years ago by xeen

Owner: changed from anonymous to xeen
Status: assignednew

Good idea. Will work on this, might take some time though.

comment:5 Changed 13 years ago by anonymous

Cc: xeen added
Summary: [PATCH] Supress "No Data Imported Message" in "Download OSM Data Along this track"Supress "No Data Imported Message" in "Download OSM Data Along this track"

comment:6 Changed 13 years ago by xeen

I looked into it and it looks like if I want to throw an exception or report the error to JOSM I need to change the worker Executor to ExecutorService and grab the messages somewhere globally.

It seems unreasonable to solve this just for when downloading via GPX-Track. I suggest changing the way of error reporting for all runnables and display a message when all tasks are finished instead.

E.g. if task 1 reports "bbox too large", task 2 works fine, task 3 reports "time out error" a message box would be displayed after task 3 finished stating:

The following errors occured:

  • bbox too large
  • time out error

This would solve the problems for future applications and remove the need for the caller to decide if it may need to set "silent" or not.

Changed 13 years ago by xeen

Attachment: NoErrorMstg.patch added

comment:7 Changed 13 years ago by xeen

Summary: Supress "No Data Imported Message" in "Download OSM Data Along this track"[PATCH] Supress "No Data Imported Message" in "Download OSM Data Along this track"

This became a rather large patch:

  • Cancel in PleaseWaitDialog button gets disabled if clicked
  • PleaseWaitDialog has an additional label that can contain additional text. Currently used to display "Download 23 of 42 (19 left)" and thus fixes the FIXME comment in GpxLayer.java/DownloadAlongTrackAction
  • A new wrapper that allows mass downloading and handles all "internas"
    • Making this work required changing the main worker from Executor to ExecutorService because I need Futures to determine when all download tasks have finished.
    • UpdateAction and DownloadAlongTrack now use this
  • Clean up and documentation here and there

Changed 13 years ago by xeen

Attachment: NoErrorMstg.2.patch added

Forgot removing fixed FIXME comment

comment:8 Changed 13 years ago by xeen

  • Also gives Data Layers a counter so when downloading a new layer there is no confusion which is the new one because all are named "Data Layer"

comment:9 Changed 13 years ago by xeen

Summary: [PATCH] Supress "No Data Imported Message" in "Download OSM Data Along this track"Supress "No Data Imported Message" in "Download OSM Data Along this track"

Apparently this causes ApgIfoJ to stop working:

File could not be found.Java version: 1.6.0_06
Plugins: AgPifoJ;Create_grid_of_ways;DirectUpload;nearclick;terracer;utilsplugin;validator;wmsplugin
Plugin AgPifoJ Version: 13929
Plugin Create_grid_of_ways Version: 12782
Plugin DirectUpload Version: 13820
Plugin nearclick Version: 13409
Plugin terracer Version: 13561
Plugin utilsplugin Version: 13776
Plugin validator Version: 13918
Plugin wmsplugin Version: 13927

java.lang.NoSuchFieldError: worker
	at org.openstreetmap.josm.plugins.agpifoj.AgpifojLayer.create(Unknown Source)
	at org.openstreetmap.josm.plugins.agpifoj.AgpifojPlugin$Action.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

comment:10 Changed 13 years ago by xeen

Summary: Supress "No Data Imported Message" in "Download OSM Data Along this track"[Patch?] Supress "No Data Imported Message" in "Download OSM Data Along this track"

Hmm… apparently this breaks just because PleaseWaitDialog has new members although the argmentents changed nowhere. Simply re-compiling with the new JOSM sources solved the problem… is there any better way to do this without breaking all consumer plugins or having to duplicate PleaseWaitDialog?

comment:11 Changed 13 years ago by stoecker

I don't know how Java dynamic linking works, but probably adding the new variable as last variable helps?

comment:12 Changed 13 years ago by xeen

Good idea, but did no good. I moved the label down to the setCustomText function but it still reports the error.

comment:13 Changed 13 years ago by stoecker

Resolution: fixed
Status: newclosed

Applied in r1467.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain xeen.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.