[gnome] Update extensions for version 48

This commit is contained in:
2025-03-29 17:52:56 -04:00
parent e01589e836
commit a84b79ca08
153 changed files with 3479 additions and 2189 deletions

View File

@ -422,6 +422,28 @@ export const Window = GObject.registerClass({
dialog.show_all();
}
_validateName(name) {
// None of the forbidden characters and at least one non-whitespace
if (name.trim() && /^[^"',;:.!?()[\]<>]{1,32}$/.test(name))
return true;
const dialog = new Gtk.MessageDialog({
text: _('Invalid Device Name'),
// TRANSLATOR: %s is a list of forbidden characters
secondary_text: _('Device name must not contain any of %s ' +
'and have a length of 1-32 characters')
.format('<b><tt>^"\',;:.!?()[]&lt;&gt;</tt></b>'),
secondary_use_markup: true,
buttons: Gtk.ButtonsType.OK,
modal: true,
transient_for: this,
});
dialog.connect('response', (dialog) => dialog.destroy());
dialog.show_all();
return false;
}
/*
* "Help" GAction
*/
@ -456,7 +478,7 @@ export const Window = GObject.registerClass({
}
_onSetServiceName(widget) {
if (this.rename_entry.text.length) {
if (this._validateName(this.rename_entry.text)) {
this.headerbar.title = this.rename_entry.text;
this.settings.set_string('name', this.rename_entry.text);
}