From d4a0ec1bfae38c87db6dd25466abc79b1871d887 Mon Sep 17 00:00:00 2001 From: Philipp Unger Date: Mon, 18 Apr 2022 23:25:55 +0200 Subject: [PATCH] remove version check in _createPreferencesDialog --- prefs.js | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/prefs.js b/prefs.js index 5525fc0..e7c02e0 100644 --- a/prefs.js +++ b/prefs.js @@ -486,34 +486,31 @@ const Preferences = class { _createPreferencesDialog(title, content, reset_function = null) { let dialog; - if (true) { // Config.PACKAGE_VERSION < '42') { - dialog = new Gtk.Dialog({ title: title, - transient_for: this.notebook.get_root(), - use_header_bar: true, - modal: true }); + dialog = new Gtk.Dialog({ title: title, + transient_for: this.notebook.get_root(), + use_header_bar: true, + modal: true }); - // GTK+ leaves positive values for application-defined response ids. - // Use +1 for the reset action - if (reset_function != null) - dialog.add_button(_('Reset to defaults'), 1); + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + if (reset_function != null) + dialog.add_button(_('Reset to defaults'), 1); + + dialog.get_content_area().append(content); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings + if (reset_function) + reset_function(); + } else { + // remove the settings content so it doesn't get destroyed; + dialog.get_content_area().remove(content); + dialog.destroy(); + } + return; + }); - dialog.get_content_area().append(content); - - dialog.connect('response', (dialog, id) => { - if (id == 1) { - // restore default settings - if (reset_function) - reset_function(); - } else { - // remove the settings content so it doesn't get destroyed; - dialog.get_content_area().remove(content); - dialog.destroy(); - } - return; - }); - } else { - dialog = new Adw.PreferencesWindow({ title: title }); - } return dialog; }