Modify

Opened 12 years ago

Closed 12 years ago

#7429 closed defect (fixed)

[Patch] Shortcut/toolbar redefinition dealing with the Save features

Reported by: rickmastfan67 Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: Cc: xeen

Description

These only show up when saving from the new save/upload dialog when you close JOSM or delete a layer.

Keystroke ctrl pressed S is already assigned to org.openstreetmap.josm.actions.SaveAction@5dedb45, will be overridden by org.openstreetmap.josm.actions.SaveAction@51055f4d
Keystroke ctrl pressed S is already assigned to org.openstreetmap.josm.actions.SaveAction@7f8837f1, will be overridden by org.openstreetmap.josm.actions.SaveAction@73efe4ac
Registered toolbar action save overwritten: org.openstreetmap.josm.actions.SaveAction gets org.openstreetmap.josm.actions.SaveAction

Attachments (2)

singleton.patch (6.6 KB ) - added by xeen 12 years ago.
SaveAsSingleton.patch (1.8 KB ) - added by akks 12 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 by stoecker, 12 years ago

Cc: xeen added

comment:2 by xeen, 12 years ago

Can’t reproduce neither with my nor the default config. I get some other messages

Toolbar action simplify overwritten: sk.zdila.josm.plugin.simplify.SimplifyAreaAction gets org.openstreetmap.josm.actions.SimplifyWayAction
Toolbar action simplify overwritten: org.openstreetmap.josm.actions.SimplifyWayAction gets sk.zdila.josm.plugin.simplify.SimplifyAreaAction

when opening the dialog; and a lot of ones when closing the last layer and opening a new one

Keystroke shift pressed S is already assigned to MultikeyActionorg.openstreetmap.josm.gui.dialogs.LayerListDialog$ShowHideLayerAction@5cda2610, will be overridden by MultikeyActionorg.openstreetmap.josm.gui.dialogs.LayerListDialog$ShowHideLayerAction@5cda2610
Keystroke shift pressed A is already assigned to MultikeyActionorg.openstreetmap.josm.gui.dialogs.LayerListDialog$ActivateLayerAction@638c6b76, will be overridden by MultikeyActionorg.openstreetmap.josm.gui.dialogs.LayerListDialog$ActivateLayerAction@17e34309
Keystroke ctrl alt pressed J is already assigned to MultikeyActionorg.openstreetmap.josm.gui.layer.JumpToMarkerActions$JumpToNextMarker@16cc88ce, will be overridden by MultikeyActionorg.openstreetmap.josm.gui.layer.JumpToMarkerActions$JumpToNextMarker@4e299813
Keystroke ctrl alt pressed E is already assigned to MultikeyActionorg.openstreetmap.josm.gui.dialogs.FilterDialog$EnableFilterAction@57baf36f, will be overridden by MultikeyActionorg.openstreetmap.josm.gui.dialogs.FilterDialog$EnableFilterAction@32c42968
Keystroke ctrl alt pressed H is already assigned to MultikeyActionorg.openstreetmap.josm.gui.dialogs.FilterDialog$HidingFilterAction@5faa076a, will be overridden by MultikeyActionorg.openstreetmap.josm.gui.dialogs.FilterDialog$HidingFilterAction@13ccf137

It might have to do with how your configured your shortcuts or toolbar. Can you post your preferences file? (don’t forget to remove password; or use Help → Show Status Report)

comment:3 by stoecker, 12 years ago

I fixed the first (simplifyarea).

in reply to:  2 comment:4 by rickmastfan67, 12 years ago

Replying to xeen:

It might have to do with how your configured your shortcuts or toolbar. Can you post your preferences file? (don’t forget to remove password; or use Help → Show Status Report)

Is this all you need?

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-02-20 11:59:50
Last Changed Author: xeen
Revision: 5004
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-02-20 12:32:21 +0100 (Mon, 20 Feb 2012)
Last Changed Rev: 5004

Identification: JOSM/1.5 (5004 en)
Memory Usage: 120 MB / 2730 MB (41 MB allocated, but free)
Java version: 1.6.0_31, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

Plugin: OpeningHoursEditor (27852)
Plugin: buildings_tools (27865)
Plugin: imageryadjust (27865)
Plugin: licensechange (27865)
Plugin: mapdust (27884)
Plugin: measurement (27852)
Plugin: openstreetbugs (27852)
Plugin: reverter (27865)
Plugin: turnrestrictions (27891)
Plugin: undelete (27852)
Plugin: utilsplugin2 (27865)

