Started checking for themes updates

This commit is contained in:
Mauro Balades
2024-08-25 11:27:27 +02:00
parent 5c4c3e6fb2
commit 3def55d48b
12 changed files with 85 additions and 33 deletions

2
l10n

Submodule l10n updated: c92099b2d1...bfcfcf1aab

View File

@@ -0,0 +1,17 @@
browser_locales=engine/browser/locales
copy_browser_locales() {
langId=$1
mkdir -p $browser_locales/$langId
if [ "$langId" = "en-US" ]; then
find $browser_locales/$langId -type f -name "zen*" -delete
rsync -av --exclude=.git ./l10n/en-US/browser/ $browser_locales/$langId/
return
fi
rm -rf $browser_locales/$langId/
rsync -av --exclude=.git ./l10n/$langId/ $browser_locales/$langId/
}
LANG=$1
echo "Copying language pack for $LANG"
copy_browser_locales $LANG

View File

@@ -39,24 +39,14 @@ done
cd $CURRENT_DIR
# Move all the files to the correct location
browser_locales=engine/browser/locales
copy_browser_locales() {
langId=$1
only_en=$2
mkdir -p $browser_locales/$langId
if [ "$only_en" = true ]; then
rsync -av --exclude=.git ./l10n/en-US/browser/ $browser_locales/$langId/
return
fi
rm -rf $browser_locales/$langId/
rsync -av --exclude=.git ./l10n/$langId/ $browser_locales/$langId/
}
copy_browser_locales en-US true
sh scripts/copy-language-pack.sh en-US
for lang in $(cat ./l10n/supported-languages); do
copy_browser_locales $lang false
sh scripts/copy-language-pack.sh $lang
done
wait
echo "Cleaning up"
rm -rf ~/tools
rm -rf ~/.git-cinnabar

View File

@@ -0,0 +1,2 @@
sh ./scripts/copy-language-pack.sh en-US

View File

