AppsPage

1. Overview

GTK page that aggregates connections by executable/application identity for the current session, showing connection count, latest destination, verdict, and time with constant-time row updates.

File role: Implementation. The file contains 155 lines and belongs to the pages/AppsPage.cpp path.

The companion file is pages/AppsPage.hpp.


2. Component Responsibilities

  • Implement the behavior declared by the corresponding header or entry-point contract.
  • Resolve a stable application display name
  • Use executable path or process command as the aggregation key
  • Insert a new application row on first sight
  • Update count and latest connection metadata in O(1)
  • Clear the session list on user request

3. Dependencies and Integration

Project-level dependencies:

  • AppsPage.hpp
  • ../util/AppResolver.hpp
  • glibmm/i18n.h

System and library dependencies:

  • ctime
  • filesystem
  • iomanip
  • sstream

4. Signals and Event Integration

The file exposes or connects the following signal-related elements:

  • m_clearBtn.signal_clicked().connect([this]() { clear(); });

GTK-facing callbacks must execute on the main UI context. Components with worker threads use dispatchers or idle callbacks to cross the thread boundary.


5. Functions and Methods

The file exposes or implements 6 detected function or method signatures.

1. AppsPage

AppsPage::AppsPage() : Gtk::Box(Gtk::Orientation::VERTICAL, 0)

Implements the apps page operation declared by this component.

2. buildUI

void AppsPage::buildUI()

Builds and configures the ui user-interface or internal structure.

3. currentTimeString

std::string AppsPage::currentTimeString()

Implements the current time string operation declared by this component.

4. displayNameFor

std::string AppsPage::displayNameFor(const ConnectionInfo& info)

Implements the display name for operation declared by this component.

5. noteConnection

void AppsPage::noteConnection(const ConnectionInfo& info, const std::string& verdict)

Records connection in the current in-memory model.

6. clear

void AppsPage::clear()

Clears clear and resets related state.


6. Runtime Flow

  1. Resolve a stable application display name
  2. Use executable path or process command as the aggregation key
  3. Insert a new application row on first sight
  4. Update count and latest connection metadata in O(1)
  5. Clear the session list on user request

7. Runtime and Security Considerations

  • Uses the shared application resolver to avoid misleading process attribution.
  • Keeps session data in memory and exposes an explicit clear operation.

8. Error Handling and Operational Notes

  • Errors are propagated through the return type, callbacks, or the owning controller.

9. Source Integrity

Relative source path: pages/AppsPage.cpp

SHA-256:

c5fce02b7fe5d45a10ae14fb739b77a280d76da285d81413c6de44d075f101e8

10. Licensing

The source header identifies this component as distributed under the GNU General Public License version 3. BastionGuard branding and trademarks remain subject to the notices stated in the source file.