Tue, 02 Jan 2024 00:36:32 -0600
Create a full widget for the new instant message window
This now uses AdwMessageDialog and is self contained but PidginApplication
manages a singleton of it.
Previously this used the request api. I'm not sure why, as the request fields
were created by the ui itself.
Testing Done:
Created an im with `Echo` on a `demo` account and was able to send and receive messages.
Reviewed at https://reviews.imfreedom.org/r/2896/
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include "pidgin/pidgininfopane.h" |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | struct _PidginInfoPane { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | GtkBox parent; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | PurpleConversation *conversation; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | GtkWidget *topic; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | }; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | enum { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | PROP_0, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | PROP_CONVERSATION, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | N_PROPERTIES, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | }; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | G_DEFINE_TYPE(PidginInfoPane, pidgin_info_pane, GTK_TYPE_BOX) |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | /****************************************************************************** |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
43 | * Callbacks |
|
42367
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
44 | *****************************************************************************/ |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
45 | static char * |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
46 | pidgin_info_pane_linkify_text_cb(GObject *self, const char *topic, |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
47 | G_GNUC_UNUSED gpointer data) |
|
42367
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
48 | { |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
49 | PidginInfoPane *pane = PIDGIN_INFO_PANE(self); |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
50 | char *ret = NULL; |
|
42367
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
51 | |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
52 | ret = purple_markup_linkify(topic); |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
53 | gtk_widget_set_visible(pane->topic, !purple_strempty(ret)); |
|
42367
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
54 | |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
55 | return ret; |
|
42367
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
56 | } |
|
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
57 | |
|
12b865212d37
Rework the info pane a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42296
diff
changeset
|
58 | /****************************************************************************** |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * GObject Implementation |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | *****************************************************************************/ |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | static void |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | pidgin_info_pane_get_property(GObject *obj, guint param_id, GValue *value, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | GParamSpec *pspec) |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | PidginInfoPane *pane = PIDGIN_INFO_PANE(obj); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | switch(param_id) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | case PROP_CONVERSATION: |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | g_value_set_object(value, pidgin_info_pane_get_conversation(pane)); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | break; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | default: |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | break; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | static void |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | pidgin_info_pane_set_property(GObject *obj, guint param_id, const GValue *value, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | GParamSpec *pspec) |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | PidginInfoPane *pane = PIDGIN_INFO_PANE(obj); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | switch(param_id) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | case PROP_CONVERSATION: |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | pidgin_info_pane_set_conversation(pane, g_value_get_object(value)); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | break; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | default: |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | break; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | static void |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
94 | pidgin_info_pane_dispose(GObject *obj) { |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | PidginInfoPane *pane = PIDGIN_INFO_PANE(obj); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | g_clear_object(&pane->conversation); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
99 | G_OBJECT_CLASS(pidgin_info_pane_parent_class)->dispose(obj); |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | static void |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | pidgin_info_pane_init(PidginInfoPane *pane) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | gtk_widget_init_template(GTK_WIDGET(pane)); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | static void |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | pidgin_info_pane_class_init(PidginInfoPaneClass *klass) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | obj_class->get_property = pidgin_info_pane_get_property; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | obj_class->set_property = pidgin_info_pane_set_property; |
|
41184
05b5c210352b
Move conversation management from gtkconv.c to PidginConversationWindow.
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
114 | obj_class->dispose = pidgin_info_pane_dispose; |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | /** |
|
41479
3d2e114380f6
Add source files to GObject introspection
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41184
diff
changeset
|
117 | * PidginInfoPane:conversation |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | * The #PurpleConversation whose information will be displayed. |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | */ |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | properties[PROP_CONVERSATION] = g_param_spec_object( |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | "conversation", "conversation", |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | "The PurpleConversation instance", |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | PURPLE_TYPE_CONVERSATION, |
|
42296
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
125 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | gtk_widget_class_set_template_from_resource( |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | widget_class, |
|
41030
ec8b76f3bf0a
Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents:
41027
diff
changeset
|
131 | "/im/pidgin/Pidgin3/Conversations/infopane.ui" |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | ); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | gtk_widget_class_bind_template_child(widget_class, PidginInfoPane, topic); |
|
42521
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
135 | |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
136 | gtk_widget_class_bind_template_callback(widget_class, |
|
a8e758b503eb
Simplify PidginInfoPane by using bindings everywhere
Gary Kramlich <grim@reaperworld.com>
parents:
42367
diff
changeset
|
137 | pidgin_info_pane_linkify_text_cb); |
|
40858
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | /****************************************************************************** |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | * API |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | *****************************************************************************/ |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | GtkWidget * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | pidgin_info_pane_new(PurpleConversation *conversation) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | return GTK_WIDGET(g_object_new( |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | PIDGIN_TYPE_INFO_PANE, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | "conversation", conversation, |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | NULL)); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | } |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | PurpleConversation * |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | pidgin_info_pane_get_conversation(PidginInfoPane *pane) { |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | g_return_val_if_fail(PIDGIN_IS_INFO_PANE(pane), NULL); |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | return pane->conversation; |
|
2bd48c93678a
Create a new standalone info pane widget
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | } |
|
42296
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
157 | |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
158 | void |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
159 | pidgin_info_pane_set_conversation(PidginInfoPane *pane, |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
160 | PurpleConversation *conversation) |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
161 | { |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
162 | g_return_if_fail(PIDGIN_IS_INFO_PANE(pane)); |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
163 | |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
164 | if(!g_set_object(&pane->conversation, conversation)) { |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
165 | return; |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
166 | } |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
167 | |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
168 | g_object_notify_by_pspec(G_OBJECT(pane), properties[PROP_CONVERSATION]); |
|
1707a28b1258
Allow the conversation property of PidginInfoPane to be changed
Gary Kramlich <grim@reaperworld.com>
parents:
41479
diff
changeset
|
169 | } |