[Pkg-mozext-commits] [gcontactsync] 18/88: Made the new account wizard functional. Added a menuitem to the gContactSync menu to open the new account wizard. Removed the first login GUI since it is no longer used

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 20:52:26 UTC 2014


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

taffit pushed a commit to branch master
in repository gcontactsync.

commit 7325eed220bcb920f1b4ac79ddedb8c3367dc5d3
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Sat Dec 28 11:30:47 2013 -0600

    Made the new account wizard functional.  Added a menuitem to the gContactSync menu to open the new account wizard.  Removed the first login GUI since it is no longer used
---
 src/content/AccountSetupWizard.js        |  78 ++++++++++++++++---
 src/content/AccountSetupWizard.xul       |   5 +-
 src/content/FirstLogin.xul               | 115 ----------------------------
 src/content/MessengerOverlay.js          | 126 ++-----------------------------
 src/content/Overlay.js                   |  47 ++++++++++++
 src/content/Overlay.xul                  |  10 +++
 src/content/Preferences.js               |   1 -
 src/defaults/preferences/gContactSync.js |   2 -
 src/locale/en-US/gcontactsync.properties |   4 +-
 src/locale/en-US/options.dtd             |   3 +-
 src/locale/en-US/overlay.dtd             |   6 +-
 11 files changed, 144 insertions(+), 253 deletions(-)

