--- a/pidgin/gtkaccount.c Mon May 02 21:57:35 2022 -0500
+++ b/pidgin/gtkaccount.c Mon May 02 23:43:16 2022 -0500
@@ -36,6 +36,7 @@
#include "pidgindialog.h"
#include "pidginprotocolchooser.h"
+#include "pidginproxyoptions.h" @@ -92,8 +93,6 @@
PurpleProtocol *protocol;
- PurpleProxyType new_proxy_type;
GList *user_split_entries;
GList *protocol_opt_entries;
@@ -126,14 +125,7 @@
GtkWidget *protocol_frame;
- GtkWidget *proxy_frame;
- GtkWidget *proxy_dropdown;
- GtkWidget *proxy_host_entry;
- GtkWidget *proxy_port_entry;
- GtkWidget *proxy_user_entry;
- GtkWidget *proxy_pass_entry;
+ GtkWidget *proxy_options; /* Voice & Video Options*/
@@ -159,7 +151,6 @@
static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent);
static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent);
static void add_account_options(AccountPrefsDialog *dialog);
-static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent);
static void add_voice_options(AccountPrefsDialog *dialog);
@@ -917,210 +908,6 @@
g_list_free_full(opts, (GDestroyNotify)purple_account_option_destroy);
-make_proxy_dropdown(void)
- GtkCellRenderer *renderer;
- model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
- dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 0, purple_running_gnome() ? _("Use GNOME Proxy Settings")
- :_("Use Global Proxy Settings"),
- 1, PURPLE_PROXY_TYPE_USE_GLOBAL,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 1, PURPLE_PROXY_TYPE_NONE,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 1, PURPLE_PROXY_TYPE_SOCKS4,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 1, PURPLE_PROXY_TYPE_SOCKS5,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 0, _("Tor/Privacy (SOCKS5)"),
- 1, PURPLE_PROXY_TYPE_TOR,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 1, PURPLE_PROXY_TYPE_HTTP,
- gtk_list_store_append(model, &iter);
- gtk_list_store_set(model, &iter,
- 0, _("Use Environmental Settings"),
- 1, PURPLE_PROXY_TYPE_USE_ENVVAR,
- renderer = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE);
- gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer,
-proxy_type_changed_cb(GtkWidget *menu, AccountPrefsDialog *dialog)
- if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(menu), &iter)) {
- gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(menu)), &iter,
- dialog->new_proxy_type = int_value;
- if (dialog->new_proxy_type == PURPLE_PROXY_TYPE_USE_GLOBAL ||
- dialog->new_proxy_type == PURPLE_PROXY_TYPE_NONE ||
- dialog->new_proxy_type == PURPLE_PROXY_TYPE_USE_ENVVAR) {
- gtk_widget_hide(dialog->proxy_vbox);
- gtk_widget_show_all(dialog->proxy_vbox);
-port_popup_cb(GtkWidget *w, GtkMenu *menu, gpointer data)
- /* This is an easter egg.
- It means one of two things, both intended as humourus:
- A) your network is really slow and you have nothing better to do than
- B)You are looking really closely at something that shouldn't matter. */
- item1 = gtk_menu_item_new_with_label(_("If you look real closely"));
- /* This is an easter egg. See the comment on the previous line in the source. */
- item2 = gtk_menu_item_new_with_label(_("you can see the butterflies mating"));
- gtk_widget_show(item1);
- gtk_widget_show(item2);
- /* Prepend these in reverse order so they appear correctly. */
- gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item2);
- gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item1);
-add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent)
- PurpleProxyInfo *proxy_info;
- GtkTreeModel *proxy_model;
- if (dialog->proxy_frame != NULL)
- gtk_widget_destroy(dialog->proxy_frame);
- dialog->proxy_frame = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
- gtk_container_add(GTK_CONTAINER(parent), vbox);
- /* Proxy Type drop-down. */
- dialog->proxy_dropdown = make_proxy_dropdown();
- add_pref_box(dialog, vbox, _("Proxy _type:"), dialog->proxy_dropdown);
- /* Setup the second vbox, which may be hidden at times. */
- dialog->proxy_vbox = vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
- gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 12);
- gtk_widget_show(vbox2);
- dialog->proxy_host_entry = gtk_entry_new();
- add_pref_box(dialog, vbox2, _("_Host:"), dialog->proxy_host_entry);
- dialog->proxy_port_entry = gtk_entry_new();
- add_pref_box(dialog, vbox2, _("_Port:"), dialog->proxy_port_entry);
- g_signal_connect(G_OBJECT(dialog->proxy_port_entry), "populate-popup",
- G_CALLBACK(port_popup_cb), NULL);
- dialog->proxy_user_entry = gtk_entry_new();
- add_pref_box(dialog, vbox2, _("_Username:"), dialog->proxy_user_entry);
- dialog->proxy_pass_entry = gtk_entry_new();
- gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE);
- add_pref_box(dialog, vbox2, _("Pa_ssword:"), dialog->proxy_pass_entry);
- if (dialog->account != NULL &&
- (proxy_info = purple_account_get_proxy_info(dialog->account)) != NULL) {
- dialog->new_proxy_type = purple_proxy_info_get_proxy_type(proxy_info);
- if ((value = purple_proxy_info_get_hostname(proxy_info)) != NULL)
- gtk_entry_set_text(GTK_ENTRY(dialog->proxy_host_entry), value);
- if ((int_val = purple_proxy_info_get_port(proxy_info)) != 0) {
- g_snprintf(buf, sizeof(buf), "%d", int_val);
- gtk_entry_set_text(GTK_ENTRY(dialog->proxy_port_entry), buf);
- if ((value = purple_proxy_info_get_username(proxy_info)) != NULL)
- gtk_entry_set_text(GTK_ENTRY(dialog->proxy_user_entry), value);
- if ((value = purple_proxy_info_get_password(proxy_info)) != NULL)
- gtk_entry_set_text(GTK_ENTRY(dialog->proxy_pass_entry), value);
- dialog->new_proxy_type = PURPLE_PROXY_TYPE_USE_GLOBAL;
- proxy_model = gtk_combo_box_get_model(
- GTK_COMBO_BOX(dialog->proxy_dropdown));
- if (gtk_tree_model_get_iter_first(proxy_model, &iter)) {
- gtk_tree_model_get(proxy_model, &iter, 1, &int_val, -1);
- if (int_val == dialog->new_proxy_type) {
- gtk_combo_box_set_active_iter(
- GTK_COMBO_BOX(dialog->proxy_dropdown), &iter);
- } while(gtk_tree_model_iter_next(proxy_model, &iter));
- proxy_type_changed_cb(dialog->proxy_dropdown, dialog);
- g_signal_connect(G_OBJECT(dialog->proxy_dropdown), "changed",
- G_CALLBACK(proxy_type_changed_cb), dialog);
add_voice_options(AccountPrefsDialog *dialog)
@@ -1372,63 +1159,8 @@
- /* Set the proxy stuff. */
- proxy_info = purple_account_get_proxy_info(account);
- /* Create the proxy info if it doesn't exist. */
- if (proxy_info == NULL) {
- proxy_info = purple_proxy_info_new();
- purple_account_set_proxy_info(account, proxy_info);
- /* Add a reference to make sure the proxy info stays around. */
- g_object_ref(proxy_info);
- /* Set the proxy info type. */
- purple_proxy_info_set_proxy_type(proxy_info, dialog->new_proxy_type);
- value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry));
- purple_proxy_info_set_hostname(proxy_info, value);
- purple_proxy_info_set_hostname(proxy_info, NULL);
- value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry));
- purple_proxy_info_set_port(proxy_info, atoi(value));
- purple_proxy_info_set_port(proxy_info, 0);
- value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry));
- purple_proxy_info_set_username(proxy_info, value);
- purple_proxy_info_set_username(proxy_info, NULL);
- value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry));
- purple_proxy_info_set_password(proxy_info, value);
- purple_proxy_info_set_password(proxy_info, NULL);
- /* If there are no values set then proxy_info NULL */
- if ((purple_proxy_info_get_proxy_type(proxy_info) == PURPLE_PROXY_TYPE_USE_GLOBAL) &&
- (purple_proxy_info_get_hostname(proxy_info) == NULL) &&
- (purple_proxy_info_get_port(proxy_info) == 0) &&
- (purple_proxy_info_get_username(proxy_info) == NULL) &&
- (purple_proxy_info_get_password(proxy_info) == NULL))
- purple_account_set_proxy_info(account, NULL);
- g_clear_object(&proxy_info);
+ proxy_info = pidgin_proxy_options_get_info(PIDGIN_PROXY_OPTIONS(dialog->proxy_options)); + purple_account_set_proxy_info(account, proxy_info); /* Voice and Video settings */
if (dialog->voice_frame) {
@@ -1459,8 +1191,6 @@
/* We no longer need the data from the dialog window */
account_win_destroy_cb(NULL, NULL, dialog);
- g_clear_object(&proxy_info);
@@ -1488,7 +1218,6 @@
@@ -1564,13 +1293,15 @@
/* Setup the page with 'Advanced' (protocol options). */
add_account_options(dialog);
- /* Setup the page with 'Proxy'. */
- dbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
- gtk_container_set_border_width(GTK_CONTAINER(dbox), 12);
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dbox,
- gtk_label_new_with_mnemonic(_("P_roxy")));
- add_proxy_options(dialog, dbox);
+ /* Setup the proxy options page. */ + dialog->proxy_options = pidgin_proxy_options_new(); + if(PURPLE_IS_ACCOUNT(dialog->account)) { + pidgin_proxy_options_set_info(PIDGIN_PROXY_OPTIONS(dialog->proxy_options), + purple_account_get_proxy_info(dialog->account)); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dialog->proxy_options, + gtk_label_new_with_mnemonic(_("Proxy"))); + gtk_widget_show(dialog->proxy_options); add_voice_options(dialog);
--- a/pidgin/meson.build Mon May 02 21:57:35 2022 -0500
+++ b/pidgin/meson.build Mon May 02 23:43:16 2022 -0500
@@ -50,6 +50,7 @@
'pidginprotocolchooser.c',
+ 'pidginproxyoptions.c', @@ -113,6 +114,7 @@
'pidginprotocolchooser.h',
+ 'pidginproxyoptions.h', --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginproxyoptions.c Mon May 02 23:43:16 2022 -0500
@@ -0,0 +1,463 @@
+ * 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 "pidginproxyoptions.h" +struct _PidginProxyOptions { + GtkTreeModelFilter *filter; +static GParamSpec *properties[N_PROPERTIES] = {NULL, }; +G_DEFINE_TYPE(PidginProxyOptions, pidgin_proxy_options, GTK_TYPE_BOX) +/****************************************************************************** + *****************************************************************************/ +pidgin_proxy_options_null_to_empty_str(G_GNUC_UNUSED GBinding *binding, + const GValue *from_value, + G_GNUC_UNUSED gpointer data) + const gchar *str_val = g_value_get_string(from_value); + g_value_set_string(to_value, str_val); +pidgin_proxy_options_empty_str_to_null(G_GNUC_UNUSED GBinding *binding, + const GValue *from_value, + G_GNUC_UNUSED gpointer data) + const gchar *str_val = g_value_get_string(from_value); + if(str_val != NULL && *str_val == '\0') { + g_value_set_string(to_value, str_val); +pidgin_proxy_options_gint_to_double(G_GNUC_UNUSED GBinding *binding, + const GValue *from_value, GValue *to_value, + G_GNUC_UNUSED gpointer data) + g_value_set_double(to_value, (gdouble)g_value_get_int(from_value)); +pidgin_proxy_options_double_to_gint(G_GNUC_UNUSED GBinding *binding, + const GValue *from_value, GValue *to_value, + G_GNUC_UNUSED gpointer user_data) + g_value_set_int(to_value, (gint)g_value_get_double(from_value)); +pidgin_proxy_options_filter_visible(GtkTreeModel *model, GtkTreeIter *iter, + PidginProxyOptions *options = data; + gtk_tree_model_get(model, iter, COLUMN_TYPE, &type, -1); + if(type == PURPLE_PROXY_TYPE_USE_GLOBAL) { + return options->show_global; +/****************************************************************************** + *****************************************************************************/ +pidgin_proxy_options_proxy_type_changed_cb(GtkComboBox *box, gpointer data) { + PidginProxyOptions *options = data; + gboolean sensitive = TRUE; + if(!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(options->proxy_type), &iter)) { + gtk_tree_model_get(GTK_TREE_MODEL(options->filter), &iter, + purple_proxy_info_set_proxy_type(options->info, type); + case PURPLE_PROXY_TYPE_USE_GLOBAL: + case PURPLE_PROXY_TYPE_NONE: + case PURPLE_PROXY_TYPE_USE_ENVVAR: + gtk_widget_set_sensitive(options->options, sensitive); +pidgin_proxy_options_ports_popup_cb(G_GNUC_UNUSED GtkEntry *entry, + G_GNUC_UNUSED gpointer data) + GtkWidget *item = NULL; + /* This is an easter egg. The items are in reverse order because they are + * prepended to the menu. + * It means one of two things, both intended as humorous: + * A) your network is really slow and you have nothing better to do than + * B) You are looking really closely at something that shouldn't matter. + item = gtk_menu_item_new_with_label(_("you can see the butterflies mating")); + gtk_menu_shell_prepend(GTK_MENU_SHELL(widget), item); + /* This is also an easter egg, see the previous comment. */ + item = gtk_menu_item_new_with_label(_("If you look real closely")); + gtk_menu_shell_prepend(GTK_MENU_SHELL(widget), item); +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +pidgin_proxy_options_get_property(GObject *obj, guint param_id, GValue *value, + PidginProxyOptions *options = PIDGIN_PROXY_OPTIONS(obj); + g_value_set_boolean(value, + pidgin_proxy_options_get_show_global(options)); + g_value_set_object(value, pidgin_proxy_options_get_info(options)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +pidgin_proxy_options_set_property(GObject *obj, guint param_id, + const GValue *value, GParamSpec *pspec) + PidginProxyOptions *options = PIDGIN_PROXY_OPTIONS(obj); + pidgin_proxy_options_set_show_global(options, + g_value_get_boolean(value)); + pidgin_proxy_options_set_info(options, g_value_get_object(value)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +pidgin_proxy_options_init(PidginProxyOptions *options) { + gtk_widget_init_template(GTK_WIDGET(options)); + /* Set the visible function so we can control the visibility of the "Use + * Global Proxy" option. + gtk_tree_model_filter_set_visible_func(options->filter, + pidgin_proxy_options_filter_visible, +pidgin_proxy_options_constructed(GObject *obj) { + PidginProxyOptions *options = PIDGIN_PROXY_OPTIONS(obj); + G_OBJECT_CLASS(pidgin_proxy_options_parent_class)->constructed(obj); + if(options->info == NULL) { + pidgin_proxy_options_set_info(options, NULL); +pidgin_proxy_options_class_init(PidginProxyOptionsClass *klass) { + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + obj_class->get_property = pidgin_proxy_options_get_property; + obj_class->set_property = pidgin_proxy_options_set_property; + obj_class->constructed = pidgin_proxy_options_constructed; + * PidginProxyOptions::show-global: + * Whether or not to show the "Use Global Proxy Settings" option. This + * is turned off for the preferences where we use this widget to define + * the global proxy settings. + properties[PROP_SHOW_GLOBAL] = g_param_spec_boolean( + "show-global", "show-global", + "Whether or not to show the global proxy settings option", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); + * PidginProxyOptions::info: + * The [class@Purple.ProxyInfo] that this options widget is configuring. If + * unset, a new instance will be created. + properties[PROP_INFO] = g_param_spec_object( + "The proxy info to configure", + PURPLE_TYPE_PROXY_INFO, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties(obj_class, N_PROPERTIES, properties); + gtk_widget_class_set_template_from_resource( + "/im/pidgin/Pidgin3/proxyoptions.ui" + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_child(widget_class, PidginProxyOptions, + gtk_widget_class_bind_template_callback(widget_class, + pidgin_proxy_options_proxy_type_changed_cb); + gtk_widget_class_bind_template_callback(widget_class, + pidgin_proxy_options_ports_popup_cb); +/****************************************************************************** + *****************************************************************************/ +pidgin_proxy_options_new(void) { + return g_object_new(PIDGIN_TYPE_PROXY_OPTIONS, NULL); +pidgin_proxy_options_set_show_global(PidginProxyOptions *options, + PurpleProxyType proxy_type = PURPLE_PROXY_TYPE_USE_GLOBAL; + g_return_if_fail(PIDGIN_IS_PROXY_OPTIONS(options)); + if(show_global == options->show_global) { + options->show_global = show_global; + if(options->info == NULL) { + g_object_notify_by_pspec(G_OBJECT(options), + properties[PROP_SHOW_GLOBAL]); + proxy_type = purple_proxy_info_get_proxy_type(options->info); + if(proxy_type == PURPLE_PROXY_TYPE_USE_GLOBAL && show_global == FALSE) { + proxy_type = PURPLE_PROXY_TYPE_NONE; + purple_proxy_info_set_proxy_type(options->info, proxy_type); + options->show_global = show_global; + g_object_notify_by_pspec(G_OBJECT(options), properties[PROP_SHOW_GLOBAL]); + /* Tell the filter to rerun. */ + gtk_tree_model_filter_refilter(options->filter); +pidgin_proxy_options_get_show_global(PidginProxyOptions *options) { + g_return_val_if_fail(PIDGIN_IS_PROXY_OPTIONS(options), FALSE); + return options->show_global; +pidgin_proxy_options_set_info(PidginProxyOptions *options, + g_return_if_fail(PIDGIN_IS_PROXY_OPTIONS(options)); + /* We want to always have a PurpleProxyInfo instance to make management + * easier. So if someone clears it, just replace it with an empty one + if(!PURPLE_IS_PROXY_INFO(info)) { + PurpleProxyInfo *empty_info = purple_proxy_info_new(); + if(!g_set_object(&options->info, empty_info)) { + g_assert_not_reached(); + g_object_unref(empty_info); + } else if(!g_set_object(&options->info, info)) { + model = GTK_TREE_MODEL(options->filter); + if(gtk_tree_model_get_iter_first(model, &iter)) { + PurpleProxyType type = purple_proxy_info_get_proxy_type(options->info); + PurpleProxyType row_type; + gtk_tree_model_get(model, &iter, COLUMN_TYPE, &row_type, -1); + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(options->proxy_type), + } while(gtk_tree_model_iter_next(model, &iter)); + g_object_bind_property_full(options->info, "hostname", + options->hostname, "text", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + pidgin_proxy_options_null_to_empty_str, + pidgin_proxy_options_empty_str_to_null, + g_object_bind_property_full(options->info, "port", + options->port, "value", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + pidgin_proxy_options_gint_to_double, + pidgin_proxy_options_double_to_gint, + g_object_bind_property_full(options->info, "username", + options->username, "text", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + pidgin_proxy_options_null_to_empty_str, + pidgin_proxy_options_empty_str_to_null, + g_object_bind_property_full(options->info, "password", + options->password, "text", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + pidgin_proxy_options_null_to_empty_str, + pidgin_proxy_options_empty_str_to_null, + g_object_notify_by_pspec(G_OBJECT(options), properties[PROP_INFO]); +pidgin_proxy_options_get_info(PidginProxyOptions *options) { + g_return_val_if_fail(PIDGIN_IS_PROXY_OPTIONS(options), NULL); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidginproxyoptions.h Mon May 02 23:43:16 2022 -0500
@@ -0,0 +1,108 @@
+ * 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_PROXY_OPTIONS_H +#define PIDGIN_PROXY_OPTIONS_H + * A widget for the proxy options in the account editor. +#define PIDGIN_TYPE_PROXY_OPTIONS (pidgin_proxy_options_get_type()) +G_DECLARE_FINAL_TYPE(PidginProxyOptions, pidgin_proxy_options, PIDGIN, + * pidgin_proxy_options_new: + * Creates a new proxy options widget. + * Returns: (transfer full): The widget. +GtkWidget *pidgin_proxy_options_new(void); + * pidgin_proxy_options_set_show_global: + * @options: The instance. + * @show_global: Whether or not to show the use global settings proxy item. + * Sets whether or not to show the "Use Global Proxy Settings" item. +void pidgin_proxy_options_set_show_global(PidginProxyOptions *options, gboolean show_global); + * pidgin_proxy_options_get_show_global: + * @options: The instance. + * Gets whether or not @options is displaying the "Use Global Proxy Settings" + * Returns: %TRUE if displaying it, %FALSE otherwise. +gboolean pidgin_proxy_options_get_show_global(PidginProxyOptions *options); + * pidgin_proxy_options_get_info: + * @options: The instance. + * Gets the [class@Purple.ProxyInfo] that is being configured. + * Returns: (transfer none): The proxy info. +PurpleProxyInfo *pidgin_proxy_options_get_info(PidginProxyOptions *options); + * pidgin_proxy_options_set_info: + * @options: The instance. + * @info: The [class@Purple.ProxyInfo] to set. + * The proxy info that will be configured. +void pidgin_proxy_options_set_info(PidginProxyOptions *options, PurpleProxyInfo *info); +#endif /* PIDGIN_PROXY_OPTIONS_H */ --- a/pidgin/resources/pidgin.gresource.xml Mon May 02 21:57:35 2022 -0500
+++ b/pidgin/resources/pidgin.gresource.xml Mon May 02 23:43:16 2022 -0500
@@ -37,6 +37,7 @@
<file compressed="true">Xfer/xfer.ui</file>
<file compressed="true">closebutton.ui</file>
<file compressed="true">gtk/menus.ui</file>
+ <file compressed="true">proxyoptions.ui</file> <file compressed="true">statusprimitivechooser.ui</file>
<file>icons/16x16/status/pidgin-user-available.png</file>
<file>icons/16x16/status/pidgin-user-away.png</file>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/proxyoptions.ui Mon May 02 23:43:16 2022 -0500
@@ -0,0 +1,305 @@
+<?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, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + <requires lib="gtk+" version="3.24"/> + <!-- interface-license-type gplv2 --> + <!-- interface-name Pidgin --> + <!-- interface-description Internet Messenger --> + <!-- interface-copyright Pidgin Developers <devel@pidgin.im> --> + <object class="GtkListStore" id="model"> + <!-- column-name type --> + <column type="PurpleProxyType"/> + <!-- column-name description --> + <column type="gchararray"/> + <col id="0">PURPLE_PROXY_TYPE_USE_GLOBAL</col> + <col id="1" translatable="yes">Use Global Proxy Settings</col> + <col id="0">PURPLE_PROXY_TYPE_NONE</col> + <col id="1" translatable="yes">No Proxy</col> + <col id="0">PURPLE_PROXY_TYPE_SOCKS4</col> + <col id="1" translatable="yes">SOCKS 4</col> + <col id="0">PURPLE_PROXY_TYPE_SOCKS5</col> + <col id="1" translatable="yes">SOCKS 5</col> + <col id="0">PURPLE_PROXY_TYPE_TOR</col> + <col id="1" translatable="yes">TOR/Privacy (SOCKS 5)</col> + <col id="0">PURPLE_PROXY_TYPE_HTTP</col> + <col id="1" translatable="yes">HTTP</col> + <col id="0">PURPLE_PROXY_TYPE_USE_ENVVAR</col> + <col id="1" translatable="yes">Use Environmental Settings</col> + <object class="GtkTreeModelFilter" id="filter"> + <property name="child-model">model</property> + <object class="GtkAdjustment" id="port_adjustment"> + <property name="lower">-1</property> + <property name="upper">65535</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + <template class="PidginProxyOptions" parent="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <object class="GtkLabel" id="proxy_type_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Proxy _type:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">proxy_type</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkComboBox" id="proxy_type"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="model">filter</property> + <signal name="changed" handler="pidgin_proxy_options_proxy_type_changed_cb" object="PidginProxyOptions" swapped="no"/> + <object class="GtkCellRendererText"/> + <attribute name="text">1</attribute> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkBox" id="options"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can-focus">False</property> + <property name="orientation">vertical</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <object class="GtkLabel" id="host_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">_Host:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">hostname</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkEntry" id="hostname"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="progress-pulse-step">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <object class="GtkLabel" id="port_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">_Port:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">port</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkSpinButton" id="port"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="input-hints">GTK_INPUT_HINT_NO_EMOJI | GTK_INPUT_HINT_NONE</property> + <property name="adjustment">port_adjustment</property> + <property name="numeric">True</property> + <signal name="populate-popup" handler="pidgin_proxy_options_ports_popup_cb" object="PidginProxyOptions" swapped="no"/> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <object class="GtkLabel" id="username_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">_Username:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">username</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkEntry" id="username"> + <property name="visible">True</property> + <property name="can-focus">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">True</property> + <property name="position">2</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <object class="GtkLabel" id="password_label"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Pa_ssword:</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">password</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GtkEntry" id="password"> + <property name="visible">True</property> + <property name="can-focus">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">True</property> + <property name="position">3</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + <object class="GtkSizeGroup"> + <widget name="proxy_type_label"/> + <widget name="host_label"/> + <widget name="port_label"/> + <widget name="username_label"/> + <widget name="password_label"/> --- a/po/POTFILES.in Mon May 02 21:57:35 2022 -0500
+++ b/po/POTFILES.in Mon May 02 23:43:16 2022 -0500
@@ -336,6 +336,7 @@
pidgin/pidginaccountchooser.c
pidgin/pidginaccountfilterconnected.c
pidgin/pidginaccountfilterprotocol.c
+pidgin/pidginaccountmanager.c pidgin/pidginaccountsenabledmenu.c
pidgin/pidginaccountsmenu.c
pidgin/pidginaccountstore.c
@@ -364,6 +365,7 @@
pidgin/pidginpresenceicon.c
pidgin/pidginprotocolchooser.c
pidgin/pidginprotocolstore.c
+pidgin/pidginproxyoptions.c pidgin/pidginscrollbook.c
pidgin/pidginstatusprimitivechooser.c
@@ -415,6 +417,7 @@
pidgin/resources/Whiteboard/whiteboard.ui
pidgin/resources/Xfer/xfer.ui
pidgin/resources/gtk/menus.ui
+pidgin/resources/proxyoptions.ui pidgin/win32/gtkwin32dep.c
purple-history/purplehistorycore.c