73 lines
2.0 KiB
JavaScript
73 lines
2.0 KiB
JavaScript
// prefs.js - Préférences de l'extension (optionnel pour V1)
|
|
|
|
import Adw from 'gi://Adw';
|
|
import Gtk from 'gi://Gtk';
|
|
|
|
import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
|
|
|
export default class PilotPreferences extends ExtensionPreferences {
|
|
/**
|
|
* Remplit la fenêtre de préférences
|
|
*/
|
|
fillPreferencesWindow(window) {
|
|
// Page principale
|
|
const page = new Adw.PreferencesPage({
|
|
title: 'General',
|
|
icon_name: 'dialog-information-symbolic',
|
|
});
|
|
|
|
// Groupe: Configuration
|
|
const configGroup = new Adw.PreferencesGroup({
|
|
title: 'Configuration',
|
|
description: 'Extension settings for Pilot Control',
|
|
});
|
|
|
|
// Config file path
|
|
const configPathRow = new Adw.ActionRow({
|
|
title: 'Config File Path',
|
|
subtitle: 'Path to pilot-v2/config.yaml',
|
|
});
|
|
|
|
const configPathEntry = new Gtk.Entry({
|
|
text: '~/app/pilot/pilot-v2/config.yaml',
|
|
valign: Gtk.Align.CENTER,
|
|
hexpand: true,
|
|
});
|
|
|
|
configPathRow.add_suffix(configPathEntry);
|
|
configGroup.add(configPathRow);
|
|
|
|
// Service name
|
|
const serviceNameRow = new Adw.ActionRow({
|
|
title: 'Service Name',
|
|
subtitle: 'Systemd service name',
|
|
});
|
|
|
|
const serviceNameEntry = new Gtk.Entry({
|
|
text: 'mqtt_pilot.service',
|
|
valign: Gtk.Align.CENTER,
|
|
hexpand: true,
|
|
});
|
|
|
|
serviceNameRow.add_suffix(serviceNameEntry);
|
|
configGroup.add(serviceNameRow);
|
|
|
|
page.add(configGroup);
|
|
|
|
// Groupe: About
|
|
const aboutGroup = new Adw.PreferencesGroup({
|
|
title: 'About',
|
|
});
|
|
|
|
const aboutRow = new Adw.ActionRow({
|
|
title: 'Pilot Control Extension',
|
|
subtitle: 'Version 1.0\n\nControl Pilot V2 MQTT agent from GNOME Shell',
|
|
});
|
|
|
|
aboutGroup.add(aboutRow);
|
|
page.add(aboutGroup);
|
|
|
|
window.add(page);
|
|
}
|
|
}
|