Modify

Opened 14 years ago

Closed 14 years ago

#4470 closed defect (fixed)

[patch] Remembers choice does not remember correctly

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

Description

Edit a relation

Select some netities: some are already in the relation, some are not

Add everything to the relation

METHOD 1 (works but tedious): click on No every single time the window syaing that the entity is already in the relation

METHOD 2 (easy but broken): click on emember choice"and then hit No. You end up with lots of duplicates in the relation

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2010-02-02 02:31:27
Last Changed Author: jttt
Revision: 2920
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2010-02-01 21:56:31 +0100 (Mon, 01 Feb 2010)
Last Changed Rev: 2920

Attachments (0)

Change History (2)

comment:1 by Nakor, 14 years ago

Summary: Remembers choice does not remember correctly[patch] Remembers choice does not remember correctly

Below is a proposed patch for this. One of my first experiences in Java, may break other things.

Index: src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
===================================================================
--- src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java (revision 2928)
+++ src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java (working copy)
@@ -105,13 +105,15 @@

*
*/

static public int showOptionDialog(String preferenceKey, Component parent, Object message, String title, int optionType, int messageType, Object [] options, Object defaultOption) throws HeadlessException {

  • if (!getDialogShowingEnabled(preferenceKey))
  • return DIALOG_DISABLED_OPTION;

+ if (!getDialogShowingEnabled(preferenceKey) && (getDialogReturnValue(preferenceKey) >= 0))
+ return getDialogReturnValue(preferenceKey);

MessagePanel pnl = new MessagePanel(false, message);
int ret = JOptionPane.showOptionDialog(parent, pnl, title, optionType, messageType, null,options,defaultOption);


  • if(!pnl.getDialogShowingEnabled())

+ if ((ret >= 0) && !pnl.getDialogShowingEnabled()) {

setDialogShowingEnabled(preferenceKey, false);

+ setDialogReturnValue(preferenceKey, ret);
+ }

return ret;

}

comment:2 by mjulius, 14 years ago

Resolution: fixed
Status: newclosed

(In [2929]) fixes #4470 - Remembers choice does not remember correctly - based on patch by Nakor
OptionDialogs and ConfirmationDialogs now remember their enabled status and return value only if the user has either chosen Yes/OK or No.

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.