Tue, 01 Oct 2019 01:38:06 -0400
Use g_list_free_full instead of g_list_foreach+g_list_free.
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 7432 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
7537
4c3be2f554b1
[gaim-migrate @ 8150]
Christian Hammond <chipx86@chipx86.com>
parents:
7535
diff
changeset
|
6 | * |
| 7432 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18743
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7432 | 20 | */ |
| 9791 | 21 | #include "internal.h" |
| 15577 | 22 | #include "pidgin.h" |
| 7432 | 23 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
24 | #include <talkatu.h> |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
25 | |
| 7432 | 26 | #include "account.h" |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
27 | #include "debug.h" |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
28 | #include "log.h" |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
29 | #include "notify.h" |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
30 | #include "request.h" |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
31 | #include "util.h" |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
32 | |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
33 | #include "pidginstock.h" |
| 7432 | 34 | #include "gtkblist.h" |
| 35 | #include "gtkutils.h" | |
|
39603
98fd85e156e0
Rename gtklog -> pidginlog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38897
diff
changeset
|
36 | #include "pidginlog.h" |
| 7432 | 37 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33142
diff
changeset
|
38 | #include "gtk3compat.h" |
| 7432 | 39 | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
40 | #define PIDGIN_TYPE_LOG_VIEWER pidgin_log_viewer_get_type() |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
41 | /** |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
42 | * PidginLogViewer: |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
43 | * @logs: The list of logs viewed in this viewer |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
44 | * @browse_button: The button for opening a log folder externally |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
45 | * @treestore: The treestore containing said logs |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
46 | * @treeview: The treeview representing said treestore |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
47 | * @log_view: The talkatu view to display said logs |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
48 | * @log_buffer: The talkatu buffer to hold said logs |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
49 | * @title_box: The box containing the title (and optional icon) |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
50 | * @label: The label at the top of the log viewer |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
51 | * @size_label: The label to show the size of the logs |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
52 | * @entry: The search entry, in which search terms are entered |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
53 | * @search: The string currently being searched for |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
54 | * |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
55 | * A Pidgin Log Viewer. You can look at logs with it. |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
56 | */ |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
57 | G_DECLARE_FINAL_TYPE(PidginLogViewer, pidgin_log_viewer, PIDGIN, LOG_VIEWER, GtkDialog) |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
58 | |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
59 | struct _PidginLogViewer { |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
60 | GtkDialog parent; |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
61 | |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
62 | GList *logs; |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
63 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
64 | GtkWidget *browse_button; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
65 | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
66 | GtkTreeStore *treestore; |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
67 | GtkWidget *treeview; |
|
39605
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
68 | GtkWidget *log_view; |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
69 | TalkatuHtmlBuffer *log_buffer; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
70 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
71 | GtkWidget *title_box; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
72 | GtkLabel *label; |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
73 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
74 | GtkWidget *size_label; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
75 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
76 | GtkWidget *entry; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
77 | char *search; |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
78 | }; |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
79 | |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
80 | G_DEFINE_TYPE(PidginLogViewer, pidgin_log_viewer, GTK_TYPE_DIALOG) |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
81 | |
| 7432 | 82 | static GHashTable *log_viewers = NULL; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
83 | static void populate_log_tree(PidginLogViewer *lv); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
84 | static PidginLogViewer *syslog_viewer = NULL; |
| 7432 | 85 | |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
86 | struct log_viewer_hash { |
| 15884 | 87 | PurpleLogType type; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
88 | char *buddyname; |
| 15884 | 89 | PurpleAccount *account; |
| 90 | PurpleContact *contact; | |
| 7432 | 91 | }; |
| 92 | ||
| 7440 | 93 | static guint log_viewer_hash(gconstpointer data) |
| 7432 | 94 | { |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
95 | const struct log_viewer_hash *viewer = data; |
| 7440 | 96 | |
| 10663 | 97 | if (viewer->contact != NULL) |
| 98 | return g_direct_hash(viewer->contact); | |
| 99 | ||
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
100 | return g_str_hash(viewer->buddyname) + |
| 15884 | 101 | g_str_hash(purple_account_get_username(viewer->account)); |
| 7432 | 102 | } |
| 103 | ||
| 10663 | 104 | static gboolean log_viewer_equal(gconstpointer y, gconstpointer z) |
| 7432 | 105 | { |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
106 | const struct log_viewer_hash *a, *b; |
| 7432 | 107 | int ret; |
| 7440 | 108 | char *normal; |
| 109 | ||
| 110 | a = y; | |
| 111 | b = z; | |
| 112 | ||
| 10663 | 113 | if (a->contact != NULL) { |
| 114 | if (b->contact != NULL) | |
| 115 | return (a->contact == b->contact); | |
| 116 | else | |
| 117 | return FALSE; | |
| 118 | } else { | |
| 119 | if (b->contact != NULL) | |
| 120 | return FALSE; | |
| 121 | } | |
| 122 | ||
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
123 | normal = g_strdup(purple_normalize(a->account, a->buddyname)); |
| 7440 | 124 | ret = (a->account == b->account) && |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
33728
diff
changeset
|
125 | purple_strequal(normal, purple_normalize(b->account, b->buddyname)); |
| 7432 | 126 | g_free(normal); |
| 10663 | 127 | |
| 7432 | 128 | return ret; |
| 129 | } | |
| 130 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
131 | static void select_first_log(PidginLogViewer *lv) |
|
13569
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
132 | { |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
133 | GtkTreeModel *model; |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
134 | GtkTreeIter iter, it; |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
135 | GtkTreePath *path; |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
136 | |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
137 | model = GTK_TREE_MODEL(lv->treestore); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
138 | |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
139 | if (!gtk_tree_model_get_iter_first(model, &iter)) |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
140 | return; |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
141 | |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
142 | path = gtk_tree_model_get_path(model, &iter); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
143 | if (gtk_tree_model_iter_children(model, &it, &iter)) |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
144 | { |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
145 | gtk_tree_view_expand_row(GTK_TREE_VIEW(lv->treeview), path, TRUE); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
146 | path = gtk_tree_model_get_path(model, &it); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
147 | } |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
148 | |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
149 | gtk_tree_selection_select_path(gtk_tree_view_get_selection(GTK_TREE_VIEW(lv->treeview)), path); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
150 | |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
151 | gtk_tree_path_free(path); |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
152 | } |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
153 | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
154 | static gchar *log_get_date(PurpleLog *log) |
|
15060
a5d9fafd2b8c
[gaim-migrate @ 17777]
Richard Laager <rlaager@pidgin.im>
parents:
14861
diff
changeset
|
155 | { |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
156 | GDateTime *dt; |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
157 | gchar *ret; |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
158 | dt = g_date_time_to_local(log->time); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
159 | ret = g_date_time_format(dt, "%c"); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
160 | g_date_time_unref(dt); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
161 | return ret; |
|
15060
a5d9fafd2b8c
[gaim-migrate @ 17777]
Richard Laager <rlaager@pidgin.im>
parents:
14861
diff
changeset
|
162 | } |
|
a5d9fafd2b8c
[gaim-migrate @ 17777]
Richard Laager <rlaager@pidgin.im>
parents:
14861
diff
changeset
|
163 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
164 | static void |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
165 | entry_stop_search_cb(GtkWidget *entry, PidginLogViewer *lv) |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
166 | { |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
167 | /* reset the tree */ |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
168 | gtk_tree_store_clear(lv->treestore); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
169 | populate_log_tree(lv); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
170 | g_clear_pointer(&lv->search, g_free); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
171 | #if 0 |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
172 | webkit_web_view_unmark_text_matches(WEBKIT_WEB_VIEW(lv->log_view)); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
173 | #endif |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
174 | select_first_log(lv); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
175 | } |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
176 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
177 | static void |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
178 | entry_search_changed_cb(GtkWidget *button, PidginLogViewer *lv) |
| 7535 | 179 | { |
| 180 | const char *search_term = gtk_entry_get_text(GTK_ENTRY(lv->entry)); | |
| 181 | GList *logs; | |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
182 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
33728
diff
changeset
|
183 | if (lv->search != NULL && purple_strequal(lv->search, search_term)) |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
184 | { |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
185 | #if 0 |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
186 | /* Searching for the same term acts as "Find Next" */ |
|
39605
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
187 | webkit_web_view_search_text(WEBKIT_WEB_VIEW(lv->log_view), lv->search, FALSE, TRUE, TRUE); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
188 | #endif |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
189 | return; |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
190 | } |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
191 | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
192 | pidgin_set_cursor(GTK_WIDGET(lv), GDK_WATCH); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
193 | |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
194 | g_free(lv->search); |
|
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
195 | lv->search = g_strdup(search_term); |
|
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
196 | |
|
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
197 | gtk_tree_store_clear(lv->treestore); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
198 | talkatu_buffer_clear(TALKATU_BUFFER(lv->log_buffer)); |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
199 | |
| 7535 | 200 | for (logs = lv->logs; logs != NULL; logs = logs->next) { |
| 15884 | 201 | char *read = purple_log_read((PurpleLog*)logs->data, NULL); |
| 202 | if (read && *read && purple_strcasestr(read, search_term)) { | |
| 7535 | 203 | GtkTreeIter iter; |
| 15884 | 204 | PurpleLog *log = logs->data; |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
205 | gchar *log_date = log_get_date(log); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
11869
diff
changeset
|
206 | |
| 7535 | 207 | gtk_tree_store_append (lv->treestore, &iter, NULL); |
| 208 | gtk_tree_store_set(lv->treestore, &iter, | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
209 | 0, log_date, |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
210 | 1, log, -1); |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
211 | g_free(log_date); |
| 7535 | 212 | } |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10181
diff
changeset
|
213 | g_free(read); |
| 7535 | 214 | } |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
215 | |
|
13569
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
216 | select_first_log(lv); |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
217 | pidgin_clear_cursor(GTK_WIDGET(lv)); |
| 7535 | 218 | } |
| 219 | ||
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
220 | static void |
|
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
221 | destroy_cb(GtkWidget *w, gint resp, struct log_viewer_hash *ht) |
|
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
222 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
223 | PidginLogViewer *lv = syslog_viewer; |
|
7454
c99a2070471e
[gaim-migrate @ 8067]
Mark Doliner <markdoliner@pidgin.im>
parents:
7440
diff
changeset
|
224 | |
|
15298
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
225 | #ifdef _WIN32 |
|
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
226 | if (resp == GTK_RESPONSE_HELP) { |
|
18743
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
227 | GtkTreeSelection *sel; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
228 | GtkTreeIter iter; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
229 | GtkTreeModel *model; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
230 | PurpleLog *log = NULL; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
231 | char *logdir; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
232 | |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
233 | if (ht != NULL) |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
234 | lv = g_hash_table_lookup(log_viewers, ht); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
235 | model = GTK_TREE_MODEL(lv->treestore); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
236 | |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
237 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(lv->treeview)); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
238 | if (gtk_tree_selection_get_selected(sel, &model, &iter)) { |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
239 | GValue val; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
240 | |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
241 | val.g_type = 0; |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
242 | gtk_tree_model_get_value (model, &iter, 1, &val); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
243 | log = g_value_get_pointer(&val); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
244 | g_value_unset(&val); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
245 | } |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
246 | |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
247 | |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
248 | if (log == NULL) |
|
38870
575e41bfc15e
Migrate certificates, icons, logs to XDG dirs
qarkai <qarkai@gmail.com>
parents:
38007
diff
changeset
|
249 | logdir = g_build_filename(purple_data_dir(), "logs", NULL); |
|
18743
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
250 | else |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
251 | logdir = purple_log_get_log_dir(log->type, log->name, log->account); |
|
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
252 | |
|
15574
18d9d1c05994
Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents:
15568
diff
changeset
|
253 | winpidgin_shell_execute(logdir, "explore", NULL); |
|
15298
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
254 | g_free(logdir); |
|
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
255 | return; |
|
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
256 | } |
|
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
257 | #endif |
|
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
258 | |
| 10663 | 259 | if (ht != NULL) { |
| 8573 | 260 | lv = g_hash_table_lookup(log_viewers, ht); |
| 261 | g_hash_table_remove(log_viewers, ht); | |
| 10663 | 262 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
263 | g_free(ht->buddyname); |
| 8573 | 264 | g_free(ht); |
| 265 | } else | |
| 266 | syslog_viewer = NULL; | |
| 267 | ||
| 15884 | 268 | purple_request_close_with_handle(lv); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
269 | |
|
39897
16b440d4ab36
Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39824
diff
changeset
|
270 | g_list_free_full(lv->logs, (GDestroyNotify)purple_log_free); |
| 10663 | 271 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13569
diff
changeset
|
272 | g_free(lv->search); |
| 10663 | 273 | |
|
7454
c99a2070471e
[gaim-migrate @ 8067]
Mark Doliner <markdoliner@pidgin.im>
parents:
7440
diff
changeset
|
274 | gtk_widget_destroy(w); |
|
c99a2070471e
[gaim-migrate @ 8067]
Mark Doliner <markdoliner@pidgin.im>
parents:
7440
diff
changeset
|
275 | } |
|
c99a2070471e
[gaim-migrate @ 8067]
Mark Doliner <markdoliner@pidgin.im>
parents:
7440
diff
changeset
|
276 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
277 | static void log_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, PidginLogViewer *viewer) { |
| 10663 | 278 | if (gtk_tree_view_row_expanded(tv, path)) |
| 279 | gtk_tree_view_collapse_row(tv, path); | |
| 280 | else | |
| 281 | gtk_tree_view_expand_row(tv, path, FALSE); | |
| 8573 | 282 | } |
| 10663 | 283 | |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
284 | static void delete_log_cleanup_cb(gpointer *data) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
285 | { |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
286 | g_free(data[1]); /* iter */ |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
287 | g_free(data); |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
288 | } |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
289 | |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
290 | static void delete_log_cb(gpointer *data) |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
291 | { |
| 15884 | 292 | if (!purple_log_delete((PurpleLog *)data[2])) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
293 | { |
|
22384
0a2c39b4a6b1
Mark some strings for translation
Mark Doliner <markdoliner@pidgin.im>
parents:
22237
diff
changeset
|
294 | purple_notify_error(NULL, NULL, _("Log Deletion Failed"), |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
295 | _("Check permissions and try again."), NULL); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
296 | } |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
297 | else |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
298 | { |
|
15613
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
299 | GtkTreeStore *treestore = data[0]; |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
300 | GtkTreeIter *iter = (GtkTreeIter *)data[1]; |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
301 | GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), iter); |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
302 | gboolean first = !gtk_tree_path_prev(path); |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
303 | |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
304 | if (!gtk_tree_store_remove(treestore, iter) && first) |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
305 | { |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
306 | /* iter was the last child at its level */ |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
307 | |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
308 | if (gtk_tree_path_up(path)) |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
309 | { |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
310 | gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), iter, path); |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
311 | gtk_tree_store_remove(treestore, iter); |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
312 | } |
|
9a6ec23fe078
If you delete the last log for a month, delete the month header as well.
Richard Laager <rlaager@pidgin.im>
parents:
15612
diff
changeset
|
313 | } |
|
29500
1e0464dad92b
This should pretty much finish off the GTK_CHECK_VERSION calls in Pidgin.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25889
diff
changeset
|
314 | |
| 16293 | 315 | gtk_tree_path_free(path); |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
316 | } |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
317 | |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
318 | delete_log_cleanup_cb(data); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
319 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
320 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
321 | static void log_delete_log_cb(GtkWidget *menuitem, gpointer *data) |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
322 | { |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
323 | PidginLogViewer *lv = data[0]; |
| 15884 | 324 | PurpleLog *log = data[1]; |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
325 | GtkTreeIter *iter = data[2]; |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
326 | gchar *time = log_get_date(log); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
327 | const char *name; |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
328 | char *tmp; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
329 | gpointer *data2; |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
330 | |
| 15884 | 331 | if (log->type == PURPLE_LOG_IM) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
332 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
333 | PurpleBuddy *buddy = purple_blist_find_buddy(log->account, log->name); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
334 | if (buddy != NULL) |
| 15884 | 335 | name = purple_buddy_get_contact_alias(buddy); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
336 | else |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
337 | name = log->name; |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
338 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
339 | tmp = g_strdup_printf(_("Are you sure you want to permanently delete the log of the " |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
340 | "conversation with %s which started at %s?"), name, time); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
341 | } |
| 15884 | 342 | else if (log->type == PURPLE_LOG_CHAT) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
343 | { |
| 15884 | 344 | PurpleChat *chat = purple_blist_find_chat(log->account, log->name); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
345 | if (chat != NULL) |
| 15884 | 346 | name = purple_chat_get_name(chat); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
347 | else |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
348 | name = log->name; |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
349 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
350 | tmp = g_strdup_printf(_("Are you sure you want to permanently delete the log of the " |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
351 | "conversation in %s which started at %s?"), name, time); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
352 | } |
| 15884 | 353 | else if (log->type == PURPLE_LOG_SYSTEM) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
354 | { |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
355 | tmp = g_strdup_printf(_("Are you sure you want to permanently delete the system log " |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
356 | "which started at %s?"), time); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
357 | } |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
358 | else { |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
359 | g_free(time); |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
360 | g_free(iter); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
361 | g_return_if_reached(); |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
362 | } |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
363 | |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
364 | /* The only way to free data in all cases is to tie it to the menuitem with |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
365 | * g_object_set_data_full(). But, since we need to get some data down to |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
366 | * delete_log_cb() to delete the log from the log viewer after the file is |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
367 | * deleted, we have to allocate a new data array and make sure it gets freed |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
368 | * either way. */ |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
369 | data2 = g_new(gpointer, 3); |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
370 | data2[0] = lv->treestore; |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
371 | data2[1] = iter; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
372 | data2[2] = log; |
|
22384
0a2c39b4a6b1
Mark some strings for translation
Mark Doliner <markdoliner@pidgin.im>
parents:
22237
diff
changeset
|
373 | purple_request_action(lv, NULL, _("Delete Log?"), tmp, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34274
diff
changeset
|
374 | NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
375 | data2, 2, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
376 | _("Delete"), delete_log_cb, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
377 | _("Cancel"), delete_log_cleanup_cb); |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
378 | g_free(time); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
379 | g_free(tmp); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
380 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
381 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
382 | static GtkWidget * |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
383 | log_create_popup_menu(GtkWidget *treeview, PidginLogViewer *lv, GtkTreeIter *iter) |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
384 | { |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
385 | GValue val; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
386 | PurpleLog *log; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
387 | GtkWidget *menu; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
388 | GtkWidget *menuitem; |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
389 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
390 | val.g_type = 0; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
391 | gtk_tree_model_get_value(GTK_TREE_MODEL(lv->treestore), iter, 1, &val); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
392 | log = g_value_get_pointer(&val); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
393 | if (log == NULL) { |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
394 | g_free(iter); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
395 | return NULL; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
396 | } |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
397 | |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
398 | menu = gtk_menu_new(); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
399 | menuitem = gtk_menu_item_new_with_label(_("Delete Log...")); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
400 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
401 | if (purple_log_is_deletable(log)) { |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
402 | gpointer *data = g_new(gpointer, 3); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
403 | data[0] = lv; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
404 | data[1] = log; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
405 | data[2] = iter; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
406 | |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
407 | g_signal_connect(menuitem, "activate", G_CALLBACK(log_delete_log_cb), data); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
408 | g_object_set_data_full(G_OBJECT(menuitem), "log-viewer-data", data, g_free); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
409 | } else { |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
410 | gtk_widget_set_sensitive(menuitem, FALSE); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
411 | } |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
412 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
413 | gtk_widget_show_all(menu); |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
414 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
415 | return menu; |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
416 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
417 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
418 | static gboolean log_button_press_cb(GtkWidget *treeview, GdkEventButton *event, PidginLogViewer *lv) |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
419 | { |
|
38705
62a7a975251a
Use gdk_event_triggers_context_menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38620
diff
changeset
|
420 | if (gdk_event_triggers_context_menu((GdkEvent *)event)) { |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
421 | GtkTreePath *path; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
422 | GtkTreeIter *iter; |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
423 | GtkWidget *menu; |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
424 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
425 | if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), event->x, event->y, &path, NULL, NULL, NULL)) |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
426 | return FALSE; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
427 | iter = g_new(GtkTreeIter, 1); |
|
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
428 | gtk_tree_model_get_iter(GTK_TREE_MODEL(lv->treestore), iter, path); |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22384
diff
changeset
|
429 | gtk_tree_path_free(path); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
430 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
431 | menu = log_create_popup_menu(treeview, lv, iter); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
432 | if (menu) { |
|
38707
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38706
diff
changeset
|
433 | gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *)event); |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
434 | return TRUE; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
435 | } else { |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
436 | return FALSE; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
437 | } |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
438 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
439 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
440 | return FALSE; |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
441 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
442 | |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
443 | static gboolean log_popup_menu_cb(GtkWidget *treeview, PidginLogViewer *lv) |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
444 | { |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
445 | GtkTreeSelection *sel; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
446 | GtkTreeIter *iter; |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
447 | GtkWidget *menu; |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
448 | |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
449 | iter = g_new(GtkTreeIter, 1); |
|
18743
58a367fa661a
Make the "Browse Logs Folder" button open the folder containing the log
Richard Laager <rlaager@pidgin.im>
parents:
16490
diff
changeset
|
450 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(lv->treeview)); |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
451 | if (!gtk_tree_selection_get_selected(sel, NULL, iter)) { |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
452 | g_free(iter); |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
453 | return FALSE; |
|
15612
5de26d19e4e5
After the log is deleted, remove the entry from the log viewer.
Richard Laager <rlaager@pidgin.im>
parents:
15586
diff
changeset
|
454 | } |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
455 | |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
456 | menu = log_create_popup_menu(treeview, lv, iter); |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
457 | if (menu) { |
|
38709
6c80734ca3b4
Add pidgin_menu_popup_at_treeview_selection.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38707
diff
changeset
|
458 | pidgin_menu_popup_at_treeview_selection(menu, treeview); |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
459 | return TRUE; |
|
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
460 | } else { |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
461 | return FALSE; |
|
38706
4a3f253ea22c
Reduce code duplication in log popup menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
462 | } |
|
15586
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
463 | } |
|
b03db9cb6cac
Implement the UI for deleting logs. This allows users to right-click on
Richard Laager <rlaager@pidgin.im>
parents:
15578
diff
changeset
|
464 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
465 | #if 0 /* FIXME: Add support in Talkatu for highlighting search terms. */ |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
466 | static gboolean search_find_cb(gpointer data) |
|
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
467 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
468 | PidginLogViewer *viewer = data; |
|
39605
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
469 | webkit_web_view_mark_text_matches(WEBKIT_WEB_VIEW(viewer->log_view), viewer->search, FALSE, 0); |
|
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
470 | webkit_web_view_set_highlight_text_matches(WEBKIT_WEB_VIEW(viewer->log_view), TRUE); |
|
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
471 | webkit_web_view_search_text(WEBKIT_WEB_VIEW(viewer->log_view), viewer->search, FALSE, TRUE, TRUE); |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
472 | return FALSE; |
|
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
473 | } |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
474 | #endif |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
475 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
476 | static void log_select_cb(GtkTreeSelection *sel, PidginLogViewer *viewer) { |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
477 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12232
diff
changeset
|
478 | GValue val; |
| 7432 | 479 | GtkTreeModel *model = GTK_TREE_MODEL(viewer->treestore); |
| 15884 | 480 | PurpleLog *log = NULL; |
| 481 | PurpleLogReadFlags flags; | |
| 7432 | 482 | char *read = NULL; |
| 483 | ||
| 10663 | 484 | if (!gtk_tree_selection_get_selected(sel, &model, &iter)) |
| 7432 | 485 | return; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12232
diff
changeset
|
486 | |
|
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12232
diff
changeset
|
487 | val.g_type = 0; |
| 7432 | 488 | gtk_tree_model_get_value (model, &iter, 1, &val); |
| 489 | log = g_value_get_pointer(&val); | |
| 490 | g_value_unset(&val); | |
| 491 | ||
| 10663 | 492 | if (log == NULL) |
| 7432 | 493 | return; |
| 494 | ||
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
495 | pidgin_set_cursor(GTK_WIDGET(viewer), GDK_WATCH); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
11869
diff
changeset
|
496 | |
| 15884 | 497 | if (log->type != PURPLE_LOG_SYSTEM) { |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
498 | gchar *log_date = log_get_date(log); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
499 | gchar *title; |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
500 | if (log->type == PURPLE_LOG_CHAT) { |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
501 | title = g_strdup_printf(_("Conversation in %s on %s"), |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
502 | log->name, log_date); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
503 | } else { |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
504 | title = g_strdup_printf(_("Conversation with %s on %s"), |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
505 | log->name, log_date); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
506 | } |
| 10663 | 507 | |
|
35721
abae078d0525
Fix some warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35528
diff
changeset
|
508 | gtk_label_set_markup(viewer->label, title); |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
509 | g_free(log_date); |
| 10663 | 510 | g_free(title); |
| 511 | } | |
| 512 | ||
| 15884 | 513 | read = purple_log_read(log, &flags); |
| 10663 | 514 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
515 | talkatu_buffer_clear(TALKATU_BUFFER(viewer->log_buffer)); |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
516 | |
| 15884 | 517 | purple_signal_emit(pidgin_log_get_handle(), "log-displaying", viewer, log); |
|
32981
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
518 | |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
519 | /* plaintext log (html one starts with <html> tag) */ |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
520 | if (read[0] != '<') |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
521 | { |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
522 | char *newRead = purple_strreplace(read, "\n", "<br>"); |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
523 | g_free(read); |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
524 | read = newRead; |
|
19e0299e7d2d
Still making trunk usable again: correctly display plaintext logs
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32912
diff
changeset
|
525 | } |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
526 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
527 | talkatu_markup_set_html(TALKATU_BUFFER(viewer->log_buffer), read, -1); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
11869
diff
changeset
|
528 | g_free(read); |
| 7535 | 529 | |
| 10663 | 530 | if (viewer->search != NULL) { |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
531 | #if 0 /* FIXME: Add support in Talkatu for highlighting search terms. */ |
|
39605
d18e1b255f51
Remove web_view naming from PidginLogViewer internals.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39604
diff
changeset
|
532 | webkit_web_view_unmark_text_matches(WEBKIT_WEB_VIEW(viewer->log_view)); |
|
14400
953baf2eba1a
[gaim-migrate @ 17035]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
533 | g_idle_add(search_find_cb, viewer); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
534 | #endif |
|
10574
5abb2931b6ff
[gaim-migrate @ 11966]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10181
diff
changeset
|
535 | } |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
536 | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
537 | pidgin_clear_cursor(GTK_WIDGET(viewer)); |
| 7432 | 538 | } |
| 539 | ||
| 540 | /* I want to make this smarter, but haven't come up with a cool algorithm to do so, yet. | |
| 541 | * I want the tree to be divided into groups like "Today," "Yesterday," "Last week," | |
| 542 | * "August," "2002," etc. based on how many conversation took place in each subdivision. | |
| 543 | * | |
| 544 | * For now, I'll just make it a flat list. | |
| 545 | */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
546 | static void populate_log_tree(PidginLogViewer *lv) |
| 11585 | 547 | /* Logs are made from trees in real life. |
| 7432 | 548 | This is a tree made from logs */ |
| 549 | { | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
550 | gchar *month; |
| 10663 | 551 | char prev_top_month[30] = ""; |
| 9435 | 552 | GtkTreeIter toplevel, child; |
| 7432 | 553 | GList *logs = lv->logs; |
| 10663 | 554 | |
| 555 | while (logs != NULL) { | |
| 15884 | 556 | PurpleLog *log = logs->data; |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
557 | GDateTime *dt; |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
558 | gchar *log_date; |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
559 | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
560 | dt = g_date_time_to_local(log->time); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
561 | month = g_date_time_format(dt, _("%B %Y")); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
562 | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
563 | if (!purple_strequal(month, prev_top_month)) { |
| 9435 | 564 | /* top level */ |
| 565 | gtk_tree_store_append(lv->treestore, &toplevel, NULL); | |
| 566 | gtk_tree_store_set(lv->treestore, &toplevel, 0, month, 1, NULL, -1); | |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
567 | |
|
33728
be5378bae40e
CID 731947 - Deal with the unlikely scenario that a locale would have a month+year value longer than 29 bytes.
Daniel Atallah <datallah@pidgin.im>
parents:
31321
diff
changeset
|
568 | g_strlcpy(prev_top_month, month, sizeof(prev_top_month)); |
|
10680
e4a00ce2fc35
[gaim-migrate @ 12226]
Richard Laager <rlaager@pidgin.im>
parents:
10669
diff
changeset
|
569 | } |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
570 | |
|
10680
e4a00ce2fc35
[gaim-migrate @ 12226]
Richard Laager <rlaager@pidgin.im>
parents:
10669
diff
changeset
|
571 | /* sub */ |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
572 | log_date = g_date_time_format(dt, "%c"); |
|
10680
e4a00ce2fc35
[gaim-migrate @ 12226]
Richard Laager <rlaager@pidgin.im>
parents:
10669
diff
changeset
|
573 | gtk_tree_store_append(lv->treestore, &child, &toplevel); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13091
diff
changeset
|
574 | gtk_tree_store_set(lv->treestore, &child, |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
575 | 0, log_date, |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13091
diff
changeset
|
576 | 1, log, |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13091
diff
changeset
|
577 | -1); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
578 | |
|
38620
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
579 | g_free(log_date); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
580 | g_free(month); |
|
b02941b9fa9a
Change purple_log_new to use GDateTime.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
581 | g_date_time_unref(dt); |
| 7432 | 582 | logs = logs->next; |
| 583 | } | |
| 584 | } | |
| 585 | ||
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
586 | static PidginLogViewer * |
|
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
587 | display_log_viewer(struct log_viewer_hash *ht, GList *logs, const char *title, |
|
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
588 | GtkWidget *icon, int log_size) |
| 10663 | 589 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
590 | PidginLogViewer *lv; |
| 7432 | 591 | |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
592 | if (logs == NULL) |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
593 | { |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
594 | /* No logs were found. */ |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
595 | const char *log_preferences = NULL; |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
596 | |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
597 | if (ht == NULL) { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16293
diff
changeset
|
598 | if (!purple_prefs_get_bool("/purple/logging/log_system")) |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
599 | log_preferences = _("System events will only be logged if the \"Log all status changes to system log\" preference is enabled."); |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
600 | } else { |
| 15884 | 601 | if (ht->type == PURPLE_LOG_IM) { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16293
diff
changeset
|
602 | if (!purple_prefs_get_bool("/purple/logging/log_ims")) |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
603 | log_preferences = _("Instant messages will only be logged if the \"Log all instant messages\" preference is enabled."); |
| 15884 | 604 | } else if (ht->type == PURPLE_LOG_CHAT) { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
16293
diff
changeset
|
605 | if (!purple_prefs_get_bool("/purple/logging/log_chats")) |
|
11869
e77f2f29b09d
[gaim-migrate @ 14160]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11780
diff
changeset
|
606 | log_preferences = _("Chats will only be logged if the \"Log all chats\" preference is enabled."); |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
607 | } |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
608 | g_free(ht->buddyname); |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
609 | g_free(ht); |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
610 | } |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
611 | |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
612 | if(icon != NULL) |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
613 | gtk_widget_destroy(icon); |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
614 | |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
615 | purple_notify_info(NULL, title, _("No logs were found"), log_preferences, NULL); |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
616 | return NULL; |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
617 | } |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
618 | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
619 | /* Window ***********/ |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
620 | lv = g_object_new(PIDGIN_TYPE_LOG_VIEWER, NULL); |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
621 | gtk_window_set_title(GTK_WINDOW(lv), title); |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
622 | |
|
13569
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
623 | lv->logs = logs; |
|
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
624 | |
| 10663 | 625 | if (ht != NULL) |
| 626 | g_hash_table_insert(log_viewers, ht, lv); | |
| 7432 | 627 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
628 | #ifndef _WIN32 |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
629 | gtk_widget_hide(lv->browse_button); |
|
15298
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
630 | #endif |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
631 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
632 | g_signal_connect(G_OBJECT(lv), "response", G_CALLBACK(destroy_cb), ht); |
|
7454
c99a2070471e
[gaim-migrate @ 8067]
Mark Doliner <markdoliner@pidgin.im>
parents:
7440
diff
changeset
|
633 | |
| 10663 | 634 | /* Icon *************/ |
|
15639
4d29fa62453d
Use person icon for Person log viewer
Sean Egan <seanegan@pidgin.im>
parents:
15613
diff
changeset
|
635 | if (icon != NULL) { |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
636 | gtk_box_pack_start(GTK_BOX(lv->title_box), icon, FALSE, FALSE, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
637 | 0); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
638 | } |
| 7432 | 639 | |
| 640 | /* Label ************/ | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
641 | gtk_label_set_markup(lv->label, title); |
| 7432 | 642 | |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
643 | /* List *************/ |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
644 | populate_log_tree(lv); |
|
11402
1be90c47f022
[gaim-migrate @ 13637]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
11243
diff
changeset
|
645 | |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
646 | /* Log size ************/ |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
647 | if(log_size) { |
|
39824
aefdb7ab2475
Replace purple_str_size_to_units by g_format_size.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39660
diff
changeset
|
648 | char *sz_txt = g_format_size(log_size); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
649 | char *text = g_strdup_printf("<span weight='bold'>%s</span> %s", |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
650 | _("Total log size:"), sz_txt); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
651 | gtk_label_set_markup(GTK_LABEL(lv->size_label), text); |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
652 | g_free(sz_txt); |
|
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
653 | g_free(text); |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
654 | } else { |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
655 | gtk_widget_hide(lv->size_label); |
|
11769
66e922bf0ebd
[gaim-migrate @ 14060]
Mark Doliner <markdoliner@pidgin.im>
parents:
11703
diff
changeset
|
656 | } |
|
11402
1be90c47f022
[gaim-migrate @ 13637]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
11243
diff
changeset
|
657 | |
|
13569
4f0396bc59fc
[gaim-migrate @ 15947]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13435
diff
changeset
|
658 | select_first_log(lv); |
| 7432 | 659 | |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
660 | gtk_widget_show(GTK_WIDGET(lv)); |
| 10663 | 661 | |
| 662 | return lv; | |
| 663 | } | |
| 664 | ||
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
665 | /**************************************************************************** |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
666 | * GObject Implementation |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
667 | ****************************************************************************/ |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
668 | static void |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
669 | pidgin_log_viewer_class_init(PidginLogViewerClass *klass) |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
670 | { |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
671 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
672 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
673 | gtk_widget_class_set_template_from_resource( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
674 | widget_class, "/im/pidgin/Pidgin/Log/log-viewer.ui"); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
675 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
676 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
677 | widget_class, PidginLogViewer, browse_button); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
678 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
679 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
680 | widget_class, PidginLogViewer, title_box); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
681 | gtk_widget_class_bind_template_child_internal(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
682 | PidginLogViewer, label); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
683 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
684 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
685 | widget_class, PidginLogViewer, treeview); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
686 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
687 | widget_class, PidginLogViewer, treestore); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
688 | gtk_widget_class_bind_template_callback(widget_class, log_select_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
689 | gtk_widget_class_bind_template_callback(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
690 | log_row_activated_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
691 | gtk_widget_class_bind_template_callback(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
692 | log_button_press_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
693 | gtk_widget_class_bind_template_callback(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
694 | log_popup_menu_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
695 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
696 | gtk_widget_class_bind_template_child_internal(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
697 | PidginLogViewer, entry); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
698 | gtk_widget_class_bind_template_callback(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
699 | entry_search_changed_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
700 | gtk_widget_class_bind_template_callback(widget_class, |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
701 | entry_stop_search_cb); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
702 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
703 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
704 | widget_class, PidginLogViewer, log_view); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
705 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
706 | widget_class, PidginLogViewer, log_buffer); |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
707 | |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
708 | gtk_widget_class_bind_template_child_internal( |
|
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
709 | widget_class, PidginLogViewer, size_label); |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
710 | } |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
711 | |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
712 | static void |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
713 | pidgin_log_viewer_init(PidginLogViewer *self) |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
714 | { |
|
39628
52c772b30a1c
Convert log viewer to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39606
diff
changeset
|
715 | gtk_widget_init_template(GTK_WIDGET(self)); |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
716 | } |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
717 | |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
718 | /**************************************************************************** |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
719 | * Public API |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
720 | ****************************************************************************/ |
|
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
721 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
722 | void pidgin_log_show(PurpleLogType type, const char *buddyname, PurpleAccount *account) { |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
723 | struct log_viewer_hash *ht; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
724 | PidginLogViewer *lv = NULL; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
725 | const char *name = buddyname; |
| 10663 | 726 | char *title; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
727 | GdkPixbuf *protocol_icon; |
| 10663 | 728 | |
| 729 | g_return_if_fail(account != NULL); | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
730 | g_return_if_fail(buddyname != NULL); |
| 10663 | 731 | |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
732 | ht = g_new0(struct log_viewer_hash, 1); |
|
15298
e192226f7804
[gaim-migrate @ 18026]
Daniel Atallah <datallah@pidgin.im>
parents:
15060
diff
changeset
|
733 | |
| 10663 | 734 | ht->type = type; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
735 | ht->buddyname = g_strdup(buddyname); |
| 10663 | 736 | ht->account = account; |
| 737 | ||
| 738 | if (log_viewers == NULL) { | |
| 739 | log_viewers = g_hash_table_new(log_viewer_hash, log_viewer_equal); | |
| 740 | } else if ((lv = g_hash_table_lookup(log_viewers, ht))) { | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
741 | gtk_window_present(GTK_WINDOW(lv)); |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
742 | g_free(ht->buddyname); |
| 10663 | 743 | g_free(ht); |
| 744 | return; | |
| 745 | } | |
| 746 | ||
| 15884 | 747 | if (type == PURPLE_LOG_CHAT) { |
| 748 | PurpleChat *chat; | |
| 10663 | 749 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
750 | chat = purple_blist_find_chat(account, buddyname); |
| 10663 | 751 | if (chat != NULL) |
| 15884 | 752 | name = purple_chat_get_name(chat); |
| 10663 | 753 | |
| 754 | title = g_strdup_printf(_("Conversations in %s"), name); | |
| 755 | } else { | |
| 15884 | 756 | PurpleBuddy *buddy; |
| 10663 | 757 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
758 | buddy = purple_blist_find_buddy(account, buddyname); |
| 10663 | 759 | if (buddy != NULL) |
| 15884 | 760 | name = purple_buddy_get_contact_alias(buddy); |
| 10663 | 761 | |
| 762 | title = g_strdup_printf(_("Conversations with %s"), name); | |
| 763 | } | |
| 764 | ||
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
765 | protocol_icon = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
|
20229
0c823e1a389d
applied changes from 1e697229b1c9a564fa1e509cc9a4a83da6e664df
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
766 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
767 | display_log_viewer(ht, purple_log_get_logs(type, buddyname, account), |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
768 | title, gtk_image_new_from_pixbuf(protocol_icon), |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
24964
diff
changeset
|
769 | purple_log_get_total_size(type, buddyname, account)); |
|
20229
0c823e1a389d
applied changes from 1e697229b1c9a564fa1e509cc9a4a83da6e664df
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
770 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
771 | if (protocol_icon) |
|
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
772 | g_object_unref(protocol_icon); |
| 10663 | 773 | g_free(title); |
| 774 | } | |
| 775 | ||
| 15884 | 776 | void pidgin_log_show_contact(PurpleContact *contact) { |
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
777 | struct log_viewer_hash *ht; |
| 15884 | 778 | PurpleBlistNode *child; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
779 | PidginLogViewer *lv = NULL; |
| 10663 | 780 | GList *logs = NULL; |
| 781 | GdkPixbuf *pixbuf; | |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
782 | GtkWidget *image; |
| 10663 | 783 | const char *name = NULL; |
| 784 | char *title; | |
| 11585 | 785 | int total_log_size = 0; |
| 10663 | 786 | |
| 787 | g_return_if_fail(contact != NULL); | |
| 788 | ||
|
39660
4ddb9885a38b
Fix reserved name usage of struct *_t.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39628
diff
changeset
|
789 | ht = g_new0(struct log_viewer_hash, 1); |
| 15884 | 790 | ht->type = PURPLE_LOG_IM; |
| 10663 | 791 | ht->contact = contact; |
| 792 | ||
| 793 | if (log_viewers == NULL) { | |
| 794 | log_viewers = g_hash_table_new(log_viewer_hash, log_viewer_equal); | |
| 795 | } else if ((lv = g_hash_table_lookup(log_viewers, ht))) { | |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
796 | gtk_window_present(GTK_WINDOW(lv)); |
| 10663 | 797 | g_free(ht); |
| 798 | return; | |
| 799 | } | |
| 800 | ||
|
24959
346d2e79e719
Fix one struct hiding issue.
Richard Laager <rlaager@pidgin.im>
parents:
22455
diff
changeset
|
801 | for (child = purple_blist_node_get_first_child((PurpleBlistNode*)contact) ; |
|
346d2e79e719
Fix one struct hiding issue.
Richard Laager <rlaager@pidgin.im>
parents:
22455
diff
changeset
|
802 | child != NULL ; |
|
346d2e79e719
Fix one struct hiding issue.
Richard Laager <rlaager@pidgin.im>
parents:
22455
diff
changeset
|
803 | child = purple_blist_node_get_sibling_next(child)) { |
|
24964
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
804 | const char *buddy_name; |
|
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
805 | PurpleAccount *account; |
|
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
806 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
33760
diff
changeset
|
807 | if (!PURPLE_IS_BUDDY(child)) |
| 10663 | 808 | continue; |
| 809 | ||
|
24964
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
810 | buddy_name = purple_buddy_get_name((PurpleBuddy *)child); |
|
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
811 | account = purple_buddy_get_account((PurpleBuddy *)child); |
|
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
812 | logs = g_list_concat(purple_log_get_logs(PURPLE_LOG_IM, buddy_name, account), logs); |
|
ce4a5049a69f
Another small struct hiding change.
Richard Laager <rlaager@pidgin.im>
parents:
24959
diff
changeset
|
813 | total_log_size += purple_log_get_total_size(PURPLE_LOG_IM, buddy_name, account); |
| 10663 | 814 | } |
| 15884 | 815 | logs = g_list_sort(logs, purple_log_compare); |
| 10663 | 816 | |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
817 | image = gtk_image_new(); |
|
16280
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
818 | pixbuf = gtk_widget_render_icon(image, PIDGIN_STOCK_STATUS_PERSON, |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
819 | gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow"); |
|
22237
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
820 | if (pixbuf) { |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
821 | gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf); |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
822 | g_object_unref(pixbuf); |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
823 | } else { |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
824 | gtk_widget_destroy(image); |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
825 | image = NULL; |
|
8865b5d78095
Some more little leak fixes.
Daniel Atallah <datallah@pidgin.im>
parents:
22214
diff
changeset
|
826 | } |
|
16280
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
827 | |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
828 | name = purple_contact_get_alias(contact); |
| 10663 | 829 | |
|
16280
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
830 | /* This will happen if the contact doesn't have an alias, |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
831 | * and none of the contact's buddies are online. |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
832 | * There is probably a better way to deal with this. */ |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
833 | if (name == NULL) { |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
834 | if (PURPLE_BLIST_NODE(contact)->child != NULL && |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
835 | PURPLE_IS_BUDDY(PURPLE_BLIST_NODE(contact)->child)) |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
836 | name = purple_buddy_get_contact_alias(PURPLE_BUDDY( |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
837 | PURPLE_BLIST_NODE(contact)->child)); |
|
16280
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
838 | if (name == NULL) |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
839 | name = ""; |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
840 | } |
|
f1174892ed45
Fix a printf(%s, NULL) when opening a log for an buddy whose contact has no online buddies and no alias.
Daniel Atallah <datallah@pidgin.im>
parents:
16259
diff
changeset
|
841 | |
| 10663 | 842 | title = g_strdup_printf(_("Conversations with %s"), name); |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21172
diff
changeset
|
843 | display_log_viewer(ht, logs, title, image, total_log_size); |
| 10663 | 844 | g_free(title); |
| 7432 | 845 | } |
| 8573 | 846 | |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21172
diff
changeset
|
847 | void pidgin_syslog_show() |
| 8573 | 848 | { |
| 849 | GList *accounts = NULL; | |
| 10663 | 850 | GList *logs = NULL; |
| 8573 | 851 | |
|
10181
2425c3773266
[gaim-migrate @ 11296]
Mark Doliner <markdoliner@pidgin.im>
parents:
10175
diff
changeset
|
852 | if (syslog_viewer != NULL) { |
|
39604
f39e54ed7bfa
Convert PidginLogViewer into a (private) GObject.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
853 | gtk_window_present(GTK_WINDOW(syslog_viewer)); |
| 8573 | 854 | return; |
| 855 | } | |
| 856 | ||
| 15884 | 857 | for(accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) { |
| 8573 | 858 | |
| 15884 | 859 | PurpleAccount *account = (PurpleAccount *)accounts->data; |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
860 | if(purple_protocols_find(purple_account_get_protocol_id(account)) == NULL) |
| 8573 | 861 | continue; |
| 862 | ||
| 15884 | 863 | logs = g_list_concat(purple_log_get_system_logs(account), logs); |
| 8573 | 864 | } |
| 15884 | 865 | logs = g_list_sort(logs, purple_log_compare); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
9917
diff
changeset
|
866 | |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21172
diff
changeset
|
867 | syslog_viewer = display_log_viewer(NULL, logs, _("System Log"), NULL, 0); |
| 8573 | 868 | } |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
869 | |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
870 | /**************************************************************************** |
|
39603
98fd85e156e0
Rename gtklog -> pidginlog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38897
diff
changeset
|
871 | * PIDGIN LOG SUBSYSTEM ***************************************************** |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
872 | ****************************************************************************/ |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
873 | |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
874 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
875 | pidgin_log_get_handle(void) |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
876 | { |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
877 | static int handle; |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
878 | |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
879 | return &handle; |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
880 | } |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
881 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
882 | void pidgin_log_init(void) |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
883 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
884 | void *handle = pidgin_log_get_handle(); |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
885 | |
| 15884 | 886 | purple_signal_register(handle, "log-displaying", |
| 887 | purple_marshal_VOID__POINTER_POINTER, | |
|
34827
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34739
diff
changeset
|
888 | G_TYPE_NONE, 2, |
|
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34739
diff
changeset
|
889 | G_TYPE_POINTER, /* (PidginLogViewer *) */ |
|
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34739
diff
changeset
|
890 | PURPLE_TYPE_LOG); |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
891 | } |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
892 | |
|
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
893 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15497
diff
changeset
|
894 | pidgin_log_uninit(void) |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
895 | { |
| 15884 | 896 | purple_signals_unregister_by_instance(pidgin_log_get_handle()); |
|
12838
5c6f36abeee8
[gaim-migrate @ 15186]
Richard Laager <rlaager@pidgin.im>
parents:
12600
diff
changeset
|
897 | } |