cleanup: Port non-GObject classes to JS6 classes

ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
This commit is contained in:
Florian Müllner
2017-10-31 02:19:44 +01:00
committed by Georges Basile Stavracas Neto
parent 99ce3deeb0
commit bacfdbbb03
102 changed files with 3454 additions and 4183 deletions

View File

@ -5,7 +5,6 @@ const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
@ -700,15 +699,12 @@ function queueDeferredWork(workId) {
}
}
var RestartMessage = new Lang.Class({
Name: 'RestartMessage',
Extends: ModalDialog.ModalDialog,
_init(message) {
this.parent({ shellReactive: true,
styleClass: 'restart-message headline',
shouldFadeIn: false,
destroyOnClose: true });
var RestartMessage = class extends ModalDialog.ModalDialog {
constructor(message) {
super({ shellReactive: true,
styleClass: 'restart-message headline',
shouldFadeIn: false,
destroyOnClose: true });
let label = new St.Label({ text: message });
@ -718,7 +714,7 @@ var RestartMessage = new Lang.Class({
y_align: St.Align.MIDDLE });
this.buttonLayout.hide();
}
});
};
function showRestartMessage(message) {
let restartMessage = new RestartMessage(message);