Modify

Opened 16 years ago

Closed 16 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 16 years ago.
Adds a new ExtendedDialog class that allows creating iconified dialogs
EnhanceExtendedDialog.patch (4.4 KB ) - added by xeen 16 years ago.
Adds a method to just pass text to ExtendedDialog instead of JComponent
MakeMultiLineLabelSupportNewLines.patch (2.6 KB ) - added by xeen 16 years ago.
AddExtendedDialogWhereFit.zip (5.4 KB ) - added by xeen 16 years ago.
EnhanceExtendedDialog.2.patch (4.1 KB ) - added by xeen 16 years ago.
Now fixes the scrollbar issue too

Download all attachments as: .zip

Change History (12)

by xeen, 16 years ago

Attachment: addExtendedDialog.patch added

Adds a new ExtendedDialog class that allows creating iconified dialogs

comment:1 by xeen, 16 years ago

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 by anonymous, 16 years ago

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

Applied.

by xeen, 16 years ago

Attachment: EnhanceExtendedDialog.patch added

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

by xeen, 16 years ago

comment:3 by xeen, 16 years ago

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 by xeen, 16 years ago

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.

by xeen, 16 years ago

Now fixes the scrollbar issue too

comment:5 by anonymous, 16 years ago

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

comment:6 by xeen, 16 years ago

Last three:

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

comment:7 by anonymous, 16 years ago

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. 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.