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)
Change History (21)
comment:1 by , 12 years ago
Cc: | added |
---|
follow-up: 4 comment:2 by , 12 years ago
comment:4 by , 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:
- Download a small area in JOSM
- Move just one node.
- Delete the layer (the save prompt now shows up.
- Configure it to save the file on you HD (don't upload of course)
- 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 , 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 , 12 years ago
Yeah, can reproduce. But does happen without my changes as well, so it’s rooted somewhere else…
comment:7 by , 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...)?
comment:8 by , 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. :)
follow-up: 13 comment:9 by , 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 , 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)
by , 12 years ago
Attachment: | singleton.patch added |
---|
follow-up: 12 comment:11 by , 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...
comment:12 by , 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 :-)
comment:13 by , 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:16 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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
comment:17 by , 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 , 12 years ago
Attachment: | SaveAsSingleton.patch added |
---|
comment:18 by , 12 years ago
Summary: | Shortcut/toolbar redefinition dealing with the Save features → [Patch] Shortcut/toolbar redefinition dealing with the Save features |
---|
Can’t reproduce neither with my nor the default config. I get some other messages
when opening the dialog; and a lot of ones when closing the last layer and opening a new one
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)