comparison finch/gntblist.c @ 21305:0208beabfa33

Cancel the typeahead search when escape is pressed.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 11 Nov 2007 19:42:02 +0000
parents a20ef7180680
children 665e04562de0
comparison
equal deleted inserted replaced
21304:add12afc3140 21305:0208beabfa33
1504 static gboolean 1504 static gboolean
1505 key_pressed(GntWidget *widget, const char *text, FinchBlist *ggblist) 1505 key_pressed(GntWidget *widget, const char *text, FinchBlist *ggblist)
1506 { 1506 {
1507 if (text[0] == 27 && text[1] == 0) { 1507 if (text[0] == 27 && text[1] == 0) {
1508 /* Escape was pressed */ 1508 /* Escape was pressed */
1509 if (gnt_tree_is_searching(GNT_TREE(ggblist->tree)))
1510 gnt_bindable_perform_action_named(GNT_BINDABLE(ggblist->tree), "end-search", NULL);
1509 remove_peripherals(ggblist); 1511 remove_peripherals(ggblist);
1510 } else if (strcmp(text, GNT_KEY_CTRL_O) == 0) { 1512 } else if (strcmp(text, GNT_KEY_CTRL_O) == 0) {
1511 purple_prefs_set_bool(PREF_ROOT "/showoffline", 1513 purple_prefs_set_bool(PREF_ROOT "/showoffline",
1512 !purple_prefs_get_bool(PREF_ROOT "/showoffline")); 1514 !purple_prefs_get_bool(PREF_ROOT "/showoffline"));
1513 } else if (strcmp(text, GNT_KEY_INS) == 0) { 1515 } else if (strcmp(text, GNT_KEY_INS) == 0) {