summaryrefslogtreecommitdiff
path: root/raveos-gnome-theme/theme-data/extensions/installed/blur-my-shell@aunetx/prefs.js
blob: b3d79807b41078a2276f0b99d744ed5f35fda6b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import Gdk from 'gi://Gdk';
import Gtk from 'gi://Gtk';
import Gio from 'gi://Gio';
import { ExtensionPreferences } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';

import { update_from_old_settings } from './conveniences/settings_updater.js';
import { PipelinesManager } from './conveniences/pipelines_manager.js';
import { Settings } from './conveniences/settings.js';
import { KEYS } from './conveniences/keys.js';

import { addMenu } from './preferences/menu.js';
import { Pipelines } from './preferences/pipelines.js';
import { Panel } from './preferences/panel.js';
import { Overview } from './preferences/overview.js';
import { Dash } from './preferences/dash.js';
import { Applications } from './preferences/applications.js';
import { Other } from './preferences/other.js';

import './preferences/pipelines_management/pipeline_choose_row.js';


export default class BlurMyShellPreferences extends ExtensionPreferences {
    constructor(metadata) {
        super(metadata);

        // load the icon theme
        let iconPath = this.dir.get_child("icons").get_path();
        let iconTheme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default());
        iconTheme.add_search_path(iconPath);
    }

    fillPreferencesWindow(window) {
        addMenu(window);

        // update from old settings, very important for hacks level specifically
        update_from_old_settings(this.getSettings());

        const actionGroup = new Gio.SimpleActionGroup();
        window.insert_action_group('link', actionGroup);
        const action = new Gio.SimpleAction({ name: 'open-gnome-rounded-blur' });
        action.connect('activate', () => {
            Gio.AppInfo.launch_default_for_uri(
                'https://github.com/aunetx/blur-my-shell/blob/master/scripts/GUIDE.md',
                null
            );
        });
        actionGroup.add_action(action);

        const preferences = new Settings(KEYS, this.getSettings());
        const pipelines_manager = new PipelinesManager(preferences);

        const pipelines_page = new Pipelines(preferences, pipelines_manager, window);

        window.add(pipelines_page);
        window.add(new Panel(preferences, pipelines_manager, pipelines_page));
        window.add(new Overview(preferences, pipelines_manager, pipelines_page));
        window.add(new Dash(preferences, pipelines_manager, pipelines_page));
        window.add(new Applications(preferences, window, pipelines_manager, pipelines_page));
        window.add(new Other(preferences, pipelines_manager, pipelines_page));

        window.search_enabled = true;
    }
}