[gnome-sound-recorder/bilelmoussaoui/fixes: 7/12] dialogs: use close/show instead of destroy/run




commit 592e437282ea066ae43720833015eeb4eef0a9bb
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Wed Sep 9 03:01:48 2020 +0200

    dialogs: use close/show instead of destroy/run

 src/application.js | 2 +-
 src/row.js         | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index d5c7887..0cfcd32 100644
--- a/src/application.js
+++ b/src/application.js
@@ -130,7 +130,7 @@ var Application = GObject.registerClass(class Application extends Gtk.Applicatio
         });
         aboutDialog.show();
         aboutDialog.connect('response', () => {
-            aboutDialog.destroy();
+            aboutDialog.close();
         });
     }
 });
diff --git a/src/row.js b/src/row.js
index 4b861be..19e4993 100644
--- a/src/row.js
+++ b/src/row.js
@@ -67,15 +67,14 @@ var Row = GObject.registerClass({
             const window = Gio.Application.get_default().get_active_window();
             const dialog = Gtk.FileChooserNative.new(_('Export Recording'), window, 
Gtk.FileChooserAction.SAVE, _('_Export'), _('_Cancel'));
             dialog.set_current_name(`${this._recording.name}.${this._recording.extension}`);
-            dialog.connect('response', (_dialog, _response) => {
-                if (_response === Gtk.ResponseType.ACCEPT) {
+            dialog.connect('response', (_dialog, response) => {
+                if (response === Gtk.ResponseType.ACCEPT) {
                     const dest = dialog.get_file();
                     this._recording.save(dest);
                 }
-                _dialog.destroy();
+                dialog.destroy();
             });
-
-            dialog.run();
+            dialog.show();
         });
 
         renameAction.connect('activate', () => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]