Split conversation/interface prefs into a separate widget

Fri, 13 May 2022 04:50:00 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 13 May 2022 04:50:00 -0500
changeset 41371
fe57d9ddc7ce
parent 41370
0ae2dfa4a5cf
child 41372
e3d28548e01d

Split conversation/interface prefs into a separate widget

No re-design, just `HdyPreferencesGroup` instead of `GtkFrame`.

Testing Done:
Opened Preferences, changed options and made sure everything was saving according to the debug log.

Reviewed at https://reviews.imfreedom.org/r/1444/

pidgin/meson.build file | annotate | diff | comparison | revisions
pidgin/prefs/pidginconversationprefs.c file | annotate | diff | comparison | revisions
pidgin/prefs/pidginconversationprefs.h file | annotate | diff | comparison | revisions
pidgin/prefs/pidginprefs.c file | annotate | diff | comparison | revisions
pidgin/resources/Prefs/conversation.ui file | annotate | diff | comparison | revisions
pidgin/resources/Prefs/prefs.ui file | annotate | diff | comparison | revisions
pidgin/resources/pidgin.gresource.xml file | annotate | diff | comparison | revisions
--- a/pidgin/meson.build	Fri May 13 04:43:04 2022 -0500
+++ b/pidgin/meson.build	Fri May 13 04:50:00 2022 -0500
@@ -61,6 +61,7 @@
 	'pidgintalkatu.c',
 	'prefs/pidginprefs.c',
 	'prefs/pidginawaypage.c',
+	'prefs/pidginconversationprefs.c',
 	'prefs/pidgincredentialproviderrow.c',
 	'prefs/pidgincredentialspage.c',
 	'prefs/pidginnetworkpage.c',
