From 2e0a455f9241cdaebc3b826b0bb9e7b47005c39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Thu, 2 Sep 2021 17:29:56 +0200 Subject: [PATCH] dialogs: Use response virtual function instead of signal --- src/dialogs.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/dialogs.js b/src/dialogs.js index 78cced1f..2e444c24 100644 --- a/src/dialogs.js +++ b/src/dialogs.js @@ -29,7 +29,6 @@ class ClapperFileChooser extends Gtk.FileChooserNative } this.chooserPurpose = purpose; - this.responseSignal = this.connect('response', this._onResponse.bind(this)); /* File chooser closes itself when nobody is holding its ref */ this.ref(); @@ -62,14 +61,11 @@ class ClapperFileChooser extends Gtk.FileChooserNative this.add_filter(filter); } - _onResponse(filechooser, response) + vfunc_response(respId) { debug('closing file chooser dialog'); - this.disconnect(this.responseSignal); - this.responseSignal = null; - - if(response === Gtk.ResponseType.ACCEPT) { + if(respId === Gtk.ResponseType.ACCEPT) { switch(this.chooserPurpose) { case 'open_local': this._handleOpenLocal(); @@ -209,14 +205,12 @@ class ClapperResumeDialog extends Gtk.MessageDialog }); this.resumeInfo = resumeInfo; - this.set_default_response(Gtk.ResponseType.YES); - this.connect('response', this._onResponse.bind(this)); this.show(); } - _onResponse(dialog, respId) + vfunc_response(respId) { const { player } = this.transient_for.child;