@@ -1,14 +1,15 @@
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
index 7e21bab426b6eb52fe84876d817fddbdb1a35ffc..fb7c6f419c02701aecd148ef2fe271ed6f1a73c1 100644
index 7e21bab426b6eb52fe84876d817fddbdb1a35ffc..56b42e2d025e4a47ea0983cf33ae69ffafa0d576 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -196,6 +196,9 @@ function init_all() {
@@ -196,6 +196,10 @@ function init_all() {
// the entire document.
Preferences.queueUpdateOfAllElements();
Services.telemetry.setEventRecordingEnabled("aboutpreferences", true);
+ register_module("paneZenLooks", gZenLooksAndFeel);
+ register_module("paneZenWorkspaces", gZenWorkspacesSettings);
+ register_module("paneZenCKS", gZenCKSSettings);
+ register_module("paneZenMarketplace", gZenMarketplaceManager);
register_module("paneGeneral", gMainPane);
register_module("paneHome", gHomePane);

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
index 3affb19d1a243da4a5782c9a4a5588d165b4119f..6fdc0c4447d2d43ee5f4563c725b6eca1cf7acc5 100644
index 3affb19d1a243da4a5782c9a4a5588d165b4119f..837f078ff1f3a65a40877c1380c6d050a8415bab 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -43,6 +43,8 @@
@@ -24,7 +24,7 @@ index 3affb19d1a243da4a5782c9a4a5588d165b4119f..6fdc0c4447d2d43ee5f4563c725b6eca
<!-- category list -->
<richlistbox id="categories" data-l10n-id="category-list" data-l10n-attrs="aria-label">
<richlistitem id="category-general"
@@ -110,6 +118,39 @@
@@ -110,6 +118,50 @@
<label class="category-name" flex="1" data-l10n-id="pane-general-title"></label>
</richlistitem>
@@ -60,11 +60,22 @@ index 3affb19d1a243da4a5782c9a4a5588d165b4119f..6fdc0c4447d2d43ee5f4563c725b6eca
+ <image class="category-icon"/>
+ <label class="category-name" flex="1" data-l10n-id="pane-zen-CKS-title"></label>
+ </richlistitem>
+
+ <richlistitem id="category-zen-marketplace"
+ class="category"
+ value="paneZenMarketplace"
+ helpTopic="prefs-main"
+ data-l10n-id="category-zen-marketplace"
+ data-l10n-attrs="tooltiptext"
+ align="center">
+ <image class="category-icon"/>
+ <label class="category-name" flex="1" data-l10n-id="pane-zen-marketplace-title"></label>
+ </richlistitem>
+
<richlistitem id="category-home"
class="category"
value="paneHome"
@@ -228,11 +269,13 @@
@@ -228,11 +280,13 @@
<html:a href="about:policies" target="_blank" data-l10n-id="managed-notice"/>
</hbox>
</hbox>
@@ -78,13 +89,14 @@ index 3affb19d1a243da4a5782c9a4a5588d165b4119f..6fdc0c4447d2d43ee5f4563c725b6eca
</hbox>
</hbox>
<vbox id="mainPrefPane">
@@ -246,6 +289,9 @@
@@ -246,6 +300,10 @@
#include sync.inc.xhtml
#include experimental.inc.xhtml
#include moreFromMozilla.inc.xhtml
+#include zenLooksAndFeel.inc.xhtml
+#include zenKeyboardShortcuts.inc.xhtml
+#include zenWorkspaces.inc.xhtml
+#include zenMarketplace.inc.xhtml
</vbox>
</vbox>
</vbox>

View File

@@ -23,8 +23,18 @@ const kZenOSToSmallName = {
var gZenMarketplaceManager = {
init() {
this._buildThemesList();
Services.prefs.addObserver(this.updatePref, this._buildThemesList.bind(this));
this._buildThemesList();
document.getElementById("zenThemeMarketplaceCheckForUpdates").addEventListener("click", (event) => {
this._checkForThemeUpdates(event);
});
},
_checkForThemeUpdates(event) {
// Send a message to the child to check for theme updates.
event.target.disabled = true;
// send an event that will be listened by the child process.
document.dispatchEvent(new CustomEvent("ZenCheckForThemeUpdates"));
},
get updatePref() {

View File

@@ -42,14 +42,6 @@
</hbox>
<groupbox id="zenThemeGroup" data-category="paneZenLooks" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-theme-marketplace-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-theme-marketplace-description" />
<hbox class="indent">
<html:a id="zenThemeMarketplaceLink" href="https://zen-browser.app/themes" target="_blank" data-l10n-id="zen-theme-marketplace-link" />
</hbox>
<vbox id="zenThemeMarketplaceList"></vbox>
<label><html:h2 data-l10n-id="zen-look-and-feel-buttons-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-look-and-feel-buttons-description" />

View File

@@ -0,0 +1,20 @@
<html:template id="template-paneZenMarketplace">
<hbox id="ZenMarketplaceCategory"
class="subcategory"
hidden="true"
data-category="paneZenMarketplace">
<html:h1 data-l10n-id="pane-zen-marketplace-title"/>
</hbox>
<groupbox id="zenMarketplaceGroup" data-category="paneZenMarketplace" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-theme-marketplace-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-theme-marketplace-description" />
<hbox class="indent">
<html:a id="zenThemeMarketplaceLink" href="https://zen-browser.app/themes" target="_blank" data-l10n-id="zen-theme-marketplace-link" />
<button id="zenThemeMarketplaceCheckForUpdates" data-l10n-id="zen-theme-marketplace-check-for-updates-button" />
</hbox>
<vbox id="zenThemeMarketplaceList"></vbox>
</groupbox>
</html:template>

View File

@@ -314,6 +314,10 @@ groupbox h2 {
/* THemes marketplace */
#category-zen-marketplace > .category-icon {
list-style-image: url("chrome://mozapps/skin/extensions/category-themes.svg");
}
.zenThemeMarketplaceItem {
width: 100%;
@@ -342,6 +346,10 @@ groupbox h2 {
margin-left: auto;
}
#zenThemeMarketplaceCheckForUpdates {
margin-left: auto;
}
/* Disable mozilla's settings */
#dataCollectionCategory,

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/modules/ActorManagerParent.sys.mjs b/toolkit/modules/ActorManagerParent.sys.mjs
index 71409e58271802fc506999712519df63eff3b1a6..a136eb21a8abf1697b820ae4ab85224c56b725ec 100644
index 71409e58271802fc506999712519df63eff3b1a6..684c9da0139db1dc0962fbb50304ca4f013950ca 100644
--- a/toolkit/modules/ActorManagerParent.sys.mjs
+++ b/toolkit/modules/ActorManagerParent.sys.mjs
@@ -666,6 +666,20 @@ if (!Services.prefs.getBoolPref("browser.pagedata.enabled", false)) {
@@ -16,7 +16,7 @@ index 71409e58271802fc506999712519df63eff3b1a6..a136eb21a8abf1697b820ae4ab85224c
+ DOMContentLoaded: {},
+ },
+ },
+ matches: ["https://*.zen-browser.app/*"],
+ matches: ["https://*.zen-browser.app/*", "about:preferences"],
+ allFrames: true,
+};
+