diff src/dialogs.c @ 7431:643cbc9a6035

[gaim-migrate @ 8036] This is good enough for CVS. This is new logging. It centers around the highly modular "GaimLogLogger," which controls how to write the log. Currently I only have the plain text logger. I wrote the beginning of an XML logger, but decided I didn't think it was that great an idea. Plugins can implement loggers themselves, so you can have, like, an SQL logger or something. The default logger writes to a file unique to the conversation, and they're saved on disk in a heirarchical fashion: ~/.gaim/logs/aim/seanegn/robflynn-date.log would be a conversation I had with Rob on date. What doesn't work: System logging The search button in the log viewer. Oh, chats probably don't log either, I didn't test. You can only log in plain text right now. Obviously, it's not done yet. But you can play around with it, and give it some love. I'll get back to it tomorrow after school, maybe. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 05 Nov 2003 06:15:49 +0000
parents fd17af0b7df1
children 357eb1c39b72
line wrap: on
line diff
--- a/src/dialogs.c	Wed Nov 05 00:18:51 2003 +0000
+++ b/src/dialogs.c	Wed Nov 05 06:15:49 2003 +0000
@@ -903,89 +903,6 @@
 }
 
 
-/*------------------------------------------------------------------------*/
-/*  Functions Called To Add A Log                                          */
-/*------------------------------------------------------------------------*/
-
-void cancel_log(GtkWidget *widget, GaimConversation *c)
-{
-	GaimGtkConversation *gtkconv;
-
-	gtkconv = GAIM_GTK_CONVERSATION(c);
-
-	if (gtkconv->toolbar.log) {
-		gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkconv->toolbar.log),
-									   FALSE);
-	}
-
-	dialogwindows = g_list_remove(dialogwindows, gtkconv->dialogs.log);
-	gtk_widget_destroy(gtkconv->dialogs.log);
-	gtkconv->dialogs.log = NULL;
-}
-
-void do_log(GtkWidget *w, GaimConversation *c)
-{
-	GaimGtkConversation *gtkconv;
-	struct log_conversation *l;
-	const char *file;
-	char path[PATHSIZE];
-
-	gtkconv = GAIM_GTK_CONVERSATION(c);
-
-	if (!find_log_info(c->name)) {
-		file = gtk_file_selection_get_filename(
-			GTK_FILE_SELECTION(gtkconv->dialogs.log));
-
-		strncpy(path, file, PATHSIZE - 1);
-
-		if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(gtkconv->dialogs.log)))
-			return;
-
-		l = (struct log_conversation *)g_new0(struct log_conversation, 1);
-		strcpy(l->name, gaim_conversation_get_name(c));
-		strcpy(l->filename, file);
-		log_conversations = g_list_append(log_conversations, l);
-
-		if (c != NULL)
-			gaim_conversation_set_logging(c, TRUE);
-	}
-
-	cancel_log(NULL, c);
-}
-
-void show_log_dialog(GaimConversation *c)
-{
-	GaimGtkConversation *gtkconv;
-	char *buf = g_malloc(BUF_LEN);
-
-	gtkconv = GAIM_GTK_CONVERSATION(c);
-
-	if (!gtkconv->dialogs.log) {
-		gtkconv->dialogs.log = gtk_file_selection_new(_("Log Conversation"));
-
-		gtk_file_selection_hide_fileop_buttons(
-			GTK_FILE_SELECTION(gtkconv->dialogs.log));
-
-		g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s.log",
-				   gaim_home_dir(), gaim_normalize(c->account, c->name));
-		g_object_set_data(G_OBJECT(gtkconv->dialogs.log), "dialog_type",
-								 "log dialog");
-		gtk_file_selection_set_filename(GTK_FILE_SELECTION(gtkconv->dialogs.log),
-										buf);
-		g_signal_connect(G_OBJECT(gtkconv->dialogs.log), "delete_event",
-						 G_CALLBACK(delete_event_dialog), c);
-		g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(gtkconv->dialogs.log)->ok_button), "clicked",
-						 G_CALLBACK(do_log), c);
-		g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(gtkconv->dialogs.log)->cancel_button), "clicked",
-						 G_CALLBACK(cancel_log), c);
-	}
-
-	g_free(buf);
-
-	gtk_widget_show(gtkconv->dialogs.log);
-	gdk_window_raise(gtkconv->dialogs.log->window);
-}
-
 /*------------------------------------------------------*/
 /* Link Dialog                                          */
 /*------------------------------------------------------*/
@@ -2098,19 +2015,6 @@
 		g_free(x);
 }
 
-void conv_show_log(GtkWidget *w, gpointer data)
-{
-	char *name = g_strdup(data);
-	show_log(name);
-	g_free(name);
-}
-
-void chat_show_log(GtkWidget *w, gpointer data)
-{
-	char *name = g_strdup_printf("%s.chat", (char*)data);
-	show_log(name);
-	g_free(name);
-}
 
 static void
 url_clicked_cb(GtkWidget *widget, const char *uri)