🔧 Port update notification to GTK4

This commit is contained in:
Simon Schneegans
2023-02-08 06:14:57 +01:00
parent 26e7f6bb00
commit 3c7849cc1a
2 changed files with 80 additions and 39 deletions
+19 -10
View File
@@ -345,16 +345,25 @@ var PreferencesDialog = class PreferencesDialog {
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 2000, () => {
this._showUpdateInfoTimeout = 0;
const toast = Adw.Toast.new(_('Burn-My-Windows has been updated!'));
toast.set_button_label(_('View Changelog'));
toast.set_action_name('prefs.changelog');
toast.set_timeout(0);
toast.connect(
'dismissed',
() => this._settings.set_int('last-version', Me.metadata.version));
window.add_toast(toast);
if (utils.isADW()) {
const toast = Adw.Toast.new(_('Burn-My-Windows has been updated!'));
toast.set_button_label(_('View Changelog'));
toast.set_action_name('prefs.changelog');
toast.set_timeout(0);
toast.connect(
'dismissed',
() => this._settings.set_int('last-version', Me.metadata.version));
window.add_toast(toast);
}else {
const infoBar = this._builder.get_object("update-info");
infoBar.connect("response", i => {
this._settings.set_int('last-version', Me.metadata.version);
i.set_revealed(false);
});
infoBar.set_revealed(true);
}
return false;
});