Skip to content

Port to GNOME 45 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions locale/uk.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ msgid ""
"Gnome Shell topbar with mouse (both in overview and workspace modes)."
msgstr ""
"Розширення дозволяє перемикатися між вікнами або робочими місцями шляхом "
"прокручування верхньої панелі Gnome Shell коліщатком миші (як в режимі огляду, "
"так і при роботі)."
"прокручування верхньої панелі Gnome Shell коліщатком миші (як в режимі "
"огляду, так і при роботі)."

#: sources/prefs.js:181
#, javascript-format
Expand All @@ -36,8 +36,8 @@ msgid ""
"Seems like you are using unlocalized extension, would you like to <a "
"href=\"%s\">localize it</a>?"
msgstr ""
"Залишайте свої пропозиції щодо доопрацювання та локалізації на "
"<a href=\"%s\">сторінці проєкту</a>!"
"Залишайте свої пропозиції щодо доопрацювання та локалізації на <a "
"href=\"%s\">сторінці проєкту</a>!"

#: sources/prefs.ui:33
msgid "Reset settings"
Expand Down Expand Up @@ -69,9 +69,10 @@ msgid ""
"inaccessible because of other actors rendered over it."
msgstr ""
"Для зміни рівня ієрархії під час вибору панелі (наприклад, вибору між "
"годинником і усієї панелі) використовуйте прокручування. Жовта рамка показує, "
"що вибрана панель ще не має обробників подій і може бути недоступною для "
"прокручування, якщо поверх неї відмальовані інші елементи інтерфейсу."
"годинником і усієї панелі) використовуйте прокручування. Жовта рамка "
"показує, що вибрана панель ще не має обробників подій і може бути "
"недоступною для прокручування, якщо поверх неї відмальовані інші елементи "
"інтерфейсу."