@@ -132,6 +133,7 @@
 libpidgin_prefs_headers = [
 	'prefs/pidginprefs.h',
 	'prefs/pidginawaypage.h',
+	'prefs/pidginconversationprefs.h',
 	'prefs/pidgincredentialproviderrow.h',
 	'prefs/pidgincredentialspage.h',
 	'prefs/pidginnetworkpage.h',
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/prefs/pidginconversationprefs.c	Fri May 13 04:50:00 2022 -0500
@@ -0,0 +1,149 @@
+/*
+ * Pidgin - Internet Messenger
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * 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 2 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include <glib/gi18n-lib.h>
+
+#include <purple.h>
+
+#include <handy.h>
+#include <talkatu.h>
+
+#include "pidginconversationprefs.h"
+#include "pidgincore.h"
+#include "pidginprefsinternal.h"
+
+struct _PidginConversationPrefs {
+	HdyPreferencesPage parent;
+
+	GtkWidget *show_incoming_formatting;
+	struct {
+		GtkWidget *send_typing;
+	} im;
+	GtkWidget *use_smooth_scrolling;
+	struct {
+		GtkWidget *blink_im;
+	} win32;
+	GtkWidget *minimum_entry_lines;
+	GtkTextBuffer *format_buffer;
+	GtkWidget *format_view;
+};
+
+G_DEFINE_TYPE(PidginConversationPrefs, pidgin_conversation_prefs,
+              HDY_TYPE_PREFERENCES_PAGE)
+
+/******************************************************************************
+ * Helpers
+ *****************************************************************************/
+static void
+formatting_toggle_cb(TalkatuActionGroup *ag, GAction *action, const gchar *name, gpointer data)
+{
+	gboolean activated = talkatu_action_group_get_action_activated(ag, name);
+	if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_BOLD, name) != 0) {
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold",
+		                      activated);
+	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_ITALIC, name) != 0) {
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic",
+		                      activated);
+	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_UNDERLINE, name) != 0) {
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline",
+		                      activated);
+	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_STRIKETHROUGH, name) != 0) {
+		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike",
+		                      activated);
+	}
+}
+
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+static void
+pidgin_conversation_prefs_class_init(PidginConversationPrefsClass *klass)
+{
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+
+	gtk_widget_class_set_template_from_resource(
+		widget_class,
+		"/im/pidgin/Pidgin3/Prefs/conversation.ui"
+	);
+
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			show_incoming_formatting);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			im.send_typing);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			use_smooth_scrolling);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			win32.blink_im);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			minimum_entry_lines);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			format_buffer);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginConversationPrefs,
+			format_view);
+}
+
+static void
+pidgin_conversation_prefs_init(PidginConversationPrefs *prefs)
+{
+	GSimpleActionGroup *ag = NULL;
+
+	gtk_widget_init_template(GTK_WIDGET(prefs));
+
+	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting",
+			prefs->show_incoming_formatting);
+
+	pidgin_prefs_bind_checkbox("/purple/conversations/im/send_typing",
+			prefs->im.send_typing);
+
+	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling",
+			prefs->use_smooth_scrolling);
+
+#ifdef _WIN32
+	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/win32/blink_im",
+			prefs->win32.blink_im);
+#else
+	gtk_widget_hide(prefs->win32.blink_im);
+#endif
+
+	pidgin_prefs_bind_spin_button(
+		PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
+		prefs->minimum_entry_lines);
+
+	ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(prefs->format_buffer));
+	g_signal_connect_after(G_OBJECT(ag), "action-activated",
+	                       G_CALLBACK(formatting_toggle_cb), NULL);
+}
+
+/******************************************************************************
+ * API
+ *****************************************************************************/
+GtkWidget *
+pidgin_conversation_prefs_new(void) {
+	return GTK_WIDGET(g_object_new(PIDGIN_TYPE_CONVERSATION_PREFS, NULL));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/prefs/pidginconversationprefs.h	Fri May 13 04:50:00 2022 -0500
@@ -0,0 +1,62 @@
+/*
+ * Pidgin - Internet Messenger
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * 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 2 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 <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
+# error "only <pidgin.h> may be included directly"
+#endif
+
+#ifndef PIDGIN_CONVERSATION_PREFS_H
+#define PIDGIN_CONVERSATION_PREFS_H
+
+#include <glib.h>
+
+#include <gtk/gtk.h>
+#include <handy.h>
+
+G_BEGIN_DECLS
+
+/**
+ * PidginConversationPrefs:
+ *
+ * #PidginConversationPrefs is a widget for the preferences window to let users
+ * choose and configure their conversation settings.
+ *
+ * Since: 3.0.0
+ */
+#define PIDGIN_TYPE_CONVERSATION_PREFS (pidgin_conversation_prefs_get_type())
+G_DECLARE_FINAL_TYPE(PidginConversationPrefs, pidgin_conversation_prefs,
+                     PIDGIN, CONVERSATION_PREFS, HdyPreferencesPage)
+
+/**
+ * pidgin_conversation_prefs_new:
+ *
+ * Creates a new #PidginConversationPrefs instance.
+ *
+ * Returns: (transfer full): The new #PidginConversationPrefs instance.
+ *
+ * Since: 3.0.0
+ */
+GtkWidget *pidgin_conversation_prefs_new(void);
+
+G_END_DECLS
+
+#endif /* PIDGIN_CONVERSATION_PREFS_H */
--- a/pidgin/prefs/pidginprefs.c	Fri May 13 04:43:04 2022 -0500
+++ b/pidgin/prefs/pidginprefs.c	Fri May 13 04:50:00 2022 -0500
@@ -55,21 +55,6 @@
 	/* Stack */
 	GtkWidget *stack;
 
-	/* Conversations page */
-	struct {
-		GtkWidget *show_incoming_formatting;
-		struct {
-			GtkWidget *send_typing;
-		} im;
-		GtkWidget *use_smooth_scrolling;
-		struct {
-			GtkWidget *blink_im;
-		} win32;
-		GtkWidget *minimum_entry_lines;
-		GtkTextBuffer *format_buffer;
-		GtkWidget *format_view;
-	} conversations;
-
 #ifdef USE_VV
 	/* Voice/Video page */
 	struct {
@@ -685,55 +670,6 @@
 	prefs = NULL;
 }
 
-static void
-formatting_toggle_cb(TalkatuActionGroup *ag, GAction *action, const gchar *name, gpointer data)
-{
-	gboolean activated = talkatu_action_group_get_action_activated(ag, name);
-	if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_BOLD, name) != 0) {
-		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold",
-		                      activated);
-	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_ITALIC, name) != 0) {
-		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic",
-		                      activated);
-	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_UNDERLINE, name) != 0) {
-		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline",
-		                      activated);
-	} else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_STRIKETHROUGH, name) != 0) {
-		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike",
-		                      activated);
-	}
-}
-
-static void
-bind_conv_page(PidginPrefsWindow *win)
-{
-	GSimpleActionGroup *ag = NULL;
-
-	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting",
-			win->conversations.show_incoming_formatting);
-
-	pidgin_prefs_bind_checkbox("/purple/conversations/im/send_typing",
-			win->conversations.im.send_typing);
-
-	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling",
-			win->conversations.use_smooth_scrolling);
-
-#ifdef _WIN32
-	pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/win32/blink_im",
-			win->conversations.win32.blink_im);
-#else
-	gtk_widget_hide(win->conversations.win32.blink_im);
-#endif
-
-	pidgin_prefs_bind_spin_button(
-		PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
-		win->conversations.minimum_entry_lines);
-
-	ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(win->conversations.format_buffer));
-	g_signal_connect_after(G_OBJECT(ag), "action-activated",
-	                       G_CALLBACK(formatting_toggle_cb), NULL);
-}
-
 #ifdef USE_VV
 static GList *
 get_vv_device_menuitems(PurpleMediaElementType type)