The steps to reproduce this is the following:

  1. Download a small area in JOSM
  2. Move just one node.
  3. Delete the layer (the save prompt now shows up.
  4. Configure it to save the file on you HD (don't upload of course)
  5. Once you save the file, the messages above will show up (well, just one of the keystroke ones, the other only shows up when closing JOSM).

comment:5 by skyper, 12 years ago

Can reproduce

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-02-20 11:59:50
Last Changed Author: xeen
Revision: 5004
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-02-20 12:32:21 +0100 (Mon, 20 Feb 2012)
Last Changed Rev: 5004

Information: Einstellungsdatei '$HOME/.josm/preferences.xml' fehlt. Erstelle Standardeinstellungsdatei.
GET http://api.openstreetmap.org/api/capabilities... OK
GET http://api.openstreetmap.org/api/0.6/map?bbox=36.6423225,35.2551517,36.6534805,35.2693784
Successfully loaded Bing attribution data.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Bing: attribution data is not yet loaded.
Keystroke ctrl pressed S is already assigned to org.openstreetmap.josm.actions.SaveAction@c6eff5, will be overridden by org.openstreetmap.josm.actions.SaveAction@101f23d
Registered toolbar action save overwritten: org.openstreetmap.josm.actions.SaveAction gets org.openstreetmap.josm.actions.SaveAction
Keystroke ctrl pressed S is already assigned to org.openstreetmap.josm.actions.SaveAction@101f23d, will be overridden by org.openstreetmap.josm.actions.SaveAction@99860f
Registered toolbar action save overwritten: org.openstreetmap.josm.actions.SaveAction gets org.openstreetmap.josm.actions.SaveAction

comment:6 by xeen, 12 years ago

Yeah, can reproduce. But does happen without my changes as well, so it’s rooted somewhere else…

comment:7 by akks, 12 years ago

There are 4 places in code when SaveAction is constructed. (find "new SaveAction" - Layer.java, OsmDataSessionExporter.java, SaveLayerTask.java and main call in MainMenu.java).

Each subsequent call causes this warnings.
Why not replace new SaveAction().(...) with Main.main.menu.save.(...) ? Or SaveAction is aware of some state, like toggle dialogs from #7424 (I do not see such code...)?

Last edited 12 years ago by akks (previous) (diff)

comment:8 by rickmastfan67, 12 years ago

For the fun of it, I've been testing older versions to see if I can nail down a version where this doesn't happen.
r4879 - both Happen
r4488 - both Happen
r4143 - both Happen
r4137 - Only the Keystroke one happens

So, the Toolbar action one was introduced into JOSM between r4137 and r4143. At least that's a start to fixing this. :)

comment:9 by rickmastfan67, 12 years ago

And looking at the changesets between r4137 and r4143, it looks like it was [4139] that introduced the toolbar action problem for saving. The only thing in [4139] that was changed that mentioned the word "save" was a change in the "ToolbarPreferences.java" file.
https://josm.openstreetmap.de/changeset/4139/josm/trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

Fixing that file should should at least fix the toolbar action problem for the save feature imo.

comment:10 by xeen, 12 years ago

This is hackish. If we don’t want there to be multiple instances of *Action, then we should enforce this by using a singleton. Not only does this solve our problem in a nice way via new SaveAction() → SaveAction.getInstance() rather than Main.main.menu.save; but it also prevents the problem from happening in the future. It probably will solve #7424 if applied to all offending actions, too.

I’ll attach a patch for SaveAction. It implements the Singleton as I suggested and makes all methods that can be static, static. So in some cases simply writing SaveAction.doSave is enough.

(also stop posting so fast ;) … the „SAVING FAILED“ messages of trac are quite annoying)

Last edited 12 years ago by xeen (previous) (diff)

by xeen, 12 years ago

Attachment: singleton.patch added

comment:11 by akks, 12 years ago

@stoecker: please tell us which is better - use singleton (SaveAction.getInstance) or use Main.main.menu.save? (I prefer xeen's variant)
Then all similar problems can be fixed...

in reply to:  11 comment:12 by stoecker, 12 years ago

Replying to akks:

@stoecker: please tell us which is better - use singleton (SaveAction.getInstance) or use Main.main.menu.save? (I prefer xeen's variant)
Then all similar problems can be fixed...

Don't know, but singleton sounds to be the cleaner interface. In JOSM both methods are used in different places :-)

in reply to:  9 comment:13 by stoecker, 12 years ago

Replying to rickmastfan67:

And looking at the changesets between r4137 and r4143, it looks like it was [4139] that introduced the toolbar action problem for saving. The only thing in [4139] that was changed that mentioned the word "save" was a change in the "ToolbarPreferences.java" file.
https://josm.openstreetmap.de/changeset/4139/josm/trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

Fixing that file should should at least fix the toolbar action problem for the save feature imo.

This was the time when the corresponding warning was introduced. The bug is probably much older :-)

comment:14 by xeen, 12 years ago

three in favor of singleton? Commit, here I come…

comment:15 by xeen, 12 years ago

Resolution: fixed
Status: newclosed

In 5014/josm:

fix #7429

comment:16 by skyper, 12 years ago

Resolution: fixed
Status: closedreopened

Not fixed yet !

Using /usr/lib/jvm/java-6-openjdk/bin/java to execute josm.
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-03-06 02:36:00
Last Changed Author: Don-vip
Revision: 5046
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-03-05 22:41:23 +0100 (Mon, 05 Mar 2012)
Last Changed Rev: 5046

Information: Einstellungsdatei '$HOME/.josm-latest/preferences.xml' fehlt. Erstelle Standardeinstellungsdatei.
GET http://api.openstreetmap.org/api/capabilities... Open file: /home/gast/A.osm.bz2 (938 bytes)
Keystroke shift ctrl pressed S is already assigned to org.openstreetmap.josm.actions.SaveAsAction@1546dbc,
will be overridden by org.openstreetmap.josm.actions.SaveAsAction@5789f3
Registrierte Werkzeugleistenaktion save_as überschrieben:
org.openstreetmap.josm.actions.SaveAsAction wird org.openstreetmap.josm.actions.SaveAsAction
Last edited 12 years ago by skyper (previous) (diff)

comment:17 by akks, 12 years ago

It is SaveAsAction, not SaveAction :). Here is the patch. I think it is better to wait stable release because this warning is not often or critical.

by akks, 12 years ago

Attachment: SaveAsSingleton.patch added

comment:18 by skyper, 12 years ago

Summary: Shortcut/toolbar redefinition dealing with the Save features[Patch] Shortcut/toolbar redefinition dealing with the Save features

comment:19 by akks, 12 years ago

Resolution: fixed
Status: reopenedclosed

In 5048/josm:

fix #7429 - Shortcut redefinition in Save As feature

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.