[gnome] Fix version for gjsosk and gsconnect, add impatience
This commit is contained in:
@ -2,17 +2,15 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Battery'),
|
||||
description: _('Exchange battery information'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Battery',
|
||||
@ -32,9 +30,9 @@ var Metadata = {
|
||||
* Battery Plugin
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/battery
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const BatteryPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectBatteryPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class BatteryPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'battery');
|
||||
@ -431,3 +429,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default BatteryPlugin;
|
||||
|
||||
@ -2,15 +2,13 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Clipboard'),
|
||||
description: _('Share the clipboard content'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Clipboard',
|
||||
@ -47,9 +45,9 @@ var Metadata = {
|
||||
* Clipboard Plugin
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/clipboard
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const ClipboardPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectClipboardPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class ClipboardPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'clipboard');
|
||||
@ -180,3 +178,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default ClipboardPlugin;
|
||||
|
||||
@ -2,17 +2,14 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Connectivity Report'),
|
||||
description: _('Display connectivity status'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.ConnectivityReport',
|
||||
@ -30,9 +27,9 @@ var Metadata = {
|
||||
* Connectivity Report Plugin
|
||||
* https://invent.kde.org/network/kdeconnect-kde/-/tree/master/plugins/connectivity_report
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const ConnectivityReportPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectConnectivityReportPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class ConnectivityReportPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'connectivity_report');
|
||||
@ -162,3 +159,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default ConnectivityReportPlugin;
|
||||
|
||||
@ -2,27 +2,28 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const PluginBase = imports.service.plugin;
|
||||
const Contacts = imports.service.components.contacts;
|
||||
import Plugin from '../plugin.js';
|
||||
import Contacts from '../components/contacts.js';
|
||||
|
||||
/*
|
||||
* We prefer libebook's vCard parser if it's available
|
||||
*/
|
||||
var EBookContacts;
|
||||
let EBookContacts;
|
||||
export const setEBookContacts = (ebook) => { // This function is only for tests to call!
|
||||
EBookContacts = ebook;
|
||||
};
|
||||
|
||||
try {
|
||||
EBookContacts = imports.gi.EBookContacts;
|
||||
EBookContacts = (await import('gi://EBookContacts')).default;
|
||||
} catch (e) {
|
||||
EBookContacts = null;
|
||||
}
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Contacts'),
|
||||
description: _('Access contacts of the paired device'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Contacts',
|
||||
@ -53,14 +54,14 @@ const VCARD_TYPED_META = /([a-z]+)=(.*)/i;
|
||||
* Contacts Plugin
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/contacts
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const ContactsPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectContactsPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class ContactsPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'contacts');
|
||||
|
||||
this._store = new Contacts.Store(device.id);
|
||||
this._store = new Contacts(device.id);
|
||||
this._store.fetch = this._requestUids.bind(this);
|
||||
|
||||
// Notify when the store is ready
|
||||
@ -458,3 +459,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default ContactsPlugin;
|
||||
|
||||
@ -2,18 +2,16 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import Gdk from 'gi://Gdk';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gtk from 'gi://Gtk';
|
||||
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Find My Phone'),
|
||||
description: _('Ring your paired device'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.FindMyPhone',
|
||||
@ -36,9 +34,9 @@ var Metadata = {
|
||||
* FindMyPhone Plugin
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/findmyphone
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const FindMyPhonePlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectFindMyPhonePlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class FindMyPhonePlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'findmyphone');
|
||||
@ -247,3 +245,5 @@ const Dialog = GObject.registerClass({
|
||||
this._plugin = plugin;
|
||||
}
|
||||
});
|
||||
|
||||
export default FindMyPhonePlugin;
|
||||
|
||||
@ -2,17 +2,15 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import Gdk from 'gi://Gdk';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const {InputDialog} = imports.service.ui.mousepad;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import {InputDialog} from '../ui/mousepad.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Mousepad'),
|
||||
description: _('Enables the paired device to act as a remote mouse and keyboard'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Mousepad',
|
||||
@ -120,7 +118,7 @@ const KeyMapCodes = new Map([
|
||||
*
|
||||
* TODO: support outgoing mouse events?
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const MousepadPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectMousepadPlugin',
|
||||
Properties: {
|
||||
'state': GObject.ParamSpec.boolean(
|
||||
@ -131,7 +129,7 @@ var Plugin = GObject.registerClass({
|
||||
false
|
||||
),
|
||||
},
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class MousepadPlugin extends Plugin {
|
||||
_init(device) {
|
||||
super._init(device, 'mousepad');
|
||||
|
||||
@ -379,3 +377,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default MousepadPlugin;
|
||||
|
||||
@ -2,20 +2,18 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const Config = imports.config;
|
||||
const DBus = imports.service.utils.dbus;
|
||||
const MPRIS = imports.service.components.mpris;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Config from '../../config.js';
|
||||
import * as DBus from '../utils/dbus.js';
|
||||
import {Player} from '../components/mpris.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('MPRIS'),
|
||||
description: _('Bidirectional remote media playback control'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.MPRIS',
|
||||
@ -33,9 +31,9 @@ var Metadata = {
|
||||
* https://specifications.freedesktop.org/mpris-spec/latest/
|
||||
* https://github.com/GNOME/gnome-shell/blob/master/js/ui/mpris.js
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const MPRISPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectMPRISPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class MPRISPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'mpris');
|
||||
@ -242,11 +240,22 @@ var Plugin = GObject.registerClass({
|
||||
player.Volume = packet.body.setVolume / 100;
|
||||
|
||||
if (packet.body.hasOwnProperty('Seek'))
|
||||
await player.Seek(packet.body.Seek * 1000);
|
||||
await player.Seek(packet.body.Seek);
|
||||
|
||||
if (packet.body.hasOwnProperty('SetPosition')) {
|
||||
const offset = (packet.body.SetPosition * 1000) - player.Position;
|
||||
await player.Seek(offset);
|
||||
// We want to avoid implementing this as a seek operation,
|
||||
// because some players seek a fixed amount for every
|
||||
// seek request, only respecting the sign of the parameter.
|
||||
// (Chrome, for example, will only seek ±5 seconds, regardless
|
||||
// what value is passed to Seek().)
|
||||
const position = packet.body.SetPosition;
|
||||
const metadata = player.Metadata;
|
||||
if (metadata.hasOwnProperty('mpris:trackid')) {
|
||||
const trackId = metadata['mpris:trackid'];
|
||||
await player.SetPosition(trackId, position * 1000);
|
||||
} else {
|
||||
await player.Seek(position * 1000 - player.Position);
|
||||
}
|
||||
}
|
||||
|
||||
// Information Request
|
||||
@ -448,7 +457,7 @@ var Plugin = GObject.registerClass({
|
||||
*/
|
||||
const PlayerRemote = GObject.registerClass({
|
||||
GTypeName: 'GSConnectMPRISPlayerRemote',
|
||||
}, class PlayerRemote extends MPRIS.Player {
|
||||
}, class PlayerRemote extends Player {
|
||||
|
||||
_init(device, identity) {
|
||||
super._init();
|
||||
@ -904,3 +913,5 @@ const PlayerRemote = GObject.registerClass({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default MPRISPlugin;
|
||||
|
||||
@ -2,20 +2,18 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const Config = imports.config;
|
||||
const PluginBase = imports.service.plugin;
|
||||
const NotificationUI = imports.service.ui.notification;
|
||||
import * as Components from '../components/index.js';
|
||||
import Config from '../../config.js';
|
||||
import Plugin from '../plugin.js';
|
||||
import ReplyDialog from '../ui/notification.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Notifications'),
|
||||
description: _('Share notifications with the paired device'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Notification',
|
||||
@ -162,9 +160,9 @@ function _removeNotification(id, application = null) {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/notifications
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/sendnotifications
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const NotificationPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectNotificationPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class NotificationPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'notification');
|
||||
@ -642,7 +640,7 @@ var Plugin = GObject.registerClass({
|
||||
|
||||
// If the message has no content, open a dialog for the user to add one
|
||||
if (!message) {
|
||||
const dialog = new NotificationUI.ReplyDialog({
|
||||
const dialog = new ReplyDialog({
|
||||
device: this.device,
|
||||
uuid: uuid,
|
||||
notification: notification,
|
||||
@ -692,3 +690,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default NotificationPlugin;
|
||||
|
||||
@ -2,16 +2,14 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const PluginBase = imports.service.plugin;
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Ping'),
|
||||
description: _('Send and receive pings'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Ping',
|
||||
@ -34,9 +32,9 @@ var Metadata = {
|
||||
* Ping Plugin
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/ping
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const PingPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectPingPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class PingPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'ping');
|
||||
@ -71,3 +69,5 @@ var Plugin = GObject.registerClass({
|
||||
this.device.sendPacket(packet);
|
||||
}
|
||||
});
|
||||
|
||||
export default PingPlugin;
|
||||
|
||||
@ -2,15 +2,13 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Presentation'),
|
||||
description: _('Use the paired device as a presenter'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Presenter',
|
||||
@ -25,9 +23,9 @@ var Metadata = {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/presenter
|
||||
* https://github.com/KDE/kdeconnect-android/tree/master/src/org/kde/kdeconnect/Plugins/PresenterPlugin/
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const PresenterPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectPresenterPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class PresenterPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'presenter');
|
||||
@ -61,3 +59,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default PresenterPlugin;
|
||||
|
||||
@ -2,16 +2,14 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const PluginBase = imports.service.plugin;
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Run Commands'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.RunCommand',
|
||||
description: _('Run commands on your paired device or let the device run predefined commands on this PC'),
|
||||
@ -49,7 +47,7 @@ var Metadata = {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/remotecommands
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/runcommand
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const RunCommandPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectRunCommandPlugin',
|
||||
Properties: {
|
||||
'remote-commands': GObject.param_spec_variant(
|
||||
@ -61,7 +59,7 @@ var Plugin = GObject.registerClass({
|
||||
GObject.ParamFlags.READABLE
|
||||
),
|
||||
},
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class RunCommandPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'runcommand');
|
||||
@ -252,3 +250,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default RunCommandPlugin;
|
||||
|
||||
@ -2,18 +2,15 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Config = imports.config;
|
||||
const Lan = imports.service.backends.lan;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import Config from '../../config.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('SFTP'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.SFTP',
|
||||
description: _('Browse the paired device filesystem'),
|
||||
@ -48,9 +45,9 @@ const MAX_MOUNT_DIRS = 12;
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/sftp
|
||||
* https://github.com/KDE/kdeconnect-android/tree/master/src/org/kde/kdeconnect/Plugins/SftpPlugin
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const SFTPPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectSFTPPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class SFTPPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'sftp');
|
||||
@ -106,7 +103,7 @@ var Plugin = GObject.registerClass({
|
||||
super.connected();
|
||||
|
||||
// Only enable for Lan connections
|
||||
if (this.device.channel instanceof Lan.Channel) {
|
||||
if (this.device.channel.constructor.name === 'LanChannel') { // FIXME: Circular import workaround
|
||||
if (this.settings.get_boolean('automount'))
|
||||
this.mount();
|
||||
} else {
|
||||
@ -486,3 +483,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default SFTPPlugin;
|
||||
|
||||
@ -2,19 +2,17 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
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 GdkPixbuf = imports.gi.GdkPixbuf;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
|
||||
const PluginBase = imports.service.plugin;
|
||||
const URI = imports.service.utils.uri;
|
||||
import Plugin from '../plugin.js';
|
||||
import * as URI from '../utils/uri.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Share'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Share',
|
||||
description: _('Share files and URLs between devices'),
|
||||
@ -64,9 +62,9 @@ var Metadata = {
|
||||
* TODO: receiving 'text' TODO: Window with textview & 'Copy to Clipboard..
|
||||
* https://github.com/KDE/kdeconnect-kde/commit/28f11bd5c9a717fb9fbb3f02ddd6cea62021d055
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const SharePlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectSharePlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class SharePlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'share');
|
||||
@ -198,6 +196,9 @@ var Plugin = GObject.registerClass({
|
||||
];
|
||||
iconName = 'document-save-symbolic';
|
||||
|
||||
const gtk_recent_manager = Gtk.RecentManager.get_default();
|
||||
gtk_recent_manager.add_item(file.get_uri());
|
||||
|
||||
if (packet.body.open) {
|
||||
const uri = file.get_uri();
|
||||
Gio.AppInfo.launch_default_for_uri_async(uri, null, null, null);
|
||||
@ -369,7 +370,7 @@ var Plugin = GObject.registerClass({
|
||||
|
||||
|
||||
/** A simple FileChooserDialog for sharing files */
|
||||
var FileChooserDialog = GObject.registerClass({
|
||||
const FileChooserDialog = GObject.registerClass({
|
||||
GTypeName: 'GSConnectShareFileChooserDialog',
|
||||
}, class FileChooserDialog extends Gtk.FileChooserDialog {
|
||||
|
||||
@ -451,10 +452,11 @@ var FileChooserDialog = GObject.registerClass({
|
||||
_onUriButtonToggled(button) {
|
||||
const header = this.get_header_bar();
|
||||
|
||||
// Show the URL entry
|
||||
// Show and focus the URL entry
|
||||
if (button.active) {
|
||||
this.extra_widget.sensitive = false;
|
||||
header.set_custom_title(this._uriEntry);
|
||||
this._uriEntry.grab_focus();
|
||||
this.set_response_sensitive(Gtk.ResponseType.OK, true);
|
||||
|
||||
// Hide the URL entry
|
||||
@ -490,3 +492,5 @@ var FileChooserDialog = GObject.registerClass({
|
||||
this.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default SharePlugin;
|
||||
|
||||
@ -2,19 +2,17 @@
|
||||
//
|
||||
// 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';
|
||||
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const PluginBase = imports.service.plugin;
|
||||
const LegacyMessaging = imports.service.ui.legacyMessaging;
|
||||
const Messaging = imports.service.ui.messaging;
|
||||
const URI = imports.service.utils.uri;
|
||||
import Plugin from '../plugin.js';
|
||||
import LegacyMessagingDialog from '../ui/legacyMessaging.js';
|
||||
import * as Messaging from '../ui/messaging.js';
|
||||
import SmsURI from '../utils/uri.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('SMS'),
|
||||
description: _('Send and read SMS of the paired device and be notified of new SMS'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.SMS',
|
||||
@ -85,7 +83,7 @@ var Metadata = {
|
||||
*
|
||||
* TEXT_MESSAGE: Has a "body" field which contains pure, human-readable text
|
||||
*/
|
||||
var MessageEventType = {
|
||||
export const MessageEventType = {
|
||||
TEXT_MESSAGE: 0x1,
|
||||
};
|
||||
|
||||
@ -97,7 +95,7 @@ var MessageEventType = {
|
||||
* UNREAD: A message not marked as read
|
||||
* READ: A message marked as read
|
||||
*/
|
||||
var MessageStatus = {
|
||||
export const MessageStatus = {
|
||||
UNREAD: 0,
|
||||
READ: 1,
|
||||
};
|
||||
@ -117,7 +115,7 @@ var MessageStatus = {
|
||||
* FAILED: Failed outgoing messages
|
||||
* QUEUED: Messages queued to send later
|
||||
*/
|
||||
var MessageBox = {
|
||||
export const MessageBox = {
|
||||
ALL: 0,
|
||||
INBOX: 1,
|
||||
SENT: 2,
|
||||
@ -133,7 +131,7 @@ var MessageBox = {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/sms
|
||||
* https://github.com/KDE/kdeconnect-android/tree/master/src/org/kde/kdeconnect/Plugins/SMSPlugin/
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const SMSPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectSMSPlugin',
|
||||
Properties: {
|
||||
'threads': GObject.param_spec_variant(
|
||||
@ -145,7 +143,7 @@ var Plugin = GObject.registerClass({
|
||||
GObject.ParamFlags.READABLE
|
||||
),
|
||||
},
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class SMSPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'sms');
|
||||
@ -162,7 +160,7 @@ var Plugin = GObject.registerClass({
|
||||
|
||||
get window() {
|
||||
if (this.settings.get_boolean('legacy-sms')) {
|
||||
return new LegacyMessaging.Dialog({
|
||||
return new LegacyMessagingDialog({
|
||||
device: this.device,
|
||||
plugin: this,
|
||||
});
|
||||
@ -473,7 +471,7 @@ var Plugin = GObject.registerClass({
|
||||
*/
|
||||
uriSms(uri) {
|
||||
try {
|
||||
uri = new URI.SmsURI(uri);
|
||||
uri = new SmsURI(uri);
|
||||
|
||||
// Lookup contacts
|
||||
const addresses = uri.recipients.map(number => {
|
||||
@ -534,3 +532,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default SMSPlugin;
|
||||
|
||||
@ -2,16 +2,14 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const Config = imports.config;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Config from '../../config.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('System Volume'),
|
||||
description: _('Enable the paired device to control the system volume'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.SystemVolume',
|
||||
@ -26,9 +24,9 @@ var Metadata = {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/systemvolume
|
||||
* https://github.com/KDE/kdeconnect-android/tree/master/src/org/kde/kdeconnect/Plugins/SystemvolumePlugin/
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const SystemVolumePlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectSystemVolumePlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class SystemVolumePlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'systemvolume');
|
||||
@ -202,3 +200,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default SystemVolumePlugin;
|
||||
|
||||
@ -2,18 +2,16 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
'use strict';
|
||||
import GdkPixbuf from 'gi://GdkPixbuf';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
|
||||
const GdkPixbuf = imports.gi.GdkPixbuf;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Components = imports.service.components;
|
||||
const PluginBase = imports.service.plugin;
|
||||
import * as Components from '../components/index.js';
|
||||
import Plugin from '../plugin.js';
|
||||
|
||||
|
||||
var Metadata = {
|
||||
export const Metadata = {
|
||||
label: _('Telephony'),
|
||||
description: _('Be notified about calls and adjust system volume during ringing/ongoing calls'),
|
||||
id: 'org.gnome.Shell.Extensions.GSConnect.Plugin.Telephony',
|
||||
@ -43,9 +41,9 @@ var Metadata = {
|
||||
* https://github.com/KDE/kdeconnect-kde/tree/master/plugins/telephony
|
||||
* https://github.com/KDE/kdeconnect-android/tree/master/src/org/kde/kdeconnect/Plugins/TelephonyPlugin
|
||||
*/
|
||||
var Plugin = GObject.registerClass({
|
||||
const TelephonyPlugin = GObject.registerClass({
|
||||
GTypeName: 'GSConnectTelephonyPlugin',
|
||||
}, class Plugin extends PluginBase.Plugin {
|
||||
}, class TelephonyPlugin extends Plugin {
|
||||
|
||||
_init(device) {
|
||||
super._init(device, 'telephony');
|
||||
@ -243,3 +241,5 @@ var Plugin = GObject.registerClass({
|
||||
super.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
export default TelephonyPlugin;
|
||||
|
||||
Reference in New Issue
Block a user