1. Overview
The RsyncLogBox module parses, filters, and displays an RSYNC operation log.
Its principal responsibilities are:
- Runs log parsing in a worker thread
- Displays parsing progress
- Filters entries by status and path text
- Renders filesystem-change rows in a GTK list
2. Class Structure and Dependencies
public class RsyncLogBox : Gtk.Box
The source imports:
GtkGeeTeeJee.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.Box vbox_progress– Box widget used by the interfaceGtk.Box vbox_list– Box widget used by the interfaceGtk.ComboBoxText cmb_filter– combo box used to select filterGtk.Box hbox_filter– Box widget used by the interfaceGtk.Entry txt_pattern– text entry used for patternGtk.ListBox listbox– GTK list used to render selectable rowsstring name_filter– text value for name filterstring status_filter– text value for status filterGtk.Label lbl_header– page or result headingGtk.Label lbl_header_progress– label used to display header progress informationGtk.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 taskuint tmr_init– numeric state for tmr initbool thread_is_running– Boolean state for thread is runningstring rsync_log_file– path of the RSYNC log being displayedGee.ArrayList<FileItem> loglist– collection of loglist itemsGtk.Window window– window reference used by the component
4. User Interface Composition
The module directly constructs the following GTK widget types:
Gtk.Box– layout containersGtk.Button– action and navigation buttonsGtk.ComboBoxText– text-based selection controlsGtk.Entry– editable text fieldsGtk.Image– themed icons and state illustrationsGtk.Label– headings, descriptions, and status textGtk.ListBox– dynamic selectable rowsGtk.ListBoxRow– custom list rowsGtk.ProgressBar– operation progressGtk.ScrolledWindow– scrollable content regionsGtk.Spinner– indeterminate activity indicators
Event-driven behavior is connected through signals such as:
changed
clicked
5. Initialization
RsyncLogBox()
public RsyncLogBox(Gtk.Window _window)
Initializes the class instance, creates its GTK controls, and prepares the initial state.
6. Central Controller Integration
The module reads or modifies the following Main controller members through the global App object:
App.dry_runApp.task
7. Operational Workflow
- Open the selected log file
- Parse entries in a background thread
- Build the list view after parsing
- Apply status and text filters whenever controls change
8. Method Reference
open_log()
public void open_log(string _rsync_log_file)
Opens log and updates the active interface. It reads or updates central state through App.dry_run. It connects the changed signal.
init_delayed()
public bool init_delayed()
Performs initialization scheduled after the window has been presented. It reads or updates central state through App.dry_run.
parse_log_file()
private void parse_log_file()
Parses log file and populates the internal model. It reads or updates central state through App.task. The long-running work is delegated to a background thread.
parse_log_file_thread()
private void parse_log_file_thread()
Parses log file thread and populates the internal model. It reads or updates central state through App.task.
create_progressbar()
private void create_progressbar()
Creates progressbar required by the workflow. It creates Gtk.Box, Gtk.ProgressBar, Gtk.Spinner where required.
create_filters()
private void create_filters()
Creates filters required by the workflow. It reads or updates central state through App.dry_run. It creates Gtk.Box, Gtk.Button where required. It connects the clicked signal.
add_search_entry()
private void add_search_entry(Gtk.Box hbox)
Adds or constructs search entry for the current interface or model. It creates Gtk.Entry where required. It connects the changed signal.
add_combo()
private void add_combo(Gtk.Box hbox)
Adds or constructs combo for the current interface or model. It reads or updates central state through App.dry_run. It creates Gtk.ComboBoxText where required.
create_listview()
private void create_listview()
Creates listview required by the workflow. It creates Gtk.Box, Gtk.ListBox, Gtk.ScrolledWindow where required.
display_status()
private string display_status(FileItem item)
Implements the display status operation. It reads or updates central state through App.dry_run.
relpath_for()
private string relpath_for(FileItem item)
Implements the relpath for operation.
item_matches()
private bool item_matches(FileItem item)
Implements the item matches operation.
create_log_row()
private Gtk.Widget create_log_row(FileItem item)
Creates log row required by the workflow. It creates Gtk.Box, Gtk.Image, Gtk.Label, Gtk.ListBoxRow where required.
clear_rows()
private void clear_rows()
Implements the clear rows operation.
refresh_rows()
private void refresh_rows()
Refreshes rows from the current application state. It reads or updates central state through App.dry_run.
apply_filters()
private void apply_filters()
Applies filters to the active state.
9. External Resources and Paths
The component does not directly define protected filesystem paths or external command strings.
10. Data and Event Flow
- Construct the component and initialize its child controls
- Load the current model state into the interface
- React to GTK signals generated by navigation, selections, and action controls
- Read or update central backup and restore state through the global controller
- Run long-running work through the component worker path
11. Runtime and Security Considerations
- Thread coordination: long-running work is separated from immediate GTK callbacks and UI state must be refreshed on the main loop.
- Shared controller state: the component reads and modifies the global
Appcontroller used by the surrounding workflow. - Signal-driven behavior: GTK callbacks update the model and interface when controls are activated or changed.
- Dry-run support: the interface can invoke validation or simulation paths without committing the final restore operation.
12. Implementation Considerations
- Polling loops: some operations wait synchronously while continuing to process GTK events.
- Worker result state: completion and success are communicated through shared fields that must remain consistent with the worker lifecycle.
- Global coupling: the class depends on the process-wide
Appobject rather than receiving a controller through dependency injection.
13. Licensing
The applicable licensing terms are defined by the source-file header and the containing BastionGuard Backup project.
