# HG changeset patch
# Node ID 0fc3a0be2c59
# Parent  0291c83873c8
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -60,6 +60,7 @@ libpidgin_SOURCES = [
 	'pidginstylecontext.c',
 	'pidgintalkatu.c',
 	'prefs/pidginprefs.c',
+	'prefs/pidginawaypage.c',
 	'prefs/pidgincredentialproviderrow.c',
 	'prefs/pidgincredentialspage.c',
 ]
@@ -128,6 +129,7 @@ libpidgin_headers = [
 
 libpidgin_prefs_headers = [
 	'prefs/pidginprefs.h',
+	'prefs/pidginawaypage.h',
 	'prefs/pidgincredentialproviderrow.h',
 	'prefs/pidgincredentialspage.h',
 ]
diff --git a/pidgin/prefs/pidginawaypage.h b/pidgin/prefs/pidginawaypage.h
new file mode 100644
--- /dev/null
+++ b/pidgin/prefs/pidginawaypage.h
@@ -0,0 +1,70 @@
+/*
+ * 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
+
+/**
+ * PIDGIN_TYPE_AWAY_PAGE:
+ *
+ * The standard _get_type macro for #PidginAwayPage.
+ *
+ * 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)
+
+/**
+ * PidginAwayPage:
+ *
+ * #PidginAwayPage is a widget for the preferences window to let users
+ * choose and configure their away and idle settings.
+ *
+ * Since: 3.0.0
+ */
+
+/**
+ * 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 */
diff --git a/pidgin/prefs/pidginawaypage.c b/pidgin/prefs/pidginawaypage.c
new file mode 100644
--- /dev/null
+++ b/pidgin/prefs/pidginawaypage.c
@@ -0,0 +1,146 @@
+/*
+ * 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));
+}
+
+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));
+}
diff --git a/pidgin/prefs/pidginprefs.c b/pidgin/prefs/pidginprefs.c
--- a/pidgin/prefs/pidginprefs.c
+++ b/pidgin/prefs/pidginprefs.c
@@ -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 @@ struct _PidginPrefsWindow {
 		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 @@ bind_proxy_page(PidginPrefsWindow *win)
 	}
 }
 
-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 @@ prefs_stack_init(PidginPrefsWindow *win)
 	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 @@ pidgin_prefs_window_class_init(PidginPre
 			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
diff --git a/pidgin/resources/Prefs/away.ui b/pidgin/resources/Prefs/away.ui
new file mode 100644
--- /dev/null
+++ b/pidgin/resources/Prefs/away.ui
@@ -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>
diff --git a/pidgin/resources/Prefs/prefs.ui b/pidgin/resources/Prefs/prefs.ui
--- a/pidgin/resources/Prefs/prefs.ui
+++ b/pidgin/resources/Prefs/prefs.ui
@@ -27,57 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fi
   <!-- 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 @@ Foundation, Inc., 51 Franklin Street, Fi
                   </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 @@ Foundation, Inc., 51 Franklin Street, Fi
       </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"/>
diff --git a/pidgin/resources/pidgin.gresource.xml b/pidgin/resources/pidgin.gresource.xml
--- a/pidgin/resources/pidgin.gresource.xml
+++ b/pidgin/resources/pidgin.gresource.xml
@@ -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>
