<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="diag_preferences">
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="tasktree_search">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="secondary_icon_stock">gtk-find</property>
+ <signal name="changed" handler="ui_tasktree_search_changed_cbk" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
static GtkTreeView *w_treeview;
static GtkMenu *w_menu;
static struct task **current_tasks;
+static gchar *search_keywords;
enum {
COL_ID,
}
-void ui_tasktree_update(struct task **tasks, const char *prj_filter)
+void ui_tasktree_update(struct task **tasks)
{
GtkTreeModel *model;
struct task **tasks_cur;
struct task *task;
GtkTreeIter iter;
- const char *prj;
+ const char *prj, *prj_filter;
char *s;
+ gchar *desc;
+ int ok;
+
+ prj_filter = ui_projecttree_get_project();
current_tasks = tasks;
if (prj_filter && strcmp(prj, prj_filter))
continue;
+ if (search_keywords
+ && strlen(search_keywords)
+ && task->description) {
+ desc = g_ascii_strup(task->description, -1);
+
+ if (strstr(desc, search_keywords))
+ ok = 1;
+ else
+ ok = 0;
+
+ free(desc);
+
+ if (!ok)
+ continue;
+ }
+
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
gtk_list_store_set(GTK_LIST_STORE(model),
}
-void ui_tasktree_update_filter(const char *prj_filter)
-{
- ui_tasktree_update(current_tasks, prj_filter);
-}
-
gboolean tasktree_button_press_event_cbk(GtkWidget *widget,
GdkEventButton *evt,
gpointer data)
log_fct_exit();
}
+
+void
+ui_tasktree_search_changed_cbk(GtkEntry *entry, gchar *preedit, gpointer data)
+{
+ if (search_keywords)
+ g_free(search_keywords);
+
+ search_keywords = g_ascii_strup(gtk_entry_get_text(entry), -1);
+
+ ui_tasktree_update(current_tasks);
+}
+
+void ui_tasktree_update_filter(const char *prj)
+{
+ ui_tasktree_update(current_tasks);
+}