The chooser runs before ScopeModel exists, so declining costs no buffer and no socket. UDPSCOPE_PROBE_SOURCES=1 prints what the discovery found and exits, before gtk_init(), so the list is checkable with no display.
20 lines
729 B
C++
20 lines
729 B
C++
// SPDX-License-Identifier: MIT
|
|
// SPDX-FileCopyrightText: 2026 Martino Ferrari
|
|
|
|
#pragma once
|
|
|
|
#include "config.hpp"
|
|
|
|
namespace udpscope {
|
|
|
|
/// Asks which data source to open: a list of the sources with a stored session, and a form for a
|
|
/// new one. Returns true with `cfg`'s connection fields filled in, or false if the user declined
|
|
/// -- in which case `cfg` is untouched and the caller should exit.
|
|
///
|
|
/// Runs *before* `ScopeModel` exists, so declining costs no buffer and no socket. It drives its
|
|
/// own `gtk_init()` and nested `GMainLoop`; `run_ui()`'s `GtkApplication` comes afterwards in the
|
|
/// same process, which works because `gtk_init()` is idempotent.
|
|
bool choose_source(Config& cfg);
|
|
|
|
} // namespace udpscope
|