Changeset 13781 in josm


Ignore:
Timestamp:
2018-05-18T01:41:13+02:00 (6 years ago)
Author:
Don-vip
Message:

see #8011 - improve About dialog to promote translations:

Location:
trunk
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CONTRIBUTION

    r13710 r13781  
    104104Some are originally LGPL but redistributed here under GPL.
    105105
     106Simple OpenStreetMap logo has been created by ScubbX (CC-SA 2.0) based on official
     107logo used by the OpenStreetMap Foundation:
     108https://wiki.openstreetmap.org/wiki/File:Logo_simple.svg
     109
     110Social logos come from https://github.com/Automattic/social-logos (GPLv2 or later)
     111
    106112The keyboard icon comes fom:
    107113- source: http://www.iconfinder.net/index.php?q=key&page=icondetails&iconid=8553&size=128&q=key&s12=on&s16=on&s22=on&s32=on&s48=on&s64=on&s128=on
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r13647 r13781  
    66import java.awt.Color;
    77import java.awt.Dimension;
     8import java.awt.FlowLayout;
    89import java.awt.GridBagLayout;
    910import java.awt.event.ActionEvent;
    1011import java.awt.event.KeyEvent;
     12import java.awt.event.MouseAdapter;
     13import java.awt.event.MouseEvent;
    1114import java.io.BufferedReader;
    1215import java.io.IOException;
     
    3235import org.openstreetmap.josm.tools.GBC;
    3336import org.openstreetmap.josm.tools.ImageProvider;
     37import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    3438import org.openstreetmap.josm.tools.Logging;
     39import org.openstreetmap.josm.tools.OpenBrowser;
    3540import org.openstreetmap.josm.tools.Shortcut;
    3641import org.openstreetmap.josm.tools.Utils;
     
    9398                "<p style='font-size:50%'></p>" +
    9499                "</html>");
    95         info.add(label, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 0));
     100        info.add(label, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 10));
    96101        info.add(new JLabel(tr("Homepage")), GBC.std().insets(10, 0, 10, 0));
    97         info.add(new UrlLabel(Main.getJOSMWebsite(), 2), GBC.eol().fill(GBC.HORIZONTAL));
     102        info.add(new UrlLabel(Main.getJOSMWebsite(), 2), GBC.eol());
     103        info.add(new JLabel(tr("Translations")), GBC.std().insets(10, 0, 10, 0));
     104        info.add(new UrlLabel("https://translations.launchpad.net/josm", 2), GBC.eol());
     105        info.add(new JLabel(tr("Follow us on")), GBC.std().insets(10, 10, 10, 0));
     106        JPanel logos = new JPanel(new FlowLayout());
     107        logos.add(createImageLink("OpenStreetMap", "openstreetmap", "https://www.openstreetmap.org/user/josmeditor/diary"));
     108        logos.add(createImageLink("Twitter", "twitter", "https://twitter.com/josmeditor"));
     109        logos.add(createImageLink("Facebook", "facebook", "https://www.facebook.com/josmeditor"));
     110        logos.add(createImageLink("Google+", "google-plus", "https://plus.google.com/115458051662705872607"));
     111        logos.add(createImageLink("Github", "github", "https://github.com/JOSM"));
     112        info.add(logos, GBC.eol().insets(0, 10, 0, 0));
    98113        info.add(GBC.glue(0, 5), GBC.eol());
    99114
     
    120135            MainApplication.getMenu().reportbug.actionPerformed(null);
    121136        }
     137    }
     138
     139    private static JLabel createImageLink(String tooltip, String icon, final String link) {
     140        JLabel label = new JLabel(ImageProvider.get("dialogs/about", icon, ImageSizes.LARGEICON));
     141        label.setToolTipText(tooltip);
     142        label.addMouseListener(new MouseAdapter() {
     143            @Override
     144            public void mouseClicked(MouseEvent e) {
     145                OpenBrowser.displayUrl(link);
     146            }
     147        });
     148        return label;
    122149    }
    123150
Note: See TracChangeset for help on using the changeset viewer.