Split away/idle prefs into a separate widget

Fri, 13 May 2022 03:16:36 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 13 May 2022 03:16:36 -0500
changeset 41368
54d7cfc990eb
parent 41366
789f96848a43
child 41369
70144e5e0a89

Split away/idle prefs into a separate widget

I didn't do any re-designing, but did change `GtkFrame` to `HdyPreferencesGroup`, as that allowed using a `HdyPreferencesPage` like with the credentials page.

Testing Done:
Opened Preferences and didn't see any errors. Also, changed all settings and saw that debug log showed they were changed and prefs were re-saving.

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

pidgin/meson.build file | annotate | diff | comparison | revisions
pidgin/prefs/pidginawaypage.c file | annotate | diff | comparison | revisions
pidgin/prefs/pidginawaypage.h file | annotate | diff | comparison | revisions
pidgin/prefs/pidginprefs.c file | annotate | diff | comparison | revisions
pidgin/resources/Prefs/away.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
po/POTFILES.in file | annotate | diff | comparison | revisions
--- a/pidgin/meson.build	Fri May 13 00:39:03 2022 -0500
+++ b/pidgin/meson.build	Fri May 13 03:16:36 2022 -0500
@@ -60,6 +60,7 @@
 	'pidginstylecontext.c',
 	'pidgintalkatu.c',
 	'prefs/pidginprefs.c',
+	'prefs/pidginawaypage.c',
 	'prefs/pidgincredentialproviderrow.c',
 	'prefs/pidgincredentialspage.c',
 ]
