EstimateBox

1. Overview

The EstimateBox module estimates the size of the first RSYNC snapshot.

Its principal responsibilities are:

  • Runs the central system-size estimator
  • Displays an indeterminate progress state while estimation is active
  • Feeds the result into repository free-space validation

2. Class Structure and Dependencies

public class EstimateBox : Gtk.Box

The source imports:

  • Gtk
  • Gee
  • XApp
  • 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.ProgressBar progressbar – visual progress indicator for a long-running task
  • 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.ProgressBar – operation progress
  • Gtk.Spinner – indeterminate activity indicators

5. Initialization

EstimateBox()

public EstimateBox(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.estimate_system_size

7. Method Reference

estimate_system_size()

public void estimate_system_size()

Implements the estimate system size operation. It reads or updates central state through App.estimate_system_size.


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. 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.

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.