Ignore:
Timestamp:
2009-06-26T16:21:47+02:00 (15 years ago)
Author:
hampelratte
Message:

added switch from appspot to schokokeks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r14817 r16135  
    2828package org.openstreetmap.josm.plugins.osb;
    2929
     30import static org.openstreetmap.josm.tools.I18n.tr;
     31
    3032import java.awt.event.ActionEvent;
    3133import java.awt.event.ActionListener;
     
    8789        }
    8890       
     91        // check, which api is used
     92        String uriNew = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
     93        boolean oldApi = uriNew != null && uriNew.contains("appspot");
     94        boolean switchApi = true;
     95        if(oldApi) {
     96            int choice = JOptionPane.showConfirmDialog(Main.parent,
     97                    tr("<html>The openstreetbus plugin is using the old server at appspot.com.<br>" +
     98                                "A new server is available at schokokeks.org.<br>" +
     99                                "Do you want to switch to the new server? (Strongly recommended)</html>"),
     100                    tr("Switch to new openstreetbugs server?"),
     101                    JOptionPane.YES_NO_OPTION);
     102            switchApi = choice == JOptionPane.YES_OPTION;
     103        }
     104               
    89105        String uri = Main.pref.get(ConfigKeys.OSB_API_URI_EDIT);
    90         if(uri == null || uri.length() == 0) {
    91             uri = "http://openstreetbugs.appspot.com/editPOIexec";
     106        if(uri == null || uri.length() == 0 || switchApi) {
     107            uri = "http://openstreetbugs.schokokeks.org/api/0.1/editPOIexec";
    92108            Main.pref.put(ConfigKeys.OSB_API_URI_EDIT, uri);
    93109        }
    94110       
    95111        uri = Main.pref.get(ConfigKeys.OSB_API_URI_CLOSE);
    96         if(uri == null || uri.length() == 0) {
    97             uri = "http://openstreetbugs.appspot.com/closePOIexec";
     112        if(uri == null || uri.length() == 0 || switchApi) {
     113            uri = "http://openstreetbugs.schokokeks.org/api/0.1/closePOIexec";
    98114            Main.pref.put(ConfigKeys.OSB_API_URI_CLOSE, uri);
    99115        }
    100116       
    101117        uri = Main.pref.get(ConfigKeys.OSB_API_URI_DOWNLOAD);
    102         if(uri == null || uri.length() == 0) {
    103             uri = "http://openstreetbugs.appspot.com/getBugs";
     118        if(uri == null || uri.length() == 0 || switchApi) {
     119            uri = "http://openstreetbugs.schokokeks.org/api/0.1/getBugs";
    104120            Main.pref.put(ConfigKeys.OSB_API_URI_DOWNLOAD, uri);
    105121        }
    106122       
    107123        uri = Main.pref.get(ConfigKeys.OSB_API_URI_NEW);
    108         if(uri == null || uri.length() == 0) {
    109             uri = "http://openstreetbugs.appspot.com/addPOIexec";
     124        if(uri == null || uri.length() == 0 || switchApi) {
     125            uri = "http://openstreetbugs.schokokeks.org/api/0.1/addPOIexec";
    110126            Main.pref.put(ConfigKeys.OSB_API_URI_NEW, uri);
    111127        }
Note: See TracChangeset for help on using the changeset viewer.