Permalink
Browse files

Revert "Bug 803533 - [Settings] Need call forwarding settings UI r=ka…

…ze r=timdream"

This reverts commit 9cc083a.
  • Loading branch information...
1 parent b0e1277 commit ffa71f69808cdf3b1bf7ef4770ded1321395ceca @julienw julienw committed Dec 6, 2012
@@ -336,148 +336,6 @@ <h2 data-l10n-id="advancedSettings"> Advanced Settings </h2>
-->
</section>
- <!-- Connectivity :: Call :: Call Forwarding Not Reachable -->
- <section role="region" hidden id="call-cf-notReachableSettings">
- <!--
- <header>
- <a href="#call"><span class="icon icon-back">back</span></a>
- <h1 data-l10n-id="callForwarding"> Call forwarding </h1>
- </header>
-
- <ul id="cf-notreachable-advanced">
- <li>
- <p data-l10n-id="cf-numberWhenUnreachable">Number when unreachable</p>
- <input type="text" data-setting="ril.cf.notreachable.number" />
- </li>
- <li>
- <label>
- <input type="checkbox" data-type="switch" name="ril.cf.notreachable.enabled"/>
- <span></span>
- </label>
- <a data-l10n-id="callForwardingNotReachable"> Forward when unreachable </a>
- </li>
- </ul>
-
- -->
- </section>
-
- <!-- Connectivity :: Call :: Call Forwarding No Reply -->
- <section role="region" hidden id="call-cf-noReplySettings">
- <!--
- <header>
- <a href="#call"><span class="icon icon-back">back</span></a>
- <h1 data-l10n-id="callForwarding"> Call forwarding </h1>
- </header>
-
- <ul id="cf-noreply-advanced">
- <li>
- <p data-l10n-id="cf-numberWhenUnanswered">Number when unanswered</p>
- <input type="text" data-setting="ril.cf.noreply.number" />
- </li>
- <li>
- <label>
- <input type="checkbox" data-type="switch" name="ril.cf.noreply.enabled"/>
- <span></span>
- </label>
- <a data-l10n-id="callForwardingNoReply"> Forward when unanswered </a>
- </li>
- </ul>
-
- -->
- </section>
-
- <!-- Connectivity :: Call :: Call Forwarding Mobile Busy -->
- <section role="region" hidden id="call-cf-mobileBusySettings">
- <!--
- <header>
- <a href="#call"><span class="icon icon-back">back</span></a>
- <h1 data-l10n-id="callForwarding"> Call forwarding </h1>
- </header>
-
- <ul id="cf-mobilebusy-advanced">
- <li>
- <p data-l10n-id="cf-numberWhenBusy">Number when busy</p>
- <input type="text" data-setting="ril.cf.mobilebusy.number" />
- </li>
- <li>
- <label>
- <input type="checkbox" data-type="switch" name="ril.cf.mobilebusy.enabled"/>
- <span></span>
- </label>
- <a data-l10n-id="callForwardingMobileBusy"> Forward when busy </a>
- </li>
- </ul>
-
- -->
- </section>
-
- <!-- Connectivity :: Call :: Call Forwarding Unconditional -->
- <section role="region" hidden id="call-cf-unconditionalSettings">
- <!--
- <header>
- <a href="#call"><span class="icon icon-back">back</span></a>
- <h1 data-l10n-id="callForwarding"> Call forwarding </h1>
- </header>
-
- <ul id="cf-unconditional-advanced">
- <li>
- <p data-l10n-id="cf-alwaysUseThisNumber">Always use this number</p>
- <input type="text" data-setting="ril.cf.unconditional.number"/>
- </li>
- <li>
- <label>
- <input type="checkbox" data-type="switch" name="ril.cf.unconditional.enabled"/>
- <span></span>
- </label>
- <a data-l10n-id="callForwardingUnconditional">Always forward</a>
- </li>
- </ul>
-
- -->
- </section>
-
- <!-- Connectivity :: Call -->
- <section role="region" hidden id="call">
- <!--
- <header>
- <a href="#root"><span class="icon icon-back">back</span></a>
- <h1 data-l10n-id="call"> Call Settings </h1>
- </header>
- <ul>
- <li>
- <label>
- <input type="checkbox" data-type="switch" name="ril.callwaiting.enabled"/>
- <span></span>
- </label>
- <a data-l10n-id="callWaiting">Call Waiting</a>
- </li>
- </ul>
- <header>
- <h2 data-l10n-id="callForwarding"> Call Forwarding </h2>
- </header>
- <ul>
- <li>
- <small id="cfu-desc"></small>
- <a id="menuItem-callForwardingUnconditional" href="#call-cf-unconditionalSettings" data-l10n-id="callForwardingUnconditional">Always forward</a>
- </li>
- <li>
- <small id="cfmb-desc"></small>
- <a id="menuItem-callForwardingMobileBusy" href="#call-cf-mobileBusySettings" data-l10n-id="callForwardingMobileBusy">Forward when busy</a>
- </li>
- <li>
- <small id="cfnrep-desc"></small>
- <a id="menuItem-callForwardingNoReply" href="#call-cf-noReplySettings" data-l10n-id="callForwardingNoReply">Forward when unanswered</a>
- </li>
- <li>
- <small id="cfnrea-desc"></small>
- <a id="menuItem-callForwardingNotReachable" href="#call-cf-notReachableSettings" data-l10n-id="callForwardingNotReachable">Forward when unreachable</a>
- </li>
- </ul>
-
- <script type="application/javascript" src="js/call.js"></script>
- -->
- </section>
-
<!-- Connectivity :: Cellular & Data :: Network Operator -->
<section role="region" hidden id="carrier-operatorSettings">
<!--
@@ -697,6 +555,13 @@ <h1 data-l10n-id="cellularAndData"> Cellular &amp; Data </h1>
<small id="dataNetwork-desc"></small>
<a data-l10n-id="dataNetwork">Carrier</a>
</li>
+ <li>
+ <label>
+ <input type="checkbox" data-type="switch" name="ril.callwaiting.enabled"/>
+ <span></span>
+ </label>
+ <a data-l10n-id="callWaiting">Call Waiting</a>
+ </li>
</ul>
<header>
@@ -2337,10 +2202,6 @@ <h2 data-l10n-id="networkAndConnectivity">Network &amp; Connectivity</h2>
<a id="menuItem-wifi" class="menu-item" href="#wifi" data-l10n-id="wifi">Wi-Fi</a>
</li>
<li>
- <small id="call-desc" class="menu-item-desc"></small>
- <a id="menuItem-call" class="menu-item" href="#call" data-l10n-id="call">Call</a>
- </li>
- <li>
<small id="data-desc" class="menu-item-desc"></small>
<a id="menuItem-cellularAndData" class="menu-item" href="#carrier" data-l10n-id="cellularAndData">Cellular &amp; Data</a>
</li>
@@ -1,171 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-
-'use strict';
-
-// Handle call settings.
-var Calls = (function(window, document, undefined) {
- var _ = navigator.mozL10n.get;
-
- // Must be in sync with nsIDOMMozMobileCFInfo interface.
- var _cfReason = {
- CALL_FORWARD_REASON_UNCONDITIONAL: 0,
- CALL_FORWARD_REASON_MOBILE_BUSY: 1,
- CALL_FORWARD_REASON_NO_REPLY: 2,
- CALL_FORWARD_REASON_NOT_REACHABLE: 3
- };
- var _cfAction = {
- CALL_FORWARD_ACTION_DISABLE: 0,
- CALL_FORWARD_ACTION_ENABLE: 1,
- CALL_FORWARD_ACTION_QUERY_STATUS: 2,
- CALL_FORWARD_ACTION_REGISTRATION: 3,
- CALL_FORWARD_ACTION_ERASURE: 4
- };
-
- var _voiceServiceClassMask = gMobileConnection.ICC_SERVICE_CLASS_VOICE;
-
- // Display rule info.
- function displayRule(rules, elementId, settingKey) {
- var textInput = document.querySelector('input[data-setting="ril.cf.' + settingKey + '.number"]');
- var switchInput = document.querySelector('input[name="ril.cf.' + settingKey + '.enabled"]');
-
- for (var i = 0; i < rules.length; i++) {
- if (rules[i].active &&
- ((_voiceServiceClassMask & rules[i].serviceClass) != 0)) {
- document.getElementById(elementId).textContent =
- _('callForwardingForwardingVoiceTo') + ' ' + rules[i].number;
- textInput.value = rules[i].number;
- switchInput.checked = true;
- return;
- }
- }
-
- document.getElementById(elementId).textContent =
- _('callForwardingNotForwarding');
- textInput.value = '';
- switchInput.checked = false;
- };
-
- // Display what's happening while getting call forwarding info.
- function displayInfoForAll(what) {
- document.getElementById('cfu-desc').textContent =
- document.getElementById('cfmb-desc').textContent =
- document.getElementById('cfnrep-desc').textContent =
- document.getElementById('cfnrea-desc').textContent =
- what;
- };
-
- // Get current call forwarding rules.
- function getCallForwardingOption() {
- displayInfoForAll(_('callForwardingGetting'));
-
- // Queries rules for unconditional call forwarding.
- var unconditional = gMobileConnection.getCallForwardingOption(
- _cfReason.CALL_FORWARD_REASON_UNCONDITIONAL);
-
- unconditional.onsuccess = function() {
- var unconditionalRules = unconditional.result;
- displayRule(unconditionalRules, 'cfu-desc', 'unconditional');
-
- // Queries rules for call forwarding when device busy.
- var mobileBusy = gMobileConnection.getCallForwardingOption(
- _cfReason.CALL_FORWARD_REASON_MOBILE_BUSY);
-
- mobileBusy.onsuccess = function() {
- var mobileBusyRules = mobileBusy.result;
- displayRule(mobileBusyRules, 'cfmb-desc', 'mobilebusy');
-
- // Queries rules for call forwarding when device does not reply.
- var noReply = gMobileConnection.getCallForwardingOption(
- _cfReason.CALL_FORWARD_REASON_NO_REPLY);
-
- noReply.onsuccess = function() {
- var noReplyRules = noReply.result;
- displayRule(noReplyRules, 'cfnrep-desc', 'noreply');
-
- // Queries rules for call forwarding when device is not reachable.
- var notReachable = gMobileConnection.getCallForwardingOption(
- _cfReason.CALL_FORWARD_REASON_NOT_REACHABLE);
-
- notReachable.onsuccess = function() {
- var notReachableRules = notReachable.result;
- displayRule(notReachableRules, 'cfnrea-desc', 'notreachable');
- };
- notReachable.onerror = function () {
- displayInfoForAll(_('callForwardingQueryError'));
- };
- };
- noReply.onerror = function () {
- displayInfoForAll(_('callForwardingQueryError'));
- };
- };
- mobileBusy.onerror = function () {
- displayInfoForAll(_('callForwardingQueryError'));
- };
- };
- unconditional.onerror = function () {
- displayInfoForAll(_('callForwardingQueryError'));
- };
- };
-
- // Public API.
- return {
- // Startup.
- init: function calls_init() {
- var settings = window.navigator.mozSettings;
- if (!settings) {
- // TODO: Update UI with some error info.
- return;
- }
- getCallForwardingOption();
- var settingKeys = ['unconditional',
- 'mobilebusy',
- 'noreply',
- 'notreachable'];
- settingKeys.forEach(function(key) {
- settings.addObserver('ril.cf.' + key + '.enabled', function(event) {
- var textInput = document.querySelector('input[data-setting="ril.cf.' + key + '.number"]');
- var mozMobileCFInfo = {};
-
- mozMobileCFInfo['action'] = event.settingValue ?
- _cfAction.CALL_FORWARD_ACTION_REGISTRATION :
- _cfAction.CALL_FORWARD_ACTION_DISABLE;
- switch (key) {
- case 'unconditional':
- mozMobileCFInfo['reason'] = _cfReason.CALL_FORWARD_REASON_UNCONDITIONAL;
- break;
- case 'mobilebusy':
- mozMobileCFInfo['reason'] = _cfReason.CALL_FORWARD_REASON_MOBILE_BUSY;
- break;
- case 'noreply':
- mozMobileCFInfo['reason'] = _cfReason.CALL_FORWARD_REASON_NO_REPLY;
- break;
- case 'notreachable':
- mozMobileCFInfo['reason'] = _cfReason.CALL_FORWARD_REASON_NOT_REACHABLE;
- break;
- }
- mozMobileCFInfo['serviceClass'] = gMobileConnection.ICC_SERVICE_CLASS_VOICE;
- // TODO: Check number.
- mozMobileCFInfo['number'] = textInput.value;
- mozMobileCFInfo['timeSecond'] =
- mozMobileCFInfo['reason'] != _cfReason.CALL_FORWARD_REASON_NO_REPLY ?
- 0 : 20;
- console.log(JSON.stringify(mozMobileCFInfo));
-
- var req = gMobileConnection.setCallForwardingOption(mozMobileCFInfo);
- req.onsuccess = function() {
- console.log("Success");
- getCallForwardingOption();
- };
- req.onerror = function() {
- console.log("Error");
- getCallForwardingOption();
- };
- });
- });
- }
- };
-})(this, document);
-
-// Startup.
-onLocalized(Calls.init.bind(Calls));
@@ -244,7 +244,6 @@ var Connectivity = (function(window, document, undefined) {
var data = gMobileConnection.data ? gMobileConnection.data.network : null;
var name = data ? (data.shortName || data.longName) : '';
document.getElementById('data-desc').textContent = name;
- document.getElementById('call-desc').textContent = name;
}
function updateBluetooth() {
@@ -86,27 +86,10 @@ wpsPinInput=Input {{pin}} to opposite device
wpsCancelMessage=Cancel WPS
wpsCancelFailedMessage=Failed to cancel WPS
-# Connectivity :: Call
-call=Call
-callWaiting=Call waiting
-callForwarding=Call forwarding
-callForwardingUnconditional=Always forward
-callForwardingMobileBusy=Forward when busy
-callForwardingNoReply=Forward when unanswered
-callForwardingNotReachable=Forward when unreachable
-callForwardingGetting=Getting network info...
-callForwardingQueryError=Error in query
-callForwardingForwardingVoiceTo=Voice calls to
-callForwardingNotForwarding=Disabled
-
-cf-alwaysUseThisNumber=Always use this number
-cf-numberWhenUnreachable=Number when unreachable
-cf-numberWhenUnanswered=Number when unanswered
-cf-numberWhenBusy=Number when busy
-
# Connectivity :: Cellular & Data
cellularAndData=Cellular & Data
dataNetwork=Carrier
+callWaiting=Call waiting
dataConnectivity=Data
dataConnection=Data connection
dataRoaming=Data roaming
@@ -281,7 +281,6 @@
<div id="statusbar-sms" class="sb-icon sb-icon-sms" hidden></div>
<div id="statusbar-geolocation" class="sb-icon sb-icon-geolocation" hidden></div>
<div id="statusbar-usb" class="sb-icon sb-icon-usb" hidden></div>
- <div id="statusbar-call-forwarding" class="sb-icon sb-icon-call-forwarding" hidden></div>
</div>
<div id="utility-tray" data-z-index-level="utility-tray">
Oops, something went wrong.

0 comments on commit ffa71f6

Please sign in to comment.