Opened 4 years ago
Closed 4 years ago
#1977 closed enhancement (fixed)
[PATCH] JOSM shouldn't have Yes/No buttons
| Reported by: | xeen | Owned by: | xeen |
|---|---|---|---|
| Priority: | minor | 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)
Changed 4 years ago by xeen
comment:1 Changed 4 years ago by xeen
- Owner changed from framm to xeen
- Summary changed from JOSM shouldn't have Yes/No buttons to [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 4 years ago by anonymous
- Summary changed from [PATCH] JOSM shouldn't have Yes/No buttons to JOSM shouldn't have Yes/No buttons
Applied.
Changed 4 years ago by xeen
Changed 4 years ago by xeen
comment:3 Changed 4 years ago by xeen
- Summary changed from JOSM shouldn't have Yes/No buttons to [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 4 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.
comment:5 Changed 4 years ago by anonymous
I assume I need to care for last two files only?
comment:6 Changed 4 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 4 years ago by anonymous
- Resolution set to fixed
- Status changed from new to closed
Fixed in r1397.



Adds a new ExtendedDialog class that allows creating iconified dialogs