Bug 841480 - Metro sync UI changes. r=mbrubeck
authorBrian R. Bondy <netzen@gmail.com>
Wed, 27 Feb 2013 11:18:31 -0500
changeset 123178 026f901ab4177471f7c37f6f71552dc58ecd0e64
parent 123177 e5c769a2741a28645e6d249934d0d91056df11d6
child 123179 a2c6dda9543e8f693629c6bbc32f203169d75336
push id24373
push userryanvm@gmail.com
push dateThu, 28 Feb 2013 01:36:21 +0000
treeherdermozilla-central@8cb9d6981978 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs841480
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841480 - Metro sync UI changes. r=mbrubeck
browser/metro/base/content/browser.xul
browser/metro/base/content/sync.js
browser/metro/locales/en-US/chrome/sync.dtd
browser/metro/theme/browser.css
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -424,32 +424,29 @@
         <label value="&aboutHeader.company.label;"/>
 #expand <label id="about-version-label">__MOZ_APP_VERSION__</label>
         <label id="about-policy-label"
                onclick="if (event.button == 0) { Browser.onAboutPolicyClick(); }"
                class="text-link" value="&aboutHeader.policy.label;"/>
     </flyoutpanel>
 
     <flyoutpanel id="sync-flyoutpanel" headertext="&syncHeader.title;">
-      <settings id="prefs-sync" label="&sync.title;">
-        <setting id="sync-connect" title="&sync.notconnected;" type="control">
-          <button label="&sync.connect;" oncommand="WeaveGlue.tryConnect();" />
-        </setting>
-        <setting id="sync-connected" class="setting-group" title="&sync.connected;" type="control" collapsed="true">
-          <button id="sync-pairdevice" label="&sync.pair.title;" oncommand="SyncPairDevice.open();" />
-          <button id="sync-details" label="&sync.details;" type="checkbox" autocheck="false" checked="false" oncommand="WeaveGlue.showDetails();" />
-        </setting>
-        <setting id="sync-sync" class="setting-subgroup" type="control" collapsed="true">
-          <button id="sync-syncButton" label="&sync.syncNow;" oncommand="WeaveGlue.sync();"/>
-        </setting>
-        <setting id="sync-device" class="setting-subgroup" type="string" title="&sync.deviceName;" onchange="WeaveGlue.changeName(this);" collapsed="true"/>
-        <setting id="sync-disconnect" class="setting-subgroup" type="control" collapsed="true">
-          <button label="&sync.disconnect;" oncommand="WeaveGlue.disconnect();" />
-        </setting>
-      </settings>
+      <setting id="sync-connect" title="&sync.notconnected;" type="control">
+        <button label="&sync.connect;" oncommand="WeaveGlue.tryConnect();" />
+      </setting>
+      <setting id="sync-connected" class="setting-group" title="&sync.connected;" type="control" collapsed="true">
+        <button id="sync-pairdevice" label="&sync.pair.title;" oncommand="SyncPairDevice.open();" />
+      </setting>
+      <setting id="sync-sync" class="setting-subgroup" type="control" collapsed="true">
+        <button id="sync-syncButton" label="&sync.syncNow;" oncommand="WeaveGlue.sync();"/>
+      </setting>
+      <setting id="sync-device" class="setting-subgroup" type="string" title="&sync.deviceName;" onchange="WeaveGlue.changeName(this);" collapsed="true"/>
+      <setting id="sync-disconnect" class="setting-subgroup" type="control" collapsed="true">
+        <button label="&sync.disconnect;" oncommand="WeaveGlue.disconnect();" />
+      </setting>
     </flyoutpanel>
 
     <flyoutpanel id="prefs-flyoutpanel" headertext="&optionsHeader.title;">
       <settings id="prefs-startup" label="&optionsHeader.startup.title;"> <!-- note, this element has a custom margin-top -->
         <setting id="prefs-homepage" title="&optionsHeader.homepage.title;" type="menulist" pref="browser.startup.sessionRestore" class="setting-expanded">
           <menulist id="prefs-homepage-options">
             <menupopup id="prefs-homepage-popup" position="after_end">
               <menuitem id="prefs-homepage-default" label="&optionsHeader.homepage.startPage.button;" value="false"/>
--- a/browser/metro/base/content/sync.js
+++ b/browser/metro/base/content/sync.js
@@ -280,25 +280,16 @@ let WeaveGlue = {
     let account = this._elements.account.value;
     let password = this._elements.password.value;
     let synckey = this._elements.synckey.value;
 
     let disabled = !(account && password && synckey);
     document.getElementById("syncsetup-button-connect").disabled = disabled;
   },
 
