Modify

Opened 11 years ago

Closed 11 years ago

#1977 closed enhancement (fixed)

[PATCH] JOSM shouldn't have Yes/No buttons

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

Description

Instead they should tell what will happen.
e.g. the upload dialog:
Yes: Upload Changes
No: Cancel

This doesn't make you read the question (thus easier and probably faster) and also helps you doing the right thing. Most users use the mouse and therefore focus the button visually anyway and by that probably recognize the button. A generic "Yes" doesn't warn you that you're actually in the "exit dialog" rather than in the "simplify way out of downloaded area" (that dialog has Yes/No/Cancel options which is especially bad by the way).

I tried to write a patch but ran into some difficulties. Renaming the buttons is pretty easy, as explained here http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#button but the JOSM's default "YesIcon", "NoIcon" etc. disappear, and there's no "option1Icon" entry or similar. The results are still the same (e.g. YES_OPTION) but the buttons for some reason are not.

Any hints?

Attachments (5)

addExtendedDialog.patch (5.5 KB) - added by xeen 11 years ago.
Adds a new ExtendedDialog class that allows creating iconified dialogs
EnhanceExtendedDialog.patch (4.4 KB) - added by xeen 11 years ago.
Adds a method to just pass text to ExtendedDialog instead of JComponent
MakeMultiLineLabelSupportNewLines.patch (2.6 KB) - added by xeen 11 years ago.
AddExtendedDialogWhereFit.zip (5.4 KB) - added by xeen 11 years ago.
EnhanceExtendedDialog.2.patch (4.1 KB) - added by xeen 11 years ago.
Now fixes the scrollbar issue too

Download all attachments as: .zip

Change History (12)

Changed 11 years ago by xeen

Attachment: addExtendedDialog.patch added

Adds a new ExtendedDialog class that allows creating iconified dialogs

comment:1 Changed 11 years ago by xeen

Owner: changed from framm to xeen
Summary: JOSM shouldn't have Yes/No buttons[PATCH] JOSM shouldn't have Yes/No buttons

The patch does not yet fix this bug but makes it much easier to do so (all calls to JOptionPane have to be fixed to use ExtendedDialog instead).

Please have a look if the implementation makes sense. For an example how this new dialog should be used, have a look at #1425 in a few moments.

comment:2 Changed 11 years ago by anonymous

Summary: [PATCH] JOSM shouldn't have Yes/No buttonsJOSM shouldn't have Yes/No buttons

Applied.

Changed 11 years ago by xeen

Attachment: EnhanceExtendedDialog.patch added

Adds a method to just pass text to ExtendedDialog instead of JComponent

Changed 11 years ago by xeen

Changed 11 years ago by xeen

comment:3 Changed 11 years ago by xeen

Summary: JOSM shouldn't have Yes/No buttons[PATCH] JOSM shouldn't have Yes/No buttons

This patch consists off three parts:

  • Make MultiLineLabel support forces newlines ("\n")
  • Update ExtendedDialog to offer a method that accepts Strings instead of JComponents
  • Replace JOptionPane with ExtendedDialog where fit (in core)

I'll update plugins in a later patch.

comment:4 Changed 11 years ago by xeen

Oh, and this almost fixes #1779 (Upload to OSM impossible on screens with a small screen) because content is wrapped in a JScrollPane and dialog size is limited automatically.

Almost because it doesn't accommodate for a vertical scrollbar if there's enough horizontal space left (which then causes a horizontal scrollbar, too). I'll attach an updated EnhanceExtendedDialog.patch that fixes this.

Changed 11 years ago by xeen

Now fixes the scrollbar issue too

comment:5 Changed 11 years ago by anonymous

I assume I need to care for last two files only?

comment:6 Changed 11 years ago by xeen

Last three:

  • EnhanceExtendedDialog.2.patch (4.1 kB)
  • AddExtendedDialogWhereFit.zip (5.4 kB)
  • MakeMultiLineLabelSupportNewLines.patch (2.6 kB)

comment:7 Changed 11 years ago by anonymous

Resolution: fixed
Status: newclosed

Fixed in r1397.

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.