Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Mar 2008 06:38:51 GMT
From:      dongmei <dongmei@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 138498 for review
Message-ID:  <200803250638.m2P6cpqN083160@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=138498

Change 138498 by dongmei@dongmei2007 on 2008/03/25 06:38:27

	add find mechanism continue

Affected files ...

.. //depot/projects/soc2007/dongmei-auditanalyzer/Makefile#5 edit
.. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.c#6 edit
.. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.h#3 edit
.. //depot/projects/soc2007/dongmei-auditanalyzer/gtk/progress_dlg.c#3 edit
.. //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#9 edit

Differences ...

==== //depot/projects/soc2007/dongmei-auditanalyzer/Makefile#5 (text+ko) ====

@@ -2,8 +2,9 @@
 .PATH:	${.CURDIR}
 .PATH:	${.CURDIR}/gtk
 .PATH:  ${.CURDIR}/image
+.PATH:  ${.CURDIR}/eng
 	
-SOURCES = main.c  menu.c list_view.c tree_view.c file_dlg.c gui_utils.c simple_dialog.c trail_file_dlg.c filesystem.c buffer.c except.c file_access.c strerror.c tfile.c tsess.c file_util.c capture.c toolbar.c
+SOURCES = main.c  menu.c list_view.c tree_view.c file_dlg.c gui_utils.c simple_dialog.c trail_file_dlg.c filesystem.c buffer.c except.c file_access.c strerror.c tfile.c tsess.c file_util.c capture.c toolbar.c find_dlg.c progress_dlg.c strutil.c 
 OBJS    = ${SOURCES:.c=.o}
 CFLAGS  = `pkg-config gtk+-2.0 --cflags` -D_U_=""
 LDADD   = `pkg-config gtk+-2.0  gthread-2.0 --libs` -lbsm

==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.c#6 (text+ko) ====

@@ -214,4 +214,63 @@
 	free(event);
 
 }
+gint
+packet_list_find_row_from_data(gpointer data)
+{
+#ifdef LATER
+    return eth_clist_find_row_from_data(ETH_CLIST(packet_list), data);
+#endif
+}
+void
+packet_list_set_selected_row(gint row)
+{
+#ifdef LATER
+	gint visible_rows;
+	gint first_row;
+	gboolean full_visible;
+
+
+	full_visible = eth_clist_row_is_visible(ETH_CLIST(packet_list), row) ==
+        GTK_VISIBILITY_FULL;
+
+    /* XXX - why is there no "eth_clist_set_focus_row()", so that we
+     * can make the row for the frame we found the focus row?
+     *
+     * See http://www.gnome.org/mailing-lists/archives/gtk-list/2000-January/0038.shtml
+     */
+    ETH_CLIST(packet_list)->focus_row = row;
+
+    eth_clist_select_row(ETH_CLIST(packet_list), row, -1);
+
+    if (!full_visible) {
+
+        eth_clist_freeze(ETH_CLIST(packet_list));
+
+        eth_clist_moveto(ETH_CLIST(packet_list), row, -1, 0.0, 0.0);
+
+		/* even after move still invisible (happens with empty list) -> give up */
+		if(eth_clist_row_is_visible(ETH_CLIST(packet_list), row) !=
+			GTK_VISIBILITY_FULL) {
+			eth_clist_thaw(ETH_CLIST(packet_list));
+			return;
+		}
+
+		/* The now selected row will be the first visible row in the list.
+		 * This is inconvenient, as the user is usually interested in some
+		 * packets *before* the currently selected one too.
+		 *
+		 * Try to adjust the visible rows, so the currently selected row will
+		 * be shown around the first third of the list screen.
+		 *
+		 * (This won't even do any harm if the current row is the first or the
+		 * last in the list) */
+		visible_rows = packet_list_last_full_visible_row(row) - packet_list_first_full_visible_row(row);
+		first_row = row - visible_rows / 3;
+
+		eth_clist_moveto(ETH_CLIST(packet_list), first_row >= 0 ? first_row : 0, -1, 0.0, 0.0);
+
+		eth_clist_thaw(ETH_CLIST(packet_list));
+	}
+#endif
+}
 

==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/list_view.h#3 (text+ko) ====


==== //depot/projects/soc2007/dongmei-auditanalyzer/gtk/progress_dlg.c#3 (text+ko) ====

@@ -3,6 +3,23 @@
  *
  * $Id: progress_dlg.c 19942 2006-11-21 00:40:36Z ulfl $
  *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -13,7 +30,7 @@
 
 #include <gtk/gtk.h>
 #include "gtkglobals.h"
-#include "dlg_utils.h"
+//#include "dlg_utils.h"
 #include "gui_utils.h"
 #include "progress_dlg.h"
 #include "compat_macros.h"

==== //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#9 (text+ko) ====

@@ -8,6 +8,7 @@
 #include <bsm/libbsm.h>
 #include "exceptions.h"
 #include "gtk/tree_view.h"
+#include "gtk/list_view.h"
 #include "file_wrappers.h"
 
 #include <stdbool.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803250638.m2P6cpqN083160>