# HG changeset patch # User Sadrul Habib Chowdhury # Date 1163647047 0 # Node ID f719225f988ecfb0b5a3b09d7382c9f1be425b7a # Parent e601bc7880a6d87fad10ff3bae0db250b2920035 [gaim-migrate @ 17757] show-menu action for a window. committer: Tailor Script diff -r e601bc7880a6 -r f719225f988e console/libgnt/gntstyle.c --- a/console/libgnt/gntstyle.c Thu Nov 16 00:27:30 2006 +0000 +++ b/console/libgnt/gntstyle.c Thu Nov 16 03:17:27 2006 +0000 @@ -46,7 +46,8 @@ return bool_styles[style]; } -void refine(char *text) +static void +refine(char *text) { char *s = text, *t = text; diff -r e601bc7880a6 -r f719225f988e console/libgnt/gntwindow.c --- a/console/libgnt/gntwindow.c Thu Nov 16 00:27:30 2006 +0000 +++ b/console/libgnt/gntwindow.c Thu Nov 16 03:17:27 2006 +0000 @@ -9,18 +9,17 @@ static GntBoxClass *parent_class = NULL; -static gboolean (*org_keypress)(GntWidget *widget, const char *text); static void (*org_destroy)(GntWidget *widget); static gboolean -gnt_window_key_pressed(GntWidget *widget, const char *text) +show_menu(GntBindable *bind, GList *null) { - if (strcmp(text, GNT_KEY_CTRL_O) == 0 && GNT_WINDOW(widget)->menu) { - gnt_screen_menu_show(GNT_WINDOW(widget)->menu); + GntWindow *win = GNT_WINDOW(bind); + if (win->menu) { + gnt_screen_menu_show(win->menu); return TRUE; - } else - return org_keypress(widget, text); - + } + return FALSE; } static void @@ -35,15 +34,17 @@ static void gnt_window_class_init(GntWindowClass *klass) { + GntBindableClass *bindable = GNT_BINDABLE_CLASS(klass); GntWidgetClass *wid_class = GNT_WIDGET_CLASS(klass); parent_class = GNT_BOX_CLASS(klass); - org_keypress = wid_class->key_pressed; - wid_class->key_pressed = gnt_window_key_pressed; - org_destroy = wid_class->destroy; wid_class->destroy = gnt_window_destroy; + gnt_bindable_class_register_action(bindable, "show-menu", show_menu, + GNT_KEY_CTRL_O, NULL); + gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), bindable); + GNTDEBUG; } diff -r e601bc7880a6 -r f719225f988e doc/gaim-text.1.in --- a/doc/gaim-text.1.in Thu Nov 16 00:27:30 2006 +0000 +++ b/doc/gaim-text.1.in Thu Nov 16 03:17:27 2006 +0000 @@ -261,6 +261,11 @@ # The following will let you open the context-menu in the buddylist with c-b .br c-b = context-menu +.br + +[GntWindow::binding] +.br +c-o = show-menu The \fBc-\fR corresponds to the \fBControl\fR key. You can also use \fBctrl-\fR or \fBctr-\fR or \fBctl-\fR to indicate a combination. For alt-keys, you can use