Revision: 1109 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1109&view=re... Author: eht16 Date: 2010-01-03 23:23:42 +0000 (Sun, 03 Jan 2010)
Log Message: ----------- Add a new column to the tasks list showing the used type (keyword).
Modified Paths: -------------- trunk/geany-plugins/addons/ChangeLog trunk/geany-plugins/addons/src/ao_tasks.c
Modified: trunk/geany-plugins/addons/ChangeLog =================================================================== --- trunk/geany-plugins/addons/ChangeLog 2010-01-03 23:23:14 UTC (rev 1108) +++ trunk/geany-plugins/addons/ChangeLog 2010-01-03 23:23:42 UTC (rev 1109) @@ -4,6 +4,7 @@ Move the code for creating a new task into create_task(). Strip the token from the displayed task description to be closer to the initial implementation (closes #2925003). + Add a new column to the tasks list showing the used type (keyword).
2010-01-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/geany-plugins/addons/src/ao_tasks.c =================================================================== --- trunk/geany-plugins/addons/src/ao_tasks.c 2010-01-03 23:23:14 UTC (rev 1108) +++ trunk/geany-plugins/addons/src/ao_tasks.c 2010-01-03 23:23:42 UTC (rev 1109) @@ -77,6 +77,7 @@ TLIST_COL_FILENAME, TLIST_COL_DISPLAY_FILENAME, TLIST_COL_LINE, + TLIST_COL_TOKEN, TLIST_COL_NAME, TLIST_COL_TOOLTIP, TLIST_COL_MAX @@ -384,7 +385,7 @@ AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t);
priv->store = gtk_list_store_new(TLIST_COL_MAX, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING); + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); priv->tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->store));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->tree)); @@ -418,6 +419,17 @@ text_renderer = gtk_cell_renderer_text_new(); g_object_set(text_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); column = gtk_tree_view_column_new(); + gtk_tree_view_column_set_title(column, _("Type")); + gtk_tree_view_column_pack_start(column, text_renderer, TRUE); + gtk_tree_view_column_set_attributes(column, text_renderer, "text", TLIST_COL_TOKEN, NULL); + gtk_tree_view_column_set_sort_indicator(column, FALSE); + gtk_tree_view_column_set_sort_column_id(column, TLIST_COL_TOKEN); + gtk_tree_view_column_set_resizable(column, TRUE); + gtk_tree_view_append_column(GTK_TREE_VIEW(priv->tree), column); + + text_renderer = gtk_cell_renderer_text_new(); + g_object_set(text_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Task")); gtk_tree_view_column_pack_start(column, text_renderer, TRUE); gtk_tree_view_column_set_attributes(column, text_renderer, "text", TLIST_COL_NAME, NULL); @@ -512,7 +524,7 @@ }
-static void create_task(AoTasks *t, GeanyDocument *doc, gint line, +static void create_task(AoTasks *t, GeanyDocument *doc, gint line, const gchar *token, const gchar *line_buf, const gchar *task_start, const gchar *display_name) { AoTasksPrivate *priv = AO_TASKS_GET_PRIVATE(t); @@ -529,6 +541,7 @@ TLIST_COL_FILENAME, DOC_FILENAME(doc), TLIST_COL_DISPLAY_FILENAME, display_name, TLIST_COL_LINE, line + 1, + TLIST_COL_TOKEN, token, TLIST_COL_NAME, task_start, TLIST_COL_TOOLTIP, tooltip, -1); @@ -564,7 +577,7 @@ if (! NZV(task_start)) task_start = line_buf; /* create the task */ - create_task(t, doc, line, line_buf, task_start, display_name); + create_task(t, doc, line, *token, line_buf, task_start, display_name); /* if we found a token, continue on next line */ break; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.