feat: the About dialog on AdwAboutDialog, showing the app icon
AdwAboutDialog puts the application icon in its own header, which is what the app now has one for, and adw_about_window_new() is deprecated in favour of it. It is an AdwDialog and not a GtkWindow, so it clears on ::closed and closes with adw_dialog_close() -- the same trap the shortcut overview documents, and both dialogs now share one handler keyed by the pointer to clear. Two gains while mapping the fields: system_information becomes debug_info, which renders as a Troubleshooting page with a copy button, and the string behind it becomes a std::string rather than a char[1024] that truncated a long settings path in silence. The probe now reads the icon name back out of the open dialog, so it is asserted to carry the icon rather than merely to open.
This commit is contained in:
1 parent
6deb53c458
commit
33eee0c8d0
3 files changed
+60
-37
No files matched your search
+13
-6
@@ -8,10 +8,16 @@
|
||||
|
||||
namespace udpscope {
|
||||
|
||||
/// The About dialog: version, commit, build timestamp and where the session files live.
|
||||
/// Modal on `parent`. `session_path` is this run's own session file.
|
||||
/// The About dialog: the app icon, version, commit, build timestamp and where the session
|
||||
/// files live. An `AdwAboutDialog`, so it is modal on `parent` by being presented on it, and
|
||||
/// it is an `AdwDialog` rather than a `GtkWindow`. `session_path` is this run's own session
|
||||
/// file; it goes on the Troubleshooting page, which has a copy button.
|
||||
void show_about(GtkWindow* parent, const std::string& session_path);
|
||||
|
||||
/// The icon name the open About dialog carries, or "" when it is not open. The probe reads it
|
||||
/// so the dialog is asserted to *show* the app icon rather than merely to open.
|
||||
const char* about_icon_name();
|
||||
|
||||
/// The paged help window. Modal on nothing — it is a reference, so it stays usable while
|
||||
/// the scope runs. Already open: presented.
|
||||
void show_help(GtkWindow* parent);
|
||||
@@ -33,10 +39,11 @@ HelpReport help_self_check();
|
||||
/// deprecated as of GTK 4.18 and this project builds warning-free.
|
||||
void show_shortcuts(GtkWindow* parent);
|
||||
|
||||
/// Closes whichever of the three windows are open. The About dialog and the help window are
|
||||
/// GtkWindows and close with gtk_window_close(), so their close-request handlers run; the
|
||||
/// shortcut overview is an AdwDialog and closes with adw_dialog_close(), which emits ::closed.
|
||||
/// Either way the file-scope pointer is nulled by the handler. Used by the probe.
|
||||
/// Closes whichever of the three windows are open. One of them is a GtkWindow -- the help
|
||||
/// window, closed with gtk_window_close(), which emits close-request so its handler runs. The
|
||||
/// other two are AdwDialogs, which are not GtkWindows: they close with adw_dialog_close(),
|
||||
/// which emits ::closed. Either way the file-scope pointer is nulled by the handler, which is
|
||||
/// what prevents a second open presenting a dead widget. Used by the probe.
|
||||
void close_help_windows();
|
||||
|
||||
} // namespace udpscope
|
||||
Reference in new issue
Block a user