--- a/libpurple/meson.build Fri Mar 10 17:17:53 2023 -0600
+++ b/libpurple/meson.build Fri Mar 10 17:25:22 2023 -0600
@@ -101,6 +101,7 @@
'request/purplerequestfieldbool.c',
'request/purplerequestfieldchoice.c',
'request/purplerequestfieldint.c',
+ 'request/purplerequestfieldlabel.c', 'request/purplerequestfieldlist.c',
'request/purplerequestfieldstring.c',
@@ -230,6 +231,7 @@
'request/purplerequestfieldbool.h',
'request/purplerequestfieldchoice.h',
'request/purplerequestfieldint.h',
+ 'request/purplerequestfieldlabel.h', 'request/purplerequestfieldlist.h',
'request/purplerequestfieldstring.h',
--- a/libpurple/purplerequestfield.c Fri Mar 10 17:17:53 2023 -0600
+++ b/libpurple/purplerequestfield.c Fri Mar 10 17:25:22 2023 -0600
@@ -635,19 +635,6 @@
-purple_request_field_label_new(const char *id, const char *text)
- PurpleRequestField *field;
- g_return_val_if_fail(id != NULL, NULL);
- g_return_val_if_fail(text != NULL, NULL);
- field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LABEL);
purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size)
PurpleRequestField *field;
--- a/libpurple/purplerequestfield.h Fri Mar 10 17:17:53 2023 -0600
+++ b/libpurple/purplerequestfield.h Fri Mar 10 17:25:22 2023 -0600
@@ -64,7 +64,6 @@
* PurpleRequestFieldType:
* @PURPLE_REQUEST_FIELD_NONE: No field.
- * @PURPLE_REQUEST_FIELD_LABEL: Label field.
* @PURPLE_REQUEST_FIELD_IMAGE: Image field.
* @PURPLE_REQUEST_FIELD_DATASHEET: Datasheet field.
@@ -73,7 +72,6 @@
PURPLE_REQUEST_FIELD_NONE,
- PURPLE_REQUEST_FIELD_LABEL,
PURPLE_REQUEST_FIELD_IMAGE,
PURPLE_REQUEST_FIELD_DATASHEET
@@ -309,22 +307,6 @@
gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
/**************************************************************************/
-/**************************************************************************/
- * purple_request_field_label_new:
- * @text: The label of the field.
- * Creates a label field.
- * Returns: (transfer full): The new field.
-PurpleRequestField *purple_request_field_label_new(const char *id,
-/**************************************************************************/
/**************************************************************************/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/request/purplerequestfieldlabel.c Fri Mar 10 17:25:22 2023 -0600
@@ -0,0 +1,58 @@
+ * Purple 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +#include <glib/gi18n-lib.h> +#include "purplerequestfield.h" +#include "request/purplerequestfieldlabel.h" +struct _PurpleRequestFieldLabel { + PurpleRequestField parent; +/****************************************************************************** + * GObject Implementation + *****************************************************************************/ +G_DEFINE_TYPE(PurpleRequestFieldLabel, purple_request_field_label, + PURPLE_TYPE_REQUEST_FIELD) +purple_request_field_label_init(G_GNUC_UNUSED PurpleRequestFieldLabel *field) { +purple_request_field_label_class_init(G_GNUC_UNUSED PurpleRequestFieldLabelClass *klass) { +/****************************************************************************** + *****************************************************************************/ +purple_request_field_label_new(const char *id, const char *text) { + g_return_val_if_fail(id != NULL, NULL); + g_return_val_if_fail(text != NULL, NULL); + return g_object_new(PURPLE_TYPE_REQUEST_FIELD_LABEL, --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/request/purplerequestfieldlabel.h Fri Mar 10 17:25:22 2023 -0600
@@ -0,0 +1,63 @@
+ * Purple - Internet Messaging Library + * Copyright (C) Pidgin Developers <devel@pidgin.im> + * Purple 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(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) +# error "only <purple.h> may be included directly" +#ifndef PURPLE_REQUEST_FIELD_LABEL_H +#define PURPLE_REQUEST_FIELD_LABEL_H +#include <glib-object.h> + * PurpleRequestFieldLabel: + * A label request field. +typedef struct _PurpleRequestFieldLabel PurpleRequestFieldLabel; +#include "purplerequestfield.h" +#define PURPLE_TYPE_REQUEST_FIELD_LABEL (purple_request_field_label_get_type()) +G_DECLARE_FINAL_TYPE(PurpleRequestFieldLabel, purple_request_field_label, + PURPLE, REQUEST_FIELD_LABEL, PurpleRequestField) + * purple_request_field_label_new: + * @text: The label of the field. + * Creates a label field. + * Returns: (transfer full): The new field. +PurpleRequestField *purple_request_field_label_new(const char *id, const char *text); +#endif /* PURPLE_REQUEST_FIELD_LABEL_H */ --- a/pidgin/gtkrequest.c Fri Mar 10 17:17:53 2023 -0600
+++ b/pidgin/gtkrequest.c Fri Mar 10 17:25:22 2023 -0600
@@ -2050,8 +2050,7 @@
if (type == PURPLE_REQUEST_FIELD_DATASHEET)
contains_resizable = TRUE;
- if (type == PURPLE_REQUEST_FIELD_LABEL)
+ if(PURPLE_IS_REQUEST_FIELD_LABEL(field)) { else if(PURPLE_IS_REQUEST_FIELD_LIST(field) ||
@@ -2108,7 +2107,7 @@
if (field_label[strlen(field_label) - 1] != ':' &&
field_label[strlen(field_label) - 1] != '?' &&
- type != PURPLE_REQUEST_FIELD_LABEL)
+ !PURPLE_IS_REQUEST_FIELD_LABEL(field)) text = g_strdup_printf("%s:", field_label);
@@ -2123,7 +2122,7 @@
gtk_size_group_add_widget(sg, label);
- if (type == PURPLE_REQUEST_FIELD_LABEL ||
+ if (PURPLE_IS_REQUEST_FIELD_LABEL(field) || PURPLE_IS_REQUEST_FIELD_LIST(field) ||
(PURPLE_IS_REQUEST_FIELD_STRING(field) &&
purple_request_field_string_is_multiline(PURPLE_REQUEST_FIELD_STRING(field))))