BootOptionsWindow

1. Overview

The BootOptionsWindow module hosts BootOptionsBox in a standalone boot-options window.

Its principal responsibilities are:

  • Builds a compact wrapper around the reusable options widget
  • Loads current selections after presentation
  • Saves boot-related changes when the window closes

2. Class Structure and Dependencies

public class BootOptionsWindow : Gtk.Window

The source imports:

  • Gtk
  • Gee
  • TeeJee.Logging
  • TeeJee.FileSystem
  • TeeJee.JsonHelper
  • TeeJee.ProcessHelper
  • TeeJee.GtkHelper
  • TeeJee.System
  • TeeJee.Misc

The GTK inheritance and imported modules allow the component to participate in the application event loop, share the central backup state, and construct native GTK4 controls.


3. Primary Runtime State

The principal fields declared by the module include:

  • Gtk.Box vbox_main – primary vertical layout container
  • BootOptionsBox boot_options_box – container or reusable widget for boot options
  • uint tmr_init – numeric state for tmr init

4. User Interface Composition

The module directly constructs the following GTK widget types:

  • Gtk.Box – layout containers
  • Gtk.SizeGroup – consistent alignment across labels and values

Event-driven behavior is connected through signals such as:

clicked
close_request

5. Initialization

BootOptionsWindow()

public BootOptionsWindow()

Initializes the class instance, creates its GTK controls, and prepares the initial state. It creates Gtk.Box where required. It connects the close_request signal.


6. Central Controller Integration

The module does not directly access the global App controller and instead operates through its own inputs or child objects.


7. Method Reference

init_delayed()

private bool init_delayed()

Performs initialization scheduled after the window has been presented.

on_close_request()

private bool on_close_request()

Handles a request to close the window and coordinates cleanup or state persistence.

save_changes()

private void save_changes()

Copies UI selections into the central configuration and persists the result.

create_actions()

private void create_actions()

Creates action buttons and connects their callbacks. It creates Gtk.Box, Gtk.SizeGroup where required. It connects the clicked signal.


8. External Resources and Paths

The component does not directly define protected filesystem paths or external command strings.


9. Data and Event Flow

  1. Construct the component and initialize its child controls
  2. React to GTK signals generated by navigation, selections, and action controls
  3. Persist the final selections when the workflow is accepted or closed

10. Runtime and Security Considerations

  • Shared controller state: the component reads and modifies the global App controller used by the surrounding workflow.
  • Signal-driven behavior: GTK callbacks update the model and interface when controls are activated or changed.
  • Schedule persistence: changes can require regeneration of the application Cron configuration.

11. Implementation Considerations

  • Global coupling: the class depends on the process-wide App object rather than receiving a controller through dependency injection.

12. Licensing

The source header contains the following copyright notices:

Copyright 2012-2018 Tony George <teejeetech@gmail.com>

The file is distributed under the GNU General Public License version 2 or later.