modalDialog: Inherit from St.Widget

Make the dialog a widget itself, removing the `_group` property used for
handling the actor.

Update all the inherited classes to be also GObject implementations, moving all
the signals to proper object ones.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/55
This commit is contained in:
Marco Trevisan (Treviño)
2019-05-23 15:45:44 -05:00
parent dd5d7d3b70
commit d25bcbc3a7
14 changed files with 130 additions and 123 deletions

View File

@ -1,4 +1,4 @@
const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
@ -13,10 +13,11 @@ var AudioDevice = {
const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
var AudioDeviceSelectionDialog =
class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
constructor(devices) {
super({ styleClass: 'audio-device-selection-dialog' });
var AudioDeviceSelectionDialog = GObject.registerClass({
Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } }
}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
_init(devices) {
super._init({ styleClass: 'audio-device-selection-dialog' });
this._deviceItems = {};
@ -33,10 +34,6 @@ class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
throw new Error('Too few devices for a selection');
}
destroy() {
super.destroy();
}
_buildLayout(devices) {
let title = new St.Label({ style_class: 'audio-selection-title',
text: _("Select Audio Device"),
@ -125,7 +122,7 @@ class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
Main.overview.hide();
app.activate();
}
};
});
var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
constructor() {