Changeset 6847 in josm for trunk/src/org


Ignore:
Timestamp:
2014-02-12T20:52:31+01:00 (11 years ago)
Author:
Don-vip
Message:

see #9710 - OAuth advanced parameters persistence

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r6599 r6847  
    235235    }
    236236
    237     /**
    238      * Saves these OAuth parameters to the given {@code Preferences}.
    239      * @param pref The Preferences into which are saved these OAuth parameters with the prefix "oauth.settings"
    240      */
    241     public void saveToPreferences(Preferences pref) {
    242         pref.put("oauth.settings.consumer-key", consumerKey);
    243         pref.put("oauth.settings.consumer-secret", consumerSecret);
    244         pref.put("oauth.settings.request-token-url", requestTokenUrl);
    245         pref.put("oauth.settings.access-token-url", accessTokenUrl);
    246         pref.put("oauth.settings.authorise-url", authoriseUrl);
    247     }
    248 
    249237    @Override
    250238    public int hashCode() {
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r6845 r6847  
    246246        } else {
    247247            cbUseDefaults.setSelected(false);
    248             tfConsumerKey.setText(pref.get("oauth.settings.consumer-key", ""));
    249             tfConsumerSecret.setText(pref.get("oauth.settings.consumer-secret", ""));
    250             tfRequestTokenURL.setText(pref.get("oauth.settings.request-token-url", ""));
    251             tfAccessTokenURL.setText(pref.get("oauth.settings.access-token-url", ""));
    252             tfAuthoriseURL.setText(pref.get("oauth.settings.authorise-url", ""));
     248            tfConsumerKey.setText(pref.get("oauth.settings.consumer-key", OAuthParameters.DEFAULT_JOSM_CONSUMER_KEY));
     249            tfConsumerSecret.setText(pref.get("oauth.settings.consumer-secret", OAuthParameters.DEFAULT_JOSM_CONSUMER_SECRET));
     250            tfRequestTokenURL.setText(pref.get("oauth.settings.request-token-url", OAuthParameters.DEFAULT_REQUEST_TOKEN_URL));
     251            tfAccessTokenURL.setText(pref.get("oauth.settings.access-token-url", OAuthParameters.DEFAULT_ACCESS_TOKEN_URL));
     252            tfAuthoriseURL.setText(pref.get("oauth.settings.authorise-url", OAuthParameters.DEFAULT_AUTHORISE_URL));
    253253            setChildComponentsEnabled(true);
    254254        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r6602 r6847  
    171171        OAuthAccessTokenHolder.getInstance().setSaveToPreferences(cbSaveToPreferences.isSelected());
    172172        OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
    173         pnlAdvancedProperties.getAdvancedParameters().saveToPreferences(Main.pref);
     173        pnlAdvancedProperties.rememberPreferences(Main.pref);
    174174    }
    175175
Note: See TracChangeset for help on using the changeset viewer.