-  showDetails: function showDetails() {
-    // Show the connect UI detail settings
-    let show = this._elements.sync.collapsed;
-    this._elements.details.checked = show;
-    this._elements.sync.collapsed = !show;
-    this._elements.device.collapsed = !show;
-    this._elements.disconnect.collapsed = !show;
-  },
-
   tryConnect: function login() {
     // If Sync is not configured, simply show the setup dialog
     if (this._loginError || Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED) {
       this.open();
       return;
     }
 
     // No setup data, do nothing
@@ -404,17 +395,17 @@ let WeaveGlue = {
 
     // Get all the setting nodes from the add-ons display
     let elements = {};
     let setupids = ["account", "password", "synckey", "usecustomserver", "customserver"];
     setupids.forEach(function(id) {
       elements[id] = document.getElementById("syncsetup-" + id);
     });
 
-    let settingids = ["device", "connect", "connected", "disconnect", "sync", "details", "pairdevice"];
+    let settingids = ["device", "connect", "connected", "disconnect", "sync", "pairdevice"];
     settingids.forEach(function(id) {
       elements[id] = document.getElementById("sync-" + id);
     });
 
     // Replace the getter with the collection of settings
     delete this._elements;
     return this._elements = elements;
   },
@@ -431,17 +422,16 @@ let WeaveGlue = {
 
     // Can't do anything before settings are loaded
     if (this._elements == null)
       return;
 
     // Make some aliases
     let connect = this._elements.connect;
     let connected = this._elements.connected;
-    let details = this._elements.details;
     let device = this._elements.device;
     let disconnect = this._elements.disconnect;
     let sync = this._elements.sync;
     let pairdevice = this._elements.pairdevice;
 
     // Show what went wrong with login if necessary
     if (aTopic == "weave:ui:login:error") {
       this._loginError = true;
@@ -460,22 +450,22 @@ let WeaveGlue = {
     let isConfigured = (!this._loginError && Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED);
 
     connect.collapsed = isConfigured;
     connected.collapsed = !isConfigured;
 
     if (!isConfigured) {
       connect.setAttribute("title", this._bundle.GetStringFromName("notconnected.label"));
       connect.firstChild.disabled = false;
-      details.checked = false;
-      sync.collapsed = true;
-      device.collapsed = true;
-      disconnect.collapsed = true;
     }
 
+    sync.collapsed = !isConfigured;
+    device.collapsed = !isConfigured;
+    disconnect.collapsed = !isConfigured;
+
     // Check the lock on a timeout because it's set just after notifying
     setTimeout(function(self) {
       // Prevent certain actions when the service is locked
       if (Weave.Service.locked) {
         connect.firstChild.disabled = true;
         sync.firstChild.disabled = true;
 
         if (aTopic == "weave:service:login:start")
--- a/browser/metro/locales/en-US/chrome/sync.dtd
+++ b/browser/metro/locales/en-US/chrome/sync.dtd
@@ -1,19 +1,17 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <!ENTITY syncHeader.title           "Sync">
-<!ENTITY sync.title                 "Sync">
 <!ENTITY sync.notconnected          "Not connected">
 <!ENTITY sync.connect               "Connect">
 <!ENTITY sync.connected             "Connected">
-<!ENTITY sync.details               "Details">
 <!ENTITY sync.deviceName            "This device">
 <!ENTITY sync.disconnect            "Disconnect">
 <!ENTITY sync.syncNow               "Sync Now">
 
 <!ENTITY sync.setup.title           "Connect to Sync">
 <!ENTITY sync.setup.pair            "To activate, select &#x0022;Pair a Device&#x0022; on your other device.">
 <!ENTITY sync.fallback              "I'm not near my computer…">
 <!ENTITY sync.setup.manual          "Enter your Sync account information">
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -694,17 +694,16 @@ settings {
 
 /* <setting> elements that are not in a <settings> group get special treatment */
 #prefs-flyoutpanel > setting,
 #sync-flyoutpanel > setting {
   margin-top: 16px;
 }
 
 #prefs-flyoutpanel > setting .preferences-title,
-#sync-flyoutpanel > setting .preferences-title {
   font-weight: bold
 }
 
 setting[type="integer"] > .preferences-alignment,
 setting[type="string"] > .preferences-alignment {
   -moz-box-flex: 3;
 }