--- a/pidgin/glade/pidgin3.xml.in Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/glade/pidgin3.xml.in Mon Aug 08 22:14:37 2022 -0500
@@ -17,6 +17,7 @@
<glade-widget-class name="PidginPresenceIcon" generic-name="presence_icon" title="PresenceIcon"/>
<glade-widget-class name="PidginProtocolChooser" generic-name="protocol_chooser" title="ProtocolChooser"/>
<glade-widget-class name="PidginProtocolStore" generic-name="protocol_store" title="ProtocolStore"/>
+ <glade-widget-class name="PidginProxyOptions" generic-name="proxy_options" title="ProxyOptions"/> <glade-widget-class name="PidginScrollBook" generic-name="scroll_book" title="ScrollBook"/>
<glade-widget-class name="PidginStatusBox" generic-name="status_box" title="StatusBox"/>
<glade-widget-class name="PidginStatusPrimitiveChooser" generic-name="status_primitive_chooser" title="StatusPrimitiveChooser"/>
@@ -39,6 +40,7 @@
<glade-widget-class-ref name="PidginPresenceIcon"/>
<glade-widget-class-ref name="PidginProtocolChooser"/>
<glade-widget-class-ref name="PidginProtocolStore"/>
+ <glade-widget-class-ref name="PidginProxyOptions"/> <glade-widget-class-ref name="PidginScrollBook"/>
<glade-widget-class-ref name="PidginStatusBox"/>
<glade-widget-class-ref name="PidginStatusPrimitiveChooser"/>
--- a/pidgin/meson.build Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/meson.build Mon Aug 08 22:14:37 2022 -0500
@@ -19,6 +19,7 @@
'pidginaccountchooser.c',
+ 'pidginaccounteditor.c', 'pidginaccountfilterconnected.c',
'pidginaccountfilterprotocol.c',
'pidginaccountmanager.c',
@@ -93,6 +94,7 @@
'pidginaccountchooser.h',
+ 'pidginaccounteditor.h', 'pidginaccountfilterconnected.h',
'pidginaccountfilterprotocol.h',
'pidginaccountmanager.h',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginaccounteditor.c Mon Aug 08 22:14:37 2022 -0500
@@ -0,0 +1,217 @@
+ * 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 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <https://www.gnu.org/licenses/>. +#include <glib/gi18n-lib.h> +#include "pidginaccounteditor.h" +#include "pidginproxyoptions.h" +struct _PidginAccountEditor { + PurpleAccount *account; + GtkWidget *proxy_options; +static GParamSpec *properties[N_PROPERTIES] = {NULL, }; +/****************************************************************************** + *****************************************************************************/ +pidgin_account_editor_set_account(PidginAccountEditor *editor, + PurpleAccount *account) + if(g_set_object(&editor->account, account)) { + PurpleProxyInfo *proxy_info = NULL; + if(PURPLE_IS_ACCOUNT(account)) { + proxy_info = purple_account_get_proxy_info(account); + pidgin_proxy_options_set_info(PIDGIN_PROXY_OPTIONS(editor->proxy_options), + g_object_notify_by_pspec(G_OBJECT(editor), properties[PROP_ACCOUNT]); +pidgin_account_editor_save_account(PidginAccountEditor *editor) { + PurpleAccountManager *manager = NULL; + PurpleProxyInfo *info = NULL; + gboolean new_account = FALSE; + manager = purple_account_manager_get_default(); + if(!PURPLE_IS_ACCOUNT(editor->account)) { + editor->account = purple_account_new("undefined", "undefined"); + info = pidgin_proxy_options_get_info(PIDGIN_PROXY_OPTIONS(editor->proxy_options)); + purple_account_set_proxy_info(editor->account, info); + /* If this is a new account, add it to the account manager and bring it + const PurpleSavedStatus *saved_status; + purple_account_manager_add(manager, editor->account); + saved_status = purple_savedstatus_get_current(); + if (saved_status != NULL) { + purple_savedstatus_activate_for_account(saved_status, + purple_account_set_enabled(editor->account, TRUE); +/****************************************************************************** + *****************************************************************************/ +pidgin_account_editor_response_cb(GtkDialog *dialog, gint response_id, + G_GNUC_UNUSED gpointer data) + if(response_id == GTK_RESPONSE_APPLY) { + pidgin_account_editor_save_account(PIDGIN_ACCOUNT_EDITOR(dialog)); + gtk_widget_destroy(GTK_WIDGET(dialog)); +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +G_DEFINE_TYPE(PidginAccountEditor, pidgin_account_editor, GTK_TYPE_DIALOG) +pidgin_account_editor_get_property(GObject *obj, guint param_id, GValue *value, + PidginAccountEditor *editor = PIDGIN_ACCOUNT_EDITOR(obj); + g_value_set_object(value, + pidgin_account_editor_get_account(editor)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +pidgin_account_editor_set_property(GObject *obj, guint param_id, + const GValue *value, GParamSpec *pspec) + PidginAccountEditor *editor = PIDGIN_ACCOUNT_EDITOR(obj); + pidgin_account_editor_set_account(editor, + g_value_get_object(value)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +pidgin_account_editor_dispose(GObject *obj) { + PidginAccountEditor *editor = PIDGIN_ACCOUNT_EDITOR(obj); + g_clear_object(&editor->account); + G_OBJECT_CLASS(pidgin_account_editor_parent_class)->dispose(obj); +pidgin_account_editor_init(PidginAccountEditor *account_editor) { + GtkWidget *widget = GTK_WIDGET(account_editor); + gtk_widget_init_template(widget); +pidgin_account_editor_class_init(PidginAccountEditorClass *klass) { + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + obj_class->get_property = pidgin_account_editor_get_property; + obj_class->set_property = pidgin_account_editor_set_property; + obj_class->dispose = pidgin_account_editor_dispose; + * PidginAccountEditor::account: + * The account that this editor is modifying. + properties[PROP_ACCOUNT] = g_param_spec_object( + "The account to modify", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties(obj_class, N_PROPERTIES, properties); + gtk_widget_class_set_template_from_resource(widget_class, + "/im/pidgin/Pidgin3/Accounts/editor.ui"); + gtk_widget_class_bind_template_child(widget_class, PidginAccountEditor, + gtk_widget_class_bind_template_child(widget_class, PidginAccountEditor, + gtk_widget_class_bind_template_callback(widget_class, + pidgin_account_editor_response_cb); +/****************************************************************************** + *****************************************************************************/ +pidgin_account_editor_new(PurpleAccount *account) { + return g_object_new(PIDGIN_TYPE_ACCOUNT_EDITOR, "account", account, NULL); +pidgin_account_editor_get_account(PidginAccountEditor *editor) { + g_return_val_if_fail(PIDGIN_IS_ACCOUNT_EDITOR(editor), NULL); + return editor->account; --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginaccounteditor.h Mon Aug 08 22:14:37 2022 -0500
@@ -0,0 +1,75 @@
+ * 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 + * 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" +#ifndef PIDGIN_ACCOUNT_EDITOR_H +#define PIDGIN_ACCOUNT_EDITOR_H + * #PidginAccountEditor is a dialog that allows you to edit an account. +#define PIDGIN_TYPE_ACCOUNT_EDITOR pidgin_account_editor_get_type() +G_DECLARE_FINAL_TYPE(PidginAccountEditor, pidgin_account_editor, PIDGIN, + ACCOUNT_EDITOR, GtkDialog) + * pidgin_account_editor_new: + * @account: (nullable): The [class@Purple.Account] to edit. + * Creates a new #PidginAccountEditor for @account. If @account is %NULL, the + * editor will create a new account. + * Returns: (transfer full): The new instance. +GtkWidget *pidgin_account_editor_new(PurpleAccount *account); + * pidgin_account_editor_get_account: + * @editor: The instance. + * Gets the [class@Purple.Account] that @editor is modifying. + * Returns: (transfer none): The [class@Purple.Account] or %NULL. +PurpleAccount *pidgin_account_editor_get_account(PidginAccountEditor *editor); +#endif /* PIDGIN_ACCOUNT_EDITOR_H */ --- a/pidgin/pidginaccountmanager.c Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/pidginaccountmanager.c Mon Aug 08 22:14:37 2022 -0500
@@ -28,6 +28,7 @@
+#include "pidginaccounteditor.h" struct _PidginAccountManager {
@@ -42,7 +43,9 @@
@@ -209,14 +212,27 @@
PidginAccountManager *manager = PIDGIN_ACCOUNT_MANAGER(dialog);
PurpleAccount *account = NULL;
+ GtkWidget *editor = NULL; + editor = pidgin_account_editor_new(NULL); + gtk_widget_show_all(editor); pidgin_account_dialog_show(PIDGIN_ADD_ACCOUNT_DIALOG, NULL);
account = pidgin_account_manager_get_selected_account(manager);
+ editor = pidgin_account_editor_new(account); + gtk_widget_show_all(editor); + g_clear_object(&account); + case RESPONSE_MODIFY_OLD: + account = pidgin_account_manager_get_selected_account(manager); pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account);
g_clear_object(&account);
--- a/pidgin/pidginproxyoptions.h Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/pidginproxyoptions.h Mon Aug 08 22:14:37 2022 -0500
@@ -95,7 +95,7 @@
* pidgin_proxy_options_set_info:
* @options: The instance.
- * @info: The [class@Purple.ProxyInfo] to set.
+ * @info: (nullable): The [class@Purple.ProxyInfo] to set. * The proxy info that will be configured.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Accounts/editor.ui Mon Aug 08 22:14:37 2022 -0500
@@ -0,0 +1,123 @@
+<?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/>. + <requires lib="gtk+" version="3.24"/> + <requires lib="pidgin" version="3.0"/> + <!-- interface-license-type gplv2 --> + <!-- interface-name Pidgin --> + <!-- interface-description Internet Messenger --> + <!-- interface-copyright Pidgin Developers <devel@pidgin.im> --> + <template class="PidginAccountEditor" parent="GtkDialog"> + <property name="can-focus">False</property> + <property name="type-hint">dialog</property> + <signal name="response" handler="pidgin_account_editor_response_cb" swapped="no"/> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can-focus">False</property> + <property name="layout-style">end</property> + <object class="GtkButton" id="button1"> + <property name="label" translatable="yes">_Cancel</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkButton" id="button2"> + <property name="label" translatable="yes">_Save</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <property name="use-underline">True</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + <object class="GtkNotebook" id="notebook"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <object class="PidginProxyOptions" id="proxy_options"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-left">12</property> + <property name="margin-right">12</property> + <property name="margin-start">12</property> + <property name="margin-end">12</property> + <property name="margin-top">12</property> + <property name="margin-bottom">12</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <property name="position">0</property> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">_Proxy</property> + <property name="use-underline">True</property> + <property name="position">0</property> + <property name="tab-fill">False</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + <action-widget response="-6">button1</action-widget> + <action-widget response="-10">button2</action-widget> --- a/pidgin/resources/Accounts/manager.ui Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/resources/Accounts/manager.ui Mon Aug 08 22:14:37 2022 -0500
@@ -16,6 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, see <https://www.gnu.org/licenses/>.
<requires lib="gtk+" version="3.24"/>
@@ -56,6 +57,42 @@
<property name="can-focus">False</property>
<property name="layout-style">end</property>
+ <object class="GtkButton" id="button1"> + <property name="label" translatable="yes">τ</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> + <class name="circular"/> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + <property name="non-homogeneous">True</property> + <object class="GtkButton" id="praetorians"> + <property name="label" translatable="yes">π</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="focus-on-click">False</property> + <property name="receives-default">True</property> + <property name="relief">none</property> + <class name="circular"/> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="non-homogeneous">True</property> <object class="GtkButton" id="button3">
<property name="label" translatable="yes">_Add...</property>
<property name="visible">True</property>
@@ -66,7 +103,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">2</property> @@ -81,7 +118,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property> @@ -96,7 +133,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">4</property> @@ -110,7 +147,7 @@
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">5</property> @@ -197,8 +234,10 @@
- <action-widget response="0">button3</action-widget>
- <action-widget response="1">modify_button</action-widget>
+ <action-widget response="0">button1</action-widget> + <action-widget response="1">praetorians</action-widget> + <action-widget response="3">button3</action-widget> + <action-widget response="4">modify_button</action-widget> <action-widget response="2">remove_button</action-widget>
<action-widget response="-7">button2</action-widget>
--- a/pidgin/resources/pidgin.gresource.xml Mon Aug 08 22:03:04 2022 -0500
+++ b/pidgin/resources/pidgin.gresource.xml Mon Aug 08 22:14:37 2022 -0500
@@ -6,6 +6,7 @@
<file compressed="true">About/about.md</file>
<file compressed="true">About/credits.json</file>
<file compressed="true">Accounts/chooser.ui</file>
+ <file compressed="true">Accounts/editor.ui</file> <file compressed="true">Accounts/entry.css</file>
<file compressed="true">Accounts/manager.ui</file>
<file compressed="true">Avatar/avatar.ui</file>
--- a/po/POTFILES.in Mon Aug 08 22:03:04 2022 -0500
+++ b/po/POTFILES.in Mon Aug 08 22:14:37 2022 -0500
@@ -335,6 +335,7 @@
pidgin/pidginaccountchooser.c
+pidgin/pidginaccounteditor.c pidgin/pidginaccountfilterconnected.c
pidgin/pidginaccountfilterprotocol.c
pidgin/pidginaccountmanager.c
@@ -397,6 +398,7 @@
pidgin/prefs/pidginvvprefs.c
pidgin/resources/About/about.ui
pidgin/resources/Accounts/chooser.ui
+pidgin/resources/Accounts/editor.ui pidgin/resources/Accounts/manager.ui
pidgin/resources/Avatar/avatar.ui
pidgin/resources/Avatar/menu.ui