Skip to content

Commit

Permalink
Remove banner from preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Apr 9, 2024
1 parent 001d8ac commit f33dd77
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions [email protected]/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,6 @@ import Adw from 'gi://Adw';
import Gio from 'gi://Gio';
import Gtk from 'gi://Gtk';
import {ExtensionPreferences, gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import {PACKAGE_VERSION} from 'resource:///org/gnome/Shell/Extensions/js/misc/config.js';

// From js/misc/utils.js which can't be imported.
function _GNOMEversionToNumber(version) {
let ret = Number(version);
if (!isNaN(ret))
return ret;
if (version === 'alpha')
return -2;
if (version === 'beta')
return -1;
return ret;
}

function GNOMEversionCompare(version1, version2) {
const v1Array = version1.split('.');
const v2Array = version2.split('.');

for (let i = 0; i < Math.max(v1Array.length, v2Array.length); i++) {
let elemV1 = _GNOMEversionToNumber(v1Array[i] || '0');
let elemV2 = _GNOMEversionToNumber(v2Array[i] || '0');
if (elemV1 < elemV2)
return -1;
if (elemV1 > elemV2)
return 1;
}

return 0;
}

export default class Prefs extends ExtensionPreferences {
fillPreferencesWindow(window) {
Expand All @@ -40,17 +11,6 @@ export default class Prefs extends ExtensionPreferences {

const page = new Adw.PreferencesPage();

if (GNOMEversionCompare(PACKAGE_VERSION, '45.1') < 0) {
// window.add_toast(new Adw.Toast({title: 'Test'}));
let group = new Adw.PreferencesGroup();
let banner = new Adw.Banner({
title: _('Some features of the extension are disabled until GNOME Shell 45.1.'),
revealed: true,
});
group.add(banner);
page.add(group);
}

let group = new Adw.PreferencesGroup({
title: _('General Settings'),
});
Expand Down

0 comments on commit f33dd77

Please sign in to comment.