#: sources/prefs.ui:117
msgid "Panel fixed width"
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"private": true,
"packageManager": "yarn@3.2.3",
"packageManager": "yarn@4.3.0",
"type": "module",
"devDependencies": {
"@types/node": "^17.0.25",
"@types/node": "^20.14.2",
"archiver": "^5.3.1",
"command-line-args": "^5.2.1",
"command-line-usage": "^6.1.3",
Expand All @@ -12,8 +12,6 @@
"typescript": "^4.6.3"
},
"scripts": {
"yarn:restore": "node scripts/restore-yarn.js",
"yarn:update": "node scripts/restore-yarn.js latest && yarn up '**' -R",
"build": "node scripts/build.js",
"build:zip": "node scripts/build.js --lint=immutable --zip",
"gnome:install": "node scripts/build.js --lint=immutable --install",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ if (args['install']) {
async function copyBuildFiles(targetDirPath, baseDirPath, sourcesDirName = undefined) {
if (!args['debug']) {
await fs.mkdir(targetDirPath, { recursive: true });
await fs.writeFile(`${targetDirPath}/debug.js`, '');
await fs.writeFile(`${targetDirPath}/debug.js`, 'export const Debug = null;');
}
await copyFiles(
`${baseDirPath}/${sourcesDirName ?? '.'}`,
Expand Down
9 changes: 6 additions & 3 deletions scripts/gjs/ui-preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const { Adw, Gio, GLib, GObject } = imports.gi;
const ByteArray = imports.byteArray;
import Adw from 'gi://Adw'
import Gio from 'gi://Gio'
import GLib from 'gi://GLib'
import GObject from 'gi://GObject'
const ByteArray = imports.byteArray; // legacy module without ESM equivalent

var UiPreview = GObject.registerClass(class extends imports.gi.Adw.Application {
var UiPreview = GObject.registerClass(class extends Adw.Application {
/**
* @param {string} buildDirPath
* @param {string} uiFileName
Expand Down
4 changes: 2 additions & 2 deletions scripts/nodejs/linter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export async function lint(fix) {
'--resolve-plugins-relative-to', '.',
'./sources/*.js',
];

if (fix) {
eslintArgs.push('--fix');
}

return execPackage('eslint', eslintArgs);
}
}
8 changes: 4 additions & 4 deletions scripts/nodejs/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export async function unlinkFile(path) {
await fs.unlink(path);
} catch {
// most probably, there is no such file already
}
}
}

/**
* @param {string} filePath
* @param {string} filePath
* @param {https.RequestOptions} request
*/
export async function downloadFileIfMissed(filePath, request) {
Expand All @@ -43,7 +43,7 @@ export async function downloadFileIfMissed(filePath, request) {
}

/**
* @param {string} filePath
* @param {string} filePath
* @param {https.RequestOptions} request
*/
export async function downloadFile(filePath, request) {
Expand Down Expand Up @@ -248,7 +248,7 @@ export class BackgroundProcess {
kill(signal = 'SIGTERM') {
this.process.kill(signal);
}

pid() {
return this.process.pid;
}
Expand Down
102 changes: 0 additions & 102 deletions scripts/restore-yarn.js

This file was deleted.

38 changes: 27 additions & 11 deletions sources/debug.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
/* exported module */
// noinspection JSUnfilteredForInLoop
// This module is for debug purposes only and may use some hacks. It's content
// is expected to be erased from release build and should be used only inside
// try-catch blocks or with null coalescing operators.

const Me = imports.misc.extensionUtils.getCurrentExtension();

/**
* Debug class module.
*/
var module = new class DebugModule {
export const Debug = new class DebugModule {
/**
* Sets the extension object used for metadata retrieval.
*
* @param {object} extension - Extension object.
*/
setExtensionObject(extension) {
this.extension = extension;
}

/**
* Log verbose message.
*
* @param {string} message - Message to log.
*/
logDebug(message) {
log(`[${Me.metadata.uuid}][DBG] ${message}`);
console.debug(`[${this.extension?.uuid}][DBG] ${message}`);
}

/**
* Log a method stepping message.
*
* @param {string} message - Message to log.
*/
logStep(message) {
console.debug(`[${this.extension?.uuid}][STP] ${message}`);
}

/**
Expand Down Expand Up @@ -61,7 +76,7 @@ var module = new class DebugModule {
}
}
} catch (e) {
log(`[${Me.metadata.uuid}][STP] Loading module '${moduleName}' problem:\n${e}`);
this.logStep(`Loading module '${moduleName}' problem:\n${e}`);
}
}
}
Expand All @@ -81,7 +96,7 @@ var module = new class DebugModule {
return;
}
const debug = this;
log(`[${Me.metadata.uuid}][STP] Symbol '${symbolName}' found in module '${moduleName}', patching constructor...`);
this.logStep(`Symbol '${symbolName}' found in module '${moduleName}', patching constructor...`);
modules[moduleName][symbolName] = function (...args) {
if (new.target) {
const instance = new constructor(...args);
Expand All @@ -104,7 +119,7 @@ var module = new class DebugModule {
* @param {string} symbolName - Object name.
*/
injectObjectTraceLogs(instance, moduleName, symbolName) {
log(`[${Me.metadata.uuid}][STP] Instance of class '${symbolName}' from module '${moduleName}' spawned, patching...`);
this.logStep(`Instance of class '${symbolName}' from module '${moduleName}' spawned, patching...`);
if (instance === this) {
return;
}
Expand All @@ -116,13 +131,14 @@ var module = new class DebugModule {
if (typeof member !== 'function' || member.objectTraceLogger) {
continue;
}
const debug = this;
const memberFullName = `${moduleName}.${symbolName}.${memberName}`;
log(`[${Me.metadata.uuid}][STP] Patching '${memberFullName}'...`);
this.logStep(`Patching '${memberFullName}'...`);
instance[memberName] = (...args) => {
const memberCall = `${memberFullName}(${args.map(r => this._toShortString(r))})`;
log(`[${Me.metadata.uuid}][STP] -> ${memberCall}`);
debug.logStep(`-> ${memberCall}`);
const r = member.bind(instance)(...args);
log(`[${Me.metadata.uuid}][STP] <- ${memberCall}: ${this._toShortString(r)}`);
debug.logStep(`<- ${memberCall}: ${this._toShortString(r)}`);
return r;
};
instance[memberName].objectTraceLogger = this;
Expand Down
Loading