@@ -128,6 +129,7 @@
 
 libpidgin_prefs_headers = [
 	'prefs/pidginprefs.h',
+	'prefs/pidginawaypage.h',
 	'prefs/pidgincredentialproviderrow.h',
 	'prefs/pidgincredentialspage.h',
 ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/prefs/pidginawaypage.c	Fri May 13 03:16:36 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 <purple.h>
+
+#include <handy.h>
+
+#include "pidginawaypage.h"
+#include "gtksavedstatuses.h"
+#include "gtkutils.h"
+#include "pidginprefsinternal.h"
+
+struct _PidginAwayPage {
+	HdyPreferencesPage parent;
+
+	PidginPrefCombo idle_reporting;
+	GtkWidget *mins_before_away;
+	GtkWidget *idle_hbox;
+	GtkWidget *away_when_idle;
+	PidginPrefCombo auto_reply;
+	GtkWidget *startup_current_status;
+	GtkWidget *startup_hbox;
+	GtkWidget *startup_label;
+};
+
+G_DEFINE_TYPE(PidginAwayPage, pidgin_away_page, HDY_TYPE_PREFERENCES_PAGE)
+
+/******************************************************************************
+ * Helpers
+ *****************************************************************************/
+static void
+set_idle_away(PurpleSavedStatus *status)
+{
+	purple_prefs_set_int("/purple/savedstatus/idleaway",
+	                     purple_savedstatus_get_creation_time(status));
+}
+
+static void
+set_startupstatus(PurpleSavedStatus *status)
+{
+	purple_prefs_set_int("/purple/savedstatus/startup",
+	                     purple_savedstatus_get_creation_time(status));
+}
+
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+static void
+pidgin_away_page_class_init(PidginAwayPageClass *klass)
+{
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+
+	gtk_widget_class_set_template_from_resource(
+	    widget_class,
+	    "/im/pidgin/Pidgin3/Prefs/away.ui"
+	);
+
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, idle_reporting.combo);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, mins_before_away);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, away_when_idle);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, idle_hbox);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, auto_reply.combo);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, startup_current_status);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, startup_hbox);
+	gtk_widget_class_bind_template_child(
+			widget_class, PidginAwayPage, startup_label);
+}
+
+static void
+pidgin_away_page_init(PidginAwayPage *page)
+{
+	GtkWidget *menu;
+
+	gtk_widget_init_template(GTK_WIDGET(page));
+
+	page->idle_reporting.type = PURPLE_PREF_STRING;
+	page->idle_reporting.key = "/purple/away/idle_reporting";
+	pidgin_prefs_bind_dropdown(&page->idle_reporting);
+
+	pidgin_prefs_bind_spin_button("/purple/away/mins_before_away",
+			page->mins_before_away);
+
+	pidgin_prefs_bind_checkbox("/purple/away/away_when_idle",
+			page->away_when_idle);
+
+	/* TODO: Show something useful if we don't have any saved statuses. */
+	menu = pidgin_status_menu(purple_savedstatus_get_idleaway(),
+	                          G_CALLBACK(set_idle_away));
+	gtk_widget_show_all(menu);
+	gtk_box_pack_start(GTK_BOX(page->idle_hbox), menu, FALSE, FALSE, 0);
+
+	g_object_bind_property(page->away_when_idle, "active",
+			menu, "sensitive",
+			G_BINDING_SYNC_CREATE);
+
+	/* Away stuff */
+	page->auto_reply.type = PURPLE_PREF_STRING;
+	page->auto_reply.key = "/purple/away/auto_reply";
+	pidgin_prefs_bind_dropdown(&page->auto_reply);
+
+	/* Signon status stuff */
+	pidgin_prefs_bind_checkbox("/purple/savedstatus/startup_current_status",
+			page->startup_current_status);
+
+	/* TODO: Show something useful if we don't have any saved statuses. */
+	menu = pidgin_status_menu(purple_savedstatus_get_startup(),
+	                          G_CALLBACK(set_startupstatus));
+	gtk_widget_show_all(menu);
+	gtk_box_pack_start(GTK_BOX(page->startup_hbox), menu, FALSE, FALSE, 0);
+	gtk_label_set_mnemonic_widget(GTK_LABEL(page->startup_label), menu);
+	pidgin_set_accessible_label(menu, GTK_LABEL(page->startup_label));
+	g_object_bind_property(page->startup_current_status, "active",
+			page->startup_hbox, "sensitive",
+			G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
+}
+
+/******************************************************************************
+ * API
+ *****************************************************************************/
+GtkWidget *
+pidgin_away_page_new(void) {
+	return GTK_WIDGET(g_object_new(PIDGIN_TYPE_AWAY_PAGE, NULL));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/prefs/pidginawaypage.h	Fri May 13 03:16:36 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_AWAY_PAGE_H
+#define PIDGIN_AWAY_PAGE_H
+
+#include <glib.h>
+
+#include <gtk/gtk.h>
+#include <handy.h>
+
+G_BEGIN_DECLS
+
+/**
+ * PidginAwayPage:
+ *
+ * #PidginAwayPage is a widget for the preferences window to let users
+ * choose and configure their away and idle settings.
+ *
+ * Since: 3.0.0
+ */
+#define PIDGIN_TYPE_AWAY_PAGE (pidgin_away_page_get_type())
+G_DECLARE_FINAL_TYPE(PidginAwayPage, pidgin_away_page,
+                     PIDGIN, AWAY_PAGE, HdyPreferencesPage)
+
+/**
+ * pidgin_away_page_new:
+ *
+ * Creates a new #PidginAwayPage instance.
+ *
+ * Returns: (transfer full): The new #PidginAwayPage instance.
+ *
+ * Since: 3.0.0
+ */
+GtkWidget *pidgin_away_page_new(void);
+
+G_END_DECLS
+
+#endif /* PIDGIN_AWAY_PAGE_H */
--- a/pidgin/prefs/pidginprefs.c	Fri May 13 00:39:03 2022 -0500
+++ b/pidgin/prefs/pidginprefs.c	Fri May 13 03:16:36 2022 -0500
@@ -37,7 +37,6 @@
 #include "gtkblist.h"
 #include "gtkconv.h"
 #include "gtkdialogs.h"
-#include "gtksavedstatuses.h"
 #include "gtkutils.h"
 #include "pidgincore.h"
 #include "pidgindebug.h"
@@ -106,18 +105,6 @@
 		GtkWidget *password;
 	} proxy;
 
-	/* Away page */
-	struct {
-		PidginPrefCombo idle_reporting;
-		GtkWidget *mins_before_away;
-		GtkWidget *idle_hbox;
-		GtkWidget *away_when_idle;
-		PidginPrefCombo auto_reply;
-		GtkWidget *startup_current_status;
-		GtkWidget *startup_hbox;
-		GtkWidget *startup_label;
-	} away;
-
 #ifdef USE_VV
 	/* Voice/Video page */
 	struct {
@@ -1048,63 +1035,6 @@
 	}
 }
 
