pidgin/pidgincontactlist.c

Tue, 01 Dec 2020 01:00:55 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 01 Dec 2020 01:00:55 -0600
changeset 40632
cb8fd8a527ab
parent 40600
46d10c72c137
child 40728
2dbfbaeefe40
permissions
-rw-r--r--

Remove deleted zephyr files from translation.

Testing Done:
Run `ninja pidgin-pot`.

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

40600
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include "pidgincontactlist.h"
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #include "pidginactiongroup.h"
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 struct _PidginContactList {
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 GtkApplicationWindow parent;
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 GtkWidget *vbox;
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 };
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 G_DEFINE_TYPE(PidginContactList, pidgin_contact_list,
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 GTK_TYPE_APPLICATION_WINDOW)
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 /******************************************************************************
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 * GObject Implementation
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 *****************************************************************************/
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 static void
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 pidgin_contact_list_init(PidginContactList *contact_list) {
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 GSimpleActionGroup *group = NULL;
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 gtk_widget_init_template(GTK_WIDGET(contact_list));
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 gtk_window_set_application(GTK_WINDOW(contact_list),
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GTK_APPLICATION(g_application_get_default()));
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 group = pidgin_action_group_new();
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 gtk_widget_insert_action_group(GTK_WIDGET(contact_list), "blist",
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 G_ACTION_GROUP(group));
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 }
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 static void
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 pidgin_contact_list_class_init(PidginContactListClass *klass) {
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 gtk_widget_class_set_template_from_resource(
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 widget_class,
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 "/im/pidgin/Pidgin/BuddyList/window.ui"
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 );
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 gtk_widget_class_bind_template_child(widget_class, PidginContactList, vbox);
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 }
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 /******************************************************************************
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * Public API
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 *****************************************************************************/
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 GtkWidget *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 pidgin_contact_list_new(void) {
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 return GTK_WIDGET(g_object_new(PIDGIN_TYPE_CONTACT_LIST, NULL));
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 }
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 GtkWidget *
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 pidgin_contact_list_get_vbox(PidginContactList *contact_list) {
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 g_return_val_if_fail(PIDGIN_IS_CONTACT_LIST(contact_list), NULL);
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 return contact_list->vbox;
46d10c72c137 Create a new ContactList that will eventually fully replace PidginBuddyList
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 }

mercurial