| 1014 g_free(text); |
1014 g_free(text); |
| 1015 return TRUE; |
1015 return TRUE; |
| 1016 } |
1016 } |
| 1017 |
1017 |
| 1018 static gboolean |
1018 static gboolean |
| 1019 ignore_keys_start(GntBindable *bindable, GList *n){ |
1019 ignore_keys_start(GntBindable *bindable, GList *n) |
| |
1020 { |
| 1020 GntWM *wm = GNT_WM(bindable); |
1021 GntWM *wm = GNT_WM(bindable); |
| 1021 |
1022 |
| 1022 if(!wm->menu && !wm->_list.window && wm->mode == GNT_KP_MODE_NORMAL){ |
1023 if(!wm->menu && !wm->_list.window && wm->mode == GNT_KP_MODE_NORMAL){ |
| 1023 ignore_keys = TRUE; |
1024 ignore_keys = TRUE; |
| 1024 return TRUE; |
1025 return TRUE; |
| 1025 } |
1026 } |
| 1026 return FALSE; |
1027 return FALSE; |
| 1027 } |
1028 } |
| 1028 |
1029 |
| 1029 static gboolean |
1030 static gboolean |
| 1030 ignore_keys_end(GntBindable *bindable, GList *n){ |
1031 ignore_keys_end(GntBindable *bindable, GList *n) |
| |
1032 { |
| 1031 return ignore_keys ? !(ignore_keys = FALSE) : FALSE; |
1033 return ignore_keys ? !(ignore_keys = FALSE) : FALSE; |
| 1032 } |
1034 } |
| 1033 |
1035 |
| 1034 static GntBox * |
|
| 1035 check_for_window_exist(GntWM *wm, const char *title) |
|
| 1036 { |
|
| 1037 GList *iter; |
|
| 1038 for(iter = wm->list;iter;iter = iter->next){ |
|
| 1039 GntBox *box = GNT_BOX(iter->data); |
|
| 1040 if(!strcmp(box->title,title)) |
|
| 1041 return box; |
|
| 1042 } |
|
| 1043 return NULL; |
|
| 1044 } |
|
| 1045 |
|
| 1046 static gboolean |
1036 static gboolean |
| 1047 help_for_bindable(GntWM *wm, GntBindable *bindable) |
1037 help_for_bindable(GntWM *wm, GntBindable *bindable) |
| 1048 { |
1038 { |
| 1049 GntBox *box; |
|
| 1050 char * title; |
|
| 1051 gboolean ret = TRUE; |
1039 gboolean ret = TRUE; |
| |
1040 GntBindableClass *klass = GNT_BINDABLE_GET_CLASS(bindable); |
| 1052 |
1041 |
| 1053 title = g_strdup_printf("Bindings for %s",g_type_name(G_OBJECT_TYPE(bindable))); |
1042 if (klass->help_window) { |
| 1054 |
1043 gnt_wm_raise_window(wm, GNT_WIDGET(klass->help_window)); |
| 1055 if((box = check_for_window_exist(wm,title))){ |
1044 } else { |
| 1056 gnt_wm_raise_window(wm,GNT_WIDGET(box)); |
|
| 1057 } |
|
| 1058 else{ |
|
| 1059 ret = gnt_bindable_build_help_window(bindable); |
1045 ret = gnt_bindable_build_help_window(bindable); |
| 1060 } |
1046 } |
| 1061 g_free(title); |
|
| 1062 return ret; |
1047 return ret; |
| 1063 |
1048 |
| 1064 } |
1049 } |
| 1065 |
1050 |
| 1066 static gboolean |
1051 static gboolean |