-static void
-set_idle_away(PurpleSavedStatus *status)
-{
-	purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status));
-}
-
-static void
-set_startupstatus(PurpleSavedStatus *status)
-{
-	purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status));
-}
-
-static void
-bind_away_page(PidginPrefsWindow *win)
-{
-	GtkWidget *menu;
-
-	/* Idle stuff */
-	win->away.idle_reporting.type = PURPLE_PREF_STRING;
-	win->away.idle_reporting.key = "/purple/away/idle_reporting";
-	pidgin_prefs_bind_dropdown(&win->away.idle_reporting);
-
-	pidgin_prefs_bind_spin_button("/purple/away/mins_before_away",
-			win->away.mins_before_away);
-
-	pidgin_prefs_bind_checkbox("/purple/away/away_when_idle",
-			win->away.away_when_idle);
-
-	/* TODO: Show something useful if we don't have any saved statuses. */
-	menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away));
-	gtk_widget_show_all(menu);
-	gtk_box_pack_start(GTK_BOX(win->away.idle_hbox), menu, FALSE, FALSE, 0);
-
-	g_object_bind_property(win->away.away_when_idle, "active",
-			menu, "sensitive",
-			G_BINDING_SYNC_CREATE);
-
-	/* Away stuff */
-	win->away.auto_reply.type = PURPLE_PREF_STRING;
-	win->away.auto_reply.key = "/purple/away/auto_reply";
-	pidgin_prefs_bind_dropdown(&win->away.auto_reply);
-
-	/* Signon status stuff */
-	pidgin_prefs_bind_checkbox("/purple/savedstatus/startup_current_status",
-			win->away.startup_current_status);
-
-	/* TODO: Show something useful if we don't have any saved statuses. */
-	menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus));
-	gtk_widget_show_all(menu);
-	gtk_box_pack_start(GTK_BOX(win->away.startup_hbox), menu, FALSE, FALSE, 0);
-	gtk_label_set_mnemonic_widget(GTK_LABEL(win->away.startup_label), menu);
-	pidgin_set_accessible_label(menu, GTK_LABEL(win->away.startup_label));
-	g_object_bind_property(win->away.startup_current_status, "active",
-			win->away.startup_hbox, "sensitive",
-			G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
-}
-
 #ifdef USE_VV
 static GList *
 get_vv_device_menuitems(PurpleMediaElementType type)
@@ -1623,7 +1553,6 @@
 	bind_conv_page(win);
 	bind_network_page(win);
 	bind_proxy_page(win);
-	bind_away_page(win);
 #ifdef USE_VV
 	vv = vv_page(win);
 	gtk_container_add_with_properties(GTK_CONTAINER(stack), vv, "name",
@@ -1744,28 +1673,6 @@
 			proxy_button_clicked_cb);
 	gtk_widget_class_bind_template_callback(widget_class,
 			proxy_print_option);
