mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
remove version check in _createPreferencesDialog
This commit is contained in:
49
prefs.js
49
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user