Skip to content
Open
4 changes: 2 additions & 2 deletions js/misc/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ const _IGNORED_PHRASES = [
];

function fixupPCIDescription(desc) {
desc = desc.replace(/[_,]/, ' ');
desc = desc.replace(/[_,]/g, ' ');

/* Remove any parenthesized info longer than 2 chars (which
may be disambiguating numbers if there are multiple identical
cards present) */
desc = desc.replace(/\([\s\S][^\(\)]{2,}\)/, '');
desc = desc.replace(/\([\s\S][^\(\)]{2,}\)/g, '');

/* Attempt to shorten ID by ignoring certain phrases */
for (let i = 0; i < _IGNORED_PHRASES.length; i++) {
Expand Down
12 changes: 11 additions & 1 deletion js/ui/cinnamonDBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ var CinnamonDBus = class {

activateCallback(callback, uuid, instance_id) {
let obj = this._getXletObject(uuid, instance_id);
if (!obj) {
global.logWarning(`[CinnamonDBus] activateCallback: xlet not found (uuid=${uuid}, instance_id=${instance_id})`);
return;
}
let cb = obj[callback].bind(obj);
cb();
}
Expand All @@ -386,6 +390,13 @@ var CinnamonDBus = class {
);
return;
}
if (!Main.settingsManager.uuids[uuid][instance_id]) {
global.logWarning(
`[CinnamonDBus] [${uuid}] Unable to find instance '${instance_id}' from SettingsManager - ` +
'this is likely due to configuring settings from a removed xlet instance.'
);
return;
}
Main.settingsManager.uuids[uuid][instance_id].remoteUpdate(key, payload);
}

Expand Down Expand Up @@ -549,7 +560,6 @@ var CinnamonDBus = class {

for (let idx in sources) {
const source = sources[idx];
// global.log(source.preferences);
ret.push([
source.type,
source.id,
Expand Down
10 changes: 5 additions & 5 deletions js/ui/keyboardManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const PopupMenu = imports.ui.popupMenu;
const Cairo = imports.cairo;
const Util = imports.misc.util;

DESKTOP_INPUT_SOURCES_SCHEMA = 'org.cinnamon.desktop.input-sources';
KEY_INPUT_SOURCES = 'sources';
KEY_KEYBOARD_OPTIONS = 'xkb-options';
KEY_PER_WINDOW = 'per-window';
KEY_SOURCE_LAYOUTS = 'source-layouts';
var DESKTOP_INPUT_SOURCES_SCHEMA = 'org.cinnamon.desktop.input-sources';
var KEY_INPUT_SOURCES = 'sources';
var KEY_KEYBOARD_OPTIONS = 'xkb-options';
var KEY_PER_WINDOW = 'per-window';
var KEY_SOURCE_LAYOUTS = 'source-layouts';

var INPUT_SOURCE_TYPE_XKB = 'xkb';
var INPUT_SOURCE_TYPE_IBUS = 'ibus';
Expand Down
11 changes: 10 additions & 1 deletion js/ui/notificationDaemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ NotificationDaemon.prototype = {
case Urgency.CRITICAL:
stockIcon = 'xsi-dialog-error-symbolic';
break;
default:
stockIcon = 'xsi-dialog-information-symbolic';
break;
}
return new St.Icon({ icon_name: stockIcon,
icon_type: St.IconType.SYMBOLIC,
Expand Down Expand Up @@ -265,7 +268,13 @@ NotificationDaemon.prototype = {
let ndata = this._expireNotifications[0];

if (ndata) {
ndata.notification.destroy(MessageTray.NotificationDestroyedReason.EXPIRED);
if (ndata.notification) {
ndata.notification.destroy(MessageTray.NotificationDestroyedReason.EXPIRED);
} else {
// notification object not yet created (async PID lookup still pending)
this._expireNotifications.shift();
this._restartExpire();
}
}

this._expireTimer = 0;
Expand Down
6 changes: 3 additions & 3 deletions js/ui/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
}

_formatCountDown() {
let fmt = ngettext("Reverting to previous display settings in %d second.",
"Reverting to previous display settings in %d seconds.");
return fmt.format(this._countDown);
return ngettext("Reverting to previous display settings in %d second.",
"Reverting to previous display settings in %d seconds.",
this._countDown).format(this._countDown);
}

_tick() {
Expand Down
Loading