-
-	/* Away page */
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			away.idle_reporting.combo);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			away.mins_before_away);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow, away.away_when_idle);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow, away.idle_hbox);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			away.auto_reply.combo);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow,
-			away.startup_current_status);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow, away.startup_hbox);
-	gtk_widget_class_bind_template_child(
-			widget_class, PidginPrefsWindow, away.startup_label);
 }
 
 static void
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Prefs/away.ui	Fri May 13 03:16:36 2022 -0500
@@ -0,0 +1,376 @@
+<?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"/>
+  <!-- interface-license-type gplv2 -->
+  <!-- interface-name Pidgin -->
+  <!-- interface-description Internet Messenger -->
+  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
+  <object class="GtkListStore" id="auto_reply.store">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Never</col>
+        <col id="1">never</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">When away</col>
+        <col id="1">away</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">When both away and idle</col>
+        <col id="1">awayidle</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="idle_reporting.store">
+    <columns>
+      <!-- column-name text -->
+      <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Never</col>
+        <col id="1">none</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">From last sent message</col>
+        <col id="1">purple</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Based on keyboard or mouse use</col>
+        <col id="1">system</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkAdjustment" id="mins_before_adjustment">
+    <property name="lower">1</property>
+    <property name="upper">1440</property>
+    <property name="value">1</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
+  </object>
+  <template class="PidginAwayPage" 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">Idle</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="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label12">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes">_Report idle time:</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">idle_reporting.combo</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="idle_reporting.combo">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="model">idle_reporting.store</property>
+                        <child>
+                          <object class="GtkCellRendererText"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </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">0</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" id="label13">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes">_Minutes before becoming idle:</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">mins_before_away</property>
+                        <property name="xalign">0</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="mins_before_away">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="adjustment">mins_before_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">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="idle_hbox">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="away_when_idle">
+                        <property name="label" translatable="yes">Change to this status when _idle:</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>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</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">Away</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>
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label14">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes">_Auto-reply:</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">auto_reply.combo</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="auto_reply.combo">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="model">auto_reply.store</property>
+                        <child>
+                          <object class="GtkCellRendererText"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </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">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>
+    <child>
+      <object class="HdyPreferencesGroup">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="title" translatable="yes">Status at Startup</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="startup_current_status">
+                    <property name="label" translatable="yes">Use status from last _exit at startup</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="GtkBox" id="startup_hbox">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="startup_label">
+                        <property name="visible">True</property>
+                        <property name="can-focus">False</property>
+                        <property name="label" translatable="yes">Status to a_pply at startup:</property>
+                        <property name="use-underline">True</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
+  </template>
+  <object class="GtkSizeGroup" id="sg">
+    <widgets>
+      <widget name="label12"/>
+      <widget name="label13"/>
+      <widget name="away_when_idle"/>
+      <widget name="label14"/>
+      <widget name="startup_current_status"/>
+      <widget name="startup_label"/>
+    </widgets>
+  </object>
+</interface>
--- a/pidgin/resources/Prefs/prefs.ui	Fri May 13 00:39:03 2022 -0500
+++ b/pidgin/resources/Prefs/prefs.ui	Fri May 13 03:16:36 2022 -0500
@@ -27,57 +27,6 @@
   <!-- interface-name Pidgin -->
   <!-- interface-description Internet Messenger -->
   <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
-  <object class="GtkListStore" id="away.auto_reply.store">
-    <columns>
-      <!-- column-name text -->
-      <column type="gchararray"/>
-      <!-- column-name value -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Never</col>
-        <col id="1">never</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">When away</col>
-        <col id="1">away</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">When both away and idle</col>
-        <col id="1">awayidle</col>
-      </row>
-    </data>
-  </object>
-  <object class="GtkListStore" id="away.idle_reporting.store">
-    <columns>
-      <!-- column-name text -->
-      <column type="gchararray"/>
-      <!-- column-name value -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Never</col>
-        <col id="1">none</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">From last sent message</col>
-        <col id="1">purple</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Based on keyboard or mouse use</col>
-        <col id="1">system</col>
-      </row>
-    </data>
-  </object>
-  <object class="GtkAdjustment" id="away.mins_before_away.adjustment">
-    <property name="lower">1</property>
-    <property name="upper">1440</property>
-    <property name="value">1</property>
-    <property name="step-increment">1</property>
-    <property name="page-increment">10</property>
-  </object>
   <object class="TalkatuTagTable" id="conversations.format_tag_table"/>
   <object class="TalkatuWholeBuffer" id="conversations.format_buffer">
     <property name="tag-table">conversations.format_tag_table</property>
@@ -1264,329 +1213,9 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="away.page">
+                  <object class="PidginAwayPage">
                     <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="GtkBox">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkLabel" id="label12">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="label" translatable="yes">_Report idle time:</property>
