[Pkg-mozext-commits] [gcontactsync] 18/31: Issue #62 - Remove the New Account button

David Prévot taffit at moszumanska.debian.org
Sun Feb 22 21:34:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository gcontactsync.

commit b01261f24ce38029b7ee4457cba45670ec4d8bb8
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Tue Dec 23 08:49:08 2014 -0600

    Issue #62 - Remove the New Account button
---
 src/content/Accounts.js                  | 59 --------------------------------
 src/content/Accounts.xul                 |  2 --
 src/locale/en-US/Accounts.dtd            |  2 --
 src/locale/en-US/gcontactsync.properties |  1 -
 4 files changed, 64 deletions(-)

diff --git a/src/content/Accounts.js b/src/content/Accounts.js
index 7657413..aef9651 100644
--- a/src/content/Accounts.js
+++ b/src/content/Accounts.js
@@ -86,65 +86,6 @@ com.gContactSync.Accounts = {
     }
   },
   /**
-   * Create a new username/account for the selected plugin.
-   * @returns {boolean} True if an authentication HTTP request was sent.
-   */
-  newUsername: function Accounts_newUsername() {
-    /*
-    var prompt   = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-                             .getService(Components.interfaces.nsIPromptService)
-                             .promptUsernameAndPassword,
-        username = {},
-        password = {},
-        // opens a username/password prompt
-        ok = prompt(window, com.gContactSync.StringBundle.getStr("loginTitle"),
-                    com.gContactSync.StringBundle.getStr("loginText"), username, password, null,
-                    {value: false});
-    if (!ok) {
-      return false;
-    }
-    if (com.gContactSync.LoginManager.getAuthToken(username.value)) { // the username already exists
-      com.gContactSync.alertWarning(com.gContactSync.StringBundle.getStr("usernameExists"));
-      return false;
-    }
-    // This is a primitive way of validating an e-mail address, but Google takes
-    // care of the rest.  It seems to allow getting an auth token w/ only the
-    // username, but returns an error when trying to do anything w/ that token
-    // so this makes sure it is a full e-mail address.
-    if (username.value.indexOf("@") < 1) {
-      com.gContactSync.alertError(com.gContactSync.StringBundle.getStr("invalidEmail"));
-      return this.newUsername();
-    }
-    // fix the username before authenticating
-    username.value = com.gContactSync.fixUsername(username.value);
-    var body    = com.gContactSync.gdata.makeAuthBody(username.value, password.value),
-        httpReq = new com.gContactSync.GHttpRequest("authenticate", null, null, body);
-    // if it succeeds and Google returns the auth token, store it and then start
-    // a new sync
-    httpReq.mOnSuccess = function newUsernameSuccess(httpReq) {
-      com.gContactSync.LoginManager.addAuthToken(username.value,
-                                                 'GoogleLogin' + httpReq.responseText.split("\n")[2]);
-      com.gContactSync.Accounts.selectedAbChange();
-      com.gContactSync.Accounts.fillUsernames();
-    };
-    // if it fails, alert the user and prompt them to try again
-    httpReq.mOnError   = function newUsernameError(httpReq) {
-      com.gContactSync.alertError(com.gContactSync.StringBundle.getStr('authErr'));
-      com.gContactSync.LOGGER.LOG_ERROR('Authentication Error - ' +
-                                        httpReq.status,
-                                        httpReq.responseText);
-      com.gContactSync.Accounts.newUsername();
-    };
-    // if the user is offline, alert them and quit
-    httpReq.mOnOffline = function newUsernameOffline(httpReq) {
-      com.gContactSync.alertWarning(com.gContactSync.StringBundle.getStr('offlineErr'));
-      com.gContactSync.LOGGER.LOG_ERROR(com.gContactSync.StringBundle.getStr('offlineErr'));
-    };
-    httpReq.send();
-    */
-    return true;
-  },
-  /**
    * Returns the GAddressBook corresponding to the currently-selected address
    * book in the accounts tree.
    * @returns {com.gContactSync.GAddressBook} A GAddressBook if one is selected, else false.
diff --git a/src/content/Accounts.xul b/src/content/Accounts.xul
index f034a7d..03869e1 100644
--- a/src/content/Accounts.xul
+++ b/src/content/Accounts.xul
@@ -71,8 +71,6 @@
     <vbox>
       <hbox>
         <label control="Username" value="&Username.label;" accesskey="&Username.accesskey;"/>
-        <label id="link-label"    value="&NewUsername.label;" accesskey="&NewUsername.accesskey;"
-               onclick="com.gContactSync.Accounts.newUsername();"/>
       </hbox>
       <menulist id="Username"
                 oncommand="com.gContactSync.Accounts.restoreGroups();
diff --git a/src/locale/en-US/Accounts.dtd b/src/locale/en-US/Accounts.dtd
index b8165c0..afeb161 100644
--- a/src/locale/en-US/Accounts.dtd
+++ b/src/locale/en-US/Accounts.dtd
@@ -15,8 +15,6 @@
 <!-- Basic Settings -->
 <!ENTITY Username.label          "Choose an Account">
 <!ENTITY Username.accesskey      "C">
-<!ENTITY NewUsername.label       "Add a New Account">
-<!ENTITY NewUsername.accesskey   "A">
 <!ENTITY NoUsername.label        "No usernames found">
 
 <!ENTITY Groups.label            "Groups and Contacts to Synchronize">
diff --git a/src/locale/en-US/gcontactsync.properties b/src/locale/en-US/gcontactsync.properties
index fc2c46e..0a4d73d 100644
--- a/src/locale/en-US/gcontactsync.properties
+++ b/src/locale/en-US/gcontactsync.properties
@@ -136,7 +136,6 @@ removeLoginFailure=Unable to remove the authentication token.\nThis probably mea
 warning=Warning: The synchronized address book was deleted since the last sync.\nIt was automatically re-created, but please restart Thunderbird to avoid a crash or loss of data (Mailnews Bug 401496).\n\nClick OK to stop the sync or Cancel to continue anyway.
 abNameTitle=Address Book name for
 abName=What is the name of the address book you would like to synchronize this account's contacts with?
-usernameExists=An account with that e-mail address is already being synchronized.
 abExists=This address book already exists.\nNOTE: If you already synchronized this address book with another synchronization add-on or imported your Gmail contacts you should click Cancel and choose a new address book.\nYou cannot sync an address book with more than one account.\nAre you sure you want to continue?  Click Cancel to choose a different name.
 invalidDirName=That address book name is invalid, please try a different name.
 preferences=Preferences

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git



More information about the Pkg-mozext-commits mailing list