Mercurial > pidgin.yaz
diff finch/libgnt/gntwm.c @ 17722:15988e2bd270
Mostly whitespace changes.
Look for the rebinding-window in the class, instead of going over to the
field and asking everyone about it.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 08 Jun 2007 05:43:29 +0000 |
parents | 3ee6ea8a66f8 |
children | c918d59d5936 |
line wrap: on
line diff
--- a/finch/libgnt/gntwm.c Fri Jun 08 04:14:56 2007 +0000 +++ b/finch/libgnt/gntwm.c Fri Jun 08 05:43:29 2007 +0000 @@ -1016,7 +1016,8 @@ } static gboolean -ignore_keys_start(GntBindable *bindable, GList *n){ +ignore_keys_start(GntBindable *bindable, GList *n) +{ GntWM *wm = GNT_WM(bindable); if(!wm->menu && !wm->_list.window && wm->mode == GNT_KP_MODE_NORMAL){ @@ -1027,38 +1028,22 @@ } static gboolean -ignore_keys_end(GntBindable *bindable, GList *n){ - return ignore_keys ? !(ignore_keys = FALSE) : FALSE; -} - -static GntBox * -check_for_window_exist(GntWM *wm, const char *title) +ignore_keys_end(GntBindable *bindable, GList *n) { - GList *iter; - for(iter = wm->list;iter;iter = iter->next){ - GntBox *box = GNT_BOX(iter->data); - if(!strcmp(box->title,title)) - return box; - } - return NULL; + return ignore_keys ? !(ignore_keys = FALSE) : FALSE; } static gboolean help_for_bindable(GntWM *wm, GntBindable *bindable) { - GntBox *box; - char * title; gboolean ret = TRUE; + GntBindableClass *klass = GNT_BINDABLE_GET_CLASS(bindable); - title = g_strdup_printf("Bindings for %s",g_type_name(G_OBJECT_TYPE(bindable))); - - if((box = check_for_window_exist(wm,title))){ - gnt_wm_raise_window(wm,GNT_WIDGET(box)); - } - else{ + if (klass->help_window) { + gnt_wm_raise_window(wm, GNT_WIDGET(klass->help_window)); + } else { ret = gnt_bindable_build_help_window(bindable); } - g_free(title); return ret; } @@ -1082,7 +1067,7 @@ if (!GNT_IS_BOX(widget)) return TRUE; - return help_for_bindable(wm,GNT_BINDABLE(GNT_BOX(widget)->active)); + return help_for_bindable(wm, GNT_BINDABLE(GNT_BOX(widget)->active)); }