comparison src/gtklog.c @ 13119:fcde3faa1f57

[gaim-migrate @ 15481] This adds support for displaying log timestamps in their original timezone. If your OS's definition of struct tm sucks, then the log timestamps will show up in your local timezone, but converted, so the time is accurate. Yay! Anyway, this all works, as I've renamed lots of my log files locally, but currently, there's no code to save new logs in this name format. That's held up on a portability issue and backwards compatibility issue. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 04 Feb 2006 20:55:52 +0000
parents e1e5462b7d81
children 3de53fe8345f
comparison
equal deleted inserted replaced
13118:8855973b487b 13119:fcde3faa1f57
115 GtkTreeIter iter; 115 GtkTreeIter iter;
116 GaimLog *log = logs->data; 116 GaimLog *log = logs->data;
117 117
118 gtk_tree_store_append (lv->treestore, &iter, NULL); 118 gtk_tree_store_append (lv->treestore, &iter, NULL);
119 gtk_tree_store_set(lv->treestore, &iter, 119 gtk_tree_store_set(lv->treestore, &iter,
120 0, gaim_date_format_full(log->time), 120 0, gaim_date_format_full(localtime(&log->time)),
121 1, log, -1); 121 1, log, -1);
122 } 122 }
123 g_free(read); 123 g_free(read);
124 } 124 }
125 125
198 198
199 if (log->type != GAIM_LOG_SYSTEM) { 199 if (log->type != GAIM_LOG_SYSTEM) {
200 char *title; 200 char *title;
201 if (log->type == GAIM_LOG_CHAT) 201 if (log->type == GAIM_LOG_CHAT)
202 title = g_strdup_printf(_("<span size='larger' weight='bold'>Conversation in %s on %s</span>"), 202 title = g_strdup_printf(_("<span size='larger' weight='bold'>Conversation in %s on %s</span>"),
203 log->name, gaim_date_format_full(log->time)); 203 log->name,
204 log->tm ? gaim_date_format_full(log->tm) :
205 gaim_date_format_full(localtime(&log->time)));
204 else 206 else
205 title = g_strdup_printf(_("<span size='larger' weight='bold'>Conversation with %s on %s</span>"), 207 title = g_strdup_printf(_("<span size='larger' weight='bold'>Conversation with %s on %s</span>"),
206 log->name, gaim_date_format_full(log->time)); 208 log->name,
209 log->tm ? gaim_date_format_full(log->tm) :
210 gaim_date_format_full(localtime(&log->time)));
207 211
208 gtk_label_set_markup(GTK_LABEL(viewer->label), title); 212 gtk_label_set_markup(GTK_LABEL(viewer->label), title);
209 g_free(title); 213 g_free(title);
210 } 214 }
211 215
249 GList *logs = lv->logs; 253 GList *logs = lv->logs;
250 254
251 while (logs != NULL) { 255 while (logs != NULL) {
252 GaimLog *log = logs->data; 256 GaimLog *log = logs->data;
253 257
254 month = gaim_utf8_strftime(_("%B %Y"), localtime(&log->time)); 258 month = gaim_utf8_strftime(_("%B %Y"),
259 log->tm ? log->tm : localtime(&log->time));
255 260
256 if (strcmp(month, prev_top_month) != 0) 261 if (strcmp(month, prev_top_month) != 0)
257 { 262 {
258 /* top level */ 263 /* top level */
259 gtk_tree_store_append(lv->treestore, &toplevel, NULL); 264 gtk_tree_store_append(lv->treestore, &toplevel, NULL);
263 } 268 }
264 269
265 /* sub */ 270 /* sub */
266 gtk_tree_store_append(lv->treestore, &child, &toplevel); 271 gtk_tree_store_append(lv->treestore, &child, &toplevel);
267 gtk_tree_store_set(lv->treestore, &child, 272 gtk_tree_store_set(lv->treestore, &child,
268 0, gaim_date_format_full(log->time), 273 0, log->tm ? gaim_date_format_full(log->tm) : gaim_date_format_full(localtime(&log->time)),
269 1, log, 274 1, log,
270 -1); 275 -1);
271 276
272 logs = logs->next; 277 logs = logs->next;
273 } 278 }