RsyncLogWindow

1. Overview

The RsyncLogWindow module hosts RsyncLogBox in a standalone or embedded window.

Its principal responsibilities are:

  • Opens a specified RSYNC log
  • Provides a reusable wrapper for the log viewer
  • Supports detaching the root widget for embedded navigation

2. Class Structure and Dependencies

public class RsyncLogWindow : 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:

  • int def_width – numeric state for def width
  • int def_height – numeric state for def height
  • RsyncLogBox logbox – runtime reference for logbox
  • string rsync_log_file – path of the RSYNC log being displayed
  • bool embedded_mode – whether the component is hosted inside another window

4. User Interface Composition

The module primarily configures or hosts widgets created by reusable child components.

Event-driven behavior is connected through signals such as:

close_request

5. Initialization

RsyncLogWindow()

public RsyncLogWindow(string _rsync_log_file, bool embedded = false)

Initializes the class instance, creates its GTK controls, and prepares the initial state. 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

on_close_request()

private bool on_close_request()

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

detach_root_widget()

public Gtk.Widget detach_root_widget()

Detaches and returns the component root widget for embedding in another window.


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

10. Runtime and Security Considerations

  • Signal-driven behavior: GTK callbacks update the model and interface when controls are activated or changed.
  • Reusable presentation: the component can be hosted as a standalone window or embedded inside the main navigation stack.

11. Implementation Considerations

  • State synchronization: refresh and save methods must keep visible controls consistent with the underlying application model.

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.