[Pkg-mozext-commits] [gcontactsync] 31/88: Added sync direction to the account wizard, updated the openAccountWizard function to only sync when finished if requested (first login only).

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 20:52:27 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 5185e72bbc92ed22c6c89bc50065985f7a720c20
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Mon Jan 20 11:50:02 2014 -0600

    Added sync direction to the account wizard, updated the openAccountWizard function to only sync when finished if requested (first login only).
---
 src/content/AccountSetupWizard.xul | 17 ++++++++++++++++-
 src/content/Overlay.js             | 18 ++++++++++--------
 src/content/Overlay.xul            |  4 ++--
 3 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/content/AccountSetupWizard.xul b/src/content/AccountSetupWizard.xul
index 3072a28..b6fb72c 100644
--- a/src/content/AccountSetupWizard.xul
+++ b/src/content/AccountSetupWizard.xul
@@ -16,7 +16,7 @@
    -
    - The Initial Developer of the Original Code is
    - Josh Geenen <gcontactsync at pirules.org>.
-   - Portions created by the Initial Developer are Copyright (C) 2013
+   - Portions created by the Initial Developer are Copyright (C) 2013-2014
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
@@ -35,6 +35,8 @@
    -
    - ***** END LICENSE BLOCK ***** -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://gcontactsync/skin/Accounts.css" type="text/css"?>
+
 <!--<?xml-stylesheet href="chrome://gcontactsync/skin/AccountSetupWizard.css" type="text/css"?>-->
 <!DOCTYPE window [
   <!ENTITY % initialSetupDTD SYSTEM "chrome://gcontactsync/locale/AccountSetupWizard.dtd">
@@ -158,6 +160,19 @@
               label="&GetGroups.label;"
               accesskey="&GetGroups.accesskey;"/>
     </hbox>
+    <spacer height="5px"/>
+    <hbox>
+      <label control="SyncDirection"  value="&SyncDirection.label;" accesskey="&SyncDirection.accesskey;"/>
+      <label id="link-label"    value="&DirectionHelp.label;"
+             onclick="com.gContactSync.Accounts.directionPopup();"/>
+    </hbox>
+    <menulist id="SyncDirection">
+      <menupopup id="SyncDirectionPopup">
+        <menuitem value="Complete"  label="&Complete.label;"/>
+        <menuitem value="ReadOnly"  label="&ReadOnly.label;"/>
+        <menuitem value="WriteOnly" label="&WriteOnly.label;"/>
+      </menupopup>
+    </menulist>
     <spacer flex="1"/>
     <label align="end" value="&finish.value;"/>
   </wizardpage>
diff --git a/src/content/Overlay.js b/src/content/Overlay.js
index cde9130..04a7b87 100644
--- a/src/content/Overlay.js
+++ b/src/content/Overlay.js
@@ -15,7 +15,7 @@
  *
  * The Initial Developer of the Original Code is
  * Josh Geenen <gcontactsync at pirules.org>.
- * Portions created by the Initial Developer are Copyright (C) 2008-2010
+ * Portions created by the Initial Developer are Copyright (C) 2008-2014
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
@@ -126,24 +126,26 @@ com.gContactSync.Overlay = {
       }
     } else {
       this.setStatusBarText(com.gContactSync.StringBundle.getStr("notAuth"));
-      this.openAccountWizard();
+      this.openAccountWizard(true);
     }
   },
   /**
    * 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() {
+  openAccountWizard: function Overlay_openAccountWizard(aSyncOnUnload) {
     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();
+    if (aSyncOnUnload === 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.
diff --git a/src/content/Overlay.xul b/src/content/Overlay.xul
index d613ad4..d2acdf2 100644
--- a/src/content/Overlay.xul
+++ b/src/content/Overlay.xul
@@ -16,7 +16,7 @@
    -
    - The Initial Developer of the Original Code is
    - Josh Geenen <gcontactsync at pirules.org>.
-   - Portions created by the Initial Developer are Copyright (C) 2008-2010
+   - Portions created by the Initial Developer are Copyright (C) 2008-2014
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
@@ -128,7 +128,7 @@
                label="&newAcctMenuItem.label;"
                accesskey="&newAcctMenuItem.accesskey;"
                class="menuitem-iconic icon-mail16 menu-iconic"
-               oncommand="com.gContactSync.Overlay.openAccountWizard();"/>
+               oncommand="com.gContactSync.Overlay.openAccountWizard(false);"/>
      <menuitem id="acctMenuItem"
                label="&acctMenuItem.label;"
                accesskey="&acctMenuItem.accesskey;"

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