1. Overview
The DeleteBox module executes and monitors deletion of one or more snapshots.
Its principal responsibilities are:
- Starts the deletion worker
- Displays deletion progress and status
- Handles RSYNC and BTRFS deletion modes
- Reports the final worker result
2. Class Structure and Dependencies
public class DeleteBox : Gtk.Box
The source imports:
GtkGeeXAppTeeJee.LoggingTeeJee.FileSystemTeeJee.JsonHelperTeeJee.ProcessHelperTeeJee.GtkHelperTeeJee.SystemTeeJee.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.Spinner spinner– activity indicator shown while an operation is runningGtk.Label lbl_msg– primary operation message labelGtk.Label lbl_status– detailed status labelGtk.Label lbl_remaining– estimated remaining-time labelGtk.ProgressBar progressbar– visual progress indicator for a long-running taskGtk.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 containersGtk.ProgressBar– operation progressGtk.Spinner– indeterminate activity indicators
5. Initialization
DeleteBox()
public DeleteBox(Gtk.Window _parent_window)
Initializes the class instance, creates its GTK controls, and prepares the initial state. It creates Gtk.Box, Gtk.ProgressBar, Gtk.Spinner where required.
6. Central Controller Integration
The module reads or modifies the following Main controller members through the global App object:
App.btrfs_modeApp.delete_beginApp.delete_file_taskApp.progress_textApp.thread_delete_runningApp.thread_delete_success
7. Method Reference
delete_snapshots()
public bool delete_snapshots()
Implements the delete snapshots operation. It reads or updates central state through App.btrfs_mode, App.delete_begin, App.delete_file_task, App.progress_text, App.thread_delete_running, App.thread_delete_success.
8. External Resources and Paths
The component does not directly define protected filesystem paths or external command strings.
9. Data and Event Flow
- Construct the component and initialize its child controls
- 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
Appcontroller used by the surrounding workflow.
11. Implementation Considerations
- Polling loops: some operations wait synchronously while continuing to process GTK events.
- Global coupling: the class depends on the process-wide
Appobject 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.
