From f7f87131cdb78c3db5ff953966de098b79980ae1 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mauro-balades@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:17:24 +0000 Subject: [PATCH] =?UTF-8?q?Deshabilitar=20la=20opci=C3=B3n=20de=20espacios?= =?UTF-8?q?=20de=20trabajo=20para=20pruebas=20y=20ajustar=20la=20configura?= =?UTF-8?q?ci=C3=B3n=20de=20preferencias=20relacionadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/browser/app/profile/zen-browser.js | 2 +- .../content/zen-styles/zen-workspaces.css | 2 +- .../base/zen-components/ZenWorkspaces.mjs | 16 +-------- .../components/preferences/zen-settings.js | 19 ---------- .../preferences/zenTabsManagement.inc.xhtml | 36 ++++++++----------- .../profiles/profileserver/user-js.patch | 2 +- 6 files changed, 19 insertions(+), 58 deletions(-) diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index 93ff88714..3dcd11da4 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -190,7 +190,7 @@ pref('zen.splitView.rearrange-hover-size', 24); pref('zen.startup.smooth-scroll-in-tabs', true); // Zen Workspaces -pref('zen.workspaces.enabled', true, locked); +pref('zen.workspaces.disabled_for_testing', false); pref('zen.workspaces.hide-deactivated-workspaces', false); pref('zen.workspaces.hide-default-container-indicator', true); pref('zen.workspaces.individual-pinned-tabs', true); diff --git a/src/browser/base/content/zen-styles/zen-workspaces.css b/src/browser/base/content/zen-styles/zen-workspaces.css index 708135d0e..d63d2587c 100644 --- a/src/browser/base/content/zen-styles/zen-workspaces.css +++ b/src/browser/base/content/zen-styles/zen-workspaces.css @@ -479,7 +479,7 @@ } } -@media (not (-moz-bool-pref: 'zen.workspaces.show-workspace-indicator')) or (not (-moz-bool-pref: 'zen.workspaces.enabled')) { +@media not (-moz-bool-pref: 'zen.workspaces.show-workspace-indicator') { #zen-current-workspace-indicator { display: none !important; } diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index 3a38fac43..23039588e 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -309,7 +309,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get workspaceEnabled() { if (typeof this._workspaceEnabled === 'undefined') { - this._workspaceEnabled = Services.prefs.getBoolPref('zen.workspaces.enabled', false) && this.shouldHaveWorkspaces; + this._workspaceEnabled = (!Services.prefs.getBoolPref('zen.workspaces.disabled_for_testing', false)) && this.shouldHaveWorkspaces; return this._workspaceEnabled; } return this._workspaceEnabled; @@ -368,21 +368,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return this._workspaceCache; } - async onWorkspacesEnabledChanged() { - if (this.workspaceEnabled) { - throw Error("Shoud've had reloaded the window"); - } else { - this._workspaceCache = null; - document.getElementById('zen-workspaces-button')?.remove(); - for (let tab of gBrowser.tabs) { - gBrowser.showTab(tab); - } - } - } - async initializeWorkspaces() { - Services.prefs.addObserver('zen.workspaces.enabled', this.onWorkspacesEnabledChanged.bind(this)); - await this.initializeWorkspacesButton(); if (this.workspaceEnabled) { this._initializeWorkspaceCreationIcons(); diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index fff56e035..214bffc03 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -672,29 +672,15 @@ var gZenWorkspacesSettings = { } }, }; - Services.prefs.addObserver('zen.workspaces.enabled', this); Services.prefs.addObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener); window.addEventListener('unload', () => { - Services.prefs.removeObserver('zen.workspaces.enabled', this); Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener); }); }, - - async observe(subject, topic, data) { - await this.onWorkspaceChange(Services.prefs.getBoolPref('zen.workspaces.enabled')); - }, - - async onWorkspaceChange(checked) { - let buttonIndex = await confirmRestartPrompt(true, 1, true, false); - if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) { - Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart); - return; - } - }, }; const ZEN_CKS_CLASS_BASE = 'zenCKSOption'; @@ -1007,11 +993,6 @@ Preferences.addAll([ type: 'bool', default: true, }, - { - id: 'zen.workspaces.enabled', - type: 'bool', - default: true, - }, { id: 'zen.theme.pill-button', type: 'bool', diff --git a/src/browser/components/preferences/zenTabsManagement.inc.xhtml b/src/browser/components/preferences/zenTabsManagement.inc.xhtml index c04dd8a55..490ffef07 100644 --- a/src/browser/components/preferences/zenTabsManagement.inc.xhtml +++ b/src/browser/components/preferences/zenTabsManagement.inc.xhtml @@ -17,27 +17,21 @@ - - - - - - - - - + + + + +