Ignore:
Timestamp:
2011-01-01T14:38:14+01:00 (13 years ago)
Author:
bastik
Message:

'fixed josm bug 5800 - 'Override old backup files?' message window can't get focus'

Location:
applications/editors/josm/plugins/photo_geotagging
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photo_geotagging/build.xml

    r24097 r24928  
    2525
    2626        <!-- enter the SVN commit message -->
    27         <property name="commit.message" value="applied patch by ax (JOSM ticket 5602) - photo_geotagging fails to write coordinates into image header on win32" />
     27        <property name="commit.message" value="fixed josm bug 5800 - 'Override old backup files?' message window can't get focus" />
    2828        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    29         <property name="plugin.main.version" value="3408" />
     29        <property name="plugin.main.version" value="3752" />
    3030
    3131
  • applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java

    r24097 r24928  
    3838import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;
    3939import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
     40import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    4041import org.openstreetmap.josm.tools.GBC;
    4142import org.openstreetmap.josm.tools.ImageProvider;
     
    293294
    294295        private void confirm_override() {
    295             if (override_backup == null) {
    296                 JLabel l = new JLabel(tr("<html><h3>There are old backup files in the image directory!</h3>"));
    297                 l.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
    298                 int override = new ExtendedDialog(
    299                         Main.parent,
    300                         tr("Override old backup files?"),
    301                         new String[] {tr("Cancel"), tr("Keep old backups and continue"), tr("Override")})
    302                     .setButtonIcons(new String[] {"cancel.png", "ok.png", "dialogs/delete.png"})
    303                     .setContent(l)
    304                     .setCancelButton(1)
    305                     .setDefaultButton(2)
    306                     .showDialog()
    307                     .getValue();
    308                 if (override == 2) {
    309                     override_backup = false;
    310                 } else if (override == 3) {
    311                     override_backup = true;
    312                 } else {
    313                     cancelled = true;
    314                     return;
    315                 }
     296            if (override_backup != null)
     297                return;
     298            try {
     299                SwingUtilities.invokeAndWait(new Runnable() {
     300                    public void run() {
     301                        JLabel l = new JLabel(tr("<html><h3>There are old backup files in the image directory!</h3>"));
     302                        l.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
     303                        int override = new ExtendedDialog(
     304                                ((PleaseWaitProgressMonitor) progressMonitor).getDialog(),
     305                                tr("Override old backup files?"),
     306                                new String[] {tr("Cancel"), tr("Keep old backups and continue"), tr("Override")})
     307                            .setButtonIcons(new String[] {"cancel.png", "ok.png", "dialogs/delete.png"})
     308                            .setContent(l)
     309                            .setCancelButton(1)
     310                            .setDefaultButton(2)
     311                            .showDialog()
     312                            .getValue();
     313                        if (override == 2) {
     314                            override_backup = false;
     315                        } else if (override == 3) {
     316                            override_backup = true;
     317                        } else {
     318                            cancelled = true;
     319                        }
     320                    }
     321                });
     322            } catch (Exception e) {
     323                System.err.println(e);
     324                cancelled = true;
    316325            }
    317326        }
Note: See TracChangeset for help on using the changeset viewer.