changeset 11402:3b95804caea4

[gaim-migrate @ 13637] sf patch #1277682, from Peter McCurdy Display most recent log by default in View Logs window FANtastic! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 01 Sep 2005 02:32:14 +0000
parents 69b0378c79e0
children f5b14ad58722
files COPYRIGHT ChangeLog src/gtklog.c
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Thu Sep 01 02:29:05 2005 +0000
+++ b/COPYRIGHT	Thu Sep 01 02:32:14 2005 +0000
@@ -137,6 +137,7 @@
 Lalo Martins
 John Matthews
 Ryan McCabe
+Peter McCurdy
 Kurt McKee
 Torrey McMahon
 Robert McQueen
--- a/ChangeLog	Thu Sep 01 02:29:05 2005 +0000
+++ b/ChangeLog	Thu Sep 01 02:32:14 2005 +0000
@@ -52,6 +52,8 @@
 	  "nudges" (Julien Cegarra, Martin Bayard)
 	* Added an account action to open your Hotmail inbox from MSN
 	* Jabber support for SRV lookups
+	* When opening the log viewer, show the most recent log by default
+	  (Peter McCurdy)
 
 	Bug fixes:
 	* People using input methods can now use Enter again.
--- a/src/gtklog.c	Thu Sep 01 02:29:05 2005 +0000
+++ b/src/gtklog.c	Thu Sep 01 02:32:14 2005 +0000
@@ -332,6 +332,7 @@
 		GtkCellRenderer *rend;
 		GtkTreeViewColumn *col;
 		GtkTreeSelection *sel;
+		GtkTreePath *path_to_first_log;
 		GtkWidget *vbox;
 		GtkWidget *frame;
 		GtkWidget *hbox;
@@ -354,9 +355,9 @@
 		gtk_tree_view_append_column (GTK_TREE_VIEW(lv->treeview), col);
 		gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (lv->treeview), FALSE);
 		gtk_container_add (GTK_CONTAINER (sw), lv->treeview);
-	
+
 		populate_log_tree(lv);
-	
+
 		sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (lv->treeview));
 		g_signal_connect (G_OBJECT (sel), "changed",
 				G_CALLBACK (log_select_cb),
@@ -365,18 +366,18 @@
 				G_CALLBACK(log_row_activated_cb),
 				lv);
 		gaim_set_accessible_label(lv->treeview, lv->label);
-	
+
 		/* A fancy little box ************/
 		vbox = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
 		gtk_paned_add2(GTK_PANED(pane), vbox);
-	
+
 		/* Viewer ************/
 		frame = gaim_gtk_create_imhtml(FALSE, &lv->imhtml, NULL);
 		gtk_widget_set_name(lv->imhtml, "gaim_gtklog_imhtml");
 		gtk_widget_set_size_request(lv->imhtml, 320, 200);
 		gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 		gtk_widget_show(frame);
-	
+
 		/* Search box **********/
 		hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE);
 		gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@@ -387,10 +388,20 @@
 		g_signal_connect(GTK_ENTRY(lv->entry), "activate", G_CALLBACK(search_cb), lv);
 		g_signal_connect(GTK_BUTTON(button), "activate", G_CALLBACK(search_cb), lv);
 		g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(search_cb), lv);
+
+		/* Show most recent log **********/
+		path_to_first_log = gtk_tree_path_new_from_string("0:0");
+		if (path_to_first_log)
+		{
+			gtk_tree_view_expand_to_path(GTK_TREE_VIEW(lv->treeview), path_to_first_log);
+			gtk_tree_selection_select_path(sel, path_to_first_log);
+			gtk_tree_path_free(path_to_first_log);
+		}
+
 	} else {
 		/* No logs were found. */
 		const char *log_preferences = NULL;
-  GtkWidget *label;
+		GtkWidget *label;
 
 		if (ht == NULL) {
 			if (!gaim_prefs_get_bool("/core/logging/log_system"))