pidgin/pidginwindow.c

Tue, 15 Sep 2020 21:54:10 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 15 Sep 2020 21:54:10 -0500
changeset 40534
8dad2981fb86
parent 40533
b1921b17b683
child 40539
2941deda6d8d
permissions
-rw-r--r--

Separate the AccountChooser from its model and move options to filters

Create a store for accounts and a filter to only show connected accounts

Update everything to use the new PidginAccountStore and PidginAccountFilterConnected filter

Add a GtkTreeModelFilter for protocols by id

Testing Done:
Compiled and opened most of the dialogs to make sure they're still working the same. Was unable to test gevolution.

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

40533
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * pidgin
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Pidgin is the legal property of its developers, whose names are too numerous
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #include "pidginwindow.h"
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include "pidgincore.h"
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 struct _PidginWindow {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 GtkWindow parent;
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 };
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 /******************************************************************************
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 * GObject Implementation
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 *****************************************************************************/
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 G_DEFINE_TYPE(PidginWindow, pidgin_window, GTK_TYPE_WINDOW)
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 static void
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 pidgin_window_init(PidginWindow *button) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 static void
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 pidgin_window_class_init(PidginWindowClass *klass) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 /******************************************************************************
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 * Public API
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 *****************************************************************************/
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GtkWidget *
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 pidgin_window_new(const gchar *title, guint border_width, const gchar *role,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 gboolean resizable)
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 if(title == NULL) {
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 title = PIDGIN_ALERT_TITLE;
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 }
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 return GTK_WIDGET(g_object_new(
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 PIDGIN_TYPE_WINDOW,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 "title", title,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 "border-width", border_width,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 "role", role,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 "resizable", resizable,
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 NULL));
b1921b17b683 Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 }

mercurial