Opened 17 years ago
Closed 17 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)
Change History (12)
by , 17 years ago
| Attachment: | addExtendedDialog.patch added |
|---|
comment:1 by , 17 years ago
| Owner: | changed from to |
|---|---|
| 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 , 17 years ago
| Summary: | [PATCH] JOSM shouldn't have Yes/No buttons → JOSM shouldn't have Yes/No buttons |
|---|
Applied.
by , 17 years ago
| Attachment: | EnhanceExtendedDialog.patch added |
|---|
Adds a method to just pass text to ExtendedDialog instead of JComponent
by , 17 years ago
| Attachment: | MakeMultiLineLabelSupportNewLines.patch added |
|---|
by , 17 years ago
| Attachment: | AddExtendedDialogWhereFit.zip added |
|---|
comment:3 by , 17 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 , 17 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 , 17 years ago
| Attachment: | EnhanceExtendedDialog.2.patch added |
|---|
Now fixes the scrollbar issue too
comment:6 by , 17 years ago
Last three:
- EnhanceExtendedDialog.2.patch (4.1 kB)
- AddExtendedDialogWhereFit.zip (5.4 kB)
- MakeMultiLineLabelSupportNewLines.patch (2.6 kB)



Adds a new ExtendedDialog class that allows creating iconified dialogs