comparison src/log.c @ 5676:dae79aefac8d

[gaim-migrate @ 6094] I've been meaning to do this for a LONG time. The conversation API now follows the naming convention of the rest of the new APIs. I'll get some g_return_*_if_fail() checks in there soon. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 02 Jun 2003 21:51:06 +0000
parents b07aa997ddd8
children 5e685e42931e
comparison
equal deleted inserted replaced
5675:17e345ffeddb 5676:dae79aefac8d
25 #include "win32dep.h" 25 #include "win32dep.h"
26 #endif 26 #endif
27 27
28 void rm_log(struct log_conversation *a) 28 void rm_log(struct log_conversation *a)
29 { 29 {
30 struct gaim_conversation *cnv = gaim_find_conversation(a->name); 30 GaimConversation *cnv = gaim_find_conversation(a->name);
31 31
32 /* Added the following if statements for sanity check */ 32 /* Added the following if statements for sanity check */
33 if (!a) 33 if (!a)
34 { 34 {
35 gaim_notify_error (NULL, NULL, _("Error in specifying buddy conversation."), NULL); 35 gaim_notify_error (NULL, NULL, _("Error in specifying buddy conversation."), NULL);
67 } 67 }
68 68
69 void update_log_convs() 69 void update_log_convs()
70 { 70 {
71 GList *cnv; 71 GList *cnv;
72 struct gaim_conversation *c; 72 GaimConversation *c;
73 struct gaim_gtk_conversation *gtkconv; 73 GaimGtkConversation *gtkconv;
74 74
75 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) { 75 for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) {
76 76
77 c = (struct gaim_conversation *)cnv->data; 77 c = (GaimConversation *)cnv->data;
78 78
79 if (!GAIM_IS_GTK_CONVERSATION(c)) 79 if (!GAIM_IS_GTK_CONVERSATION(c))
80 continue; 80 continue;
81 81
82 gtkconv = GAIM_GTK_CONVERSATION(c); 82 gtkconv = GAIM_GTK_CONVERSATION(c);
92 } 92 }
93 } 93 }
94 94
95 static void do_save_convo(GObject *obj, GtkWidget *wid) 95 static void do_save_convo(GObject *obj, GtkWidget *wid)
96 { 96 {
97 struct gaim_conversation *c = g_object_get_data(obj, "gaim_conversation"); 97 GaimConversation *c = g_object_get_data(obj, "gaim_conversation");
98 const char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); 98 const char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid));
99 FILE *f; 99 FILE *f;
100 100
101 if (file_is_dir(filename, wid)) 101 if (file_is_dir(filename, wid))
102 return; 102 return;
120 fprintf(f, "%s", c->history->str); 120 fprintf(f, "%s", c->history->str);
121 fclose(f); 121 fclose(f);
122 } 122 }
123 123
124 124
125 void save_convo(GtkWidget *save, struct gaim_conversation *c) 125 void save_convo(GtkWidget *save, GaimConversation *c)
126 { 126 {
127 char buf[BUF_LONG]; 127 char buf[BUF_LONG];
128 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation")); 128 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation"));
129 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S "%s.log", gaim_home_dir(), normalize(c->name)); 129 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S "%s.log", gaim_home_dir(), normalize(c->name));
130 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf); 130 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);