pidgin/prefs/pidginprefs.c

Tue, 15 Jul 2025 03:10:33 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 15 Jul 2025 03:10:33 -0500
changeset 43288
2865cd340992
parent 43014
8194d922bd07
permissions
-rw-r--r--

Remove a bunch of unused and unnecessary preferences code

Testing Done:
Verified startup and shutdown worked fine, that there were no issues opening the preferences dialog, and called in the turtles.

Reviewed at https://reviews.imfreedom.org/r/4066/

/*
 * 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 <purpleconfig.h>

#include <errno.h>
#include <math.h>

#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>

#include <purple.h>

#include <adwaita.h>

#include "pidginprefs.h"
#include "pidgincore.h"
#if 0
#include "pidginvvprefs.h"
#endif

struct _PidginPrefsWindow {
	AdwPreferencesWindow parent;
};

G_DEFINE_FINAL_TYPE(PidginPrefsWindow, pidgin_prefs_window,
                    ADW_TYPE_PREFERENCES_WINDOW)

/******************************************************************************
 * Helpers
 *****************************************************************************/

#if 0
static void
vv_test_switch_page_cb(GtkStack *stack, G_GNUC_UNUSED GParamSpec *pspec,
                       gpointer data)
{
	PidginVVPrefs *vv_prefs = data;

	if (!g_str_equal(gtk_stack_get_visible_child_name(stack), "vv")) {
		/* Disable any running test pipelines. */
		pidgin_vv_prefs_disable_test_pipelines(vv_prefs);
	}
}
#endif

/******************************************************************************
 * GObject Implementation
 *****************************************************************************/
static void
pidgin_prefs_window_finalize(GObject *obj) {
	purple_prefs_disconnect_by_handle(obj);

	G_OBJECT_CLASS(pidgin_prefs_window_parent_class)->finalize(obj);
}

static void
pidgin_prefs_window_class_init(PidginPrefsWindowClass *klass)
{
	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);

	obj_class->finalize = pidgin_prefs_window_finalize;

	gtk_widget_class_set_template_from_resource(
		widget_class,
		"/im/pidgin/Pidgin3/Prefs/prefs.ui"
	);

	/* Main window */
#if 0
	gtk_widget_class_bind_template_callback(widget_class,
	                                        vv_test_switch_page_cb);
#endif
}

static void
pidgin_prefs_window_init(PidginPrefsWindow *win)
{
	gtk_widget_init_template(GTK_WIDGET(win));
}

/******************************************************************************
 * API
 *****************************************************************************/
void
pidgin_prefs_init(void)
{
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "");
	purple_prefs_add_none("/plugins/gtk");

	/* Plugins */
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins");
	purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL);

	/* File locations */
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations");
	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", "");
	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", "");
	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", "");

	/* Voice/Video */
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio/src");
	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device", "");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink");
	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device", "");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video/src");
	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/video/src/device", "");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video");
	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video/sink");
	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device", "");
}

mercurial