-                                        <property name="use-underline">True</property>
-                                        <property name="mnemonic-widget">away.idle_reporting.combo</property>
-                                        <property name="xalign">0</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkComboBox" id="away.idle_reporting.combo">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="model">away.idle_reporting.store</property>
-                                        <child>
-                                          <object class="GtkCellRendererText"/>
-                                          <attributes>
-                                            <attribute name="text">0</attribute>
-                                          </attributes>
-                                        </child>
-                                      </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">0</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" id="label13">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="label" translatable="yes">_Minutes before becoming idle:</property>
-                                        <property name="use-underline">True</property>
-                                        <property name="mnemonic-widget">away.mins_before_away</property>
-                                        <property name="xalign">0</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="away.mins_before_away">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">True</property>
-                                        <property name="adjustment">away.mins_before_away.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">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkBox" id="away.idle_hbox">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkCheckButton" id="away.away_when_idle">
-                                        <property name="label" translatable="yes">Change to this status when _idle:</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>
-                                      <placeholder/>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">2</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">Idle</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">
-                                <property name="visible">True</property>
-                                <property name="can-focus">False</property>
-                                <property name="orientation">vertical</property>
-                                <child>
-                                  <object class="GtkBox">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkLabel" id="label14">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="label" translatable="yes">_Auto-reply:</property>
-                                        <property name="use-underline">True</property>
-                                        <property name="mnemonic-widget">away.auto_reply.combo</property>
-                                        <property name="xalign">0</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkComboBox" id="away.auto_reply.combo">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="model">away.auto_reply.store</property>
-                                        <child>
-                                          <object class="GtkCellRendererText"/>
-                                          <attributes>
-                                            <attribute name="text">0</attribute>
-                                          </attributes>
-                                        </child>
-                                      </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">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">Away</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>
-                    <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="away.startup_current_status">
-                                    <property name="label" translatable="yes">Use status from last _exit at startup</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="GtkBox" id="away.startup_hbox">
-                                    <property name="visible">True</property>
-                                    <property name="can-focus">False</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkLabel" id="away.startup_label">
-                                        <property name="visible">True</property>
-                                        <property name="can-focus">False</property>
-                                        <property name="label" translatable="yes">Status to a_pply at startup:</property>
-                                        <property name="use-underline">True</property>
-                                        <property name="xalign">0</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <placeholder/>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</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">Status at Startup</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">2</property>
-                      </packing>
-                    </child>
                   </object>
                   <packing>
                     <property name="name">away</property>
@@ -1625,16 +1254,6 @@
       </object>
     </child>
   </template>
-  <object class="GtkSizeGroup" id="away.sg">
-    <widgets>
-      <widget name="label12"/>
-      <widget name="label13"/>
-      <widget name="away.away_when_idle"/>
-      <widget name="label14"/>
-      <widget name="away.startup_current_status"/>
-      <widget name="away.startup_label"/>
-    </widgets>
-  </object>
   <object class="GtkSizeGroup" id="network.sg">
     <widgets>
       <widget name="label8"/>
--- a/pidgin/resources/pidgin.gresource.xml	Fri May 13 00:39:03 2022 -0500
+++ b/pidgin/resources/pidgin.gresource.xml	Fri May 13 03:16:36 2022 -0500
@@ -23,6 +23,7 @@
     <file compressed="true">Log/log-viewer.ui</file>
     <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/credentials.ui</file>
     <file compressed="true">Prefs/credentialprovider.ui</file>
     <file compressed="true">Prefs/ip.css</file>
--- a/po/POTFILES.in	Fri May 13 00:39:03 2022 -0500
+++ b/po/POTFILES.in	Fri May 13 03:16:36 2022 -0500
@@ -388,6 +388,7 @@
 pidgin/plugins/unity.c
 pidgin/plugins/xmppconsole/console.ui
 pidgin/plugins/xmppconsole/xmppconsole.c
+pidgin/prefs/pidginawaypage.c
 pidgin/prefs/pidgincredentialproviderrow.c
 pidgin/prefs/pidgincredentialspage.c
 pidgin/prefs/pidginprefs.c
@@ -408,6 +409,7 @@
 pidgin/resources/Log/log-viewer.ui
 pidgin/resources/Plugins/dialog.ui
 pidgin/resources/Plugins/menu.ui
+pidgin/resources/Prefs/away.ui
 pidgin/resources/Prefs/credentialprovider.ui
 pidgin/resources/Prefs/credentials.ui
 pidgin/resources/Prefs/prefs.ui

mercurial