diff --git a/src/content/AccountSetupWizard.js b/src/content/AccountSetupWizard.js
index 5209e81..302e605 100644
--- a/src/content/AccountSetupWizard.js
+++ b/src/content/AccountSetupWizard.js
@@ -47,7 +47,7 @@ window.addEventListener("load",
 false);
 
 /**
- * Provides helper functions for the initial setup wizard.
+ * Provides helper functions for the new account wizard.
  */
 com.gContactSync.AccountSetupWizard = {
   NEW_ACCOUNT_IDS:      ["emailLabel", "email", "passwordLabel", "password"],
@@ -56,11 +56,15 @@ com.gContactSync.AccountSetupWizard = {
   mEmailAddress:        "",
   mAccounts:            [],
   /**
+   * Initializes the first page of the wizard.
    */
   init: function AccountSetupWizard_init() {
     this.updateAccountIDs();
     this.addAccounts();
   },
+  /**
+   * Adds IMAP, POP3, and gContactSync accounts from the login manager to the dropdown.
+   */
   addAccounts: function AccountSetupWizard_addAccounts() {
     com.gContactSync.LOGGER.VERBOSE_LOG("Adding accounts");
     this.mAccounts = [];
@@ -87,14 +91,21 @@ com.gContactSync.AccountSetupWizard = {
     }
     accountsMenuList.selectedIndex = 0;
   },
-  accountAlreadyExists: function AccountSetupWizard_accountAlreadyExists(username) {
-    username = username.toLowerCase();
+  /**
+   * Returns whether an account already exists for the given username.
+   * @param {string} aUsername The username to check.
+   * @return {boolean} Whether an account already exists for the given username.
+   */
+  accountAlreadyExists: function AccountSetupWizard_accountAlreadyExists(aUsername) {
+    aUsername = aUsername.toLowerCase();
     for (var i = 0; i < this.mAccounts.length; ++i) {
-      if (this.mAccounts[i].username.toLowerCase() === username) {return true;}
+      if (this.mAccounts[i].username.toLowerCase() === aUsername) {return true;}
     }
     return false;
   },
-
+  /**
+   * Updates the account-related elements to disable elements for the option not currently selected.
+   */
   updateAccountIDs: function AccountSetupWizard_updateAccountIDs() {
     var option = document.getElementById("accountOption");
     var disableIDs = this.EXISTING_ACCOUNT_IDS;
@@ -110,6 +121,12 @@ com.gContactSync.AccountSetupWizard = {
       document.getElementById(enableIDs[j]).disabled = false;
     }
   },
+  /**
+   * Gets an auth token for the selected username if necessary (and possible), then returns whether the page may
+   * advance now.  If this function must get an auth token it will advance the page upon successful completion
+   * of the HTTP request.
+   * @return {boolean} Whether the account page may advance now.
+   */
   advanceAccountPage: function AccountSetupWizard_advancedAccountPage() {
 
     // Try to get a token for the account
@@ -175,6 +192,12 @@ com.gContactSync.AccountSetupWizard = {
     // Don't let the page advance until a successful response is returned.
     return false;
   },
+  /**
+   * Initializes the account settings (address books and groups) and selects the AB with
+   * the name 'aSearch' if present.  If not found, creates an AB with the name this.mEmailAddress.
+   * Does not show ABs that are already being synchronized.
+   * @param {string} aSearch The AB to be highlighted.
+   */
   setupAccountSettings: function AccountSetupWizard_setupAccountSettings(aSearch) {
     var abNameElem = document.getElementById("abName");
     abNameElem.removeAllItems();
@@ -183,7 +206,8 @@ com.gContactSync.AccountSetupWizard = {
     var i = 0;
     aSearch = (aSearch || this.mEmailAddress).toLowerCase();
     for (var uri in abs) {
-      if (abs.hasOwnProperty(uri)) {
+      // Skip over address books that are already synchronized
+      if (abs.hasOwnProperty(uri) && !abs[uri].mPrefs.Username) {
         abNameElem.appendItem(abs[uri].getName(), uri);
         if (abs[uri].getName().toLowerCase() === aSearch) {
           selectedIndex = i;
@@ -192,14 +216,22 @@ com.gContactSync.AccountSetupWizard = {
       ++i;
     }
     if (selectedIndex === -1) {
-      abNameElem.insertItemAt(0, this.mEmailAddress, 0);
+      var name = aSearch;
+      // If an AB with the e-mail address doesn't already exist (or is synchronized) find
+      // the first AB of the form <email (#)> that 
+      for (var j = 1; true; ++j) {
+        var ab = com.gContactSync.GAbManager.getGAbByName(name, true);
+        if (!ab || !ab.mPrefs.Username) {break;}
+        name = this.mEmailAddress + " (" + j + ")";
+      }
+      abNameElem.insertItemAt(0, name, 0);
       selectedIndex = 0;
     }
     abNameElem.selectedIndex = selectedIndex;
     com.gContactSync.Accounts.restoreGroups();
   },
   /**
-   * Creates and returns a new address book after requesting a name for it.
+   * Creates and returns a new address book after requesting a name for it then updates the AB list.
    * If an AB of any type already exists this function will do nothing.
    */
   newAddressBook: function AccountSetupWizard_newAddressBook() {
@@ -207,8 +239,36 @@ com.gContactSync.AccountSetupWizard = {
     if (!name) {
       return;
     }
-    com.gContactSync.AbManager.getAbByName(name);
+    var ab = com.gContactSync.GAbManager.getGAbByName(name);
+    if (ab.mPrefs.Username) {
+      com.gContactSync.alertWarning(com.gContactSync.StringBundle.getStr("abAlreadySynchronized"));
+      return;
+    }
     this.setupAccountSettings(name);
+  },
+  /**
+   * Finishes the wizard by setting up the selected AB to sync with the selected account and group.
+   */
+  finish: function AccountSetupWizard_finish() {
+    var abName = document.getElementById("abName").label;
+    var group  = document.getElementById("Groups").value;
+    var syncGroups = String(group === "All"),
+        myContacts = String(group !== "All" && group !== "false");
+    // TODO combine with saveSelectedAccount
+    com.gContactSync.LOGGER.LOG("***Account Wizard is synchronizing " + abName + " with " + this.mEmailAddress + " / " + group + "***");
+    var ab = com.gContactSync.GAbManager.getGAbByName(abName);
+    ab.savePref("Username", this.mEmailAddress);
+    ab.savePref("Plugin", "Google");
+    ab.savePref("Disabled", "false");
+    ab.savePref("updateGoogleInConflicts", "true");
+    ab.savePref("Primary",  "true");
+    ab.savePref("syncGroups", syncGroups);
+    ab.savePref("myContacts", myContacts);
+    ab.savePref("myContactsName", group);
+    ab.savePref("writeOnly", "false");
+    ab.savePref("readOnly",  "false");
+    ab.setLastSyncDate(0);
+    return true;
   }
 };
 
diff --git a/src/content/AccountSetupWizard.xul b/src/content/AccountSetupWizard.xul
index 7ee6812..758a9f4 100644
--- a/src/content/AccountSetupWizard.xul
+++ b/src/content/AccountSetupWizard.xul
@@ -41,10 +41,13 @@
   %initialSetupDTD;
   <!ENTITY % accountsDTD SYSTEM "chrome://gcontactsync/locale/Accounts.dtd">
   %accountsDTD;
+  <!ENTITY % optionsDTD SYSTEM "chrome://gcontactsync/locale/options.dtd">
+  %optionsDTD;
 ]>
 
 <wizard id="initialSetupWizard" title="&title.label;"
-          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        onwizardfinish="com.gContactSync.AccountSetupWizard.finish();">
   <script type="application/x-javascript"
           src="chrome://gcontactsync/content/synonyms.js"/>
   <script type="application/x-javascript"
diff --git a/src/content/FirstLogin.xul b/src/content/FirstLogin.xul
deleted file mode 100644
index 7f15ca8..0000000
--- a/src/content/FirstLogin.xul
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<!-- ***** BEGIN LICENSE BLOCK *****
-   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
-   -
-   - The contents of this file are subject to the Mozilla Public License Version
-   - 1.1 (the "License"); you may not use this file except in compliance with
-   - the License. You may obtain a copy of the License at
-   - http://www.mozilla.org/MPL/
-   -
-   - Software distributed under the License is distributed on an "AS IS" basis,
-   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-   - for the specific language governing rights and limitations under the
-   - License.
-   -
-   - The Original Code is gContactSync.
-   -
-   - The Initial Developer of the Original Code is
-   - Josh Geenen <gcontactsync at pirules.org>.
-   - Portions created by the Initial Developer are Copyright (C) 2008
-   - the Initial Developer. All Rights Reserved.
-   -
-   - Contributor(s):
-   -
-   - Alternatively, the contents of this file may be used under the terms of
-   - either the GNU General Public License Version 2 or later (the "GPL"), or
-   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-   - in which case the provisions of the GPL or the LGPL are applicable instead
-   - of those above. If you wish to allow use of your version of this file only
-   - under the terms of either the GPL or the LGPL, and not to allow others to
-   - use your version of this file under the terms of the MPL, indicate your
-   - decision by deleting the provisions above and replace them with the notice
-   - and other provisions required by the LGPL or the GPL. If you do not delete
-   - the provisions above, a recipient may use your version of this file under
-   - the terms of any one of the MPL, the GPL or the LGPL.
-   -
-   - ***** END LICENSE BLOCK ***** -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE prefwindow SYSTEM "chrome://gcontactsync/locale/options.dtd">
-<prefwindow id="gContactSyncSetup"
-            title="&title.label;"
-            xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/synonyms.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/LoginManager.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/StringBundle.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/FileIO.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/Logger.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/Pref.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/Preferences.js"/>
-  <script type="application/x-javascript"
-          src="chrome://gcontactsync/content/options.js"/>
-
-  <prefpane id="gContactSync-setup" label="&title.label;">
-    <preferences>
-      <preference id="addressBookName"
-                  name="extensions.gContactSync.addressBookName"
-                  type="string"/>
-      <preference id="refreshInterval"
-                  name="extensions.gContactSync.refreshInterval"
-                  type="int"/>
-      <preference id="autoSync"
-                  name="extensions.gContactSync.autoSync"
-                  type="bool"/>
-      <preference id="phoneTypes"
-                  name="extensions.gContactSync.phoneTypes"
-                  type="bool"/>
-      <preference id="myContacts"
-                  name="extensions.gContactSync.myContacts"
-                  type="bool"/>
-    </preferences>
-    <groupbox>
-      <label value="&gettingStarted1.value;"/>
-      <separator class="thin"/>
-      <grid flex="1">
-        <columns>
-            <column/>
-        </columns>
-        <rows>
-          <row align="center">
-            <label control="abName"
-                   value="&abName.value;"/>
-            <textbox preference="addressBookName"
-                     id="abName"
-                     maxlength="40"
-                     minwidth="275"
-                     maxwidth="275"/>
-          </row>
-        </rows>
-      </grid>
-      <checkbox preference="autoSync"
-                id="autoSync"
-                label="&autoSync.label;"/>
-      <checkbox preference="phoneTypes"
-                id="phoneTypes"
-                label="&phoneTypes.label;"/>
-  	  <checkbox preference="myContacts"
-  	            id="cMyContacts"
-        				label="&myContacts.label;"/>
-      <hbox id="advancedSettings">
-        <label onclick="com.gContactSync.openAccounts();"
-               class="text-link"
-               value="&openAccounts.value;"/>
-        <label onclick="com.gContactSync.openPreferences();"
-               class="text-link"
-               value="&openPreferences.value;"/>
-      </hbox>
-    </groupbox>
-  </prefpane>
-</prefwindow>
diff --git a/src/content/MessengerOverlay.js b/src/content/MessengerOverlay.js
index 2ae0e39..230322b 100644
--- a/src/content/MessengerOverlay.js
+++ b/src/content/MessengerOverlay.js
@@ -91,21 +91,11 @@ com.gContactSync.MessengerOverlay = {
 
     com.gContactSync.Preferences.setSyncPref("synchronizing", false);
 
-    // On the first run display a login prompt
-    if (lastVersionMajor === lastVersionMinor === lastVersionRelease === 0) {
-      com.gContactSync.Overlay.setStatusBarText(com.gContactSync.StringBundle.getStr("notAuth"));
-      com.gContactSync.MessengerOverlay.promptLogin();
-    } else {
-
-      // If moving from 0.3.x or <0.4.0b1 then update the chat names
-      // The upgrade will take place during the next sync
-      if (((lastVersionMajor === 0) && (lastVersionMinor < 4)) ||
-          ((lastVersionRelease === 0) && (lastVersionSuffix.length > 0) && (lastVersionSuffix.charAt(0) === "a"))) {
-        com.gContactSync.Preferences.setSyncPref("v04UpgradeNeeded", true);
-      }
-
-      com.gContactSync.MessengerOverlay.updateVersion();
-      com.gContactSync.Sync.schedule(com.gContactSync.Preferences.mSyncPrefs.initialDelayMinutes.value * 60000);
+    // If moving from 0.3.x or <0.4.0b1 then update the chat names
+    // The upgrade will take place during the next sync
+    if (((lastVersionMajor === 0) && (lastVersionMinor < 4) && (lastVersionMajor > 0)) ||
+        ((lastVersionMajor === 0) && (lastVersionMinor === 4) && (lastVersionRelease === 0) && (lastVersionSuffix.length > 0) && (lastVersionSuffix.charAt(0) === "a"))) {
+      com.gContactSync.Preferences.setSyncPref("v04UpgradeNeeded", true);
     }
     if (com.gContactSync.Preferences.mSyncPrefs.overrideGetCardForEmail.value) {
       try {
@@ -113,6 +103,8 @@ com.gContactSync.MessengerOverlay = {
         getCardForEmail = com.gContactSync.MessengerOverlay.getCardForEmail;
       } catch (e) {}
     }
+    // Check for an auth token and either schedule a sync if at least one exists or show the new account wizard otherwise.
+    com.gContactSync.Overlay.checkAuthentication();
   },
   /**
    * Calls the original SetBusyCursor() function from mailCore.js wrapped in a
@@ -185,109 +177,5 @@ com.gContactSync.MessengerOverlay = {
       catch (ex) {}
     }
     return result;
-  },
-  /**
-   * Checks to see whether or not there is an authentication token in the login
-   * manager.  If so, it begins a sync.  If not, it shows the login prompt.
-   */
-  checkAuthentication: function MessengerOverlay_checkAuthentication() {
-    if (com.gContactSync.gdata.isAuthValid()) {
-      com.gContactSync.MessengerOverlay.updateVersion();  // Make sure the version has been updated
-      if (com.gContactSync.MessengerOverlay.mUsername) {
-        var name = com.gContactSync.Preferences.mSyncPrefs.addressBookName.value;
-        var ab   = com.gContactSync.GAbManager.getGAb(com.gContactSync.GAbManager.getAbByName(name));
-        ab.savePref("Username", com.gContactSync.MessengerOverlay.mUsername);
-        ab.setLastSyncDate(0);
-        com.gContactSync.Sync.begin(false, null);
-      } else {
-        com.gContactSync.Sync.schedule(com.gContactSync.Preferences.mSyncPrefs.initialDelayMinutes.value * 60000);
-      }
-    } else {
-      com.gContactSync.Overlay.setStatusBarText(com.gContactSync.StringBundle.getStr("notAuth"));
-      com.gContactSync.MessengerOverlay.promptLogin();
-    }
-  },
-  /**
-   * Updates the current version in the gContactSync preferences.
-   */
-  updateVersion: function MessengerOverlay_updateVersion() {
-    com.gContactSync.Preferences.setSyncPref("lastVersionMajor",
-                                             com.gContactSync.versionMajor);
-    com.gContactSync.Preferences.setSyncPref("lastVersionMinor",
-                                             com.gContactSync.versionMinor);
-    com.gContactSync.Preferences.setSyncPref("lastVersionRelease",
-                                             com.gContactSync.versionRelease);
-    com.gContactSync.Preferences.setSyncPref("lastVersionSuffix",
-                                             com.gContactSync.versionSuffix);
-  },
-  /**
-   * Prompts the user to enter his or her Google username and password and then
-   * gets an authentication token to store and use.
-   */
-  promptLogin: function MessengerOverlay_promptLogin() {
-    // TODO - open the initial login wizard
-    var prompt   = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
-                             .getService(Components.interfaces.nsIPromptService)
-                             .promptUsernameAndPassword;
-    var username = {};
-    var password = {};
-    // opens a username/password prompt
-    var ok = prompt(window, com.gContactSync.StringBundle.getStr("loginTitle"),
-                    com.gContactSync.StringBundle.getStr("loginText"), username, password, null,
-                    {value: false});
-    if (!ok)
-      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 com.gContactSync.MessengerOverlay.promptLogin();
-    }
-    
-    // fix the username before authenticating
-    username.value = com.gContactSync.fixUsername(username.value);
-    var body     = com.gContactSync.gdata.makeAuthBody(username.value, password.value);
-    var 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 authSuccess(httpReq) {
-      com.gContactSync.MessengerOverlay.login(username.value,
-                                     httpReq.responseText.split("\n")[2]);
-    };
-    // if it fails, alert the user and prompt them to try again
-    httpReq.mOnError = function authError(httpReq) {
-      com.gContactSync.alertError(com.gContactSync.StringBundle.getStr('authErr'));
-      com.gContactSync.LOGGER.LOG_ERROR('Authentication Error - ' +
-                                        httpReq.status,
-                                        httpReq.responseText);
-      com.gContactSync.MessengerOverlay.promptLogin();
-    };
-    // if the user is offline, alert them and quit
-    httpReq.mOnOffline = com.gContactSync.Sync.mOfflineFunction;
-    httpReq.send();
-    return true;
-  },
-  /**
-   * Stores the given auth token in the login manager and starts the setup
-   * window that will begin the first synchronization when closed.
-   * @param aAuthToken {string} The authentication token to store.
-   */
-  login: function MessengerOverlay_login(aUsername, aAuthToken) {
-    // TODO REMOVE
-    com.gContactSync.LoginManager.addAuthToken(aUsername, 'GoogleLogin ' + aAuthToken);
-    com.gContactSync.Overlay.setStatusBarText(com.gContactSync.StringBundle.getStr("initialSetup"));
-    var setup = window.open("chrome://gcontactsync/content/FirstLogin.xul",
-                            "SetupWindow",
-                            "chrome,resizable=yes,scrollbars=no,status=no");
-    com.gContactSync.MessengerOverlay.mUsername = aUsername;
-    // when the setup window loads, set its onunload property to begin a sync
-    setup.onload = function onloadListener() {
-      setup.onunload = function onunloadListener() {
-        com.gContactSync.MessengerOverlay.checkAuthentication();
-      };
-    };
   }
 };
diff --git a/src/content/Overlay.js b/src/content/Overlay.js
index 163640a..cde9130 100644
--- a/src/content/Overlay.js
+++ b/src/content/Overlay.js
@@ -57,6 +57,7 @@ com.gContactSync.Overlay = {
   mLastVersionMinor:   0,
   mLastVersionRelease: 0,
   mLastVersionSuffix:  "",
+  mAccountWizard:      false,
   /**
    * Called when the overlay is loaded and initializes everything and begins
    * the authentication check and sync or login prompt.
@@ -110,5 +111,51 @@ com.gContactSync.Overlay = {
     minutes     = minutes.length === 1 ?  "0" + minutes : minutes;
     seconds     = seconds.length === 1 ?  "0" + seconds : seconds;
     this.setStatusBarText(text + " " + hours + ":" + minutes + ":" + seconds);
+  },
+  /**
+   * Checks to see whether or not there is an authentication token in the login
+   * manager.  If so, it begins a sync.  If not, it shows the new account wizard.
+   */
+  checkAuthentication: function Overlay_checkAuthentication() {
+    if (com.gContactSync.gdata.isAuthValid()) {
+      this.updateVersion();  // Make sure the version has been updated
+      if (this.mAccountWizard) {
+        com.gContactSync.Sync.begin(true, null);
+      } else {
+        com.gContactSync.Sync.schedule(com.gContactSync.Preferences.mSyncPrefs.initialDelayMinutes.value * 60000);
+      }
+    } else {
+      this.setStatusBarText(com.gContactSync.StringBundle.getStr("notAuth"));
+      this.openAccountWizard();
+    }
+  },
+  /**
+   * Prompts the user to enter his or her Google username and password and then
+   * gets an authentication token to store and use.
+   */
+  openAccountWizard: function Overlay_openAccountWizard() {
+    var wizard = window.open("chrome://gcontactsync/content/AccountSetupWizard.xul",
+                             "SetupWindow",
+                             "chrome,resizable=yes,scrollbars=no,status=no");
+    this.mAccountWizard = true;
+    // when the setup window loads, set its onunload property to begin a sync
+    wizard.onload = function onloadListener() {
+      wizard.onunload = function onunloadListener() {
+        com.gContactSync.Overlay.checkAuthentication();
+      };
+    };
+  },
+  /**
+   * Updates the current version in the gContactSync preferences.
+   */
+  updateVersion: function MessengerOverlay_updateVersion() {
+    com.gContactSync.Preferences.setSyncPref("lastVersionMajor",
+                                             com.gContactSync.versionMajor);
+    com.gContactSync.Preferences.setSyncPref("lastVersionMinor",
+                                             com.gContactSync.versionMinor);
+    com.gContactSync.Preferences.setSyncPref("lastVersionRelease",
+                                             com.gContactSync.versionRelease);
+    com.gContactSync.Preferences.setSyncPref("lastVersionSuffix",
+                                             com.gContactSync.versionSuffix);
   }
 };
diff --git a/src/content/Overlay.xul b/src/content/Overlay.xul
index 379e914..505d51d 100644
--- a/src/content/Overlay.xul
+++ b/src/content/Overlay.xul
@@ -124,6 +124,11 @@
                accesskey="&syncMenuItem.accesskey;"
                class="menuitem-iconic icon-mail16 menu-iconic"
                oncommand="com.gContactSync.Sync.begin(true, null);"/>
+     <menuitem id="newAcctMenuItem"
+               label="&newAcctMenuItem.label;"
+               accesskey="&newAcctMenuItem.accesskey;"
+               class="menuitem-iconic icon-mail16 menu-iconic"
+               oncommand="com.gContactSync.Overlay.openAccountWizard();"/>
      <menuitem id="acctMenuItem"
                label="&acctMenuItem.label;"
                accesskey="&acctMenuItem.accesskey;"
@@ -201,6 +206,11 @@
                accesskey="&syncMenuItem.accesskey;"
                class="menuitem-iconic icon-mail16 menu-iconic"
                oncommand="com.gContactSync.Sync.begin(true, null);"/>
+     <menuitem id="newAcctMenuItem"
+               label="&newAcctMenuItem.label;"
+               accesskey="&newAcctMenuItem.accesskey;"
+               class="menuitem-iconic icon-mail16 menu-iconic"
+               oncommand="com.gContactSync.Overlay.openAccountWizard();"/>
      <menuitem id="acctMenuItem"
                label="&acctMenuItem.label;"
                accesskey="&acctMenuItem.accesskey;"
diff --git a/src/content/Preferences.js b/src/content/Preferences.js
index 3ecca76..2241d26 100644
--- a/src/content/Preferences.js
+++ b/src/content/Preferences.js
@@ -194,7 +194,6 @@ com.gContactSync.Preferences = {
     alertSummary:             new com.gContactSync.Pref("alertSummary",             "bool", true),
     statusBarText:            new com.gContactSync.Pref("statusBarText",            "char", ""),
     myContactsName:           new com.gContactSync.Pref("myContactsName",           "char", "My Contacts"),
-    addressBookName:          new com.gContactSync.Pref("addressBookName",          "char", "Google Contacts"),
     lastVersionMajor:         new com.gContactSync.Pref("lastVersionMajor",         "int",  0),
     lastVersionMinor:         new com.gContactSync.Pref("lastVersionMinor",         "int",  0),
     lastVersionRelease:       new com.gContactSync.Pref("lastVersionRelease",       "int",  0),
diff --git a/src/defaults/preferences/gContactSync.js b/src/defaults/preferences/gContactSync.js
index c82efcf..9230009 100644
--- a/src/defaults/preferences/gContactSync.js
+++ b/src/defaults/preferences/gContactSync.js
@@ -2,8 +2,6 @@
 pref("extensions.gContactSync.refreshInterval", 120);
 // the delay between synchronizing individual accounts (in ms)
 pref("extensions.gContactSync.accountDelay", 5000);
-// the name of the address book to sync with
-pref("extensions.gContactSync.addressBookName", "Google Contacts");
 // the number of contacts supported.  Automatically raised, if necessary.
 pref("extensions.gContactSync.maxContacts", 10000);
 // set to true if Google should be updated when a contact changes in Thunderbird
diff --git a/src/locale/en-US/gcontactsync.properties b/src/locale/en-US/gcontactsync.properties
index 69929d1..e710e04 100644
--- a/src/locale/en-US/gcontactsync.properties
+++ b/src/locale/en-US/gcontactsync.properties
@@ -1,5 +1,4 @@
-# Extension name and description
-extensions.gContactSync.addressBookName=Google Contacts
+# Add-on description
 extensions.gContactSync at pirules.net.description=Synchronizes Google Contacts with Thunderbird
 
 # Fake e-mail addresses will appear as <dummy1><some numbers and letters>
@@ -324,3 +323,4 @@ version04UpgradeMessage=Converting your contacts for version 0.4 of gContactSync
 
 # Account setup wizard
 noAccountsFound=No Accounts Found
+abAlreadySynchronized=The requested address book is already being synchronized.  Please select or create a different address book.
diff --git a/src/locale/en-US/options.dtd b/src/locale/en-US/options.dtd
index c2d0612..c50378b 100644
--- a/src/locale/en-US/options.dtd
+++ b/src/locale/en-US/options.dtd
@@ -39,7 +39,6 @@
 <!ENTITY cleanOldPrefs.label            "Clean Old AB Preferences">
 <!ENTITY cleanOldPhotos.label           "Delete Old Contact Photos">
 
-<!-- FirstLogin.xul only -->
-<!ENTITY myContacts.label               "Only synchronize the 'My Contacts' group">
+<!-- FirstLogin.xul only TODO -->
 <!ENTITY openAccounts.value             "Advanced Account Settings">
 <!ENTITY openPreferences.value          "Advanced Settings">
diff --git a/src/locale/en-US/overlay.dtd b/src/locale/en-US/overlay.dtd
index d1d6aee..fdffe88 100644
--- a/src/locale/en-US/overlay.dtd
+++ b/src/locale/en-US/overlay.dtd
@@ -38,10 +38,12 @@
 
 <!-- The gContactSync menu -->
 <!ENTITY gContactSyncMenu.label        "gContactSync">
-<!ENTITY gContactSyncMenu.accesskey    "g">
+<!ENTITY gContactSyncMenu.accesskey    "C">
 <!ENTITY syncMenuItem.label            "Sync">
 <!ENTITY syncMenuItem.accesskey        "S">
-<!ENTITY acctMenuItem.label            "Accounts">
+<!ENTITY newAcctMenuItem.label         "New Account">
+<!ENTITY newAcctMenuItem.accesskey     "N">
+<!ENTITY acctMenuItem.label            "Edit Accounts">
 <!ENTITY acctMenuItem.accesskey        "A">
 <!ENTITY prefMenuItem.label            "Preferences">
 <!ENTITY prefMenuItem.accesskey        "P">

-- 
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