ExcludeAppsBox

1. Overview

The ExcludeAppsBox module presents application-specific exclusion choices.

Its principal responsibilities are:

  • Lists AppExcludeEntry objects
  • Displays paths associated with each application
  • Updates each entry enabled state
  • Links to the complete exclusion summary

2. Class Structure and Dependencies

public class ExcludeAppsBox : Gtk.Box

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.ListBox listbox – GTK list used to render selectable rows
  • Gtk.Window parent_window – parent GTK window used for transient dialogs

4. User Interface Composition

The module directly constructs the following GTK widget types:

  • Gtk.Box – layout containers
  • Gtk.CheckButton – Boolean or mutually exclusive choices
  • Gtk.Label – headings, descriptions, and status text
  • Gtk.ListBox – dynamic selectable rows
  • Gtk.ListBoxRow – custom list rows
  • Gtk.ScrolledWindow – scrollable content regions
  • Gtk.SizeGroup – consistent alignment across labels and values

Event-driven behavior is connected through signals such as:

clicked
toggled

5. Initialization

ExcludeAppsBox()

public ExcludeAppsBox(Gtk.Window _parent_window)

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


6. Central Controller Integration

The module reads or modifies the following Main controller members through the global App object:

  • App.exclude_list_apps

7. Method Reference

init_listbox()

private void init_listbox()

Initializes listbox state and controls. It creates Gtk.ListBox, Gtk.ScrolledWindow where required.

create_row()

private Gtk.Widget create_row(AppExcludeEntry entry)

Creates row required by the workflow. It creates Gtk.Box, Gtk.CheckButton, Gtk.Label, Gtk.ListBoxRow where required. It connects the toggled signal.

init_exclude_summary_link()

private void init_exclude_summary_link(Gtk.Box box)

Initializes exclude summary link state and controls. It creates Gtk.SizeGroup where required. It connects the clicked signal.

refresh()

public void refresh()

Reloads current application state and updates the visible controls.

refresh_treeview()

public void refresh_treeview()

Rebuilds the visible list from the current model state. It reads or updates central state through App.exclude_list_apps.


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. Load the current model state into the interface
  3. React to GTK signals generated by navigation, selections, and action controls
  4. Read or update central backup and restore state through the global controller

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.

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 applicable licensing terms are defined by the source-file header and the containing BastionGuard Backup project.