mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1122480 - Part 9 - Link to the data choices prefs. r=rvitillo
This commit is contained in:
parent
220f89ced2
commit
6c65f40cf5
@ -126,6 +126,36 @@ function sectionalizeObject(obj) {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the main DOMWindow for the current context.
|
||||
*/
|
||||
function getMainWindow() {
|
||||
return window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the DOMWindow that can open a preferences pane.
|
||||
*
|
||||
* This is essentially "get the browser chrome window" with the added check
|
||||
* that the supposed browser chrome window is capable of opening a preferences
|
||||
* pane.
|
||||
*
|
||||
* This may return null if we can't find the browser chrome window.
|
||||
*/
|
||||
function getMainWindowWithPreferencesPane() {
|
||||
let mainWindow = getMainWindow();
|
||||
if (mainWindow && "openAdvancedPreferences" in mainWindow) {
|
||||
return mainWindow;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
let Settings = {
|
||||
SETTINGS: [
|
||||
// data upload
|
||||
@ -149,6 +179,14 @@ let Settings = {
|
||||
let setting = s;
|
||||
Preferences.observe(setting.pref, this.render, this);
|
||||
}
|
||||
|
||||
let elements = document.getElementsByClassName("change-data-choices-link");
|
||||
for (let el of elements) {
|
||||
el.addEventListener("click", function() {
|
||||
let mainWindow = getMainWindowWithPreferencesPane();
|
||||
mainWindow.openAdvancedPreferences("dataChoicesTab");
|
||||
}, false);
|
||||
}
|
||||
},
|
||||
|
||||
detachObservers: function() {
|
||||
|
@ -35,12 +35,18 @@
|
||||
<p id="description-upload-enabled" class="description-enabled">&aboutTelemetry.uploadEnabled;</p>
|
||||
<p id="description-upload-disabled" class="description-disabled">&aboutTelemetry.uploadDisabled;</p>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" class="change-data-choices-link">&aboutTelemetry.changeDataChoices;</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p id="description-extended-recording-enabled" class="description-enabled">&aboutTelemetry.extendedRecordingEnabled;</p>
|
||||
<p id="description-extended-recording-disabled" class="description-disabled">&aboutTelemetry.extendedRecordingDisabled;</p>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" class="change-data-choices-link">&aboutTelemetry.changeDataChoices;</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</header>
|
||||
|
@ -4,6 +4,10 @@
|
||||
|
||||
<!ENTITY aboutTelemetry.pageTitle "Telemetry Data">
|
||||
|
||||
<!ENTITY aboutTelemetry.changeDataChoices "
|
||||
Change
|
||||
">
|
||||
|
||||
<!ENTITY aboutTelemetry.uploadEnabled "
|
||||
FHR data upload is <span>enabled</span>.
|
||||
">
|
||||
|
Loading…
Reference in New Issue
Block a user