qulogic/pidgin

Remove all of the existing status widgets

5 months ago, Gary Kramlich
c73c0cf2b554
Parents 56a4fd2844ae
Children 1954265c38f0
Remove all of the existing status widgets

None of these work with the new presence system and were going to be removed
sooner or later. I'm opting for sooner as many of them have deprecation
warnings that make the build output difficult to read.

Testing Done:
Ran `ninja turtles` and ran pidgin3 without issues.

Reviewed at https://reviews.imfreedom.org/r/2809/
--- a/ChangeLog.API Tue Nov 28 01:15:51 2023 -0600
+++ b/ChangeLog.API Thu Nov 30 21:33:32 2023 -0600
@@ -1193,6 +1193,8 @@
* PidginStatusBoxItemType
* pidgin_status_box_add
* pidgin_status_box_add_separator
+ * pidgin_status_box_get_type
+ * pidgin_status_box_new
* pidgin_status_box_pulse_connecting
* pidgin_status_box_set_buddy_icon
* pidgin_status_box_set_network_available
--- a/pidgin/meson.build Tue Nov 28 01:15:51 2023 -0600
+++ b/pidgin/meson.build Thu Nov 30 21:33:32 2023 -0600
@@ -52,11 +52,6 @@
'pidginpluginsmenu.c',
'pidginpresenceicon.c',
'pidginprotocolchooser.c',
- 'pidginstatusbox.c',
- 'pidginstatusdisplay.c',
- 'pidginstatuseditor.c',
- 'pidginstatusmanager.c',
- 'pidginstatusprimitivechooser.c',
'pidgintextbuffer.c',
'pidginui.c',
'prefs/pidginprefs.c',
@@ -118,11 +113,6 @@
'pidginpluginsmenu.h',
'pidginpresenceicon.h',
'pidginprotocolchooser.h',
- 'pidginstatusbox.h',
- 'pidginstatusdisplay.h',
- 'pidginstatuseditor.h',
- 'pidginstatusmanager.h',
- 'pidginstatusprimitivechooser.h',
'pidgintextbuffer.h',
'pidginui.h',
'pidginversion.h',
--- a/pidgin/pidginapplication.c Tue Nov 28 01:15:51 2023 -0600
+++ b/pidgin/pidginapplication.c Thu Nov 30 21:33:32 2023 -0600
@@ -48,8 +48,6 @@
#include "pidginpluginsdialog.h"
#include "pidginpluginsmenu.h"
#include "pidginprefs.h"
-#include "pidginstatuseditor.h"
-#include "pidginstatusmanager.h"
#include "pidginui.h"
struct _PidginApplication {
@@ -474,15 +472,6 @@
}
static void
-pidgin_application_new_status(G_GNUC_UNUSED GSimpleAction *simple,
- G_GNUC_UNUSED GVariant *parameter,
- G_GNUC_UNUSED gpointer data)
-{
- GtkWidget *editor = pidgin_status_editor_new(NULL);
- gtk_window_present_with_time(GTK_WINDOW(editor), GDK_CURRENT_TIME);
-}
-
-static void
pidgin_application_online_help(G_GNUC_UNUSED GSimpleAction *simple,
G_GNUC_UNUSED GVariant *parameter,
G_GNUC_UNUSED gpointer data)
@@ -550,23 +539,6 @@
pidgin_roomlist_dialog_show();
}
-static void
-pidgin_application_show_status_manager(G_GNUC_UNUSED GSimpleAction *simple,
- G_GNUC_UNUSED GVariant *parameter,
- gpointer data)
-{
- PidginApplication *application = data;
- static GtkWidget *manager = NULL;
-
- if(!GTK_IS_WIDGET(manager)) {
- manager = pidgin_status_manager_new();
- g_object_add_weak_pointer(G_OBJECT(manager), (gpointer)&manager);
- }
-
- pidgin_application_present_transient_window(application,
- GTK_WINDOW(manager));
-}
-
static GActionEntry app_entries[] = {
{
.name = "about",
@@ -615,9 +587,6 @@
.name = "new-message",
.activate = pidgin_application_new_message,
}, {
- .name = "new-status",
- .activate = pidgin_application_new_status,
- }, {
.name = "online-help",
.activate = pidgin_application_online_help,
}, {
@@ -629,9 +598,6 @@
}, {
.name = "room-list",
.activate = pidgin_application_room_list,
- }, {
- .name = "status-manager",
- .activate = pidgin_application_show_status_manager,
}
};
--- a/pidgin/pidginstatusbox.c Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-/*
- * 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 <glib/gi18n-lib.h>
-
-#include <gtk/gtk.h>
-
-#include <purple.h>
-
-#include "pidginstatusbox.h"
-#include "pidginiconname.h"
-#include "pidginstatusdisplay.h"
-
-#define SAVEDSTATUS_FORMAT "savedstatus_%lu"
-
-struct _PidginStatusBox {
- GtkBox parent;
-
- GtkWidget *button;
- PidginStatusDisplay *display;
- GtkPopover *popover;
-
- GMenu *primitives;
- GMenu *saved_statuses;
- GList *custom_widgets;
-};
-
-G_DEFINE_TYPE(PidginStatusBox, pidgin_status_box, GTK_TYPE_BOX)
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static GtkWidget *
-pidgin_status_box_make_primitive_widget(const char *action, const char *id) {
- GtkWidget *button = NULL;
- GtkWidget *display = NULL;
- PurpleStatusPrimitive primitive = PURPLE_STATUS_UNSET;
-
- primitive = purple_primitive_get_type_from_id(id);
- display = pidgin_status_display_new_for_primitive(primitive);
-
- button = gtk_button_new();
- gtk_widget_add_css_class(button, "flat");
- gtk_button_set_child(GTK_BUTTON(button), display);
-
- gtk_actionable_set_action_name(GTK_ACTIONABLE(button), action);
- gtk_actionable_set_action_target(GTK_ACTIONABLE(button),
- (const char *)G_VARIANT_TYPE_INT32,
- primitive);
-
- return button;
-}
-
-static void
-pidgin_status_box_populate_primitives(PidginStatusBox *status_box) {
- GtkPopoverMenu *popover = GTK_POPOVER_MENU(status_box->popover);
- GMenuModel *menu = G_MENU_MODEL(status_box->primitives);
- gint n_items = 0;
-
- n_items = g_menu_model_get_n_items(menu);
- for(gint index = 0; index < n_items; index++) {
- GtkWidget *button = NULL;
- char *action = NULL;
- char *target = NULL;
- char *custom_id = NULL;
-
- g_menu_model_get_item_attribute(menu, index, G_MENU_ATTRIBUTE_ACTION,
- "s", &action);
- g_menu_model_get_item_attribute(menu, index, G_MENU_ATTRIBUTE_TARGET,
- "s", &target);
- g_menu_model_get_item_attribute(menu, index, "custom", "s", &custom_id);
-
- button = pidgin_status_box_make_primitive_widget(action, target);
- gtk_popover_menu_add_child(popover, button, custom_id);
-
- g_free(action);
- g_free(target);
- g_free(custom_id);
- }
-}
-
-static char *
-pidgin_status_box_make_savedstatus_widget(PurpleSavedStatus *saved_status,
- GtkWidget **widget)
-{
- GtkWidget *button = NULL;
- GtkWidget *display = NULL;
- time_t creation_time = 0;
-
- display = pidgin_status_display_new_for_saved_status(saved_status);
-
- if(!purple_savedstatus_is_transient(saved_status)) {
- GtkWidget *image = gtk_image_new_from_icon_name("document-save");
- gtk_widget_set_halign(image, GTK_ALIGN_END);
- gtk_widget_set_hexpand(image, TRUE);
- gtk_box_append(GTK_BOX(display), image);
- }
-
- button = gtk_button_new();
- gtk_widget_add_css_class(button, "flat");
- gtk_button_set_child(GTK_BUTTON(button), display);
-
- creation_time = purple_savedstatus_get_creation_time(saved_status);
- gtk_actionable_set_action_name(GTK_ACTIONABLE(button), "status.set-saved");
- gtk_actionable_set_action_target(GTK_ACTIONABLE(button),
- (const char *)G_VARIANT_TYPE_INT64,
- creation_time);
- *widget = button;
-
- return g_strdup_printf(SAVEDSTATUS_FORMAT, creation_time);
-}
-
-static void
-pidgin_status_box_populate_saved_statuses(PidginStatusBox *status_box)
-{
- GtkPopoverMenu *popover_menu = NULL;
- GMenu *menu = NULL;
- GList *list, *cur;
-
- list = purple_savedstatuses_get_popular(6);
- if (list == NULL) {
- /* Odd... oh well, nothing we can do about it. */
- return;
- }
-
- popover_menu = GTK_POPOVER_MENU(status_box->popover);
- menu = status_box->saved_statuses;
- for(cur = list; cur != NULL; cur = cur->next) {
- PurpleSavedStatus *saved = cur->data;
- GtkWidget *widget = NULL;
- char *id = NULL;
- GMenuItem *item = NULL;
-
- id = pidgin_status_box_make_savedstatus_widget(saved, &widget);
- item = g_menu_item_new(NULL, NULL);
- g_menu_item_set_attribute(item, "custom", "s", id);
- g_menu_append_item(menu, item);
- g_object_unref(item);
-
- gtk_popover_menu_add_child(popover_menu, widget, id);
- status_box->custom_widgets = g_list_prepend(status_box->custom_widgets,
- widget);
-
- g_free(id);
- }
-
- g_list_free(list);
-}
-
-/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static void
-pidgin_status_box_set_primitive(G_GNUC_UNUSED GSimpleAction *action,
- GVariant *parameter, gpointer data)
-{
- PidginStatusBox *status_box = data;
- PurpleSavedStatus *saved_status = NULL;
- PurpleStatusPrimitive primitive;
-
- gtk_menu_button_popdown(GTK_MENU_BUTTON(status_box->button));
-
- if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_INT32)) {
- g_critical("status.set-primitive action parameter is of incorrect type %s",
- g_variant_get_type_string(parameter));
- return;
- }
-
- primitive = g_variant_get_int32(parameter);
-
- saved_status = purple_savedstatus_find_transient_by_type_and_message(primitive, NULL);
- if(saved_status == NULL) {
- saved_status = purple_savedstatus_new(NULL, primitive);
- }
-
- if(saved_status != NULL) {
- if(saved_status != purple_savedstatus_get_current()) {
- purple_savedstatus_activate(saved_status);
- }
- }
-}
-
-static void
-pidgin_status_box_set_saved_status(G_GNUC_UNUSED GSimpleAction *action,
- GVariant *parameter, gpointer data)
-{
- PidginStatusBox *status_box = data;
- PurpleSavedStatus *saved_status = NULL;
- time_t creation_time = 0;
-
- gtk_menu_button_popdown(GTK_MENU_BUTTON(status_box->button));
-
- if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_INT64)) {
- g_critical("status.set-saved action parameter is of incorrect type %s",
- g_variant_get_type_string(parameter));
- return;
- }
-
- creation_time = (time_t)g_variant_get_int64(parameter);
- saved_status = purple_savedstatus_find_by_creation_time(creation_time);
-
- if(saved_status != NULL) {
- if(saved_status != purple_savedstatus_get_current()) {
- purple_savedstatus_activate(saved_status);
- }
- }
-}
-
-static void
-pidgin_status_box_savedstatus_changed_cb(PurpleSavedStatus *now,
- G_GNUC_UNUSED PurpleSavedStatus *old,
- gpointer data)
-{
- PidginStatusBox *status_box = data;
-
- /* If we don't have a status, we have to bail. */
- if(now == NULL) {
- return;
- }
-
- pidgin_status_display_set_saved_status(status_box->display, now);
-}
-
-static void
-pidgin_status_box_remove_custom_widget(GtkWidget *widget, gpointer user_data) {
- GtkPopoverMenu *popover_menu = user_data;
-
- gtk_popover_menu_remove_child(popover_menu, widget);
-}
-
-static void
-pidgin_status_box_savedstatus_updated_cb(G_GNUC_UNUSED PurpleSavedStatus *status,
- gpointer data)
-{
- PidginStatusBox *status_box = data;
-
- g_list_foreach(status_box->custom_widgets,
- (GFunc)pidgin_status_box_remove_custom_widget,
- status_box->popover);
- g_clear_list(&status_box->custom_widgets, NULL);
- g_menu_remove_all(status_box->saved_statuses);
-
- pidgin_status_box_populate_saved_statuses(status_box);
-}
-
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-static void
-pidgin_status_box_finalize(GObject *obj) {
- PidginStatusBox *status_box = PIDGIN_STATUS_BOX(obj);
-
- purple_signals_disconnect_by_handle(status_box);
-
- g_clear_list(&status_box->custom_widgets, NULL);
-
- G_OBJECT_CLASS(pidgin_status_box_parent_class)->finalize(obj);
-}
-
-static void
-pidgin_status_box_init(PidginStatusBox *status_box) {
- gpointer handle;
- GSimpleActionGroup *action_group = NULL;
- GActionEntry actions[] = {
- {
- .name = "set-primitive",
- .activate = pidgin_status_box_set_primitive,
- .parameter_type = (const char *)G_VARIANT_TYPE_INT32,
- }, {
- .name = "set-saved",
- .activate = pidgin_status_box_set_saved_status,
- .parameter_type = (const char *)G_VARIANT_TYPE_INT64,
- },
- };
-
- gtk_widget_init_template(GTK_WIDGET(status_box));
-
- action_group = g_simple_action_group_new();
- g_action_map_add_action_entries(G_ACTION_MAP(action_group),
- actions, G_N_ELEMENTS(actions),
- status_box);
- gtk_widget_insert_action_group(GTK_WIDGET(status_box), "status",
- G_ACTION_GROUP(action_group));
-
- status_box->popover = gtk_menu_button_get_popover(GTK_MENU_BUTTON(status_box->button));
- gtk_popover_set_has_arrow(status_box->popover, FALSE);
-
- pidgin_status_box_populate_primitives(status_box);
- pidgin_status_box_populate_saved_statuses(status_box);
-
- handle = purple_savedstatuses_get_handle();
- purple_signal_connect(handle, "savedstatus-changed", status_box,
- G_CALLBACK(pidgin_status_box_savedstatus_changed_cb),
- status_box);
- purple_signal_connect(handle, "savedstatus-added", status_box,
- G_CALLBACK(pidgin_status_box_savedstatus_updated_cb),
- status_box);
- purple_signal_connect(handle, "savedstatus-deleted", status_box,
- G_CALLBACK(pidgin_status_box_savedstatus_updated_cb),
- status_box);
- purple_signal_connect(handle, "savedstatus-modified", status_box,
- G_CALLBACK(pidgin_status_box_savedstatus_updated_cb),
- status_box);
-}
-
-static void
-pidgin_status_box_constructed(GObject *obj) {
- PidginStatusBox *status_box = PIDGIN_STATUS_BOX(obj);
- PurpleSavedStatus *status = NULL;
-
- G_OBJECT_CLASS(pidgin_status_box_parent_class)->constructed(obj);
-
- status = purple_savedstatus_get_current();
- pidgin_status_display_set_saved_status(status_box->display, status);
-}
-
-static void
-pidgin_status_box_class_init(PidginStatusBoxClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-
- obj_class->finalize = pidgin_status_box_finalize;
- obj_class->constructed = pidgin_status_box_constructed;
-
- gtk_widget_class_set_template_from_resource(
- widget_class,
- "/im/pidgin/Pidgin3/Status/box.ui"
- );
-
- gtk_widget_class_bind_template_child(widget_class, PidginStatusBox,
- button);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusBox,
- display);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusBox,
- primitives);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusBox,
- saved_statuses);
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkWidget *
-pidgin_status_box_new(void) {
- return g_object_new(PIDGIN_TYPE_STATUS_BOX, NULL);
-}
--- a/pidgin/pidginstatusbox.h Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * 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_STATUS_BOX_H
-#define PIDGIN_STATUS_BOX_H
-
-#include <gtk/gtk.h>
-
-#include "pidginversion.h"
-
-G_BEGIN_DECLS
-
-#define PIDGIN_TYPE_STATUS_BOX (pidgin_status_box_get_type ())
-
-PIDGIN_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE(PidginStatusBox, pidgin_status_box, PIDGIN, STATUS_BOX,
- GtkBox)
-
-
-PIDGIN_AVAILABLE_IN_ALL
-GtkWidget *pidgin_status_box_new(void);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STATUS_BOX_H */
--- a/pidgin/pidginstatusdisplay.c Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
- * 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 <glib/gi18n-lib.h>
-
-#include <gtk/gtk.h>
-
-#include "pidginstatusdisplay.h"
-#include "pidginiconname.h"
-
-struct _PidginStatusDisplay {
- GtkBox parent;
-
- GtkImage *image;
- GtkLabel *label;
-
- PurpleStatusPrimitive primitive;
- PurpleSavedStatus *status;
-};
-
-enum {
- PROP_0,
- PROP_PRIMITIVE,
- PROP_SAVED_STATUS,
- PROP_LAST
-};
-
-static GParamSpec *properties[PROP_LAST] = {NULL};
-
-/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static void
-pidgin_status_display_refresh(PidginStatusDisplay *display) {
- const char *icon_name = NULL;
- char *label = NULL;
-
- if(display->status != NULL) {
- PurpleSavedStatus *status = display->status;
- PurpleStatusPrimitive primitive;
- GString *text = NULL;
-
- primitive = purple_savedstatus_get_primitive_type(status);
- icon_name = pidgin_icon_name_from_status_primitive(primitive, NULL);
-
- text = g_string_new(purple_savedstatus_get_title(status));
-
- /* Transient statuses do not have a title, so the savedstatus API
- * returns the message when purple_savedstatus_get_title() is called,
- * so we don't need to get the message a second time.
- */
- if(!purple_savedstatus_is_transient(status)) {
- const char *message = NULL;
-
- message = purple_savedstatus_get_message(status);
- if(message != NULL) {
- char *stripped = purple_markup_strip_html(message);
-
- purple_util_chrreplace(stripped, '\n', ' ');
- g_string_append_printf(text, " - %s", stripped);
- g_free(stripped);
- }
- }
-
- label = g_string_free(text, FALSE);
-
- } else if(display->primitive != PURPLE_STATUS_UNSET) {
- icon_name = pidgin_icon_name_from_status_primitive(display->primitive,
- NULL);
- label = g_strdup(purple_primitive_get_name_from_type(display->primitive));
- }
-
- gtk_image_set_from_icon_name(display->image, icon_name);
- gtk_label_set_text(display->label, label);
-
- g_free(label);
-}
-
-/******************************************************************************
- * GObject implementation
- *****************************************************************************/
-G_DEFINE_TYPE(PidginStatusDisplay, pidgin_status_display, GTK_TYPE_BOX)
-
-static void
-pidgin_status_display_get_property(GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- PidginStatusDisplay *display = PIDGIN_STATUS_DISPLAY(object);
-
- switch (prop_id) {
- case PROP_PRIMITIVE:
- g_value_set_enum(value,
- pidgin_status_display_get_primitive(display));
- break;
- case PROP_SAVED_STATUS:
- g_value_set_pointer(value,
- pidgin_status_display_get_saved_status(display));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-pidgin_status_display_set_property(GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- PidginStatusDisplay *display = PIDGIN_STATUS_DISPLAY(object);
-
- switch (prop_id) {
- case PROP_PRIMITIVE:
- pidgin_status_display_set_primitive(display,
- g_value_get_enum(value));
- break;
- case PROP_SAVED_STATUS:
- pidgin_status_display_set_saved_status(display,
- g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-pidgin_status_display_class_init(PidginStatusDisplayClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-
- /* Properties */
- obj_class->get_property = pidgin_status_display_get_property;
- obj_class->set_property = pidgin_status_display_set_property;
-
- /**
- * PidginStatusDisplay:primitive:
- *
- * The status primitive that is currently displayed.
- *
- * Since: 3.0.0
- */
- properties[PROP_PRIMITIVE] = g_param_spec_enum(
- "primitive", "primitive",
- "The status primitive that is currently displayed.",
- PURPLE_TYPE_STATUS_PRIMITIVE, PURPLE_STATUS_UNSET,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * PidginStatusDisplay:saved-status:
- *
- * The saved status that is currently displayed.
- *
- * Since: 3.0.0
- */
- properties[PROP_SAVED_STATUS] = g_param_spec_pointer(
- "saved-status", "saved-status",
- "The saved status that is currently displayed.",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- g_object_class_install_properties(obj_class, PROP_LAST, properties);
-
- /* Widget template */
- gtk_widget_class_set_template_from_resource(
- widget_class, "/im/pidgin/Pidgin3/Status/display.ui");
-
- gtk_widget_class_bind_template_child(widget_class, PidginStatusDisplay,
- image);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusDisplay,
- label);
-}
-
-static void
-pidgin_status_display_init(PidginStatusDisplay *display) {
- gtk_widget_init_template(GTK_WIDGET(display));
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkWidget *
-pidgin_status_display_new(void) {
- return g_object_new(PIDGIN_TYPE_STATUS_DISPLAY, NULL);
-}
-
-GtkWidget *
-pidgin_status_display_new_for_primitive(PurpleStatusPrimitive primitive) {
- return g_object_new(PIDGIN_TYPE_STATUS_DISPLAY,
- "primitive", primitive,
- NULL);
-}
-
-GtkWidget *
-pidgin_status_display_new_for_saved_status(PurpleSavedStatus *status) {
- return g_object_new(PIDGIN_TYPE_STATUS_DISPLAY,
- "saved-status", status,
- NULL);
-}
-
-PurpleStatusPrimitive
-pidgin_status_display_get_primitive(PidginStatusDisplay *display) {
- g_return_val_if_fail(PIDGIN_IS_STATUS_DISPLAY(display),
- PURPLE_STATUS_UNSET);
-
- return display->primitive;
-}
-
-void
-pidgin_status_display_set_primitive(PidginStatusDisplay *display,
- PurpleStatusPrimitive primitive)
-{
- g_return_if_fail(PIDGIN_IS_STATUS_DISPLAY(display));
-
- g_object_freeze_notify(G_OBJECT(display));
-
- display->status = NULL;
- g_object_notify_by_pspec(G_OBJECT(display), properties[PROP_SAVED_STATUS]);
-
- if(display->primitive != primitive) {
- display->primitive = primitive;
- g_object_notify_by_pspec(G_OBJECT(display),
- properties[PROP_PRIMITIVE]);
- }
-
- pidgin_status_display_refresh(display);
-
- g_object_thaw_notify(G_OBJECT(display));
-}
-
-PurpleSavedStatus *
-pidgin_status_display_get_saved_status(PidginStatusDisplay *display) {
- g_return_val_if_fail(PIDGIN_IS_STATUS_DISPLAY(display), NULL);
-
- return display->status;
-}
-
-void
-pidgin_status_display_set_saved_status(PidginStatusDisplay *display,
- PurpleSavedStatus *status)
-{
- g_return_if_fail(PIDGIN_IS_STATUS_DISPLAY(display));
-
- g_object_freeze_notify(G_OBJECT(display));
-
- display->primitive = PURPLE_STATUS_UNSET;
- g_object_notify_by_pspec(G_OBJECT(display), properties[PROP_PRIMITIVE]);
-
- if(display->status != status) {
- display->status = status;
- g_object_notify_by_pspec(G_OBJECT(display),
- properties[PROP_SAVED_STATUS]);
- }
-
- pidgin_status_display_refresh(display);
-
- g_object_thaw_notify(G_OBJECT(display));
-}
--- a/pidgin/pidginstatusdisplay.h Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * 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_STATUS_DISPLAY_H
-#define PIDGIN_STATUS_DISPLAY_H
-
-#include <gtk/gtk.h>
-
-#include <purple.h>
-
-#include "pidginversion.h"
-
-G_BEGIN_DECLS
-
-#define PIDGIN_TYPE_STATUS_DISPLAY (pidgin_status_display_get_type())
-
-PIDGIN_AVAILABLE_IN_3_0
-G_DECLARE_FINAL_TYPE(PidginStatusDisplay, pidgin_status_display,
- PIDGIN, STATUS_DISPLAY, GtkBox)
-
-/**
- * pidgin_status_display_new:
- *
- * Creates a display for a status.
- *
- * Returns: (transfer full): The status display.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_display_new(void);
-
-/**
- * pidgin_status_display_new_for_primitive:
- * @primitive: The status primitive to display.
- *
- * Creates a display for a status primitive.
- *
- * Returns: (transfer full): The status display.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_display_new_for_primitive(PurpleStatusPrimitive primitive);
-
-/**
- * pidgin_status_display_new_for_saved_status:
- * @status: The status to display.
- *
- * Creates a display for a saved status.
- *
- * Returns: (transfer full): The status display.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_display_new_for_saved_status(PurpleSavedStatus *status);
-
-/**
- * pidgin_status_display_get_primitive:
- * @display: The display.
- *
- * Gets the currently displayed status primitive.
- *
- * Returns: (transfer none): Returns the [type@Purple.StatusPrimitive] that is
- * currently displayed.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-PurpleStatusPrimitive pidgin_status_display_get_primitive(PidginStatusDisplay *display);
-
-/**
- * pidgin_status_display_set_primitive:
- * @display: The display.
- * @primitive: The status primitive to display.
- *
- * Sets the currently displayed status primitive.
- *
- * If a saved status was previously set, it will be unset.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-void pidgin_status_display_set_primitive(PidginStatusDisplay *display, PurpleStatusPrimitive primitive);
-
-/**
- * pidgin_status_display_get_saved_status:
- * @display: The display.
- *
- * Gets the currently displayed saved status.
- *
- * Returns: (transfer none): Returns the [type@Purple.SavedStatus] that is
- * currently displayed.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-PurpleSavedStatus *pidgin_status_display_get_saved_status(PidginStatusDisplay *display);
-
-/**
- * pidgin_status_display_set_saved_status:
- * @display: The display.
- * @status: The saved status to display.
- *
- * Sets the currently displayed saved status.
- *
- * If a status primitive was previously set, it will be unset.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-void pidgin_status_display_set_saved_status(PidginStatusDisplay *display, PurpleSavedStatus *status);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STATUS_DISPLAY_H */
--- a/pidgin/pidginstatuseditor.c Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +0,0 @@
-/*
- * 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 "pidginstatuseditor.h"
-
-#include "pidginstatusprimitivechooser.h"
-
-enum {
- PROP_0,
- PROP_STATUS,
- N_PROPERTIES
-};
-static GParamSpec *properties[N_PROPERTIES] = {NULL, };
-
-enum {
- RESPONSE_USE,
- RESPONSE_SAVE
-};
-
-struct _PidginStatusEditor {
- GtkDialog parent;
-
- PurpleSavedStatus *status;
-
- GtkTextBuffer *buffer;
-
- GtkWidget *title;
- GtkWidget *primitive;
-};
-
-G_DEFINE_TYPE(PidginStatusEditor, pidgin_status_editor, GTK_TYPE_DIALOG)
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static void
-pidgin_status_editor_set_status(PidginStatusEditor *editor,
- PurpleSavedStatus *status)
-{
- PurpleStatusPrimitive primitive;
- PidginStatusPrimitiveChooser *chooser = NULL;
- const gchar *title = NULL, *message = NULL;
-
- editor->status = status;
-
- if(editor->status != NULL) {
- title = purple_savedstatus_get_title(editor->status);
- primitive = purple_savedstatus_get_primitive_type(editor->status);
- message = purple_savedstatus_get_message(editor->status);
- } else {
- primitive = PURPLE_STATUS_AWAY;
- }
-
- if(title == NULL) {
- title = "";
- }
-
- if(message == NULL) {
- message = "";
- }
-
- gtk_editable_set_text(GTK_EDITABLE(editor->title), title);
- chooser = PIDGIN_STATUS_PRIMITIVE_CHOOSER(editor->primitive);
- pidgin_status_primitive_chooser_set_selected(chooser, primitive);
- gtk_text_buffer_set_text(editor->buffer, message, -1);
-
- g_object_notify_by_pspec(G_OBJECT(editor), properties[PROP_STATUS]);
-}
-
-static void
-pidgin_status_editor_save_status(PidginStatusEditor *editor) {
- PidginStatusPrimitiveChooser *chooser = NULL;
- PurpleStatusPrimitive primitive;
- GtkTextIter start;
- GtkTextIter end;
- gchar *message = NULL;
- const gchar *title = NULL;
-
- title = gtk_editable_get_text(GTK_EDITABLE(editor->title));
-
- chooser = PIDGIN_STATUS_PRIMITIVE_CHOOSER(editor->primitive);
- primitive = pidgin_status_primitive_chooser_get_selected(chooser);
-
- gtk_text_buffer_get_start_iter(editor->buffer, &start);
- gtk_text_buffer_get_end_iter(editor->buffer, &end);
- message = gtk_text_buffer_get_text(editor->buffer, &start, &end, FALSE);
-
- if(editor->status == NULL) {
- editor->status = purple_savedstatus_new(title, primitive);
- } else {
- const gchar *current_title = NULL;
-
- /* purple_savedstatus_set_title throws a warning if you try to save a
- * status with an existing title, which means we can't just save the
- * title if it hasn't changed.
- */
- current_title = purple_savedstatus_get_title(editor->status);
- if(!purple_strequal(title, current_title)) {
- purple_savedstatus_set_title(editor->status, title);
- }
-
- purple_savedstatus_set_primitive_type(editor->status, primitive);
- }
-
- purple_savedstatus_set_message(editor->status, message);
-
- g_free(message);
-}
-
-/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static void
-pidgin_status_editor_response_cb(GtkDialog *dialog, gint response_id,
- gpointer data)
-{
- PidginStatusEditor *editor = data;
-
- switch(response_id) {
- case RESPONSE_USE:
- pidgin_status_editor_save_status(editor);
- purple_savedstatus_activate(editor->status);
- break;
- case RESPONSE_SAVE:
- pidgin_status_editor_save_status(editor);
- break;
- }
-
- gtk_window_destroy(GTK_WINDOW(dialog));
-}
-
-static void
-pidgin_status_editor_title_changed_cb(G_GNUC_UNUSED GtkEditable *editable,
- gpointer data)
-{
- PidginStatusEditor *editor = data;
- gboolean title_changed = FALSE, sensitive = FALSE;
- const gchar *title = NULL;
-
- title = gtk_editable_get_text(GTK_EDITABLE(editor->title));
-
- if(editor->status != NULL) {
- /* If we're editing a status, check if the title is the same. */
- title_changed = !purple_strequal(title,
- purple_savedstatus_get_title(editor->status));
- } else {
- /* If this is a new status, check if the title is empty or not. */
- title_changed = !purple_strequal(title, "");
- }
-
- if(title_changed) {
- gboolean duplicated = purple_savedstatus_find(title) != NULL;
-
- if(duplicated) {
- gtk_dialog_set_response_sensitive(GTK_DIALOG(editor),
- RESPONSE_USE, FALSE);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(editor),
- RESPONSE_SAVE, FALSE);
-
- return;
- }
- }
-
- sensitive = !purple_strequal(title, "");
-
- gtk_dialog_set_response_sensitive(GTK_DIALOG(editor), RESPONSE_USE,
- sensitive);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(editor), RESPONSE_SAVE,
- sensitive);
-}
-
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-static void
-pidgin_status_editor_get_property(GObject *obj, guint param_id, GValue *value,
- GParamSpec *pspec)
-{
- PidginStatusEditor *editor = PIDGIN_STATUS_EDITOR(obj);
-
- switch(param_id) {
- case PROP_STATUS:
- g_value_set_pointer(value,
- pidgin_status_editor_get_status(editor));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-pidgin_status_editor_set_property(GObject *obj, guint param_id,
- const GValue *value, GParamSpec *pspec)
-{
- PidginStatusEditor *editor = PIDGIN_STATUS_EDITOR(obj);
-
- switch(param_id) {
- case PROP_STATUS:
- pidgin_status_editor_set_status(editor,
- g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
- break;
- }
-}
-
-static void
-pidgin_status_editor_init(PidginStatusEditor *manager) {
- gtk_widget_init_template(GTK_WIDGET(manager));
-}
-
-static void
-pidgin_status_editor_class_init(PidginStatusEditorClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-
- obj_class->get_property = pidgin_status_editor_get_property;
- obj_class->set_property = pidgin_status_editor_set_property;
-
- /**
- * PidginStatusEditor:status:
- *
- * The [type@Purple.SavedStatus] that this editor is responsible for.
- * This may be %NULL if it is creating a new status.
- *
- * Since: 3.0.0.
- */
- /* we don't used boxed here because of the way status are currently
- * managed.
- */
- properties[PROP_STATUS] = g_param_spec_pointer(
- "status", "status",
- "The saved status we're editing",
- 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/Status/editor.ui"
- );
-
- gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
- buffer);
-
- gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
- title);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusEditor,
- primitive);
-
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_editor_response_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_editor_title_changed_cb);
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkWidget *
-pidgin_status_editor_new(PurpleSavedStatus *status) {
- return g_object_new(
- PIDGIN_TYPE_STATUS_EDITOR,
- "status", status,
- NULL);
-}
-
-PurpleSavedStatus *
-pidgin_status_editor_get_status(PidginStatusEditor *editor) {
- g_return_val_if_fail(PIDGIN_IS_STATUS_EDITOR(editor), NULL);
-
- return editor->status;
-}
--- a/pidgin/pidginstatuseditor.h Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * 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_STATUS_EDITOR_H
-#define PIDGIN_STATUS_EDITOR_H
-
-#include <gtk/gtk.h>
-
-#include <purple.h>
-
-#include "pidginversion.h"
-
-G_BEGIN_DECLS
-
-/**
- * PidginStatusEditor:
- *
- * A dialog for editing statuses.
- */
-
-#define PIDGIN_TYPE_STATUS_EDITOR (pidgin_status_editor_get_type())
-
-PIDGIN_AVAILABLE_IN_3_0
-G_DECLARE_FINAL_TYPE(PidginStatusEditor, pidgin_status_editor, PIDGIN,
- STATUS_EDITOR, GtkDialog)
-
-/**
- * pidgin_status_editor_new:
- * @status: (transfer none) (nullable): The [type@Purple.SavedStatus] to edit.
- *
- * Creates a new instance of the dialog. You can pass %NULL for @status to
- * create a new status with the dialog.
- *
- * Returns: (transfer full): The new #PidginStatusEditor instance.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_editor_new(PurpleSavedStatus *status);
-
-/**
- * pidgin_status_editor_get_status:
- * @editor: The editor instance.
- *
- * Gets the [type@Purple.SavedStatus] that @editor was created for. This can
- * be %NULL if a new status is being created.
- *
- * Returns: (transfer none): The status.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-PurpleSavedStatus *pidgin_status_editor_get_status(PidginStatusEditor *editor);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STATUS_EDITOR_H */
--- a/pidgin/pidginstatusmanager.c Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,421 +0,0 @@
-/*
- * 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 "pidginstatusmanager.h"
-
-#include "pidginiconname.h"
-#include "pidginstatuseditor.h"
-
-enum {
- RESPONSE_USE,
- RESPONSE_ADD,
- RESPONSE_MODIFY,
- RESPONSE_REMOVE
-};
-
-enum {
- COLUMN_TITLE,
- COLUMN_ICON_NAME,
- COLUMN_TYPE,
- COLUMN_MESSAGE,
- COLUMN_STATUS,
- COLUMN_EDITOR
-};
-
-struct _PidginStatusManager {
- GtkDialog parent;
-
- GListStore *model;
- GtkSingleSelection *selection;
-
- GtkWidget *use_button;
- GtkWidget *modify_button;
- GtkWidget *remove_button;
-};
-
-G_DEFINE_TYPE(PidginStatusManager, pidgin_status_manager, GTK_TYPE_DIALOG)
-
-/* Ugh, prototypes :,( */
-static void pidgin_status_editor_destroy_cb(GtkWidget *widget, gpointer data);
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static void
-pidgin_status_manager_show_editor(PidginStatusManager *manager) {
- GObject *wrapper = NULL;
- PurpleSavedStatus *status = NULL;
- GtkWidget *editor = NULL;
-
- wrapper = gtk_single_selection_get_selected_item(manager->selection);
- status = g_object_get_data(wrapper, "savedstatus");
- editor = g_object_get_data(wrapper, "editor");
-
- if(status == NULL) {
- return;
- }
-
- if(!PIDGIN_IS_STATUS_EDITOR(editor)) {
- editor = pidgin_status_editor_new(status);
-
- gtk_window_set_transient_for(GTK_WINDOW(editor), GTK_WINDOW(manager));
-
- g_object_set_data(wrapper, "editor", editor);
- g_signal_connect_object(editor, "destroy",
- G_CALLBACK(pidgin_status_editor_destroy_cb),
- manager, 0);
-
- gtk_widget_set_visible(editor, TRUE);
- } else {
- gtk_window_present_with_time(GTK_WINDOW(editor), GDK_CURRENT_TIME);
- }
-}
-
-static void
-pidgin_status_manager_remove_selected(PidginStatusManager *manager) {
- GObject *wrapper = NULL;
- PurpleSavedStatus *status = NULL;
- GtkWidget *editor = NULL;
-
- wrapper = gtk_single_selection_get_selected_item(manager->selection);
- status = g_object_get_data(wrapper, "savedstatus");
- editor = g_object_get_data(wrapper, "editor");
-
- if(GTK_IS_WIDGET(editor)) {
- gtk_window_destroy(GTK_WINDOW(editor));
- }
-
- purple_savedstatus_delete_by_status(status);
-}
-
-static PurpleSavedStatus *
-pidgin_status_manager_get_selected_status(PidginStatusManager *manager) {
- GObject *wrapper = NULL;
- PurpleSavedStatus *status = NULL;
-
- wrapper = gtk_single_selection_get_selected_item(manager->selection);
- status = g_object_get_data(wrapper, "savedstatus");
-
- return status;
-}
-
-static void
-pidgin_status_manager_add(PidginStatusManager *manager,
- PurpleSavedStatus *status)
-{
- GObject *wrapper = NULL;
- PurpleStatusPrimitive primitive;
- gchar *message = NULL;
- const char *type = NULL;
-
- message = purple_markup_strip_html(purple_savedstatus_get_message(status));
-
- primitive = purple_savedstatus_get_primitive_type(status);
- type = purple_primitive_get_name_from_type(primitive);
-
- /* PurpleSavedStatus is a boxed type, so it can't be put in a GListModel;
- * instead create a wrapper GObject instance to hold its information. */
- wrapper = g_object_new(G_TYPE_OBJECT, NULL);
- g_object_set_data(wrapper, "savedstatus", status);
- g_object_set_data_full(wrapper, "title",
- g_strdup(purple_savedstatus_get_title(status)),
- g_free);
- g_object_set_data_full(wrapper, "type", g_strdup(type), g_free);
- g_object_set_data_full(wrapper, "message", g_strdup(message), g_free);
-
- g_list_store_append(manager->model, wrapper);
-
- g_free(message);
- g_object_unref(wrapper);
-}
-
-static void
-pidgin_status_manager_populate_helper(gpointer data, gpointer user_data) {
- PidginStatusManager *manager = user_data;
- PurpleSavedStatus *status = data;
-
- if(!purple_savedstatus_is_transient(status)) {
- pidgin_status_manager_add(manager, status);
- }
-}
-
-static void
-pidgin_status_manager_refresh(PidginStatusManager *manager) {
- GList *statuses = NULL;
-
- g_list_store_remove_all(manager->model);
-
- statuses = purple_savedstatuses_get_all();
- g_list_foreach(statuses, pidgin_status_manager_populate_helper, manager);
-}
-
-/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static void
-pidgin_status_manager_response_cb(GtkDialog *dialog, gint response_id,
- gpointer data)
-{
- PidginStatusManager *manager = data;
- PurpleSavedStatus *status = NULL;
- GtkWidget *editor = NULL;
-
- switch(response_id) {
- case RESPONSE_USE:
- status = pidgin_status_manager_get_selected_status(manager);
-
- purple_savedstatus_activate(status);
-
- break;
- case RESPONSE_ADD:
- editor = pidgin_status_editor_new(NULL);
- gtk_window_set_transient_for(GTK_WINDOW(editor),
- GTK_WINDOW(manager));
- gtk_widget_set_visible(editor, TRUE);
- break;
- case RESPONSE_MODIFY:
- pidgin_status_manager_show_editor(manager);
-
- break;
- case RESPONSE_REMOVE:
- pidgin_status_manager_remove_selected(manager);
- break;
- case GTK_RESPONSE_CLOSE:
- case GTK_RESPONSE_DELETE_EVENT:
- gtk_window_destroy(GTK_WINDOW(dialog));
- break;
- }
-}
-
-static PurpleStatusPrimitive
-pidgin_status_manager_lookup_primitive_cb(G_GNUC_UNUSED GObject *self,
- GObject *wrapper,
- G_GNUC_UNUSED gpointer data)
-{
- PurpleStatusPrimitive primitive = PURPLE_STATUS_UNSET;
-
- if(G_IS_OBJECT(wrapper)) {
- PurpleSavedStatus *status = g_object_get_data(wrapper, "savedstatus");
- primitive = purple_savedstatus_get_primitive_type(status);
- }
-
- return primitive;
-}
-
-static char *
-pidgin_status_manager_sort_data_cb(GObject *wrapper, const char *name,
- G_GNUC_UNUSED gpointer data)
-{
- const char *value = NULL;
-
- if(G_IS_OBJECT(wrapper)) {
- value = g_object_get_data(wrapper, name);
- }
-
- /* NOTE: Most GTK widget properties don't care if you return NULL, but the
- * GtkStringSorter does some string comparisons without checking for NULL,
- * so we need to ensure that non-NULL is returned to prevent runtime
- * warnings. */
- return g_strdup(value ? value : "");
-}
-
-/* A closure from within a GtkBuilderListItemFactory passes an extra first
- * argument, so we need to drop that to re-use the above callback. */
-static char *
-pidgin_status_manager_lookup_text_data_cb(G_GNUC_UNUSED GObject *self,
- GObject *wrapper, const char *name,
- gpointer data)
-{
- return pidgin_status_manager_sort_data_cb(wrapper, name, data);
-}
-
-static void
-pidgin_status_manager_row_activated_cb(G_GNUC_UNUSED GtkColumnView *self,
- guint position, gpointer data)
-{
- PidginStatusManager *manager = data;
-
- gtk_single_selection_set_selected(manager->selection, position);
- pidgin_status_manager_show_editor(manager);
-}
-
-static void
-pidgin_status_manager_selection_changed_cb(G_GNUC_UNUSED GObject *object,
- G_GNUC_UNUSED GParamSpec *pspec,
- gpointer data)
-{
- PidginStatusManager *manager = data;
- gboolean sensitive = TRUE;
-
- if(g_list_model_get_n_items(G_LIST_MODEL(manager->model)) == 0) {
- sensitive = FALSE;
- }
-
- gtk_widget_set_sensitive(manager->use_button, sensitive);
- gtk_widget_set_sensitive(manager->modify_button, sensitive);
-
- /* Only enable the remove button if the currently selected row is not the
- * currently active status.
- */
- if(sensitive) {
- PurpleSavedStatus *status = NULL;
-
- status = pidgin_status_manager_get_selected_status(manager);
-
- sensitive = status != purple_savedstatus_get_current();
- }
-
- gtk_widget_set_sensitive(manager->remove_button, sensitive);
-}
-
-static void
-pidgin_status_manager_savedstatus_changed_cb(PurpleSavedStatus *new_status,
- G_GNUC_UNUSED PurpleSavedStatus *old_status,
- gpointer data)
-{
- PidginStatusManager *manager = data;
- PurpleSavedStatus *selected = NULL;
-
- /* Disable the remove button if the selected status is the currently active
- * status.
- */
- selected = pidgin_status_manager_get_selected_status(manager);
- if(selected != NULL) {
- gboolean sensitive = selected != new_status;
-
- gtk_widget_set_sensitive(manager->remove_button, sensitive);
- }
-}
-
-static void
-pidgin_status_manager_savedstatus_updated_cb(G_GNUC_UNUSED PurpleSavedStatus *status,
- gpointer data)
-{
- PidginStatusManager *manager = data;
-
- pidgin_status_manager_refresh(manager);
-}
-
-static void
-pidgin_status_editor_destroy_cb(GtkWidget *widget, gpointer data) {
- PidginStatusManager *manager = data;
- GListModel *model = G_LIST_MODEL(manager->model);
- guint n_items = 0;
-
- n_items = g_list_model_get_n_items(model);
- for(guint index = 0; index < n_items; index++) {
- GObject *wrapper = NULL;
- GtkWidget *editor = NULL;
-
- wrapper = g_list_model_get_item(model, index);
- editor = g_object_get_data(wrapper, "editor");
-
- /* Check if editor is the widget being destroyed. */
- if(editor == widget) {
- /* It is, so set it back to NULL to remove it from the wrapper. */
- g_object_set_data(wrapper, "editor", NULL);
- g_object_unref(wrapper);
-
- break;
- }
-
- g_object_unref(wrapper);
- }
-}
-
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-static void
-pidgin_status_manager_finalize(GObject *obj) {
- purple_signals_disconnect_by_handle(obj);
-
- G_OBJECT_CLASS(pidgin_status_manager_parent_class)->finalize(obj);
-}
-
-static void
-pidgin_status_manager_init(PidginStatusManager *manager) {
- gpointer handle = NULL;
-
- gtk_widget_init_template(GTK_WIDGET(manager));
-
- pidgin_status_manager_refresh(manager);
-
- handle = purple_savedstatuses_get_handle();
- purple_signal_connect(handle, "savedstatus-changed", manager,
- G_CALLBACK(pidgin_status_manager_savedstatus_changed_cb),
- manager);
- purple_signal_connect(handle, "savedstatus-added", manager,
- G_CALLBACK(pidgin_status_manager_savedstatus_updated_cb),
- manager);
- purple_signal_connect(handle, "savedstatus-deleted", manager,
- G_CALLBACK(pidgin_status_manager_savedstatus_updated_cb),
- manager);
- purple_signal_connect(handle, "savedstatus-modified", manager,
- G_CALLBACK(pidgin_status_manager_savedstatus_updated_cb),
- manager);
-}
-
-static void
-pidgin_status_manager_class_init(PidginStatusManagerClass *klass) {
- GObjectClass *obj_class = G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-
- obj_class->finalize = pidgin_status_manager_finalize;
-
- gtk_widget_class_set_template_from_resource(
- widget_class,
- "/im/pidgin/Pidgin3/Status/manager.ui"
- );
-
- gtk_widget_class_bind_template_child(widget_class, PidginStatusManager,
- model);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusManager,
- selection);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusManager,
- use_button);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusManager,
- modify_button);
- gtk_widget_class_bind_template_child(widget_class, PidginStatusManager,
- remove_button);
-
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_response_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_lookup_primitive_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_lookup_text_data_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_sort_data_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_row_activated_cb);
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_manager_selection_changed_cb);
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkWidget *
-pidgin_status_manager_new(void) {
- return g_object_new(PIDGIN_TYPE_STATUS_MANAGER, NULL);
-}
--- a/pidgin/pidginstatusmanager.h Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * 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_STATUS_MANAGER_H
-#define PIDGIN_STATUS_MANAGER_H
-
-#include <gtk/gtk.h>
-
-#include <purple.h>
-
-#include "pidginversion.h"
-
-G_BEGIN_DECLS
-
-/**
- * PidginStatusManager:
- *
- * A dialog for managing statuses.
- *
- * Since: 3.0.0
- */
-
-#define PIDGIN_TYPE_STATUS_MANAGER (pidgin_status_manager_get_type())
-
-PIDGIN_AVAILABLE_IN_3_0
-G_DECLARE_FINAL_TYPE(PidginStatusManager, pidgin_status_manager, PIDGIN,
- STATUS_MANAGER, GtkDialog)
-
-/**
- * pidgin_status_manager_new:
- *
- * Creates a new instance of the dialog.
- *
- * Returns: (transfer full): The new #PidginStatusManager instance.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_manager_new(void);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STATUS_MANAGER_H */
--- a/pidgin/pidginstatusprimitivechooser.c Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * 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 "pidginstatusprimitivechooser.h"
-
-#include "pidginiconname.h"
-
-struct _PidginStatusPrimitiveChooser {
- AdwComboRow parent;
-};
-
-G_DEFINE_TYPE(PidginStatusPrimitiveChooser, pidgin_status_primitive_chooser,
- ADW_TYPE_COMBO_ROW)
-
-/******************************************************************************
- * Callbacks
- *****************************************************************************/
-static PurpleStatusPrimitive
-pidgin_status_primitive_chooser_primitive_cb(G_GNUC_UNUSED GObject *self,
- GtkStringObject *object,
- G_GNUC_UNUSED gpointer data)
-{
- PurpleStatusPrimitive primitive = PURPLE_STATUS_UNSET;
-
- if(GTK_IS_STRING_OBJECT(object)) {
- const char *value = gtk_string_object_get_string(object);
- primitive = purple_primitive_get_type_from_id(value);
- }
-
- return primitive;
-}
-
-/******************************************************************************
- * GObject Implementation
- *****************************************************************************/
-static void
-pidgin_status_primitive_chooser_init(PidginStatusPrimitiveChooser *chooser) {
- gtk_widget_init_template(GTK_WIDGET(chooser));
-}
-
-static void
-pidgin_status_primitive_chooser_class_init(PidginStatusPrimitiveChooserClass *klass) {
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
-
- /* Widget template */
- gtk_widget_class_set_template_from_resource(
- widget_class, "/im/pidgin/Pidgin3/statusprimitivechooser.ui");
-
- gtk_widget_class_bind_template_callback(widget_class,
- pidgin_status_primitive_chooser_primitive_cb);
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-GtkWidget *
-pidgin_status_primitive_chooser_new(void) {
- return g_object_new(PIDGIN_TYPE_STATUS_PRIMITIVE_CHOOSER, NULL);
-}
-
-PurpleStatusPrimitive
-pidgin_status_primitive_chooser_get_selected(PidginStatusPrimitiveChooser *chooser) {
- GtkStringObject *selected = NULL;
- const char *value = NULL;
-
- g_return_val_if_fail(PIDGIN_IS_STATUS_PRIMITIVE_CHOOSER(chooser),
- PURPLE_STATUS_UNSET);
-
- selected = adw_combo_row_get_selected_item(ADW_COMBO_ROW(chooser));
- value = gtk_string_object_get_string(selected);
-
- return purple_primitive_get_type_from_id(value);
-}
-
-void
-pidgin_status_primitive_chooser_set_selected(PidginStatusPrimitiveChooser *chooser,
- PurpleStatusPrimitive primitive)
-{
- GListModel *model = NULL;
- GtkStringList *list = NULL;
-
- g_return_if_fail(PIDGIN_IS_STATUS_PRIMITIVE_CHOOSER(chooser));
-
- model = adw_combo_row_get_model(ADW_COMBO_ROW(chooser));
- list = GTK_STRING_LIST(model);
- for(guint i = 0; i < g_list_model_get_n_items(model); i++) {
- PurpleStatusPrimitive candidate = PURPLE_STATUS_UNSET;
- const char *value = NULL;
-
- value = gtk_string_list_get_string(list, i);
- candidate = purple_primitive_get_type_from_id(value);
-
- if(primitive == candidate) {
- adw_combo_row_set_selected(ADW_COMBO_ROW(chooser), i);
- break;
- }
- }
-}
--- a/pidgin/pidginstatusprimitivechooser.h Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * 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_STATUS_PRIMITIVE_CHOOSER_H
-#define PIDGIN_STATUS_PRIMITIVE_CHOOSER_H
-
-#include <gtk/gtk.h>
-
-#include <adwaita.h>
-
-#include <purple.h>
-
-#include "pidginversion.h"
-
-G_BEGIN_DECLS
-
-/**
- * PidginStatusPrimitiveChooser:
- *
- * A [class@Adw.ComboRow] for presenting [enum@Purple.StatusPrimitive]'s to a
- * user.
- *
- * Since: 3.0.0
- */
-
-#define PIDGIN_TYPE_STATUS_PRIMITIVE_CHOOSER (pidgin_status_primitive_chooser_get_type())
-
-PIDGIN_AVAILABLE_IN_3_0
-G_DECLARE_FINAL_TYPE(PidginStatusPrimitiveChooser,
- pidgin_status_primitive_chooser, PIDGIN,
- STATUS_PRIMITIVE_CHOOSER, AdwComboRow)
-
-/**
- * pidgin_status_primitive_chooser_new:
- *
- * Creates a new combo box that contains all of the available status
- * primitives in purple.
- *
- * Returns: (transfer full): The new combo box.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-GtkWidget *pidgin_status_primitive_chooser_new(void);
-
-/**
- * pidgin_status_primitive_chooser_get_selected:
- * @chooser: The instance.
- *
- * Gets the [enum@Purple.StatusPrimitive] that is selected.
- *
- * Returns: The selected primitive status.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-PurpleStatusPrimitive pidgin_status_primitive_chooser_get_selected(PidginStatusPrimitiveChooser *chooser);
-
-/**
- * pidgin_status_primitive_chooser_set_selected:
- * @chooser: The instance.
- * @primitive: The [enum@Purple.StatusPrimitive] to set.
- *
- * Sets @primitive as the active item.
- *
- * Since: 3.0.0
- */
-PIDGIN_AVAILABLE_IN_3_0
-void pidgin_status_primitive_chooser_set_selected(PidginStatusPrimitiveChooser *chooser, PurpleStatusPrimitive primitive);
-
-G_END_DECLS
-
-#endif /* PIDGIN_STATUS_PRIMITIVE_CHOOSER_H */
--- a/pidgin/resources/Display/window.ui Tue Nov 28 01:15:51 2023 -0600
+++ b/pidgin/resources/Display/window.ui Thu Nov 30 21:33:32 2023 -0600
@@ -100,9 +100,6 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="PidginStatusBox"/>
- </child>
- <child>
<object class="GtkScrolledWindow">
<property name="vexpand">1</property>
<property name="focusable">1</property>
--- a/pidgin/resources/Status/box.ui Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-<?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 Lesser General Public
-License along with this library; if not, see <https://www.gnu.org/licenses/>.
-
--->
-<interface>
- <requires lib="gtk" version="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Pidgin -->
- <!-- interface-description Internet Messenger -->
- <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <template class="PidginStatusBox" parent="GtkBox">
- <property name="focusable">1</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkMenuButton" id="button">
- <property name="focusable">1</property>
- <property name="always-show-arrow">1</property>
- <property name="child">
- <object class="PidginStatusDisplay" id="display"/>
- </property>
- <property name="menu-model">menu</property>
- </object>
- </child>
- </template>
- <menu id="menu">
- <section id="primitives">
- <!-- NOTE: labels are automatically set for primitives from the target primitive. -->
- <item>
- <attribute name="action">status.set-primitive</attribute>
- <attribute name="target">available</attribute>
- <attribute name="custom">available</attribute>
- </item>
- <item>
- <attribute name="action">status.set-primitive</attribute>
- <attribute name="target">away</attribute>
- <attribute name="custom">away</attribute>
- </item>
- <item>
- <attribute name="action">status.set-primitive</attribute>
- <attribute name="target">unavailable</attribute>
- <attribute name="custom">unavailable</attribute>
- </item>
- <item>
- <attribute name="action">status.set-primitive</attribute>
- <attribute name="target">invisible</attribute>
- <attribute name="custom">invisible</attribute>
- </item>
- <item>
- <attribute name="action">status.set-primitive</attribute>
- <attribute name="target">offline</attribute>
- <attribute name="custom">offline</attribute>
- </item>
- </section>
- <section id="saved_statuses"/>
- <section id="actions">
- <item>
- <attribute name="label" translatable="1">New Status...</attribute>
- <attribute name="action">app.new-status</attribute>
- </item>
- <item>
- <attribute name="label" translatable="1">Saved Statuses...</attribute>
- <attribute name="action">app.status-manager</attribute>
- </item>
- </section>
- </menu>
-</interface>
--- a/pidgin/resources/Status/display.ui Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-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 Lesser General Public
-License along with this library; if not, see <https://www.gnu.org/licenses/>.
-
--->
-<interface>
- <requires lib="gtk" version="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Pidgin -->
- <!-- interface-description Internet Messenger -->
- <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <template class="PidginStatusDisplay" parent="GtkBox">
- <property name="css-classes">body</property>
- <property name="orientation">horizontal</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkImage" id="image"/>
- </child>
- <child>
- <object class="GtkLabel" id="label"/>
- </child>
- </template>
-</interface>
--- a/pidgin/resources/Status/editor.ui Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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 library; if not, see <https://www.gnu.org/licenses/>.
--->
-<interface>
- <requires lib="gtk" version="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Pidgin -->
- <!-- interface-description Internet Messenger -->
- <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <template class="PidginStatusEditor" parent="GtkDialog">
- <property name="title" translatable="1">Status</property>
- <property name="destroy-with-parent">1</property>
- <property name="resizable">0</property>
- <signal name="response" handler="pidgin_status_editor_response_cb" swapped="no"/>
- <child internal-child="content_area">
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <child>
- <object class="AdwPreferencesGroup">
- <property name="margin-start">24</property>
- <property name="margin-end">24</property>
- <property name="margin-top">24</property>
- <property name="margin-bottom">24</property>
- <child>
- <object class="AdwEntryRow" id="title">
- <property name="title" translatable="1">_Title</property>
- <property name="use-underline">1</property>
- <signal name="changed" handler="pidgin_status_editor_title_changed_cb"/>
- </object>
- </child>
- <child>
- <object class="PidginStatusPrimitiveChooser" id="primitive">
- <property name="title" translatable="1">St_atus</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child>
- <object class="AdwPreferencesRow">
- <property name="focusable">0</property>
- <child>
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel">
- <property name="css-classes">subtitle</property>
- <property name="label" translatable="1">_Message</property>
- <property name="mnemonic-widget">message</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="xalign">0</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child>
- <object class="GtkScrolledWindow">
- <property name="hexpand">1</property>
- <property name="hscrollbar_policy">never</property>
- <child>
- <object class="GtkTextView" id="message">
- <property name="buffer">
- <object class="GtkTextBuffer" id="buffer"/>
- </property>
- <property name="hexpand">1</property>
- <property name="width-request">450</property>
- <property name="wrap-mode">word</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="cancel">
- <property name="label" translatable="1">_Cancel</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="use">
- <property name="label" translatable="1">_Use</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="sensitive">0</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="save">
- <property name="label" translatable="1">_Save</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="sensitive">0</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <action-widgets>
- <action-widget response="cancel">cancel</action-widget>
- <action-widget response="0">use</action-widget>
- <action-widget response="1">save</action-widget>
- </action-widgets>
- </template>
-</interface>
--- a/pidgin/resources/Status/manager.ui Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,231 +0,0 @@
-<?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 Lesser General Public
-License along with this library; if not, see <https://www.gnu.org/licenses/>.
-
--->
-<interface>
- <requires lib="gtk" version="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Pidgin -->
- <!-- interface-description Internet Messenger -->
- <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <template class="PidginStatusManager" parent="GtkDialog">
- <property name="title" translatable="1">Saved Statuses</property>
- <property name="default-width">550</property>
- <property name="default-height">250</property>
- <signal name="response" handler="pidgin_status_manager_response_cb" swapped="no"/>
- <child internal-child="content_area">
- <object class="GtkScrolledWindow">
- <property name="vexpand">1</property>
- <property name="focusable">1</property>
- <child>
- <object class="GtkColumnView" id="columnview">
- <property name="focusable">1</property>
- <property name="model">
- <object class="GtkSingleSelection" id="selection">
- <property name="model">
- <object class="GtkSortListModel">
- <property name="model">
- <object class="GListStore" id="model">
- <property name="item-type">GObject</property>
- </object>
- </property>
- <binding name="sorter">
- <lookup name="sorter">columnview</lookup>
- </binding>
- </object>
- </property>
- <signal name="notify::selected" handler="pidgin_status_manager_selection_changed_cb" swapped="no"/>
- </object>
- </property>
- <property name="vexpand">1</property>
- <signal name="activate" handler="pidgin_status_manager_row_activated_cb" swapped="no"/>
- <child>
- <object class="GtkColumnViewColumn">
- <property name="resizable">1</property>
- <property name="title" translatable="1">Title</property>
- <property name="factory">
- <object class="GtkBuilderListItemFactory">
- <property name="bytes">
-<![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <template class="GtkListItem">
- <property name="child">
- <object class="GtkLabel">
- <property name="ellipsize">end</property>
- <property name="xalign">0</property>
- <binding name="label">
- <closure type="gchararray" function="pidgin_status_manager_lookup_text_data_cb">
- <lookup name="item">GtkListItem</lookup>
- <constant type="gchararray">title</constant>
- </closure>
- </binding>
- </object>
- </property>
- </template>
-</interface>
-]]>
- </property>
- </object>
- </property>
- <property name="sorter">
- <object class="GtkStringSorter">
- <property name="expression">
- <closure type="gchararray" function="pidgin_status_manager_sort_data_cb">
- <constant type="gchararray">title</constant>
- </closure>
- </property>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkColumnViewColumn">
- <property name="resizable">1</property>
- <property name="title" translatable="1">Type</property>
- <property name="factory">
- <object class="GtkBuilderListItemFactory">
- <property name="bytes">
-<![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <template class="GtkListItem">
- <property name="child">
- <object class="PidginStatusDisplay">
- <binding name="primitive">
- <closure type="PurpleStatusPrimitive" function="pidgin_status_manager_lookup_primitive_cb">
- <lookup name="item">GtkListItem</lookup>
- </closure>
- </binding>
- </object>
- </property>
- </template>
-</interface>
-]]>
- </property>
- </object>
- </property>
- <property name="sorter">
- <object class="GtkStringSorter">
- <property name="expression">
- <closure type="gchararray" function="pidgin_status_manager_sort_data_cb">
- <constant type="gchararray">type</constant>
- </closure>
- </property>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkColumnViewColumn">
- <property name="expand">1</property>
- <property name="resizable">1</property>
- <property name="title" translatable="1">Message</property>
- <property name="factory">
- <object class="GtkBuilderListItemFactory">
- <property name="bytes">
-<![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <template class="GtkListItem">
- <property name="child">
- <object class="GtkLabel">
- <property name="xalign">0</property>
- <property name="ellipsize">end</property>
- <binding name="label">
- <closure type="gchararray" function="pidgin_status_manager_lookup_text_data_cb">
- <lookup name="item">GtkListItem</lookup>
- <constant type="gchararray">message</constant>
- </closure>
- </binding>
- </object>
- </property>
- </template>
-</interface>
-]]>
- </property>
- </object>
- </property>
- <property name="sorter">
- <object class="GtkStringSorter">
- <property name="expression">
- <closure type="gchararray" function="pidgin_status_manager_sort_data_cb">
- <constant type="gchararray">message</constant>
- </closure>
- </property>
- </object>
- </property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="use_button">
- <property name="label" translatable="1">_Use</property>
- <property name="sensitive">0</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="button1">
- <property name="label" translatable="1">_Add</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="modify_button">
- <property name="label" translatable="1">_Modify</property>
- <property name="sensitive">0</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="remove_button">
- <property name="label" translatable="1">_Remove</property>
- <property name="sensitive">0</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <child type="action">
- <object class="GtkButton" id="button2">
- <property name="label" translatable="1">_Close</property>
- <property name="focusable">1</property>
- <property name="receives-default">1</property>
- <property name="use-underline">1</property>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">use_button</action-widget>
- <action-widget response="1">button1</action-widget>
- <action-widget response="2">modify_button</action-widget>
- <action-widget response="3">remove_button</action-widget>
- <action-widget response="close">button2</action-widget>
- </action-widgets>
- </template>
-</interface>
--- a/pidgin/resources/gtk/menus.ui Tue Nov 28 01:15:51 2023 -0600
+++ b/pidgin/resources/gtk/menus.ui Thu Nov 30 21:33:32 2023 -0600
@@ -84,10 +84,6 @@
<attribute name="action">app.preferences</attribute>
<attribute name="accel">&lt;Primary&gt;P</attribute>
</item>
- <item>
- <attribute name="label" translatable="yes">_Statuses</attribute>
- <attribute name="action">app.status-manager</attribute>
- </item>
</section>
<section>
--- a/pidgin/resources/pidgin.gresource.xml Tue Nov 28 01:15:51 2023 -0600
+++ b/pidgin/resources/pidgin.gresource.xml Thu Nov 30 21:33:32 2023 -0600
@@ -36,10 +36,6 @@
<file compressed="true" preprocess="xml-stripblanks">Protocols/chooser.ui</file>
<file compressed="true" preprocess="xml-stripblanks">Protocols/detailed-view.ui</file>
<file compressed="true" preprocess="xml-stripblanks">Roomlist/roomlist.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">Status/box.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">Status/display.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">Status/editor.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">Status/manager.ui</file>
<file compressed="true" preprocess="xml-stripblanks">Whiteboard/whiteboard.ui</file>
<file compressed="true" preprocess="xml-stripblanks">Xfer/xfer.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/menus.ui</file>
@@ -47,7 +43,6 @@
<file compressed="true" preprocess="xml-stripblanks">channeljoindialog.ui</file>
<file compressed="true" preprocess="xml-stripblanks">contactlistitem.ui</file>
<file compressed="true" preprocess="xml-stripblanks">presenceicon.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">statusprimitivechooser.ui</file>
<file>icons/16x16/status/pidgin-user-available.png</file>
<file>icons/16x16/status/pidgin-user-away.png</file>
<file>icons/16x16/status/pidgin-user-busy.png</file>
--- a/pidgin/resources/statusprimitivechooser.ui Tue Nov 28 01:15:51 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-<?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="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Pidgin -->
- <!-- interface-description Internet Messenger -->
- <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
- <template class="PidginStatusPrimitiveChooser" parent="AdwComboRow">
- <property name="factory">
- <object class="GtkBuilderListItemFactory">
- <property name="bytes">
-<![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <template class="GtkListItem">
- <property name="child">
- <object class="PidginStatusDisplay">
- <binding name="primitive">
- <closure type="PurpleStatusPrimitive" function="pidgin_status_primitive_chooser_primitive_cb">
- <lookup name="item">GtkListItem</lookup>
- </closure>
- </binding>
- </object>
- </property>
- </template>
-</interface>
-]]>
- </property>
- </object>
- </property>
- <property name="model">
- <object class="GtkStringList">
- <items>
- <item>offline</item>
- <item>available</item>
- <item>unavailable</item>
- <item>invisible</item>
- <item>away</item>
- <item>extended_away</item>
- </items>
- </object>
- </property>
- </template>
-</interface>
--- a/po/POTFILES.in Tue Nov 28 01:15:51 2023 -0600
+++ b/po/POTFILES.in Thu Nov 30 21:33:32 2023 -0600
@@ -272,10 +272,6 @@
pidgin/pidginpluginsmenu.c
pidgin/pidginpresenceicon.c
pidgin/pidginprotocolchooser.c
-pidgin/pidginstatusbox.c
-pidgin/pidginstatuseditor.c
-pidgin/pidginstatusmanager.c
-pidgin/pidginstatusprimitivechooser.c
pidgin/plugins/disco/gtkdisco.c
pidgin/plugins/disco/resources/disco.ui
pidgin/plugins/disco/xmppdisco.c
@@ -319,8 +315,6 @@
pidgin/resources/Protocols/chooser.ui
pidgin/resources/Protocols/detailed-view.ui
pidgin/resources/Roomlist/roomlist.ui
-pidgin/resources/Status/editor.ui
-pidgin/resources/Status/manager.ui
pidgin/resources/Whiteboard/whiteboard.ui
pidgin/resources/Xfer/xfer.ui
pidgin/resources/gtk/menus.ui