From 3465557a5b3b09b563fc45d2c3b13f09c4935a34 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Mon, 1 Nov 2021 10:53:03 +0100 Subject: Use GResources for the UI file and the LICENSE - The About dialog now displays the licence. - The main UI file is now integrated into the binary. The project needed some of its ugly CMake code back. --- src/ld-window-main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ld-window-main.c b/src/ld-window-main.c index 6e97996..cbf9fd9 100644 --- a/src/ld-window-main.c +++ b/src/ld-window-main.c @@ -274,8 +274,8 @@ ld_window_main_init (LdWindowMain *self) priv->action_group, 0); error = NULL; - gtk_ui_manager_add_ui_from_file - (priv->ui_manager, PROJECT_SHARE_DIR "gui/window-main.ui", &error); + gtk_ui_manager_add_ui_from_resource + (priv->ui_manager, "/logdiag/logdiag.ui", &error); if (error) { g_message ("building UI failed: %s", error->message); @@ -1153,6 +1153,10 @@ static void on_action_about (GtkAction *action, LdWindowMain *self) { GtkWidget *about_dialog; + GBytes *license; + + license = g_resources_lookup_data ("/logdiag/LICENSE", + G_RESOURCE_LOOKUP_FLAGS_NONE, NULL); about_dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG, "program-name", PROJECT_NAME, @@ -1160,9 +1164,11 @@ on_action_about (GtkAction *action, LdWindowMain *self) "version", PROJECT_VERSION, "translator-credits", _("translator-credits"), "copyright", "Copyright 2010 - 2021 Přemysl Eric Janouch", + "license", g_bytes_get_data (license, NULL), "website", PROJECT_URL, NULL); + g_bytes_unref (license); g_signal_connect (about_dialog, "activate-link", G_CALLBACK (on_action_about_activate_link), self); -- cgit v1.2.3-70-g09d2