@@ -1249,7 +1185,6 @@
 	GtkWidget *vv;
 #endif
 
-	bind_conv_page(win);
 #ifdef USE_VV
 	vv = vv_page(win);
 	gtk_container_add_with_properties(GTK_CONTAINER(stack), vv, "name",
@@ -1273,29 +1208,6 @@
 	gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
 	                                     stack);
 	gtk_widget_class_bind_template_callback(widget_class, delete_prefs);
-
-	/* Conversations page */
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.show_incoming_formatting);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.im.send_typing);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.use_smooth_scrolling);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.win32.blink_im);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.minimum_entry_lines);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.format_buffer);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			conversations.format_view);
 }
 
 static void
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Prefs/conversation.ui	Fri May 13 04:50:00 2022 -0500
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 
+
+Pidgin - Internet Messenger
+Copyright (C) Pidgin Developers <devel@pidgin.im>
+
+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 2
+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 <https://www.gnu.org/licenses/>.
+
+-->
+<interface>
+  <requires lib="gtk+" version="3.22"/>
+  <requires lib="Talkatu" version="0.0"/>
+  <!-- interface-license-type gplv2 -->
+  <!-- interface-name Pidgin -->
+  <!-- interface-description Internet Messenger -->
+  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
+  <object class="TalkatuTagTable" id="format_tag_table"/>
+  <object class="TalkatuWholeBuffer" id="format_buffer">
+    <property name="tag-table">format_tag_table</property>
+    <property name="text" translatable="yes">This is how your outgoing message text will appear when you use protocols that support formatting.</property>
+    <property name="style">whole</property>
+  </object>
+  <object class="GtkAdjustment" id="minimum_entry_lines.adjustment">
+    <property name="lower">1</property>
+    <property name="upper">8</property>
+    <property name="value">2</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">1</property>
+  </object>
+  <object class="GtkSizeGroup" id="iface.sg"/>
+  <template class="PidginConversationPrefs" parent="HdyPreferencesPage">
+    <property name="visible">True</property>
+    <property name="can-focus">False</property>
+    <child>
+      <object class="HdyPreferencesGroup">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="title" translatable="yes">Conversations</property>
+        <child>
+          <object class="GtkAlignment">
+            <property name="visible">True</property>
+            <property name="can-focus">False</property>
+            <property name="left-padding">12</property>
+            <child>
+              <object class="GtkBox">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkCheckButton" id="show_incoming_formatting">
+                    <property name="label" translatable="yes">Show _formatting on incoming messages</property>
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="im.send_typing">
+                    <property name="label" translatable="yes">_Notify buddies that you are typing to them</property>
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="use_smooth_scrolling">
+                    <property name="label" translatable="yes">Use smooth-scrolling</property>
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="draw-indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="win32.blink_im">
+                    <property name="label" translatable="yes">F_lash window when IMs are received</property>
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="receives-default">False</property>
+                    <property name="use-underline">True</property>
+                    <property name="draw-indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes">Minimum input area height in lines:</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSpinButton" id="minimum_entry_lines">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="input-purpose">digits</property>
+                        <property name="adjustment">minimum_entry_lines.adjustment</property>
+                        <property name="numeric">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">4</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="HdyPreferencesGroup">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="title" translatable="yes">Default Formatting</property>
+        <child>
+          <object class="GtkAlignment">
+            <property name="visible">True</property>
+            <property name="can-focus">False</property>
+            <property name="left-padding">12</property>
+            <child>
+              <object class="GtkBox" id="sample_box">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="TalkatuEditor">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="orientation">vertical</property>
+                    <child internal-child="send_button">
+                      <object class="GtkButton">
+                        <property name="can-focus">False</property>
+                        <property name="receives-default">False</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child internal-child="toolbar">
+                      <object class="TalkatuToolbar">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child internal-child="input">
+                      <object class="TalkatuInput" id="format_view">
+                        <property name="width-request">450</property>
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="wrap-mode">word</property>
+                        <property name="buffer">format_buffer</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </template>
+</interface>
--- a/pidgin/resources/Prefs/prefs.ui	Fri May 13 04:43:04 2022 -0500
+++ b/pidgin/resources/Prefs/prefs.ui	Fri May 13 04:50:00 2022 -0500
@@ -21,26 +21,11 @@
 -->
 <interface>
   <requires lib="gtk+" version="3.22"/>
-  <requires lib="Talkatu" version="0.0"/>
   <requires lib="pidgin" version="3.0"/>
   <!-- interface-license-type gplv2 -->
   <!-- interface-name Pidgin -->
   <!-- interface-description Internet Messenger -->
   <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
