diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-01 10:53:03 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-01 12:20:16 +0100 |
commit | 3465557a5b3b09b563fc45d2c3b13f09c4935a34 (patch) | |
tree | 134fd1cde7caea0c03b24edac9591a3d664c0755 /src | |
parent | 082f1aa41c9d08fcb72e0af14ce5f3475c93482b (diff) | |
download | logdiag-3465557a5b3b09b563fc45d2c3b13f09c4935a34.tar.gz logdiag-3465557a5b3b09b563fc45d2c3b13f09c4935a34.tar.xz logdiag-3465557a5b3b09b563fc45d2c3b13f09c4935a34.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/ld-window-main.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); |