changeset 8911:35b68d76cb4c

[gaim-migrate @ 9681] you can now view logs of offline people without showing offline buddies (coreDumped) committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 09 May 2004 20:00:01 +0000
parents 26c9b8761707
children 40ebc5ecf86a
files COPYRIGHT ChangeLog src/dialogs.c src/gtkblist.c src/ui.h
diffstat 5 files changed, 57 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun May 09 04:06:58 2004 +0000
+++ b/COPYRIGHT	Sun May 09 20:00:01 2004 +0000
@@ -108,6 +108,7 @@
 Tim Ringenbach
 Luciano Miguel Ferreira Rocha
 Andrew Rodland
+Tom Samstag
 Neil Sanchala
 Carsten Schaar
 Luke Schierer
--- a/ChangeLog	Sun May 09 04:06:58 2004 +0000
+++ b/ChangeLog	Sun May 09 20:00:01 2004 +0000
@@ -10,6 +10,7 @@
 	  Add Buddy Pounce dialog.
 	* Pounce notification now includes time (Mike Lundy)
 	* The history plugin now shows history for chats in addition to IMs
+	* Menu item to view log (Tom Samstag)
 
 	Bug Fixes:
 	* Compiles again with gcc 2.96 (Ignacio J. Elia)
--- a/src/dialogs.c	Sun May 09 04:06:58 2004 +0000
+++ b/src/dialogs.c	Sun May 09 20:00:01 2004 +0000
@@ -37,6 +37,7 @@
 #include "gtkimhtmltoolbar.h"
 #include "gtkprefs.h"
 #include "gtkutils.h"
+#include "gtklog.h"
 #include "stock.h"
 
 #include "ui.h"
@@ -529,6 +530,58 @@
 						NULL);
 }
 
+static void
+get_log_cb(gpointer data, GaimRequestFields *fields)
+{
+	char *username;
+	GaimAccount *account;
+
+	account  = gaim_request_fields_get_account(fields, "account");
+
+	username = g_strdup(gaim_normalize(account,
+		gaim_request_fields_get_string(fields,  "screenname")));
+
+	if( username != NULL && *username != '\0' && account != NULL )
+		gaim_gtk_log_show( username, account );
+
+	g_free(username);
+}
+
+void
+show_log_dialog(void)
+{
+	GaimRequestFields *fields;
+	GaimRequestFieldGroup *group;
+	GaimRequestField *field;
+
+	fields = gaim_request_fields_new();
+
+	group = gaim_request_field_group_new(NULL);
+	gaim_request_fields_add_group(fields, group);
+
+	field = gaim_request_field_string_new("screenname", _("_Screen name"),
+										  NULL, FALSE);
+	gaim_request_field_set_type_hint(field, "screenname");
+	gaim_request_field_set_required(field, TRUE);
+	gaim_request_field_group_add_field(group, field);
+
+	field = gaim_request_field_account_new("account", _("_Account"), NULL);
+	gaim_request_field_set_visible(field,
+		(gaim_connections_get_all() != NULL &&
+		 gaim_connections_get_all()->next != NULL));
+	gaim_request_field_set_required(field, TRUE);
+	gaim_request_field_group_add_field(group, field);
+
+	gaim_request_fields(gaim_get_blist(), _("Get User Log"),
+						NULL,
+						_("Please enter the screen name of the person whose "
+						  "log you would like to view."),
+						fields,
+						_("OK"), G_CALLBACK(get_log_cb),
+						_("Cancel"), NULL,
+						NULL);
+}
+
 /*------------------------------------------------------*/
 /* Color Selection Dialog                               */
 /*------------------------------------------------------*/
--- a/src/gtkblist.c	Sun May 09 04:06:58 2004 +0000
+++ b/src/gtkblist.c	Sun May 09 20:00:01 2004 +0000
@@ -2313,6 +2313,7 @@
 	{ N_("/Buddies/New Instant _Message..."), "<CTL>M", show_im_dialog, 0, "<StockItem>", GAIM_STOCK_IM },
 	{ N_("/Buddies/Join a _Chat..."), "<CTL>C", gaim_gtk_blist_show_join_chat, 0, "<StockItem>", GAIM_STOCK_CHAT },
 	{ N_("/Buddies/Get User _Info..."), "<CTL>I", show_info_dialog, 0, "<StockItem>", GAIM_STOCK_INFO },
+	{ N_("/Buddies/View User _Log..."), "<CTL>L", show_log_dialog, 0, "<StockItem>" },
 	{ "/Buddies/sep1", NULL, NULL, 0, "<Separator>" },
 	{ N_("/Buddies/Show _Offline Buddies"), NULL, gaim_gtk_blist_edit_mode_cb, 1, "<CheckItem>"},
 	{ N_("/Buddies/Show _Empty Groups"), NULL, gaim_gtk_blist_show_empty_groups_cb, 1, "<CheckItem>"},
--- a/src/ui.h	Sun May 09 04:06:58 2004 +0000
+++ b/src/ui.h	Sun May 09 20:00:01 2004 +0000
@@ -129,6 +129,7 @@
 extern void show_warn_dialog(GaimConnection *, const char *);
 extern void show_im_dialog();
 extern void show_info_dialog();
+extern void show_log_dialog();
 extern void destroy_all_dialogs();
 extern void show_fgcolor_dialog(GaimConversation *c, GtkWidget *color);
 extern void show_bgcolor_dialog(GaimConversation *c, GtkWidget *color);