Ignore:
Timestamp:
2017-08-26T00:02:12+02:00 (7 years ago)
Author:
michael2402
Message:

Apply #15167: Merge OSM and overpass download dialog. Patch by bafonins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r12620 r12652  
    2020
    2121import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.actions.OverpassDownloadAction.OverpassDownloadDialog;
    2322import org.openstreetmap.josm.data.preferences.CollectionProperty;
    2423import org.openstreetmap.josm.gui.ExtendedDialog;
     
    6463            + "</style>\n";
    6564
    66     private final OverpassDownloadDialog parentDialog;
     65    private final OverpassDownloadSource.OverpassDownloadSourcePanel dsPanel;
    6766
    6867    /**
    6968     * Create a new {@link OverpassQueryWizardDialog}
    70      * @param parentDialog The parent this dialog should be displayed for
    71      */
    72     public OverpassQueryWizardDialog(OverpassDownloadDialog parentDialog) {
    73         super(parentDialog, tr("Overpass Turbo Query Wizard"),
     69     * @param dsPanel The Overpass download source panel.
     70     */
     71    public OverpassQueryWizardDialog(OverpassDownloadSource.OverpassDownloadSourcePanel dsPanel) {
     72        super(dsPanel.getParent(), tr("Overpass Turbo Query Wizard"),
    7473                tr("Build query"), tr("Build query and execute"), tr("Cancel"));
    75         this.parentDialog = parentDialog;
     74        this.dsPanel = dsPanel;
    7675
    7776        this.queryWizard = new HistoryComboBox();
     
    9190        queryWizard.setPossibleItems(OVERPASS_WIZARD_HISTORY.get());
    9291
    93         setCancelButton(CANCEL);
    94         setDefaultButton(BUILD_AN_EXECUTE_QUERY + 1); // Build and execute button
     92        setCancelButton(CANCEL + 1);
     93        setDefaultButton(BUILD_AN_EXECUTE_QUERY + 1);
    9594        setContent(panel, false);
    9695    }
     
    110109                    super.buttonAction(BUILD_AN_EXECUTE_QUERY, evt);
    111110
    112                     parentDialog.triggerDownload();
     111                    DownloadDialog.getInstance().startDownload();
    113112                }
    114113                break;
     
    143142            Logging.error(ex);
    144143            JOptionPane.showMessageDialog(
    145                     parentDialog,
     144                    dsPanel.getParent(),
    146145                    "<html>" +
    147146                     tr("The Overpass wizard could not parse the following query:") +
     
    166165        if (q.isPresent()) {
    167166            String query = q.get();
    168             parentDialog.setOverpassQuery(query);
     167            dsPanel.setOverpassQuery(query);
    169168
    170169            return true;
Note: See TracChangeset for help on using the changeset viewer.