Move the about window to it's own widget
--- a/meson.build Mon Sep 20 20:37:37 2021 -0500
+++ b/meson.build Mon Sep 20 21:19:53 2021 -0500
@@ -1,10 +1,10 @@
project('glibre', 'c', version : '0.0.3-dev')
-GLIB = dependency('glib-2.0', version : '>=2.40.0')
-GTK3 = dependency('gtk+-3.0', version : '>=3.18.0')
+GLIB = dependency('glib-2.0', version : '>=2.52.0') +GTK3 = dependency('gtk+-3.0', version : '>=3.24.0') - '-DVERSION="@0@"'.format(meson.project_version()),
+ '-DGLIBRE_VERSION="@0@"'.format(meson.project_version()), --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/glibre-about-window.c Mon Sep 20 21:19:53 2021 -0500
@@ -0,0 +1,52 @@
+ * GlibRe - The glib regex tester + * Copyright (C) 2010-2021 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "glibre-about-window.h" +struct _GlibreAboutWindow { +G_DEFINE_TYPE(GlibreAboutWindow, glibre_about_window, GTK_TYPE_ABOUT_DIALOG) +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +glibre_about_window_init(GlibreAboutWindow *window) { + gtk_widget_init_template(GTK_WIDGET(window)); +glibre_about_window_class_init(GlibreAboutWindowClass *klass) { + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + gtk_widget_class_set_template_from_resource(widget_class, + "/org/imfreedom/keep/grim/glibre/about.ui"); +/****************************************************************************** + *****************************************************************************/ +glibre_about_window_new(void) { + GLIBRE_TYPE_ABOUT_WINDOW, + "version", GLIBRE_VERSION, --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/glibre-about-window.h Mon Sep 20 21:19:53 2021 -0500
@@ -0,0 +1,36 @@
+ * GlibRe - The glib regex tester + * Copyright (C) 2010-2021 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef GLIBRE_ABOUT_WINDOW_H +#define GLIBRE_ABOUT_WINDOW_H +#include <glib-object.h> +#define GLIBRE_TYPE_ABOUT_WINDOW (glibre_about_window_get_type()) +G_DECLARE_FINAL_TYPE(GlibreAboutWindow, glibre_about_window, GLIBRE, + ABOUT_WINDOW, GtkAboutDialog) +GtkWidget *glibre_about_window_new(void); +#endif /* GLIBRE_ABOUT_WINDOW_H */ --- a/src/glibre.c Mon Sep 20 20:37:37 2021 -0500
+++ b/src/glibre.c Mon Sep 20 21:19:53 2021 -0500
@@ -19,6 +19,8 @@
+#include "glibre-about-window.h" @@ -605,34 +607,9 @@
glibre_about_cb(GtkMenuItem *w, gpointer d) {
- const gchar *license = "\
-This program is free software: you can redistribute it and/or modify \
-it under the terms of the GNU General Public License as published by \
-the Free Software Foundation, either version 3 of the License, or \
-(at your option) any later version.\n\
-This program is distributed in the hope that it will be useful, \
-but WITHOUT ANY WARRANTY; without even the implied warranty of \
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \
-GNU General Public License for more details.\n\
-You should have received a copy of the GNU General Public License \
-along with this program. If not, see <http://www.gnu.org/licenses/>.";
- const gchar *authors[] = {
- "Gary Kramlich <grim@reaperworld.com",
+ GtkWidget *about = glibre_about_window_new(); - gtk_show_about_dialog(NULL,
- "program-name", "glibre",
- "copyright", "Copyright © 2010 Gary Kramlich <grim@reaperworld.com>",
- "title", "About glibre",
- "website", "https://www.guifications.org/projects/glibre",
+ gtk_widget_show_all(about); --- a/src/meson.build Mon Sep 20 20:37:37 2021 -0500
+++ b/src/meson.build Mon Sep 20 21:19:53 2021 -0500
@@ -1,5 +1,16 @@
+glibre_resources = gnome.compile_resources( + 'resources/glibre.gresource.xml', + source_dir: 'resources') glibre = executable('glibre',
+ 'glibre-about-window.c', + 'glibre-about-window.h', dependencies: [GLIB, GTK3],
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/resources/about.ui Mon Sep 20 21:19:53 2021 -0500
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 +Copyright (C) Copyright (C) 2010-2021 +This file is part of glibre. +glibre is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +glibre is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with glibre. If not, see <http://www.gnu.org/licenses/>. +Author: Gary Kramlich <grim@reaperworld.com> +<interface domain="glibre"> + <requires lib="gtk+" version="3.24"/> + <!-- interface-license-type gplv3 --> + <!-- interface-name glibre --> + <!-- interface-description A GLib Regex Testing Tool --> + <!-- interface-copyright Copyright (C) 2010-2021 --> + <!-- interface-authors Gary Kramlich <grim@reaperworld.com> --> + <template class="GlibreAboutWindow" parent="GtkAboutDialog"> + <property name="can-focus">False</property> + <property name="type-hint">dialog</property> + <property name="program-name">Glibre</property> + <property name="copyright" translatable="yes">Copyright © 2010-2019 Gary Kramlich <grim@reaperworld.com></property> + <property name="website">https://keep.imfreedom.org/grim/glibre</property> + <property name="website-label" translatable="yes">keep.imfreedom.org/grim/glibre</property> + <property name="license" translatable="yes">This program comes with absolutely no warranty. +See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 or later</a> for details.</property> + <property name="authors">Gary Kramlich <grim@reaperworld.com></property> + <property name="logo-icon-name">edit-find-replace</property> + <property name="wrap-license">True</property> + <property name="license-type">gpl-3-0</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can-focus">False</property> + <signal name="delete-event" handler="gtk_widget_destroy" swapped="yes"/> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can-focus">False</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/resources/glibre.gresource.xml Mon Sep 20 21:19:53 2021 -0500
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?> + <gresource prefix="org/imfreedom/keep/grim/glibre"> + <file compressed="true">about.ui</file>