gnome-utils r8512 - in trunk/logview: . data
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-utils r8512 - in trunk/logview: . data
- Date: Wed, 18 Mar 2009 11:33:59 +0000 (UTC)
Author: cosimoc
Date: Wed Mar 18 11:33:58 2009
New Revision: 8512
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8512&view=rev
Log:
2009-03-18 Cosimo Cecchi <cosimoc gnome org>
* Makefile.am:
* data/Makefile.am:
* data/logview-toolbar.xml:
* logview-prefs.c: (do_finalize), (load_filters),
(save_filter_foreach_func), (save_filters), (get_filters_foreach),
(logview_prefs_init), (logview_prefs_get_filters),
(logview_prefs_remove_filter), (logview_prefs_add_filter),
(logview_prefs_get_filter):
* logview-prefs.h:
* logview-window.c: (if): implement regex based filtering of log
files. Patch by Johannes Schmid (#574362).
Modified:
trunk/logview/ChangeLog
trunk/logview/Makefile.am
trunk/logview/data/Makefile.am
trunk/logview/data/logview-toolbar.xml
trunk/logview/logview-prefs.c
trunk/logview/logview-prefs.h
trunk/logview/logview-window.c
Modified: trunk/logview/Makefile.am
==============================================================================
--- trunk/logview/Makefile.am (original)
+++ trunk/logview/Makefile.am Wed Mar 18 11:33:58 2009
@@ -38,6 +38,10 @@
logview-findbar.c \
logview-prefs.c \
logview-prefs.h \
+ logview-filter.h \
+ logview-filter.c \
+ logview-filter-manager.h \
+ logview-filter-manager.c \
$(BUILT_SOURCES)
gnome_system_log_LDADD = \
Modified: trunk/logview/data/Makefile.am
==============================================================================
--- trunk/logview/data/Makefile.am (original)
+++ trunk/logview/data/Makefile.am Wed Mar 18 11:33:58 2009
@@ -1,5 +1,5 @@
xmldir = $(pkgdatadir)
-xml_DATA = logview-toolbar.xml
+xml_DATA = logview-toolbar.xml logview-filter.ui
desktopdir = $(datadir)/applications
desktop_in_files = gnome-system-log.desktop.in
Modified: trunk/logview/data/logview-toolbar.xml
==============================================================================
--- trunk/logview/data/logview-toolbar.xml (original)
+++ trunk/logview/data/logview-toolbar.xml Wed Mar 18 11:33:58 2009
@@ -19,6 +19,12 @@
<menuitem action="ViewZoomOut"/>
<menuitem action="ViewZoom100"/>
</menu>
+ <menu action="FilterMenu">
+ <placeholder name="PlaceholderFilters"/>
+ <separator />
+ <menuitem action="FilterMatchOnly" />
+ <menuitem action="FilterManage" />
+ </menu>
<menu action="HelpMenu">
<menuitem action="HelpContents"/>
<menuitem action="AboutAction"/>
Modified: trunk/logview/logview-prefs.c
==============================================================================
--- trunk/logview/logview-prefs.c (original)
+++ trunk/logview/logview-prefs.c Wed Mar 18 11:33:58 2009
@@ -42,6 +42,7 @@
#define GCONF_LOGFILE GCONF_DIR "/logfile"
#define GCONF_LOGFILES GCONF_DIR "/logfiles"
#define GCONF_FONTSIZE_KEY GCONF_DIR "/fontsize"
+#define GCONF_FILTERS GCONF_DIR "/filters"
/* desktop-wide settings */
#define GCONF_MONOSPACE_FONT_NAME "/desktop/gnome/interface/monospace_font_name"
@@ -55,6 +56,15 @@
LAST_SIGNAL
};
+enum {
+ FILTER_NAME,
+ FILTER_INVISIBLE,
+ FILTER_FOREGROUND,
+ FILTER_BACKGROUND,
+ FILTER_REGEX,
+ MAX_TOKENS
+};
+
static guint signals[LAST_SIGNAL] = { 0 };
#define GET_PRIVATE(o) \
@@ -64,6 +74,8 @@
GConfClient *client;
guint size_store_timeout;
+
+ GHashTable *filters;
};
typedef struct {
@@ -78,6 +90,8 @@
{
LogviewPrefs *prefs = LOGVIEW_PREFS (obj);
+ g_hash_table_destroy (prefs->priv->filters);
+
g_object_unref (prefs->priv->client);
G_OBJECT_CLASS (logview_prefs_parent_class)->finalize (obj);
@@ -170,6 +184,153 @@
return FALSE;
}
+#define DELIMITER ":"
+
+static void
+load_filters (LogviewPrefs *prefs)
+{
+ GSList *node;
+ GSList *filters;
+ gchar **tokens;
+ LogviewFilter *filter;
+ GtkTextTag *tag;
+ GdkColor color;
+
+ filters = gconf_client_get_list (prefs->priv->client,
+ GCONF_FILTERS,
+ GCONF_VALUE_STRING,
+ NULL);
+
+ prefs->priv->filters = g_hash_table_new_full (g_str_hash, g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) g_object_unref);
+
+ for (node = filters; node != NULL; node = g_slist_next (node)) {
+ tokens = g_strsplit (node->data, DELIMITER, MAX_TOKENS);
+ filter = logview_filter_new (tokens[FILTER_NAME], tokens[FILTER_REGEX]);
+ tag = gtk_text_tag_new (tokens[FILTER_NAME]);
+
+ g_object_set (tag, "invisible",
+ g_str_equal (tokens[FILTER_INVISIBLE], "1"), NULL);
+
+ if (strlen (tokens[FILTER_FOREGROUND])) {
+ gdk_color_parse (tokens[FILTER_FOREGROUND], &color);
+ g_object_set (tag, "foreground-gdk", &color,
+ "foreground-set", TRUE, NULL);
+ }
+
+ if (strlen (tokens[FILTER_BACKGROUND])) {
+ gdk_color_parse (tokens[FILTER_BACKGROUND], &color);
+ g_object_set (tag, "paragraph-background-gdk", &color,
+ "paragraph-background-set", TRUE, NULL);
+ }
+
+ g_object_set (filter, "texttag", tag, NULL);
+ g_hash_table_insert (prefs->priv->filters,
+ g_strdup(tokens[FILTER_NAME]),
+ filter);
+
+ g_object_ref (filter);
+ g_object_unref (tag);
+ g_strfreev (tokens);
+ }
+
+ g_slist_foreach (filters, (GFunc) g_free, NULL);
+ g_slist_free (filters);
+}
+
+static void
+save_filter_foreach_func (gpointer key, gpointer value, gpointer user_data)
+{
+ GSList **filters;
+ const gchar *name;
+ LogviewFilter *filter;
+ GdkColor *foreground;
+ gboolean foreground_set;
+ GdkColor *background;
+ gboolean background_set;
+ gchar *regex, *color;
+ gboolean invisible;
+ GtkTextTag *tag;
+ GString *prefs_string;
+
+ filters = user_data;
+ filter = LOGVIEW_FILTER (value);
+ name = key;
+ color = NULL;
+
+ prefs_string = g_string_new (name);
+ g_string_append (prefs_string, DELIMITER);
+
+ g_object_get (filter,
+ "regex", ®ex,
+ "texttag", &tag,
+ NULL);
+ g_object_get (tag,
+ "foreground-gdk", &foreground,
+ "paragraph-background-gdk", &background,
+ "foreground-set", &foreground_set,
+ "paragraph-background-set", &background_set,
+ "invisible", &invisible, NULL);
+
+ if (invisible) {
+ g_string_append (prefs_string, "1" DELIMITER);
+ } else {
+ g_string_append (prefs_string, "0" DELIMITER);
+ }
+
+ if (foreground_set) {
+ color = gdk_color_to_string (foreground);
+ g_string_append (prefs_string, color);
+ g_free (color);
+ gdk_color_free (foreground);
+ }
+
+ g_string_append(prefs_string, DELIMITER);
+
+ if (background_set) {
+ color = gdk_color_to_string (background);
+ g_string_append (prefs_string, color);
+ g_free (color);
+ gdk_color_free (background);
+ }
+
+ g_string_append (prefs_string, DELIMITER);
+ g_string_append (prefs_string, regex);
+
+ g_free (regex);
+ g_object_unref (tag);
+
+ *filters = g_slist_prepend (*filters, g_string_free (prefs_string, FALSE));
+}
+
+static void
+save_filters (LogviewPrefs *prefs)
+{
+ GSList *filters;
+
+ filters = NULL;
+
+ g_hash_table_foreach (prefs->priv->filters,
+ save_filter_foreach_func,
+ &filters);
+ gconf_client_set_list (prefs->priv->client,
+ GCONF_FILTERS,
+ GCONF_VALUE_STRING,
+ filters, NULL);
+
+ g_slist_foreach (filters, (GFunc) g_free, NULL);
+ g_slist_free (filters);
+}
+
+static void
+get_filters_foreach (gpointer key, gpointer value, gpointer user_data)
+{
+ GList **list;
+ list = user_data;
+ *list = g_list_append (*list, value);
+}
+
static void
logview_prefs_init (LogviewPrefs *self)
{
@@ -189,6 +350,8 @@
GCONF_MENUS_HAVE_TEAROFF,
(GConfClientNotifyFunc) have_tearoff_changed_cb,
self, NULL, NULL);
+
+ load_filters (self);
}
/* public methods */
@@ -410,3 +573,54 @@
return filename;
}
+
+GList *
+logview_prefs_get_filters (LogviewPrefs *prefs)
+{
+ GList *filters = NULL;
+
+ g_assert (LOGVIEW_IS_PREFS (prefs));
+
+ g_hash_table_foreach (prefs->priv->filters,
+ get_filters_foreach,
+ &filters);
+
+ return filters;
+}
+
+void
+logview_prefs_remove_filter (LogviewPrefs *prefs,
+ const gchar *name)
+{
+ g_assert (LOGVIEW_IS_PREFS (prefs));
+
+ g_hash_table_remove (prefs->priv->filters,
+ name);
+
+ save_filters (prefs);
+}
+
+void
+logview_prefs_add_filter (LogviewPrefs *prefs,
+ LogviewFilter *filter)
+{
+ gchar* name;
+
+ g_assert (LOGVIEW_IS_PREFS (prefs));
+ g_assert (LOGVIEW_IS_FILTER (filter));
+
+ g_object_get (filter, "name", &name, NULL);
+ g_hash_table_insert (prefs->priv->filters, name, g_object_ref (filter));
+
+ save_filters (prefs);
+}
+
+LogviewFilter *
+logview_prefs_get_filter (LogviewPrefs *prefs,
+ const gchar *name)
+{
+ g_assert (LOGVIEW_IS_PREFS (prefs));
+
+ return g_hash_table_lookup (prefs->priv->filters, name);
+}
+
Modified: trunk/logview/logview-prefs.h
==============================================================================
--- trunk/logview/logview-prefs.h (original)
+++ trunk/logview/logview-prefs.h Wed Mar 18 11:33:58 2009
@@ -21,6 +21,8 @@
#ifndef __LOGVIEW_PREFS_H__
#define __LOGVIEW_PREFS_H__
+#include "logview-filter.h"
+
#define LOGVIEW_TYPE_PREFS logview_prefs_get_type()
#define LOGVIEW_PREFS(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), LOGVIEW_TYPE_PREFS, LogviewPrefs))
@@ -50,29 +52,38 @@
const char *font_name);
void (* have_tearoff_changed) (LogviewPrefs *prefs,
gboolean have_tearoff);
+ void (* filters_changed) (LogviewPrefs *prefs);
};
GType logview_prefs_get_type (void);
/* public methods */
-LogviewPrefs * logview_prefs_get (void);
-void logview_prefs_store_window_size (LogviewPrefs *prefs,
- int width, int height);
-void logview_prefs_get_stored_window_size (LogviewPrefs *prefs,
- int *width, int *height);
-char * logview_prefs_get_monospace_font_name (LogviewPrefs *prefs);
-gboolean logview_prefs_get_have_tearoff (LogviewPrefs *prefs);
-void logview_prefs_store_log (LogviewPrefs *prefs,
- GFile *file);
-void logview_prefs_remove_stored_log (LogviewPrefs *prefs,
- GFile *target);
-GSList * logview_prefs_get_stored_logfiles (LogviewPrefs *prefs);
-void logview_prefs_store_fontsize (LogviewPrefs *prefs,
- int fontsize);
-int logview_prefs_get_stored_fontsize (LogviewPrefs *prefs);
-void logview_prefs_store_active_logfile (LogviewPrefs *prefs,
- const char *filename);
-char * logview_prefs_get_active_logfile (LogviewPrefs *prefs);
+LogviewPrefs * logview_prefs_get (void);
+void logview_prefs_store_window_size (LogviewPrefs *prefs,
+ int width, int height);
+void logview_prefs_get_stored_window_size (LogviewPrefs *prefs,
+ int *width, int *height);
+char * logview_prefs_get_monospace_font_name (LogviewPrefs *prefs);
+gboolean logview_prefs_get_have_tearoff (LogviewPrefs *prefs);
+void logview_prefs_store_log (LogviewPrefs *prefs,
+ GFile *file);
+void logview_prefs_remove_stored_log (LogviewPrefs *prefs,
+ GFile *target);
+GSList * logview_prefs_get_stored_logfiles (LogviewPrefs *prefs);
+void logview_prefs_store_fontsize (LogviewPrefs *prefs,
+ int fontsize);
+int logview_prefs_get_stored_fontsize (LogviewPrefs *prefs);
+void logview_prefs_store_active_logfile (LogviewPrefs *prefs,
+ const char *filename);
+char * logview_prefs_get_active_logfile (LogviewPrefs *prefs);
+
+GList * logview_prefs_get_filters (LogviewPrefs *prefs);
+void logview_prefs_remove_filter (LogviewPrefs *prefs,
+ const gchar* name);
+void logview_prefs_add_filter (LogviewPrefs *prefs,
+ LogviewFilter *filter);
+LogviewFilter * logview_prefs_get_filter (LogviewPrefs *prefs,
+ const gchar *name);
-#endif /* __LOG_PREFS_H__ */
\ No newline at end of file
+#endif /* __LOG_PREFS_H__ */
Modified: trunk/logview/logview-window.c
==============================================================================
--- trunk/logview/logview-window.c (original)
+++ trunk/logview/logview-window.c Wed Mar 18 11:33:58 2009
@@ -33,6 +33,7 @@
#include "logview-about.h"
#include "logview-prefs.h"
#include "logview-manager.h"
+#include "logview-filter-manager.h"
#include "gtkmessagearea.h"
@@ -43,6 +44,7 @@
struct _LogviewWindowPrivate {
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
+ GtkActionGroup *filter_action_group;
GtkWidget *find_bar;
GtkWidget *loglist;
@@ -66,6 +68,10 @@
gulong monitor_id;
guint search_timeout_id;
+
+ guint filter_merge_id;
+ GList *active_filters;
+ gboolean matches_only;
};
#define GET_PRIVATE(o) \
@@ -123,7 +129,7 @@
populate_tag_table (GtkTextTagTable *tag_table)
{
GtkTextTag *tag;
-
+
tag = gtk_text_tag_new ("bold");
g_object_set (tag, "weight", PANGO_WEIGHT_BOLD,
"weight-set", TRUE, NULL);
@@ -132,9 +138,11 @@
tag = gtk_text_tag_new ("invisible");
g_object_set (tag, "invisible", TRUE, "invisible-set", TRUE, NULL);
-
gtk_text_tag_table_add (tag_table, tag);
+ tag = gtk_text_tag_new ("invisible-filter");
+ g_object_set (tag, "invisible", TRUE, "invisible-set", TRUE, NULL);
+ gtk_text_tag_table_add (tag_table, tag);
}
@@ -584,6 +592,188 @@
}
static void
+filter_buffer (LogviewWindow *logview, gint start_line)
+{
+ GtkTextBuffer *buffer;
+ GtkTextIter start, *end;
+ gchar* text;
+ GList* cur_filter;
+ gboolean matched, invisible_set;
+ int lines, i;
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logview->priv->text_view));
+ lines = gtk_text_buffer_get_line_count (buffer);
+
+ for (i = start_line; i < lines; i++) {
+ matched = FALSE;
+
+ gtk_text_buffer_get_iter_at_line (buffer, &start, i);
+ end = gtk_text_iter_copy (&start);
+ gtk_text_iter_forward_line (end);
+
+ text = gtk_text_buffer_get_text (buffer, &start, end, TRUE);
+
+ for (cur_filter = logview->priv->active_filters; cur_filter != NULL;
+ cur_filter = g_list_next (cur_filter))
+ {
+ if (logview_filter_filter (LOGVIEW_FILTER (cur_filter->data), text)) {
+ gtk_text_buffer_apply_tag (buffer,
+ logview_filter_get_tag (LOGVIEW_FILTER (cur_filter->data)),
+ &start, end);
+ matched = TRUE;
+ }
+ }
+
+ if (!matched && logview->priv->matches_only) {
+ gtk_text_buffer_apply_tag_by_name (buffer,
+ "invisible-filter",
+ &start, end);
+ } else {
+ gtk_text_buffer_remove_tag_by_name (buffer,
+ "invisible-filter",
+ &start, end);
+ }
+
+ gtk_text_iter_free (end);
+ }
+}
+
+static void
+filter_remove (LogviewWindow *logview, LogviewFilter *filter)
+{
+ GtkTextIter start, end;
+ GtkTextBuffer *buffer;
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logview->priv->text_view));
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
+
+ gtk_text_buffer_remove_tag (buffer, logview_filter_get_tag (filter),
+ &start, &end);
+}
+
+static void
+on_filter_toggled (GtkToggleAction *action, LogviewWindow *logview)
+{
+ LogviewWindowPrivate *priv = GET_PRIVATE (logview);
+ const gchar* name;
+ LogviewFilter *filter;
+
+ name = gtk_action_get_name (GTK_ACTION (action));
+
+ if (gtk_toggle_action_get_active (action)) {
+ priv->active_filters = g_list_append (priv->active_filters,
+ logview_prefs_get_filter (priv->prefs,
+ name));
+ filter_buffer(logview, 0);
+ } else {
+ filter = logview_prefs_get_filter (priv->prefs, name);
+ priv->active_filters = g_list_remove (priv->active_filters,
+ filter);
+
+ filter_remove (logview, filter);
+ }
+}
+
+#define FILTER_PLACEHOLDER "/LogviewMenu/FilterMenu/PlaceholderFilters"
+static void
+update_filter_menu (LogviewWindow *window)
+{
+ LogviewWindowPrivate *priv;
+ GtkUIManager* ui;
+ GList *actions, *l;
+ gint n, i;
+ guint id;
+ GList *filters;
+ GtkTextBuffer *buffer;
+ GtkTextTagTable *table;
+ GtkTextTag *tag;
+ GtkToggleAction *action;
+ gchar* name;
+
+ priv = GET_PRIVATE (window);
+ ui = priv->ui_manager;
+
+ g_return_if_fail (priv->filter_action_group != NULL);
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->text_view));
+ table = priv->tag_table;
+
+ if (priv->filter_merge_id != 0) {
+ gtk_ui_manager_remove_ui (ui,
+ priv->filter_merge_id);
+ }
+
+ actions = gtk_action_group_list_actions (priv->filter_action_group);
+
+ for (l = actions; l != NULL; l = g_list_next (l)) {
+ tag = gtk_text_tag_table_lookup (table, gtk_action_get_name (GTK_ACTION (l->data)));
+ gtk_text_tag_table_remove (table, tag);
+
+ g_signal_handlers_disconnect_by_func (GTK_ACTION (l->data),
+ G_CALLBACK (on_filter_toggled),
+ window);
+ gtk_action_group_remove_action (priv->filter_action_group,
+ GTK_ACTION (l->data));
+ }
+
+ g_list_free (actions);
+
+ filters = logview_prefs_get_filters (logview_prefs_get ());
+
+ id = (g_list_length (filters) > 0) ? gtk_ui_manager_new_merge_id (ui) : 0;
+
+ for (l = filters; l != NULL; l = g_list_next (l)) {
+ g_object_get (l->data, "name", &name, NULL);
+
+ action = gtk_toggle_action_new (name, name, NULL, NULL);
+ gtk_action_group_add_action (priv->filter_action_group,
+ GTK_ACTION (action));
+
+ g_signal_connect (action,
+ "toggled",
+ G_CALLBACK (on_filter_toggled),
+ window);
+
+ gtk_ui_manager_add_ui (ui, id, FILTER_PLACEHOLDER,
+ name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
+ gtk_text_tag_table_add (table,
+ logview_filter_get_tag (LOGVIEW_FILTER (l->data)));
+
+ g_object_unref (action);
+ g_free(name);
+ }
+
+ priv->filter_merge_id = id;
+}
+
+static void
+on_logview_filter_manager_response (GtkDialog *dialog,
+ gint response,
+ LogviewWindow *logview)
+{
+ update_filter_menu (logview);
+
+ g_list_free (logview->priv->active_filters);
+ logview->priv->active_filters = NULL;
+}
+
+static void
+logview_manage_filters (GtkAction *action, LogviewWindow *logview)
+{
+ GtkWidget *manager;
+
+ manager = logview_filter_manager_new ();
+
+ g_signal_connect (manager, "response",
+ G_CALLBACK (on_logview_filter_manager_response),
+ logview);
+
+ gtk_window_set_transient_for (GTK_WINDOW (manager),
+ GTK_WINDOW (logview));
+ gtk_widget_show (GTK_WIDGET (manager));
+}
+
+static void
logview_about (GtkWidget *widget, GtkWidget *window)
{
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -629,6 +819,13 @@
gtk_widget_show (logview->priv->sidebar);
}
+static void
+logview_toggle_match_filters (GtkToggleAction *action, LogviewWindow *logview)
+{
+ logview->priv->matches_only = gtk_toggle_action_get_active (action);
+ filter_buffer (logview, 0);
+}
+
/* GObject functions */
/* Menus */
@@ -637,6 +834,7 @@
{ "FileMenu", NULL, N_("_File"), NULL, NULL, NULL },
{ "EditMenu", NULL, N_("_Edit"), NULL, NULL, NULL },
{ "ViewMenu", NULL, N_("_View"), NULL, NULL, NULL },
+ { "FilterMenu", NULL, N_("_Filters"), NULL, NULL, NULL },
{ "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
{ "OpenLog", GTK_STOCK_OPEN, N_("_Open..."), "<control>O", N_("Open a log from file"),
@@ -660,6 +858,9 @@
{ "ViewZoom100", GTK_STOCK_ZOOM_100, NULL, "<control>0", N_("Normal text size"),
G_CALLBACK (logview_normal_text)},
+ { "FilterManage", NULL, N_("Manage Filters"), NULL, N_("Manage filters"),
+ G_CALLBACK (logview_manage_filters)},
+
{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", N_("Open the help contents for the log viewer"),
G_CALLBACK (logview_help) },
{ "AboutAction", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("Show the about dialog for the log viewer"),
@@ -671,6 +872,8 @@
G_CALLBACK (logview_toggle_statusbar), TRUE },
{ "ShowSidebar", NULL, N_("Side _Pane"), "F9", N_("Show Side Pane"),
G_CALLBACK (logview_toggle_sidebar), TRUE },
+ { "FilterMatchOnly", NULL, N_("Show matches only"), NULL, N_("Only show lines that match one of the given filters"),
+ G_CALLBACK (logview_toggle_match_filters), FALSE}
};
static gboolean
@@ -799,7 +1002,7 @@
LogviewWindow *window = user_data;
GtkTextBuffer *buffer;
gboolean boldify = FALSE;
- int i, old_line_count;
+ int i, old_line_count, filter_start_line;
GtkTextIter iter, start;
GtkTextMark *mark;
char *converted;
@@ -807,6 +1010,7 @@
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (window->priv->text_view));
old_line_count = gtk_text_buffer_get_line_count (buffer);
+ filter_start_line = old_line_count > 0 ? (old_line_count - 1) : 0;
if (gtk_text_buffer_get_char_count (buffer) != 0) {
boldify = TRUE;
@@ -838,6 +1042,7 @@
gtk_text_buffer_apply_tag_by_name (buffer, "bold", &start, &iter);
gtk_text_buffer_delete_mark (buffer, mark);
}
+ filter_buffer (window, filter_start_line);
paint_timestamps (buffer, old_line_count, new_days);
@@ -1241,6 +1446,13 @@
gtk_box_pack_start (GTK_BOX (vbox), priv->statusbar, FALSE, FALSE, 0);
gtk_widget_show (priv->statusbar);
+ /* Filter menu */
+ priv->filter_action_group = gtk_action_group_new ("ActionGroupFilter");
+ gtk_ui_manager_insert_action_group (priv->ui_manager, priv->filter_action_group,
+ 1);
+ priv->active_filters = NULL;
+ update_filter_menu (logview);
+
gtk_widget_show (vbox);
gtk_widget_show (main_view);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]