Ignore:
Timestamp:
2018-08-13T02:18:54+02:00 (6 years ago)
Author:
Don-vip
Message:

see #15229 - deprecate Main.parent and Main itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r14010 r14153  
    6060import javax.swing.event.DocumentListener;
    6161
    62 import org.openstreetmap.josm.Main;
    6362import org.openstreetmap.josm.actions.DiskAccessAction;
    6463import org.openstreetmap.josm.actions.ExtensionFileFilter;
     
    133132                timezone = Timezone.parseTimezone(tfTimezone.getText().trim());
    134133            } catch (ParseException e) {
    135                 JOptionPane.showMessageDialog(Main.parent, e.getMessage(),
     134                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), e.getMessage(),
    136135                        tr("Invalid timezone"), JOptionPane.ERROR_MESSAGE);
    137136                return AGAIN;
     
    141140                delta = Offset.parseOffset(tfOffset.getText().trim());
    142141            } catch (ParseException e) {
    143                 JOptionPane.showMessageDialog(Main.parent, e.getMessage(),
     142                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), e.getMessage(),
    144143                        tr("Invalid offset"), JOptionPane.ERROR_MESSAGE);
    145144                return AGAIN;
     
    147146
    148147            if (lastNumMatched == 0 && new ExtendedDialog(
    149                         Main.parent,
     148                        MainApplication.getMainFrame(),
    150149                        tr("Correlate images with GPX track"),
    151150                        tr("OK"), tr("Try Again")).
     
    272271                        if (!sel.getName().equals(wrapper.name)) {
    273272                            JOptionPane.showMessageDialog(
    274                                     Main.parent,
     273                                    MainApplication.getMainFrame(),
    275274                                    tr("File {0} is loaded yet under the name \"{1}\"", sel.getName(), wrapper.name),
    276275                                    tr("Error"),
     
    291290                    Logging.error(ex);
    292291                    JOptionPane.showMessageDialog(
    293                             Main.parent,
     292                            MainApplication.getMainFrame(),
    294293                            tr("Error while parsing {0}", sel.getName())+": "+ex.getMessage(),
    295294                            tr("Error"),
     
    300299                    Logging.error(ex);
    301300                    JOptionPane.showMessageDialog(
    302                             Main.parent,
     301                            MainApplication.getMainFrame(),
    303302                            tr("Could not read \"{0}\"", sel.getName())+'\n'+ex.getMessage(),
    304303                            tr("Error"),
     
    490489            while (!isOk) {
    491490                int answer = JOptionPane.showConfirmDialog(
    492                         Main.parent, panel,
     491                        MainApplication.getMainFrame(), panel,
    493492                        tr("Synchronize time from a photo of the GPS receiver"),
    494493                        JOptionPane.OK_CANCEL_OPTION,
     
    504503                    - dateFormat.parse(tfGpsTime.getText()).getTime();
    505504                } catch (ParseException e) {
    506                     JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing the date.\n"
     505                    JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error while parsing the date.\n"
    507506                            + "Please use the requested format"),
    508507                            tr("Invalid date"), JOptionPane.ERROR_MESSAGE);
     
    723722        if (!GraphicsEnvironment.isHeadless()) {
    724723            syncDialog = new ExtendedDialog(
    725                     Main.parent,
     724                    MainApplication.getMainFrame(),
    726725                    tr("Correlate images with GPX track"),
    727726                    new String[] {tr("Correlate"), tr("Cancel")},
     
    932931            } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
    933932                Logging.warn(e);
    934                 JOptionPane.showMessageDialog(Main.parent,
     933                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    935934                        tr("An error occurred while trying to match the photos to the GPX track."
    936935                                +" You can adjust the sliders to manually match the photos."),
     
    950949            // immediately. Therefore "Close" is marked with an "OK" icon.
    951950            // Settings are only saved temporarily to the layer.
    952             new ExtendedDialog(Main.parent,
     951            new ExtendedDialog(MainApplication.getMainFrame(),
    953952                    tr("Adjust timezone and offset"),
    954953                    tr("Close")).
     
    10121011            } catch (IndexOutOfBoundsException ex) {
    10131012                Logging.debug(ex);
    1014                 JOptionPane.showMessageDialog(Main.parent,
     1013                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    10151014                        tr("The selected photos do not contain time information."),
    10161015                        tr("Photos do not contain time information"), JOptionPane.WARNING_MESSAGE);
     
    10181017            } catch (NoGpxTimestamps ex) {
    10191018                Logging.debug(ex);
    1020                 JOptionPane.showMessageDialog(Main.parent,
     1019                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    10211020                        tr("The selected GPX track does not contain timestamps. Please select another one."),
    10221021                        tr("GPX Track has no time information"), JOptionPane.WARNING_MESSAGE);
     
    10811080        if (item == null || ((GpxDataWrapper) item).file == null) {
    10821081            if (complain) {
    1083                 JOptionPane.showMessageDialog(Main.parent, tr("You should select a GPX track"),
     1082                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("You should select a GPX track"),
    10841083                        tr("No selected GPX track"), JOptionPane.ERROR_MESSAGE);
    10851084            }
Note: See TracChangeset for help on using the changeset viewer.