--- a/pidgin/pidginabout.c Mon Jan 16 04:00:08 2023 -0600
+++ b/pidgin/pidginabout.c Mon Jan 16 22:02:08 2023 -0600
@@ -34,6 +34,7 @@
#include <json-glib/json-glib.h>
@@ -56,8 +57,12 @@
GtkWidget *translators_treeview;
GtkTreeStore *translators_store;
- GtkWidget *build_info_treeview;
- GtkTreeStore *build_info_store;
+ AdwPreferencesGroup *build_info_group; + AdwPreferencesGroup *runtime_info_group; + AdwPreferencesGroup *gtk_settings_group; + AdwPreferencesGroup *plugin_search_paths_group; + AdwPreferencesGroup *conf_path_info_group; + AdwPreferencesGroup *build_args_group; /******************************************************************************
@@ -104,6 +109,23 @@
+pidgin_about_dialog_group_add_row(AdwPreferencesGroup *group, + const char *title, const char *value) + GtkWidget *row = adw_action_row_new(); + adw_preferences_row_set_title(ADW_PREFERENCES_ROW(row), title); + GtkWidget *label = gtk_label_new(NULL); + gtk_label_set_markup(GTK_LABEL(label), value); + adw_action_row_add_suffix(ADW_ACTION_ROW(row), label); + adw_preferences_group_add(group, row); pidgin_about_dialog_load_json(GtkTreeStore *store, const gchar *json_section) {
GInputStream *istream = NULL;
GList *l = NULL, *sections = NULL;
@@ -183,96 +205,43 @@
-pidgin_about_dialog_add_build_args(PidginAboutDialog *about, const gchar *title,
- const gchar *build_args)
- GtkTreeIter section, value;
- markup = g_strdup_printf("<b>%s</b>", title);
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
- /* now walk through the arguments and add them */
- splits = g_strsplit(build_args, " ", -1);
- for(idx = 0; splits[idx]; idx++) {
- gchar **value_split = g_strsplit(splits[idx], "=", 2);
- if(value_split[0] == NULL || value_split[0][0] == '\0') {
- gtk_tree_store_append(about->build_info_store, &value, §ion);
- gtk_tree_store_set(about->build_info_store, &value, 0, value_split[0],
- 1, value_split[1] ? value_split[1] : "", -1);
- g_strfreev(value_split);
-pidgin_about_dialog_build_info_add_version(GtkTreeStore *store,
+pidgin_about_dialog_build_info_add_version(AdwPreferencesGroup *group,
gchar *version = g_strdup_printf("%u.%u.%u", major, minor, micro);
- gtk_tree_store_append(store, &item, section);
- gtk_tree_store_set(store, &item,
+ pidgin_about_dialog_group_add_row(group, title, version); pidgin_about_dialog_load_build_info(PidginAboutDialog *about) {
- GtkTreeIter section, item;
- /* create the section */
- markup = g_strdup_printf("<b>%s</b>", _("Build Information"));
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
/* add the commit hash */
- gtk_tree_store_append(about->build_info_store, &item, §ion);
- gtk_tree_store_set(about->build_info_store, &item,
+ pidgin_about_dialog_group_add_row(about->build_info_group, "Commit Hash", /* add the purple version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("Purple Version"),
+ pidgin_about_dialog_build_info_add_version(about->build_info_group, /* add the glib version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("GLib Version"),
+ pidgin_about_dialog_build_info_add_version(about->build_info_group, /* add the gtk version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("GTK Version"),
+ pidgin_about_dialog_build_info_add_version(about->build_info_group, @@ -280,34 +249,23 @@
pidgin_about_dialog_load_runtime_info(PidginAboutDialog *about) {
- /* create the section */
- markup = g_strdup_printf("<b>%s</b>", _("Runtime Information"));
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
/* add the purple version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("Purple Version"),
+ pidgin_about_dialog_build_info_add_version(about->runtime_info_group, /* add the glib version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("GLib Version"),
+ pidgin_about_dialog_build_info_add_version(about->runtime_info_group, /* add the gtk version */
- pidgin_about_dialog_build_info_add_version(about->build_info_store,
- §ion, _("GTK Version"),
+ pidgin_about_dialog_build_info_add_version(about->runtime_info_group, gtk_get_micro_version());
@@ -315,8 +273,6 @@
pidgin_about_dialog_load_gtk_settings(PidginAboutDialog *about) {
- GtkTreeIter section, iter;
gchar *cursor_theme_name = NULL, *theme_name = NULL;
gchar *icon_theme_name = NULL;
@@ -324,14 +280,6 @@
gboolean enable_animations = FALSE;
gboolean shell_shows_app_menu = FALSE, shell_shows_menubar = FALSE;
- /* create the section */
- markup = g_strdup_printf("<b>%s</b>", _("GTK Settings"));
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
/* get the settings we're interested in */
gtk_settings_get_default(),
@@ -345,53 +293,45 @@
"gtk-theme-name", &theme_name,
- gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-cursor-theme-name",
- 1, (cursor_theme_name != NULL) ? cursor_theme_name : _("(not set)"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + "gtk-cursor-theme-name", + (cursor_theme_name != NULL) ? cursor_theme_name : _("(not set)")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-enable-animations",
- 1, enable_animations ? _("yes") : _("no"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + "gtk-enable-animations", + enable_animations ? _("yes") : _("no")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-icon-theme-name",
- 1, (icon_theme_name != NULL) ? icon_theme_name : _("(not set)"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + (icon_theme_name != NULL) ? icon_theme_name : _("(not set)")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 1, (im_module != NULL) ? im_module : _("(not set)"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + (im_module != NULL) ? im_module : _("(not set)")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-shell-shows-app-menu",
- 1, shell_shows_app_menu ? _("yes") : _("no"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + "gtk-shell-shows-app-menu", + shell_shows_app_menu ? _("yes") : _("no")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-shell-shows-menubar",
- 1, shell_shows_menubar ? _("yes") : _("no"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + "gtk-shell-shows-menubar", + shell_shows_menubar ? _("yes") : _("no")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 0, "gtk-sound-theme-name",
- 1, (sound_theme_name != NULL) ? sound_theme_name : _("(not set)"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + "gtk-sound-theme-name", + (sound_theme_name != NULL) ? sound_theme_name : _("(not set)")); - gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 1, (theme_name != NULL) ? theme_name : _("(not set)"),
+ pidgin_about_dialog_group_add_row( + about->gtk_settings_group, + (theme_name != NULL) ? theme_name : _("(not set)")); g_free(cursor_theme_name);
@@ -402,28 +342,14 @@
pidgin_about_dialog_load_plugin_search_paths(PidginAboutDialog *about) {
GPluginManager *manager = gplugin_manager_get_default();
- /* create the section */
- markup = g_strdup_printf("<b>%s</b>", _("Plugin Search Paths"));
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
/* add the search paths */
paths = gplugin_manager_get_paths(manager);
- gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
- 1, (gchar*)(paths->data),
+ pidgin_about_dialog_group_add_row(about->plugin_search_paths_group, @@ -431,54 +357,55 @@
pidgin_about_dialog_load_conf_path_info(PidginAboutDialog *about) {
- GtkTreeIter section, iter;
- const gchar *path = NULL;
- /* create the section */
- markup = g_strdup_printf("<b>%s</b>", _("Runtime Directories"));
- gtk_tree_store_append(about->build_info_store, §ion, NULL);
- gtk_tree_store_set(about->build_info_store, §ion,
/* add the cache directory path */
- path = purple_cache_dir();
- gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
+ pidgin_about_dialog_group_add_row(about->conf_path_info_group, _("Cache"), /* add the config directory path */
- path = purple_config_dir();
- gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
+ pidgin_about_dialog_group_add_row(about->conf_path_info_group, + _("Configuration"), purple_config_dir()); /* add the data directory path */
- path = purple_data_dir();
- gtk_tree_store_append(about->build_info_store, &iter, §ion);
- gtk_tree_store_set(about->build_info_store, &iter,
+ pidgin_about_dialog_group_add_row(about->conf_path_info_group, _("Data"), +pidgin_about_dialog_add_build_args(PidginAboutDialog *about, + const char *build_args) + /* Walk through the arguments and add them */ + splits = g_strsplit(build_args, " ", -1); + for(gint idx = 0; splits[idx]; idx++) { + gchar **value_split = g_strsplit(splits[idx], "=", 2); + if(value_split[0] == NULL || value_split[0][0] == '\0') { + pidgin_about_dialog_group_add_row(about->build_args_group, + value_split[0], value_split[1]); + g_strfreev(value_split); pidgin_about_dialog_load_build_configuration(PidginAboutDialog *about) {
- pidgin_about_dialog_add_build_args(about, _("Meson Arguments"), MESON_ARGS);
pidgin_about_dialog_load_build_info(about);
pidgin_about_dialog_load_runtime_info(about);
pidgin_about_dialog_load_gtk_settings(about);
pidgin_about_dialog_load_plugin_search_paths(about);
pidgin_about_dialog_load_conf_path_info(about);
+ pidgin_about_dialog_add_build_args(about, MESON_ARGS); + gtk_widget_set_visible(GTK_WIDGET(about->build_args_group), TRUE); /******************************************************************************
@@ -534,9 +461,17 @@
gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
+ gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, + gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
+ plugin_search_paths_group); + gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, + gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, gtk_widget_class_bind_template_callback(widget_class,
pidgin_about_dialog_response_cb);
@@ -564,7 +499,6 @@
/* setup the build info page */
pidgin_about_dialog_load_build_configuration(about);
- gtk_tree_view_expand_all(GTK_TREE_VIEW(about->build_info_treeview));
/******************************************************************************
--- a/pidgin/resources/About/about.ui Mon Jan 16 04:00:08 2023 -0600
+++ b/pidgin/resources/About/about.ui Mon Jan 16 22:02:08 2023 -0600
@@ -26,14 +26,6 @@
<!-- interface-name Pidgin -->
<!-- interface-description Internet Messenger -->
<!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <object class="GtkTreeStore" id="build_info_store">
- <!-- column-name title -->
- <column type="gchararray"/>
- <!-- column-name value -->
- <column type="gchararray"/>
<object class="GtkTreeStore" id="developers_store">
<!-- column-name markup -->
@@ -52,7 +44,7 @@
<template class="PidginAboutDialog" parent="GtkDialog">
- <property name="resizable">0</property>
+ <property name="default-height">600</property> <signal name="response" handler="pidgin_about_dialog_response_cb" swapped="no"/>
<child internal-child="content_area">
@@ -184,40 +176,38 @@
<property name="name">build-info</property>
<property name="title" translatable="1">Build Information</property>
- <object class="GtkScrolledWindow">
- <property name="focusable">1</property>
- <property name="hscrollbar-policy">never</property>
- <property name="child">
- <object class="GtkTreeView" id="build_info_treeview">
- <property name="focusable">1</property>
- <property name="model">build_info_store</property>
- <property name="headers-visible">0</property>
- <property name="show-expanders">0</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection"/>
- <object class="GtkTreeViewColumn">
- <object class="GtkCellRendererText"/>
- <attribute name="markup">0</attribute>
- <object class="GtkTreeViewColumn">
- <object class="GtkCellRendererText"/>
- <attribute name="markup">1</attribute>
+ <object class="AdwPreferencesPage"> + <object class="AdwPreferencesGroup" id="build_info_group"> + <property name="title" translatable="1">Build Information</property> + <object class="AdwPreferencesGroup" id="runtime_info_group"> + <property name="title" translatable="1">Runtime Information</property> + <object class="AdwPreferencesGroup" id="conf_path_info_group"> + <property name="title" translatable="1">Runtime Directories</property>
+ <object class="AdwPreferencesGroup" id="gtk_settings_group"> + <property name="title" translatable="1">GTK Settings</property> + <object class="AdwPreferencesGroup" id="plugin_search_paths_group"> + <property name="title" translatable="1">Plugin Search Paths</property> + <object class="AdwPreferencesGroup" id="build_args_group"> + <property name="title" translatable="1">Meson Arguments</property> + <property name="visible">0</property>