[gnome] Fix version for gjsosk and gsconnect, add impatience

This commit is contained in:
2024-11-01 09:35:38 -04:00
parent 66e76c2764
commit 1bd891f30a
78 changed files with 804 additions and 1226 deletions

View File

@ -2,24 +2,23 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
'use strict';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
import Pango from 'gi://Pango';
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Pango = imports.gi.Pango;
const Config = imports.config;
const Keybindings = imports.preferences.keybindings;
import Config from '../config.js';
import plugins from '../service/plugins/index.js';
import * as Keybindings from './keybindings.js';
// Build a list of plugins and shortcuts for devices
const DEVICE_PLUGINS = [];
const DEVICE_SHORTCUTS = {};
for (const name in imports.service.plugins) {
const module = imports.service.plugins[name];
for (const name in plugins) {
const module = plugins[name];
if (module.Metadata === undefined)
continue;
@ -41,7 +40,7 @@ for (const name in imports.service.plugins) {
* @param {Gtk.ListBoxRow} row - The current row
* @param {Gtk.ListBoxRow} before - The previous row
*/
function rowSeparators(row, before) {
export function rowSeparators(row, before) {
const header = row.get_header();
if (before === null) {
@ -63,7 +62,7 @@ function rowSeparators(row, before) {
* @param {Gtk.ListBoxRow} row2 - The second row
* @return {number} -1, 0 or 1
*/
function titleSortFunc(row1, row2) {
export function titleSortFunc(row1, row2) {
if (!row1.title || !row2.title)
return 0;
@ -249,7 +248,7 @@ const CommandEditor = GObject.registerClass({
/**
* A widget for configuring a remote device.
*/
var Panel = GObject.registerClass({
export const Panel = GObject.registerClass({
GTypeName: 'GSConnectPreferencesDevicePanel',
Properties: {
'device': GObject.ParamSpec.object(
@ -424,7 +423,7 @@ var Panel = GObject.registerClass({
this._pluginSettings = {};
if (!this._pluginSettings.hasOwnProperty(name)) {
const meta = imports.service.plugins[name].Metadata;
const meta = plugins[name].Metadata;
this._pluginSettings[name] = new Gio.Settings({
settings_schema: Config.GSCHEMA.lookup(meta.id, -1),
@ -1058,7 +1057,7 @@ var Panel = GObject.registerClass({
}
_addPlugin(name) {
const plugin = imports.service.plugins[name];
const plugin = plugins[name];
const row = new SectionRow({
height_request: 48,

View File

@ -2,13 +2,11 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
'use strict';
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
import Gdk from 'gi://Gdk';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
/*
@ -32,7 +30,7 @@ const _MODIFIERS = [
/**
* Response enum for ShortcutChooserDialog
*/
var ResponseType = {
export const ResponseType = {
CANCEL: Gtk.ResponseType.CANCEL,
SET: Gtk.ResponseType.APPLY,
UNSET: 2,
@ -42,7 +40,7 @@ var ResponseType = {
/**
* A simplified version of the shortcut editor from GNOME Control Center
*/
var ShortcutChooserDialog = GObject.registerClass({
export const ShortcutChooserDialog = GObject.registerClass({
GTypeName: 'GSConnectPreferencesShortcutEditor',
Template: 'resource:///org/gnome/Shell/Extensions/GSConnect/ui/preferences-shortcut-editor.ui',
Children: [
@ -209,7 +207,7 @@ var ShortcutChooserDialog = GObject.registerClass({
* @param {number} [grabFlags] - Grab Flags
* @param {boolean} %true if available, %false on error or unavailable
*/
async function checkAccelerator(accelerator, modeFlags = 0, grabFlags = 0) {
export async function checkAccelerator(accelerator, modeFlags = 0, grabFlags = 0) {
try {
let result = false;
@ -276,7 +274,7 @@ async function checkAccelerator(accelerator, modeFlags = 0, grabFlags = 0) {
* @param {string} accelerator - An accelerator as taken by Gtk.ShortcutLabel
* @return {string} An accelerator or %null if it should be unset.
*/
async function getAccelerator(summary, accelerator = null) {
export async function getAccelerator(summary, accelerator = null) {
try {
const dialog = new ShortcutChooserDialog({
summary: summary,

View File

@ -2,18 +2,18 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
'use strict';
import Gdk from 'gi://Gdk';
import GdkPixbuf from 'gi://GdkPixbuf';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
const Gdk = imports.gi.Gdk;
const GdkPixbuf = imports.gi.GdkPixbuf;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
import system from 'system';
const Config = imports.config;
const Device = imports.preferences.device;
const Remote = imports.utils.remote;
import Config from '../config.js';
import {Panel, rowSeparators} from './device.js';
import {Service} from '../utils/remote.js';
/*
@ -21,7 +21,7 @@ const Remote = imports.utils.remote;
*/
const LOG_HEADER = new GLib.Bytes(`
GSConnect: ${Config.PACKAGE_VERSION} (${Config.IS_USER ? 'user' : 'system'})
GJS: ${imports.system.version}
GJS: ${system.version}
Session: ${GLib.getenv('XDG_SESSION_TYPE')}
OS: ${GLib.get_os_info('PRETTY_NAME')}
--------------------------------------------------------------------------------
@ -91,7 +91,7 @@ async function generateSupportLog(time) {
/**
* "Connect to..." Dialog
*/
var ConnectDialog = GObject.registerClass({
const ConnectDialog = GObject.registerClass({
GTypeName: 'GSConnectConnectDialog',
Template: 'resource:///org/gnome/Shell/Extensions/GSConnect/ui/connect-dialog.ui',
Children: [
@ -132,7 +132,7 @@ var ConnectDialog = GObject.registerClass({
});
var Window = GObject.registerClass({
export const Window = GObject.registerClass({
GTypeName: 'GSConnectPreferencesWindow',
Properties: {
'display-mode': GObject.ParamSpec.string(
@ -173,7 +173,7 @@ var Window = GObject.registerClass({
});
// Service Proxy
this.service = new Remote.Service();
this.service = new Service();
this._deviceAddedId = this.service.connect(
'device-added',
@ -198,7 +198,7 @@ var Window = GObject.registerClass({
this.service_box.set_focus_vadjustment(this.service_window.vadjustment);
// Device List
this.device_list.set_header_func(Device.rowSeparators);
this.device_list.set_header_func(rowSeparators);
// Discoverable InfoBar
this.settings.bind(
@ -580,7 +580,7 @@ var Window = GObject.registerClass({
try {
if (!this.stack.get_child_by_name(device.id)) {
// Add the device preferences
const prefs = new Device.Panel(device);
const prefs = new Panel(device);
this.stack.add_titled(prefs, device.id, device.name);
// Add a row to the device list