From: <sa...@us...> - 2006-11-16 03:17:34
|
Revision: 17757 http://svn.sourceforge.net/gaim/?rev=17757&view=rev Author: sadrul Date: 2006-11-15 19:17:27 -0800 (Wed, 15 Nov 2006) Log Message: ----------- show-menu action for a window. Modified Paths: -------------- trunk/console/libgnt/gntstyle.c trunk/console/libgnt/gntwindow.c trunk/doc/gaim-text.1.in Modified: trunk/console/libgnt/gntstyle.c =================================================================== --- trunk/console/libgnt/gntstyle.c 2006-11-16 00:27:30 UTC (rev 17756) +++ trunk/console/libgnt/gntstyle.c 2006-11-16 03:17:27 UTC (rev 17757) @@ -46,7 +46,8 @@ return bool_styles[style]; } -void refine(char *text) +static void +refine(char *text) { char *s = text, *t = text; Modified: trunk/console/libgnt/gntwindow.c =================================================================== --- trunk/console/libgnt/gntwindow.c 2006-11-16 00:27:30 UTC (rev 17756) +++ trunk/console/libgnt/gntwindow.c 2006-11-16 03:17:27 UTC (rev 17757) @@ -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; } Modified: trunk/doc/gaim-text.1.in =================================================================== --- trunk/doc/gaim-text.1.in 2006-11-16 00:27:30 UTC (rev 17756) +++ trunk/doc/gaim-text.1.in 2006-11-16 03:17:27 UTC (rev 17757) @@ -261,7 +261,12 @@ # 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 one of \fBa-\fR, \fBalt-\fR, \fBm-\fR or \fBmeta-\fR. You can also use This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |