Modify

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#24163 closed enhancement (fixed)

[patch] Show graceful message after successful plugin download

Reported by: gaben Owned by: team
Priority: minor Milestone: 25.02
Component: Core Version:
Keywords: template_report download plugin message Cc:

Description

What steps will reproduce the problem?

  1. Download a plugin, gridify in my example
  2. Check the status window

What is the expected result?

If the download is successful, don't show warning, but information(?). Like this:


What happens instead?

After successful download, JOSM saying warning for no reason.


Please provide any additional information below. Attach a screenshot if possible.

Revision:19334
Is-Local-Build:true
Build-Date:2025-02-21 10:06:03

After borrowing some code from PluginPreference class, it works as expected.

  • src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

     
    139139                    MainApplication.getMenu().restart.actionPerformed(null);
    140140                }
    141141            } else if (task != null && !task.isCanceled()) {
     142                Collection<PluginInformation> failed = task.getFailedPlugins();
    142143                JOptionPane.showMessageDialog(
    143144                        MainApplication.getMainFrame(),
    144145                        sb.toString(),
    145                         tr("Warning"),
    146                         JOptionPane.WARNING_MESSAGE
     146                        !failed.isEmpty() ? tr("Warning") : tr("Information"),
     147                        !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE
    147148                        );
    148149            }

Attachments (2)

before.png (10.8 KB ) - added by gaben 2 months ago.
after.png (11.5 KB ) - added by gaben 2 months ago.

Download all attachments as: .zip

Change History (6)

by gaben, 2 months ago

Attachment: before.png added

by gaben, 2 months ago

Attachment: after.png added

comment:1 by gaben, 2 months ago

The code around this panel could be simplified/refactored because it feels like glue sometimes. E.g. the task failure check is done twice, once for the UI, and once for the strings in two separate classes. Anyway, the patch I proposed is a quick fix.

comment:2 by stoecker, 2 months ago

LGTM

comment:3 by stoecker, 2 months ago

Resolution: fixed
Status: newclosed

In 19335/josm:

fix #24163 - patch by gaben - don't flag success as warning

comment:4 by stoecker, 2 months ago

In 19338/josm:

see #24163 - fix tests

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.