Ticket #2115: FixMOTD.patch

File FixMOTD.patch, 2.3 KB (added by xeen, 17 years ago)

Apparently GettingStarted was re-created everytime it was shown again… now it is cached

  • src/org/openstreetmap/josm/gui/GettingStarted.java

     
    189189
    190190    public GettingStarted() {
    191191        super(new BorderLayout());
    192         final LinkGeneral lg = new LinkGeneral(tr("Download \"Message of the day\""));
     192        final LinkGeneral lg = new LinkGeneral(
     193                                                "<html><body>\n<h1>" +
     194                                                "JOSM - " +
     195                                                tr("Java OpenStreetMap Editor") +
     196                                                "</h1>\n<h2 align=\"center\">" +
     197                                                tr("Downloading \"Message of the day\"") +
     198                                                "</h2>");
    193199        JScrollPane scroller = new JScrollPane(lg);
    194         // panel.add(GBC.glue(0,1), GBC.eol());
    195         //panel.setMinimumSize(new Dimension(400, 600));
    196200        Component linkGeneral = new LinkGeneral(content);
    197201        scroller.setViewportBorder(new EmptyBorder(10,100,10,100));
    198202        add(scroller, BorderLayout.CENTER);
  • src/org/openstreetmap/josm/Main.java

     
    113113     * The main menu bar at top of screen.
    114114     */
    115115    public final MainMenu menu;
     116               
     117                /**
     118                 * The MOTD Layer.
     119                 */
     120                private GettingStarted gettingStarted=new GettingStarted();
    116121
    117122    /**
    118123     * Print a debug message if debugging is on.
     
    144149            map.fillPanel(panel);
    145150        else {
    146151            old.destroy();
    147             panel.add(new GettingStarted(), BorderLayout.CENTER);
     152            panel.add(gettingStarted, BorderLayout.CENTER);
    148153        }
    149154        panel.setVisible(true);
    150155        redoUndoListener.commandChanged(0,0);
     
    173178//        platform = determinePlatformHook();
    174179        platform.startupHook();
    175180        contentPane.add(panel, BorderLayout.CENTER);
    176         if(splash != null) splash.setStatus(tr("Download \"Message of the day\""));
    177         panel.add(new GettingStarted(), BorderLayout.CENTER);
     181        panel.add(gettingStarted, BorderLayout.CENTER);
    178182
    179183        if(splash != null) splash.setStatus(tr("Creating main GUI"));
    180184        menu = new MainMenu();