-  <object class="TalkatuTagTable" id="conversations.format_tag_table"/>
-  <object class="TalkatuWholeBuffer" id="conversations.format_buffer">
-    <property name="tag-table">conversations.format_tag_table</property>
-    <property name="text" translatable="yes">This is how your outgoing message text will appear when you use protocols that support formatting.</property>
-    <property name="style">whole</property>
-  </object>
-  <object class="GtkAdjustment" id="conversations.minimum_entry_lines.adjustment">
-    <property name="lower">1</property>
-    <property name="upper">8</property>
-    <property name="value">2</property>
-    <property name="step-increment">1</property>
-    <property name="page-increment">1</property>
-  </object>
-  <object class="GtkSizeGroup" id="iface.sg"/>
   <template class="PidginPrefsWindow" parent="GtkDialog">
     <property name="can-focus">False</property>
     <property name="title" translatable="yes">Preferences</property>
@@ -98,239 +83,14 @@
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <child>
-                  <object class="GtkBox" id="conversations.page">
+                  <object class="PidginConversationPrefs">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
-                    <property name="border-width">12</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">18</property>
-                    <child>
-                      <object class="GtkFrame">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="label-xalign">0</property>
-                        <property name="shadow-type">none</property>
-                        <child>
-                          <object class="GtkAlignment">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <property name="left-padding">12</property>
-                            <child>
-                              <object class="GtkBox">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="orientation">vertical</property>
-                                <property name="spacing">6</property>
-                                <child>
-                                  <object class="GtkCheckButton" id="conversations.show_incoming_formatting">
-                                    <property name="label" translatable="yes">Show _formatting on incoming messages</property>
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">True</property>
-                                    <property name="receives-default">False</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="draw-indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="conversations.im.send_typing">
-                                    <property name="label" translatable="yes">_Notify buddies that you are typing to them</property>
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">True</property>
-                                    <property name="receives-default">False</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="draw-indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="conversations.use_smooth_scrolling">
-                                    <property name="label" translatable="yes">Use smooth-scrolling</property>
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">True</property>
-                                    <property name="receives-default">False</property>
-                                    <property name="draw-indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="conversations.win32.blink_im">
-                                    <property name="label" translatable="yes">F_lash window when IMs are received</property>
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">True</property>
-                                    <property name="receives-default">False</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="draw-indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">3</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkBox">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkLabel">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="label" translatable="yes">Minimum input area height in lines:</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkSpinButton" id="conversations.minimum_entry_lines">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">True</property>
-                                        <property name="input-purpose">digits</property>
-                                        <property name="adjustment">conversations.minimum_entry_lines.adjustment</property>
-                                        <property name="numeric">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">1</property>
-                                      </packing>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">4</property>
-                                  </packing>
-                                </child>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="label">
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <property name="label" translatable="yes">Conversations</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFrame">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
-                        <property name="label-xalign">0</property>
-                        <property name="shadow-type">none</property>
-                        <child>
-                          <object class="GtkAlignment">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <property name="left-padding">12</property>
-                            <child>
-                              <object class="GtkBox" id="conversations.sample_box">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="orientation">vertical</property>
-                                <child>
-                                  <object class="TalkatuEditor">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="orientation">vertical</property>
-                                    <child internal-child="send_button">
-                                      <object class="GtkButton">
-                                        <property name="can-focus">False</property>
-                                        <property name="receives-default">False</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child internal-child="toolbar">
-                                      <object class="TalkatuToolbar">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child internal-child="input">
-                                      <object class="TalkatuInput" id="conversations.format_view">
-                                        <property name="width-request">450</property>
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">True</property>
-                                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="wrap-mode">word</property>
-                                        <property name="buffer">conversations.format_buffer</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="label">
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="can-focus">False</property>
-                            <property name="label" translatable="yes">Default Formatting</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
                   </object>
                   <packing>
                     <property name="name">conversations</property>
                     <property name="title" translatable="yes">Conversations</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
--- a/pidgin/resources/pidgin.gresource.xml	Fri May 13 04:43:04 2022 -0500
+++ b/pidgin/resources/pidgin.gresource.xml	Fri May 13 04:50:00 2022 -0500
@@ -24,6 +24,7 @@
     <file compressed="true">Plugins/dialog.ui</file>
     <file compressed="true">Plugins/menu.ui</file>
     <file compressed="true">Prefs/away.ui</file>
+    <file compressed="true">Prefs/conversation.ui</file>
     <file compressed="true">Prefs/credentials.ui</file>
     <file compressed="true">Prefs/credentialprovider.ui</file>
     <file compressed="true">Prefs/ip.css</file>

mercurial