You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <the...@us...> - 2006-11-05 23:30:24
|
Revision: 17674 http://svn.sourceforge.net/gaim/?rev=17674&view=rev Author: thekingant Date: 2006-11-05 15:22:41 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Only clear out the password when the server tells us it is incorrect if the user is not saving passwords for this account Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-11-05 17:37:09 UTC (rev 17673) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-11-05 23:22:41 UTC (rev 17674) @@ -1284,7 +1284,8 @@ case 0x05: /* Incorrect password */ gc->wants_to_die = TRUE; - gaim_account_set_password(account, NULL); + if (!gaim_account_get_remember_password(account)) + gaim_account_set_password(account, NULL); gaim_connection_error(gc, _("Incorrect password.")); break; case 0x11: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-05 17:37:26
|
Revision: 17673 http://svn.sourceforge.net/gaim/?rev=17673&view=rev Author: sadrul Date: 2006-11-05 09:37:09 -0800 (Sun, 05 Nov 2006) Log Message: ----------- erasechar() returns the erase character (VERASE) from termios. This may solve the backspace problem for Sebastian Noack. Modified Paths: -------------- trunk/console/libgnt/gntentry.c Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-11-05 17:28:33 UTC (rev 17672) +++ trunk/console/libgnt/gntentry.c 2006-11-05 17:37:09 UTC (rev 17673) @@ -536,6 +536,8 @@ gnt_entry_class_init(GntEntryClass *klass) { GntBindableClass *bindable = GNT_BINDABLE_CLASS(klass); + char s[2] = {erasechar(), 0}; + parent_class = GNT_WIDGET_CLASS(klass); parent_class->destroy = gnt_entry_destroy; parent_class->draw = gnt_entry_draw; @@ -552,6 +554,7 @@ gnt_bindable_register_binding(bindable, "cursor-end", GNT_KEY_END, NULL); gnt_bindable_class_register_action(bindable, "delete-prev", backspace, GNT_KEY_BACKSPACE, NULL); + gnt_bindable_register_binding(bindable, "delete-prev", s, NULL); gnt_bindable_class_register_action(bindable, "delete-next", delkey, GNT_KEY_DEL, NULL); gnt_bindable_register_binding(bindable, "delete-next", GNT_KEY_CTRL_D, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-05 17:29:10
|
Revision: 17672 http://svn.sourceforge.net/gaim/?rev=17672&view=rev Author: sadrul Date: 2006-11-05 09:28:33 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Rearranging a bunch of stuff. Users shouldn't notice any change, apart from the added ability to bind keys for the window-manager. I will update the manual in a while. I need to know how to revert a commit in case things go terribly wrong. ... I am going to remind everyone that Dido is AWESOME! Modified Paths: -------------- trunk/console/libgnt/Makefile.am trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gntentry.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntmarshal.c trunk/console/libgnt/gntmarshal.h trunk/console/libgnt/gntmenu.c trunk/console/libgnt/gntmenuitem.c trunk/console/libgnt/gntstyle.c trunk/console/libgnt/gntstyle.h trunk/console/libgnt/gnttree.c trunk/console/libgnt/gntwidget.c trunk/console/libgnt/gntwidget.h trunk/console/libgnt/gntwm.h trunk/console/libgnt/test/multiwin.c trunk/console/libgnt/test/tv.c trunk/console/libgnt/wms/s.c Added Paths: ----------- trunk/console/libgnt/gntbindable.c trunk/console/libgnt/gntbindable.h trunk/console/libgnt/gntwm.c Modified: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am 2006-11-05 14:57:05 UTC (rev 17671) +++ trunk/console/libgnt/Makefile.am 2006-11-05 17:28:33 UTC (rev 17672) @@ -6,6 +6,7 @@ libgnt_la_SOURCES = \ gntwidget.c \ + gntbindable.c \ gntbox.c \ gntbutton.c \ gntcheckbox.c \ @@ -24,10 +25,12 @@ gnttree.c \ gntutils.c \ gntwindow.c \ + gntwm.c \ gntmain.c libgnt_la_headers = \ gntwidget.h \ + gntbindable.h \ gntbox.h \ gntbutton.h \ gntcheckbox.h \ Added: trunk/console/libgnt/gntbindable.c =================================================================== --- trunk/console/libgnt/gntbindable.c (rev 0) +++ trunk/console/libgnt/gntbindable.c 2006-11-05 17:28:33 UTC (rev 17672) @@ -0,0 +1,212 @@ +#include "gntbindable.h" +#include "gntstyle.h" +#include "gnt.h" +#include "gntutils.h" + +static GObjectClass *parent_class = NULL; + +static void +gnt_bindable_class_init(GntBindableClass *klass) +{ + parent_class = g_type_class_peek_parent(klass); + + klass->actions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, + (GDestroyNotify)gnt_bindable_action_free); + klass->bindings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, + (GDestroyNotify)gnt_bindable_action_param_free); + + gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); + GNTDEBUG; +} + +static void +duplicate_hashes(GntBindableClass *klass) +{ + /* Duplicate the bindings from parent class */ + if (klass->actions) { + klass->actions = g_hash_table_duplicate(klass->actions, g_str_hash, + g_str_equal, g_free, (GDestroyNotify)gnt_bindable_action_free); + klass->bindings = g_hash_table_duplicate(klass->bindings, g_str_hash, + g_str_equal, g_free, (GDestroyNotify)gnt_bindable_action_param_free); + } else { + klass->actions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, + (GDestroyNotify)gnt_bindable_action_free); + klass->bindings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, + (GDestroyNotify)gnt_bindable_action_param_free); + } + + GNTDEBUG; +} + +/****************************************************************************** + * GntBindable API + *****************************************************************************/ +GType +gnt_bindable_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) { + static const GTypeInfo info = { + sizeof(GntBindableClass), + (GBaseInitFunc)duplicate_hashes, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_bindable_class_init, + NULL, + NULL, /* class_data */ + sizeof(GntBindable), + 0, /* n_preallocs */ + NULL, /* instance_init */ + }; + + type = g_type_register_static(G_TYPE_OBJECT, + "GntBindable", + &info, G_TYPE_FLAG_ABSTRACT); + } + + return type; +} + +/** + * Key Remaps + */ +const char * +gnt_bindable_remap_keys(GntBindable *bindable, const char *text) +{ + const char *remap = NULL; + GType type = G_OBJECT_TYPE(bindable); + GntBindableClass *klass = GNT_BINDABLE_CLASS(GNT_BINDABLE_GET_CLASS(bindable)); + + if (klass->remaps == NULL) + { + klass->remaps = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + gnt_styles_get_keyremaps(type, klass->remaps); + } + + remap = g_hash_table_lookup(klass->remaps, text); + + return (remap ? remap : text); +} + +/** + * Actions and Bindings + */ +gboolean +gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...) +{ + GntBindableClass *klass = GNT_BINDABLE_CLASS(GNT_BINDABLE_GET_CLASS(bindable)); + GList *list = NULL; + va_list args; + GntBindableAction *action; + void *p; + + va_start(args, name); + while ((p = va_arg(args, void *)) != NULL) + list = g_list_append(list, p); + va_end(args); + + action = g_hash_table_lookup(klass->actions, name); + if (action && action->u.action) { + if (list) + return action->u.action(bindable, list); + else + return action->u.action_noparam(bindable); + } + return FALSE; +} + +gboolean +gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys) +{ + GntBindableClass *klass = GNT_BINDABLE_CLASS(GNT_BINDABLE_GET_CLASS(bindable)); + GntBindableActionParam *param = g_hash_table_lookup(klass->bindings, keys); + + if (param && param->action) { + if (param->list) + return param->action->u.action(bindable, param->list); + else + return param->action->u.action_noparam(bindable); + } + return FALSE; +} + +static void +register_binding(GntBindableClass *klass, const char *name, const char *trigger, GList *list) +{ + GntBindableActionParam *param; + GntBindableAction *action; + + if (name == NULL || *name == '\0') { + g_hash_table_remove(klass->bindings, (char*)trigger); + return; + } + + action = g_hash_table_lookup(klass->actions, name); + if (!action) { + g_printerr("GntWidget: Invalid action name %s for %s\n", + name, g_type_name(G_OBJECT_CLASS_TYPE(klass))); + if (list) + g_list_free(list); + return; + } + + param = g_new0(GntBindableActionParam, 1); + param->action = action; + param->list = list; + g_hash_table_replace(klass->bindings, g_strdup(trigger), param); +} + +void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, + const char *trigger, ...) +{ + GList *list = NULL; + va_list args; + void *data; + + va_start(args, trigger); + while ((data = va_arg(args, void *))) { + list = g_list_append(list, data); + } + va_end(args); + + register_binding(klass, name, trigger, list); +} + +void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, + GntBindableActionCallback callback, const char *trigger, ...) +{ + void *data; + va_list args; + GntBindableAction *action = g_new0(GntBindableAction, 1); + GList *list; + + action->name = g_strdup(name); + action->u.action = callback; + + g_hash_table_replace(klass->actions, g_strdup(name), action); + + if (trigger) { + list = NULL; + va_start(args, trigger); + while ((data = va_arg(args, void *))) { + list = g_list_append(list, data); + } + va_end(args); + + register_binding(klass, name, trigger, list); + } +} + +void gnt_bindable_action_free(GntBindableAction *action) +{ + g_free(action->name); + g_free(action); +} + +void gnt_bindable_action_param_free(GntBindableActionParam *param) +{ + g_list_free(param->list); /* XXX: There may be a leak here for string parameters */ + g_free(param); +} + + Property changes on: trunk/console/libgnt/gntbindable.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntbindable.h =================================================================== --- trunk/console/libgnt/gntbindable.h (rev 0) +++ trunk/console/libgnt/gntbindable.h 2006-11-05 17:28:33 UTC (rev 17672) @@ -0,0 +1,90 @@ +#ifndef GNT_BINDABLE_H +#define GNT_BINDABLE_H + +#include <stdio.h> +#include <glib.h> +#include <glib-object.h> +#include <ncurses.h> + +#define GNT_TYPE_BINDABLE (gnt_bindable_get_gtype()) +#define GNT_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BINDABLE, GntBindable)) +#define GNT_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BINDABLE, GntBindableClass)) +#define GNT_IS_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BINDABLE)) +#define GNT_IS_BINDABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BINDABLE)) +#define GNT_BINDABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BINDABLE, GntBindableClass)) + +#define GNTDEBUG fprintf(stderr, "%s\n", __FUNCTION__) + +typedef struct _GnBindable GntBindable; +typedef struct _GnBindableClass GntBindableClass; + +struct _GnBindable +{ + GObject inherit; +}; + +struct _GnBindableClass +{ + GObjectClass parent; + + GHashTable *remaps; /* Key remaps */ + GHashTable *actions; /* name -> Action */ + GHashTable *bindings; /* key -> ActionParam */ + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +}; + +G_BEGIN_DECLS + +GType gnt_bindable_get_gtype(void); + +/******************/ +/* Key Remaps */ +/******************/ +const char * gnt_bindable_remap_keys(GntBindable *bindable, const char *text); + +/******************/ +/* Bindable Actions */ +/******************/ +typedef gboolean (*GntBindableActionCallback) (GntBindable *bindable, GList *params); +typedef gboolean (*GntBindableActionCallbackNoParam)(GntBindable *bindable); + +typedef struct _GnBindableAction GntBindableAction; +typedef struct _GnBindableActionParam GntBindableActionParam; + +struct _GnBindableAction +{ + char *name; /* The name of the action */ + union { + gboolean (*action)(GntBindable *bindable, GList *params); + gboolean (*action_noparam)(GntBindable *bindable); + } u; +}; + +struct _GnBindableActionParam +{ + GntBindableAction *action; + GList *list; +}; + + +/*GntBindableAction *gnt_bindable_action_parse(const char *name);*/ + +void gnt_bindable_action_free(GntBindableAction *action); +void gnt_bindable_action_param_free(GntBindableActionParam *param); + +void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, + GntBindableActionCallback callback, const char *trigger, ...); +void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, + const char *trigger, ...); + +gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); +gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...); + +G_END_DECLS + +#endif /* GNT_BINDABLE_H */ + Property changes on: trunk/console/libgnt/gntbindable.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-11-05 14:57:05 UTC (rev 17671) +++ trunk/console/libgnt/gntcombobox.c 2006-11-05 17:28:33 UTC (rev 17672) @@ -105,6 +105,7 @@ parent->priv.width = widget->priv.width; parent->priv.height = height + 2; + GNT_WIDGET_UNSET_FLAGS(parent, GNT_WIDGET_INVISIBLE); gnt_widget_draw(parent); } Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-11-05 14:57:05 UTC (rev 17671) +++ trunk/console/libgnt/gntentry.c 2006-11-05 17:28:33 UTC (rev 17672) @@ -74,8 +74,6 @@ if (y + 10 >= getmaxy(stdscr)) y -= 11; gnt_widget_set_position(box, x, y); - - gnt_widget_draw(box); } else gnt_tree_remove_all(GNT_TREE(entry->ddown)); @@ -99,6 +97,7 @@ return FALSE; } + gnt_widget_draw(entry->ddown->parent); return TRUE; } @@ -159,9 +158,9 @@ } static gboolean -move_back(GntWidget *widget, GList *null) +move_back(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->cursor <= entry->start) return FALSE; entry->cursor = g_utf8_find_prev_char(entry->start, entry->cursor); @@ -172,9 +171,9 @@ } static gboolean -move_forward(GntWidget *widget, GList *list) +move_forward(GntBindable *bind, GList *list) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->cursor >= entry->end) return FALSE; entry->cursor = g_utf8_find_next_char(entry->cursor, NULL); @@ -185,10 +184,10 @@ } static gboolean -backspace(GntWidget *widget, GList *null) +backspace(GntBindable *bind, GList *null) { int len; - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->cursor <= entry->start) return TRUE; @@ -208,10 +207,10 @@ } static gboolean -delkey(GntWidget *widget, GList *null) +delkey(GntBindable *bind, GList *null) { int len; - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->cursor >= entry->end) return FALSE; @@ -227,18 +226,18 @@ } static gboolean -move_start(GntWidget *widget, GList *null) +move_start(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); entry->scroll = entry->cursor = entry->start; entry_redraw(GNT_WIDGET(entry)); return TRUE; } static gboolean -move_end(GntWidget *widget, GList *null) +move_end(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); entry->cursor = entry->end; /* This should be better than this */ while (gnt_util_onscreen_width(entry->scroll, entry->cursor) >= GNT_WIDGET(entry)->priv.width) @@ -248,9 +247,9 @@ } static gboolean -history_prev(GntWidget *widget, GList *null) +history_prev(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->histlength && entry->history->prev) { entry->history = entry->history->prev; @@ -263,9 +262,9 @@ } static gboolean -history_next(GntWidget *widget, GList *null) +history_next(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->histlength && entry->history->next) { if (entry->history->prev == NULL) @@ -286,52 +285,52 @@ } static gboolean -suggest_show(GntWidget *widget, GList *null) +suggest_show(GntBindable *bind, GList *null) { - return show_suggest_dropdown(GNT_ENTRY(widget)); + return show_suggest_dropdown(GNT_ENTRY(bind)); } static gboolean -suggest_next(GntWidget *widget, GList *null) +suggest_next(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->ddown) { - gnt_widget_perform_action_named(entry->ddown, "move-down", NULL); + gnt_bindable_perform_action_named(GNT_BINDABLE(entry->ddown), "move-down", NULL); return TRUE; } return FALSE; } static gboolean -suggest_prev(GntWidget *widget, GList *null) +suggest_prev(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); if (entry->ddown) { - gnt_widget_perform_action_named(entry->ddown, "move-up", NULL); + gnt_bindable_perform_action_named(GNT_BINDABLE(entry->ddown), "move-up", NULL); return TRUE; } return FALSE; } static gboolean -del_to_home(GntWidget *widget, GList *null) +del_to_home(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); memmove(entry->start, entry->cursor, entry->end - entry->cursor); entry->end -= (entry->cursor - entry->start); entry->cursor = entry->scroll = entry->start; memset(entry->end, '\0', entry->buffer - (entry->end - entry->start)); - entry_redraw(widget); + entry_redraw(GNT_WIDGET(bind)); return TRUE; } static gboolean -del_to_end(GntWidget *widget, GList *null) +del_to_end(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); entry->end = entry->cursor; memset(entry->end, '\0', entry->buffer - (entry->end - entry->start)); - entry_redraw(widget); + entry_redraw(GNT_WIDGET(bind)); return TRUE; } @@ -351,9 +350,9 @@ } static gboolean -move_back_word(GntWidget *widget, GList *null) +move_back_word(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntEntry *entry = GNT_ENTRY(bind); const char *iter = entry->cursor - 1; if (iter < entry->start) @@ -362,14 +361,15 @@ entry->cursor = (char*)iter; if (entry->cursor < entry->scroll) entry->scroll = entry->cursor; - entry_redraw(widget); + entry_redraw(GNT_WIDGET(bind)); return TRUE; } static gboolean -del_prev_word(GntWidget *widget, GList *null) +del_prev_word(GntBindable *bind, GList *null) { - GntEntry *entry = GNT_ENTRY(widget); + GntWidget *widget = GNT_WIDGET(bind); + GntEntry *entry = GNT_ENTRY(bind); char *iter = entry->cursor - 1; int count; @@ -535,6 +535,7 @@ static void gnt_entry_class_init(GntEntryClass *klass) { + GntBindableClass *bindable = GNT_BINDABLE_CLASS(klass); parent_class = GNT_WIDGET_CLASS(klass); parent_class->destroy = gnt_entry_destroy; parent_class->draw = gnt_entry_draw; @@ -543,53 +544,47 @@ parent_class->key_pressed = gnt_entry_key_pressed; parent_class->lost_focus = gnt_entry_lost_focus; - parent_class->actions = g_hash_table_duplicate(parent_class->actions, g_str_hash, - g_str_equal, g_free, (GDestroyNotify)gnt_widget_action_free); - parent_class->bindings = g_hash_table_duplicate(parent_class->bindings, g_str_hash, - g_str_equal, g_free, (GDestroyNotify)gnt_widget_action_param_free); - - gnt_widget_class_register_action(parent_class, "cursor-home", move_start, + gnt_bindable_class_register_action(bindable, "cursor-home", move_start, GNT_KEY_CTRL_A, NULL); - gnt_widget_register_binding(parent_class, "cursor-home", GNT_KEY_HOME, NULL); - gnt_widget_class_register_action(parent_class, "cursor-end", move_end, + gnt_bindable_register_binding(bindable, "cursor-home", GNT_KEY_HOME, NULL); + gnt_bindable_class_register_action(bindable, "cursor-end", move_end, GNT_KEY_CTRL_E, NULL); - gnt_widget_register_binding(parent_class, "cursor-end", GNT_KEY_END, NULL); - gnt_widget_class_register_action(parent_class, "delete-prev", backspace, + gnt_bindable_register_binding(bindable, "cursor-end", GNT_KEY_END, NULL); + gnt_bindable_class_register_action(bindable, "delete-prev", backspace, GNT_KEY_BACKSPACE, NULL); - gnt_widget_class_register_action(parent_class, "delete-next", delkey, + gnt_bindable_class_register_action(bindable, "delete-next", delkey, GNT_KEY_DEL, NULL); - gnt_widget_register_binding(parent_class, "delete-next", GNT_KEY_CTRL_D, NULL); - gnt_widget_class_register_action(parent_class, "delete-start", del_to_home, + gnt_bindable_register_binding(bindable, "delete-next", GNT_KEY_CTRL_D, NULL); + gnt_bindable_class_register_action(bindable, "delete-start", del_to_home, GNT_KEY_CTRL_U, NULL); - gnt_widget_class_register_action(parent_class, "delete-end", del_to_end, + gnt_bindable_class_register_action(bindable, "delete-end", del_to_end, GNT_KEY_CTRL_K, NULL); - gnt_widget_class_register_action(parent_class, "delete-prev-word", del_prev_word, + gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word, NULL, NULL); #if 0 - gnt_widget_class_register_action(parent_class, "delete-next-word", del_next_word, + gnt_bindable_class_register_action(bindable, "delete-next-word", del_next_word, NULL, 1, NULL); #endif - gnt_widget_class_register_action(parent_class, "cursor-prev-word", move_back_word, + gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, NULL, NULL); - gnt_widget_class_register_action(parent_class, "cursor-prev", move_back, + gnt_bindable_class_register_action(bindable, "cursor-prev", move_back, GNT_KEY_LEFT, NULL); - gnt_widget_register_binding(parent_class, "cursor-prev", GNT_KEY_CTRL_B, NULL); - gnt_widget_class_register_action(parent_class, "cursor-next", move_forward, + gnt_bindable_register_binding(bindable, "cursor-prev", GNT_KEY_CTRL_B, NULL); + gnt_bindable_class_register_action(bindable, "cursor-next", move_forward, GNT_KEY_RIGHT, NULL); - gnt_widget_register_binding(parent_class, "cursor-next", GNT_KEY_CTRL_F, NULL); - gnt_widget_class_register_action(parent_class, "suggest-show", suggest_show, + gnt_bindable_register_binding(bindable, "cursor-next", GNT_KEY_CTRL_F, NULL); + gnt_bindable_class_register_action(bindable, "suggest-show", suggest_show, "\t", NULL); - gnt_widget_class_register_action(parent_class, "suggest-next", suggest_next, + gnt_bindable_class_register_action(bindable, "suggest-next", suggest_next, GNT_KEY_DOWN, NULL); - gnt_widget_class_register_action(parent_class, "suggest-prev", suggest_prev, + gnt_bindable_class_register_action(bindable, "suggest-prev", suggest_prev, GNT_KEY_UP, NULL); - gnt_widget_class_register_action(parent_class, "history-prev", history_prev, + gnt_bindable_class_register_action(bindable, "history-prev", history_prev, "\033" GNT_KEY_CTRL_DOWN, NULL); - gnt_widget_class_register_action(parent_class, "history-next", history_next, + gnt_bindable_class_register_action(bindable, "history-next", history_next, "\033" GNT_KEY_CTRL_UP, NULL); - gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), parent_class); - + gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); GNTDEBUG; } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-11-05 14:57:05 UTC (rev 17671) +++ trunk/console/libgnt/gntmain.c 2006-11-05 17:28:33 UTC (rev 17672) @@ -38,544 +38,17 @@ * Need to wattrset for colors to use with PDCurses. */ -/** - * There can be at most one menu at a time on the screen. - * If there is a menu being displayed, then all the keystrokes will be sent to - * the menu until it is closed, either when the user activates a menuitem, or - * presses Escape to cancel the menu. - */ -static GntMenu *menu; +static GIOChannel *channel = NULL; -static int lock_focus_list; -static GList *focus_list; -static GList *ordered; - -static int X_MIN; -static int X_MAX; -static int Y_MIN; -static int Y_MAX; - static gboolean ascii_only; static gboolean mouse_enabled; -/** - * 'event_stack' will be set to TRUE when a user-event, ie. a mouse-click - * or a key-press is being processed. This variable will be used to determine - * whether to give focus to a new window. - */ -static gboolean event_stack; +static void setup_io(); -static GMainLoop *loop; - -static struct -{ - GntWidget *window; - GntWidget *tree; -} _list, *window_list, *action_list; - -typedef struct -{ - GntWidget *me; - - PANEL *panel; -} GntNode; - -typedef enum -{ - GNT_KP_MODE_NORMAL, - GNT_KP_MODE_RESIZE, - GNT_KP_MODE_MOVE, - GNT_KP_MODE_MENU, - GNT_KP_MODE_WINDOW_LIST -} GntKeyPressMode; - -static GHashTable *nodes; - -static void free_node(gpointer data); -static void draw_taskbar(gboolean reposition); -static void bring_on_top(GntWidget *widget); - static gboolean refresh_screen(); -static const GList *list_all_windows(); -static void show_actions_list(); +GntWM *wm; -static GntWM wm = -{ - NULL, /* new_window */ - NULL, /* close_window */ - NULL, /* window_resize_confirm */ - NULL, /* window_resized */ - NULL, /* window_move_confirm */ - NULL, /* window_moved */ - NULL, /* window_update */ - NULL, /* key_pressed */ - NULL, /* mouse clicked */ - bring_on_top, /* give_focus */ - NULL, /* uninit */ - list_all_windows, /* window_list */ -}; - -static const GList *list_all_windows() -{ - return focus_list; -} - -static GList * -g_list_bring_to_front(GList *list, gpointer data) -{ - list = g_list_remove(list, data); - list = g_list_prepend(list, data); - return list; -} - -static gboolean -update_screen(gpointer null) -{ - if (menu) { - GntMenu *top = menu; - while (top) { - GntNode *node = g_hash_table_lookup(nodes, top); - if (node) - top_panel(node->panel); - top = top->submenu; - } - } - update_panels(); - doupdate(); - return TRUE; -} - -void gnt_screen_take_focus(GntWidget *widget) -{ - GntWidget *w = NULL; - - if (lock_focus_list) - return; - if (g_list_find(focus_list, widget)) - return; - - if (ordered) - w = ordered->data; - - focus_list = g_list_append(focus_list, widget); - - if (event_stack) { - ordered = g_list_prepend(ordered, widget); - g_object_set_data(G_OBJECT(widget), "give_focus", GINT_TO_POINTER(event_stack)); - } else - ordered = g_list_append(ordered, widget); - - gnt_widget_set_focus(widget, TRUE); - if (w) - gnt_widget_set_focus(w, FALSE); - draw_taskbar(FALSE); -} - -void gnt_screen_remove_widget(GntWidget *widget) -{ - int pos = g_list_index(focus_list, widget); - - if (lock_focus_list) - return; - - if (pos == -1) - return; - - focus_list = g_list_remove(focus_list, widget); - ordered = g_list_remove(ordered, widget); - - if (ordered) - { - wm.give_focus(ordered->data); - } - draw_taskbar(FALSE); -} - -static void -bring_on_top(GntWidget *widget) -{ - GntNode *node = g_hash_table_lookup(nodes, widget); - - if (!node) - return; - - if (ordered->data != widget) { - GntWidget *w = ordered->data; - ordered = g_list_bring_to_front(ordered, widget); - gnt_widget_set_focus(w, FALSE); - } - - gnt_widget_set_focus(widget, TRUE); - gnt_widget_draw(widget); - top_panel(node->panel); - - if (_list.window) - { - GntNode *nd = g_hash_table_lookup(nodes, _list.window); - top_panel(nd->panel); - } - update_screen(NULL); - draw_taskbar(FALSE); -} - -static void -update_window_in_list(GntWidget *wid) -{ - GntTextFormatFlags flag = 0; - - if (window_list == NULL) - return; - - if (wid == ordered->data) - flag |= GNT_TEXT_FLAG_DIM; - else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) - flag |= GNT_TEXT_FLAG_BOLD; - - gnt_tree_set_row_flags(GNT_TREE(window_list->tree), wid, flag); -} - -static void -draw_taskbar(gboolean reposition) -{ - static WINDOW *taskbar = NULL; - GList *iter; - int n, width = 0; - int i; - - if (taskbar == NULL) - { - taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0); - } - else if (reposition) - { - mvwin(taskbar, Y_MAX, 0); - } - - wbkgdset(taskbar, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); - werase(taskbar); - - n = g_list_length(focus_list); - if (n) - width = getmaxx(stdscr) / n; - - for (i = 0, iter = focus_list; iter; iter = iter->next, i++) - { - GntWidget *w = iter->data; - int color; - const char *title; - - if (w == ordered->data) { - /* This is the current window in focus */ - color = GNT_COLOR_TITLE; - GNT_WIDGET_UNSET_FLAGS(w, GNT_WIDGET_URGENT); - if (wm.window_update) { - GntNode *node = g_hash_table_lookup(nodes, w); - wm.window_update(node ? node->panel : NULL, w); - } - } else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) { - /* This is a window with the URGENT hint set */ - color = GNT_COLOR_URGENT; - } else { - color = GNT_COLOR_NORMAL; - } - wbkgdset(taskbar, '\0' | COLOR_PAIR(color)); - mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), width); - title = GNT_BOX(w)->title; - mvwprintw(taskbar, 0, width * i, "%s", title ? title : "<gnt>"); - if (i) - mvwaddch(taskbar, 0, width *i - 1, ACS_VLINE | A_STANDOUT | COLOR_PAIR(GNT_COLOR_NORMAL)); - - update_window_in_list(w); - } - - wrefresh(taskbar); -} - -static void -switch_window(int direction) -{ - GntWidget *w = NULL, *wid = NULL; - int pos; - - if (!ordered || !ordered->next) - return; - - w = ordered->data; - pos = g_list_index(focus_list, w); - pos += direction; - - if (pos < 0) - wid = g_list_last(focus_list)->data; - else if (pos >= g_list_length(focus_list)) - wid = focus_list->data; - else if (pos >= 0) - wid = g_list_nth_data(focus_list, pos); - - ordered = g_list_bring_to_front(ordered, wid); - - wm.give_focus(ordered->data); - - if (w != wid) - { - gnt_widget_set_focus(w, FALSE); - } -} - -static void -switch_window_n(int n) -{ - GntWidget *w = NULL; - GList *l; - - if (!ordered) - return; - - w = ordered->data; - - if ((l = g_list_nth(focus_list, n)) != NULL) - { - ordered = g_list_bring_to_front(ordered, l->data); - wm.give_focus(ordered->data); - } - - if (l && w != l->data) - { - gnt_widget_set_focus(w, FALSE); - } -} - -static void -window_list_activate(GntTree *tree, gpointer null) -{ - GntWidget *widget = gnt_tree_get_selection_data(GNT_TREE(tree)); - GntWidget *old = NULL; - - if (!ordered || !widget) - return; - - old = ordered->data; - ordered = g_list_bring_to_front(ordered, widget); - wm.give_focus(widget); - - if (old != widget) - { - gnt_widget_set_focus(old, FALSE); - } -} - -static void -setup__list() -{ - GntWidget *tree, *win; - win = _list.window = gnt_box_new(FALSE, FALSE); - gnt_box_set_toplevel(GNT_BOX(win), TRUE); - gnt_box_set_pad(GNT_BOX(win), 0); - - tree = _list.tree = gnt_tree_new(); - gnt_box_add_widget(GNT_BOX(win), tree); -} - -static void -show_window_list() -{ - GntWidget *tree, *win; - GList *iter; - - if (window_list) - return; - - setup__list(); - - window_list = &_list; - - win = window_list->window; - tree = window_list->tree; - - gnt_box_set_title(GNT_BOX(win), "Window List"); - - for (iter = focus_list; iter; iter = iter->next) - { - GntBox *box = GNT_BOX(iter->data); - - gnt_tree_add_row_last(GNT_TREE(tree), box, - gnt_tree_create_row(GNT_TREE(tree), box->title), NULL); - update_window_in_list(GNT_WIDGET(box)); - } - - gnt_tree_set_selected(GNT_TREE(tree), ordered->data); - g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); - - gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3); - gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2); - gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4); - - lock_focus_list = 1; - gnt_widget_show(win); - lock_focus_list = 0; -} - -static void -shift_window(GntWidget *widget, int dir) -{ - GList *all = focus_list; - GList *list = g_list_find(all, widget); - int length, pos; - if (!list) - return; - - length = g_list_length(all); - pos = g_list_position(all, list); - - pos += dir; - if (dir > 0) - pos++; - - if (pos < 0) - pos = length; - else if (pos > length) - pos = 0; - - all = g_list_insert(all, widget, pos); - all = g_list_delete_link(all, list); - focus_list = all; - draw_taskbar(FALSE); -} - -static void -dump_screen() -{ - int x, y; - chtype old = 0, now = 0; - FILE *file = fopen("dump.html", "w"); - - fprintf(file, "<pre>"); - for (y = 0; y < getmaxy(stdscr); y++) - { - for (x = 0; x < getmaxx(stdscr); x++) - { - char ch; - now = mvwinch(curscr, y, x); - ch = now & A_CHARTEXT; - now ^= ch; - -#define CHECK(attr, start, end) \ - do \ - { \ - if (now & attr) \ - { \ - if (!(old & attr)) \ - fprintf(file, start); \ - } \ - else if (old & attr) \ - { \ - fprintf(file, end); \ - } \ - } while (0) - - CHECK(A_BOLD, "<b>", "</b>"); - CHECK(A_UNDERLINE, "<u>", "</u>"); - CHECK(A_BLINK, "<blink>", "</blink>"); - - if ((now & A_COLOR) != (old & A_COLOR) || - (now & A_REVERSE) != (old & A_REVERSE)) - { - int ret; - short fgp, bgp, r, g, b; - struct - { - int r, g, b; - } fg, bg; - - ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp); - if (fgp == -1) - fgp = COLOR_BLACK; - if (bgp == -1) - bgp = COLOR_WHITE; - if (now & A_REVERSE) - fgp ^= bgp ^= fgp ^= bgp; /* *wink* */ - ret = color_content(fgp, &r, &g, &b); - fg.r = r; fg.b = b; fg.g = g; - ret = color_content(bgp, &r, &g, &b); - bg.r = r; bg.b = b; bg.g = g; -#define ADJUST(x) (x = x * 255 / 1000) - ADJUST(fg.r); - ADJUST(fg.g); - ADJUST(fg.b); - ADJUST(bg.r); - ADJUST(bg.b); - ADJUST(bg.g); - - if (x) fprintf(file, "</span>"); - fprintf(file, "<span style=\"background:#%02x%02x%02x;color:#%02x%02x%02x\">", - bg.r, bg.g, bg.b, fg.r, fg.g, fg.b); - } - if (now & A_ALTCHARSET) - { - switch (ch) - { - case 'q': - ch = '-'; break; - case 't': - case 'u': - case 'x': - ch = '|'; break; - case 'v': - case 'w': - case 'l': - case 'm': - case 'k': - case 'j': - case 'n': - ch = '+'; break; - case '-': - ch = '^'; break; - case '.': - ch = 'v'; break; - case 'a': - ch = '#'; break; - default: - ch = ' '; break; - } - } - if (ch == '&') - fprintf(file, "&"); - else if (ch == '<') - fprintf(file, "<"); - else if (ch == '>') - fprintf(file, ">"); - else - fprintf(file, "%c", ch); - old = now; - } - fprintf(file, "</span>\n"); - old = 0; - } - fprintf(file, "</pre>"); - fclose(file); -} - -static void -refresh_node(GntWidget *widget, GntNode *node, gpointer null) -{ - int x, y, w, h; - int nw, nh; - - gnt_widget_get_position(widget, &x, &y); - gnt_widget_get_size(widget, &w, &h); - - if (x + w >= X_MAX) - x = MAX(0, X_MAX - w); - if (y + h >= Y_MAX) - y = MAX(0, Y_MAX - h); - gnt_screen_move_widget(widget, x, y); - - nw = MIN(w, X_MAX); - nh = MIN(h, Y_MAX); - if (nw != w || nh != h) - gnt_screen_resize_widget(widget, nw, nh); -} - /** * Mouse support: * - bring a window on top if you click on its taskbar @@ -602,7 +75,7 @@ GntWidget *widget = NULL; PANEL *p = NULL; - if (!ordered || buffer[0] != 27) + if (!wm->ordered || buffer[0] != 27) return FALSE; buffer++; @@ -653,16 +126,13 @@ } else return FALSE; - if (wm.mouse_clicked && wm.mouse_clicked(event, x, y, widget)) + if (gnt_wm_process_click(wm, event, x, y, widget)) return TRUE; - if (event == GNT_LEFT_MOUSE_DOWN && widget && widget != _list.window && + if (event == GNT_LEFT_MOUSE_DOWN && widget && widget != wm->_list.window && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_TRANSIENT)) { - if (widget != ordered->data) { - GntWidget *w = ordered->data; - ordered = g_list_bring_to_front(ordered, widget); - wm.give_focus(ordered->data); - gnt_widget_set_focus(w, FALSE); + if (widget != wm->ordered->data) { + gnt_wm_raise_window(wm, widget); } if (y == widget->priv.y) { offset = x - widget->priv.x; @@ -672,17 +142,16 @@ } else if (event == GNT_MOUSE_UP) { if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) { /* Clicked on the taskbar */ - int n = g_list_length(focus_list); + int n = g_list_length(wm->list); if (n) { int width = getmaxx(stdscr) / n; - switch_window_n(x / width); + gnt_bindable_perform_action_named(GNT_BINDABLE(wm), "switch-window-n", x/width, NULL); } } else if (button == MOUSE_LEFT && remember) { x -= offset; if (x < 0) x = 0; if (y < 0) y = 0; gnt_screen_move_widget(remember, x, y); - refresh_node(remember, NULL, NULL); } button = MOUSE_NONE; remember = NULL; @@ -690,87 +159,25 @@ } gnt_widget_clicked(widget, event, x, y); - return TRUE; /* XXX: this should be TRUE */ + return TRUE; } -#ifndef NO_WIDECHAR -static int -widestringwidth(wchar_t *wide) +static gboolean +io_invoke_error(GIOChannel *source, GIOCondition cond, gpointer data) { - int len, ret; - char *string; + int id = GPOINTER_TO_INT(data); + g_source_remove(id); + g_io_channel_unref(source); - len = wcstombs(NULL, wide, 0) + 1; - string = g_new0(char, len); - wcstombs(string, wide, len); - ret = gnt_util_onscreen_width(string, NULL); - g_free(string); - return ret; + channel = NULL; + setup_io(); + return TRUE; } -#endif -/* Returns the onscreen width of the character at the position */ -static int -reverse_char(WINDOW *d, int y, int x, gboolean set) -{ -#define DECIDE(ch) (set ? ((ch) | A_REVERSE) : ((ch) & ~A_REVERSE)) - -#ifdef NO_WIDECHAR - chtype ch; - ch = mvwinch(d, y, x); - mvwaddch(d, y, x, DECIDE(ch)); - return 1; -#else - cchar_t ch; - int wc = 1; - if (mvwin_wch(d, y, x, &ch) == OK) { - wc = widestringwidth(ch.chars); - ch.attr = DECIDE(ch.attr); - ch.attr &= WA_ATTRIBUTES; /* XXX: This is a workaround for a bug */ - mvwadd_wch(d, y, x, &ch); - } - - return wc; -#endif -} - -static void -window_reverse(GntWidget *win, gboolean set) -{ - int i; - int w, h; - WINDOW *d; - - if (GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_NO_BORDER)) - return; - - d = win->window; - gnt_widget_get_size(win, &w, &h); - - if (gnt_widget_has_shadow(win)) { - --w; - --h; - } - - /* the top and bottom */ - for (i = 0; i < w; i += reverse_char(d, 0, i, set)); - for (i = 0; i < w; i += reverse_char(d, h-1, i, set)); - - /* the left and right */ - for (i = 0; i < h; i += reverse_char(d, i, 0, set)); - for (i = 0; i < h; i += reverse_char(d, i, w-1, set)); - - wrefresh(win->window); -} - static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { char keys[256]; - gboolean ret = FALSE; - static GntKeyPressMode mode = GNT_KP_MODE_NORMAL; - const char *buffer; - int rd = read(STDIN_FILENO, keys, sizeof(keys) - 1); if (rd < 0) { @@ -787,255 +194,48 @@ raise(SIGABRT); } - event_stack = TRUE; keys[rd] = 0; - - if (keys[0] == 27 && keys[1] == 'd' && keys[2] == 0) - { - /* This dumps the screen contents in an html file */ - dump_screen(); - } - gnt_keys_refine(keys); if (mouse_enabled && detect_mouse_action(keys)) return TRUE; - if (wm.key_pressed) { - buffer = wm.key_pressed(keys); - if (buffer == NULL) { - event_stack = FALSE; - return TRUE; - } - } else - buffer = keys; + gnt_wm_process_input(wm, keys); - if (mode == GNT_KP_MODE_NORMAL) - { - if (menu) { - ret = gnt_widget_key_pressed(GNT_WIDGET(menu), buffer); - } else if (ordered) { - ret = gnt_widget_key_pressed(ordered->data, buffer); - } + return TRUE; +} - if (!ret) - { - if (buffer[0] == 27) - { - /* Some special key has been pressed */ - if (strcmp(buffer, GNT_KEY_POPUP) == 0) - {} - else if (strcmp(buffer + 1, "c") == 0) - { - /* Alt + c was pressed. I am going to use it to close a window. */ - if (ordered) - { - gnt_widget_destroy(ordered->data); - } - } - else if (strcmp(buffer + 1, "q") == 0) - { - /* I am going to use Alt + q to quit. */ - g_main_loop_quit(loop); - } - else if (strcmp(buffer + 1, "n") == 0) - { - /* Alt + n to go to the next window */ - switch_window(1); - } - else if (strcmp(buffer + 1, "p") == 0) - { - /* Alt + p to go to the previous window */ - switch_window(-1); - } - else if (strcmp(buffer + 1, "m") == 0 && focus_list) - { - /* Move a window */ - mode = GNT_KP_MODE_MOVE; - window_reverse(ordered->data, TRUE); - } - else if (strcmp(buffer + 1, "w") == 0 && focus_list) - { - /* Window list */ - mode = GNT_KP_MODE_WINDOW_LIST; - show_window_list(); - } - else if (strcmp(buffer + 1, "a") == 0) - { - mode = GNT_KP_MODE_WINDOW_LIST; - show_actions_list(); - } - else if (strcmp(buffer + 1, "r") == 0 && focus_list) - { - /* Resize window */ - mode = GNT_KP_MODE_RESIZE; - window_reverse(ordered->data, TRUE); - } - else if (strcmp(buffer + 1, ",") == 0 && focus_list) - { - /* Re-order the list of windows */ - shift_window(ordered->data, -1); - } - else if (strcmp(buffer + 1, ".") == 0 && focus_list) - { - shift_window(ordered->data, 1); - } - else if (strcmp(buffer + 1, "l") == 0) - { - refresh_screen(); - } - else if (strlen(buffer) == 2 && isdigit(*(buffer + 1))) - { - int n = *(buffer + 1) - '0'; +static void +setup_io() +{ + int result; + channel = g_io_channel_unix_new(STDIN_FILENO); - if (n == 0) - n = 10; + g_io_channel_set_encoding(channel, NULL, NULL); + g_io_channel_set_buffered(channel, FALSE); +#if 0 + g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL ); +#endif - switch_window_n(n - 1); - } - } - } - } - else if (mode == GNT_KP_MODE_MOVE && focus_list) - { - if (buffer[0] == 27) - { - gboolean changed = FALSE; - int x, y, w, h; - GntWidget *widget = GNT_WIDGET(ordered->data); + result = g_io_add_watch_full(channel, G_PRIORITY_HIGH, + (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI), + io_invoke, NULL, NULL); + + g_io_add_watch_full(channel, G_PRIORITY_HIGH, + (G_IO_NVAL), + io_invoke_error, GINT_TO_POINTER(result), NULL); + + g_io_channel_unref(channel); /* Apparently this caused crashes for some people. + But irssi does this, so I am going to assume the + crashes were caused by some other stuff. */ - gnt_widget_get_position(widget, &x, &y); - gnt_widget_get_size(widget, &w, &h); - - if (strcmp(buffer, GNT_KEY_LEFT) == 0) - { - if (x > X_MIN) - { - x--; - changed = TRUE; - } - } - else if (strcmp(buffer, GNT_KEY_RIGHT) == 0) - { - if (x + w < X_MAX) - { - x++; - changed = TRUE; - } - } - else if (strcmp(buffer, GNT_KEY_UP) == 0) - { - if (y > Y_MIN) - { - y--; - changed = TRUE; - } - } - else if (strcmp(buffer, GNT_KEY_DOWN) == 0) - { - if (y + h < Y_MAX) - { - y++; - changed = TRUE; - } - } - else if (buffer[1] == 0) - { - mode = GNT_KP_MODE_NORMAL; - window_reverse(widget, FALSE); - } - - if (changed) - { - gnt_screen_move_widget(widget, x, y); - } - } - else if (*buffer == '\r') - { - mode = GNT_KP_MODE_NORMAL; - window_reverse(ordered->data, FALSE); - } - } - else if (mode == GNT_KP_MODE_WINDOW_LIST && _list.window) - { - gnt_widget_key_pressed(_list.window, buffer); - - if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) - { - mode = GNT_KP_MODE_NORMAL; - lock_focus_list = 1; - gnt_widget_destroy(_list.window); - _list.window = NULL; - _list.tree = NULL; - lock_focus_list = 0; - window_list = NULL; - action_list = NULL; - } - } - else if (mode == GNT_KP_MODE_RESIZE) - { - if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) { - mode = GNT_KP_MODE_NORMAL; - window_reverse(ordered->data, FALSE); - } else if (buffer[0] == 27) { - GntWidget *widget = ordered->data; - gboolean changed = FALSE; - int width, height; - - gnt_widget_get_size(widget, &width, &height); - - if (strcmp(buffer, GNT_KEY_DOWN) == 0) - { - if (widget->priv.y + height < Y_MAX) - { - height++; - changed = TRUE; - } - } - else if (strcmp(buffer, GNT_KEY_UP) == 0) - { - height--; - changed = TRUE; - } - else if (strcmp(buffer, GNT_KEY_LEFT) == 0) - { - width--; - changed = TRUE; - } - else if (strcmp(buffer, GNT_KEY_RIGHT) == 0) - { - if (widget->priv.x + width < X_MAX) - { - width++; - changed = TRUE; - } - } - - if (changed) - { - gnt_screen_resize_widget(widget, width, height); - window_reverse(widget, TRUE); - } - } - } - - event_stack = FALSE; - return TRUE; + g_printerr("gntmain: setting up IO\n"); } static gboolean refresh_screen() { - endwin(); - refresh(); - - X_MAX = getmaxx(stdscr); - Y_MAX = getmaxy(stdscr) - 1; - - g_hash_table_foreach(nodes, (GHFunc)refresh_node, NULL); - update_screen(NULL); - draw_taskbar(TRUE); - + gnt_bindable_perform_action_named(GNT_BINDABLE(wm), "refresh-screen", NULL); return FALSE; } @@ -1082,44 +282,29 @@ const char *name = gnt_style_get(GNT_STYLE_WM); gpointer handle; - if (!name || !*name) - return; - - handle = g_module_open(name, G_MODULE_BIND_LAZY); - if (handle) { - gboolean (*init)(GntWM *); - if (g_module_symbol(handle, "gntwm_init", (gpointer)&init)) { - init(&wm); + if (name && *name) { + handle = g_module_open(name, G_MODULE_BIND_LAZY); + if (handle) { + gboolean (*init)(GntWM **); + if (g_module_symbol(handle, "gntwm_init", (gpointer)&init)) { + init(&wm); + } } } + if (wm == NULL) + wm = g_object_new(GNT_TYPE_WM, NULL); } void gnt_init() { - static GIOChannel *channel = NULL; char *filename; - int result; const char *locale; if (channel) return; - channel = g_io_channel_unix_new(STDIN_FILENO); + setup_io(); - g_io_channel_set_encoding(channel, NULL, NULL); - g_io_channel_set_buffered(channel, FALSE); -#if 0 - g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL ); -#endif - - result = g_io_add_watch_full(channel, G_PRIORITY_HIGH, - (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI | G_IO_NVAL), - io_invoke, NULL, NULL); - - g_io_channel_unref(channel); /* Apparently this caused crashes for some people. - But irssi does this, so I am going to assume the - crashes were caused by some other stuff. */ - locale = setlocale(LC_ALL, ""); if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) @@ -1139,13 +324,7 @@ g_free(filename); gnt_init_colors(); - X_MIN = 0; - Y_MIN = 0; - X_MAX = getmaxx(stdscr); - Y_MAX = getmaxy(stdscr) - 1; - nodes = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_node); - wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); refresh(); @@ -1171,112 +350,27 @@ void gnt_main() { - loop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(loop); + wm->loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(wm->loop); } /********************************* * Stuff for 'window management' * *********************************/ -static void -free_node(gpointer data) -{ - GntNode *node = data; - hide_panel(node->panel); - del_panel(node->panel); - g_free(node); -} - void gnt_screen_occupy(GntWidget *widget) { - GntNode *node; - - while (widget->parent) - widget = widget->parent; - - if (g_hash_table_lookup(nodes, widget)) - return; /* XXX: perhaps _update instead? */ - - node = g_new0(GntNode, 1); - node->me = widget; - - g_hash_table_replace(nodes, widget, node); - - refresh_node(widget, node, NULL); - - if (window_list) - { - if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list->window != widget - && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) - { - gnt_tree_add_row_last(GNT_TREE(window_list->tree), widget, - gnt_tree_create_row(GNT_TREE(window_list->tree), GNT_BOX(widget)->title), - NULL); - update_window_in_list(widget); - } - } - - update_screen(NULL); + gnt_wm_new_window(wm, widget); } void gnt_screen_release(GntWidget *widget) { - GntNode *node; - - gnt_screen_remove_widget(widget); - node = g_hash_table_lookup(nodes, widget); - - if (node == NULL) /* Yay! Nothing to do. */ - return; - - if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_DESTROYING) && wm.close_window) - wm.close_window(widget); - - g_hash_table_remove(nodes, widget); - - if (window_list) - { - gnt_tree_remove(GNT_TREE(window_list->tree), widget); - } - - update_screen(NULL); + gnt_wm_window_close(wm, widget); } void gnt_screen_update(GntWidget *widget) { - GntNode *node; - - while (widget->parent) - widget = widget->parent; - if (!GNT_IS_MENU(widget)) - gnt_box_sync_children(GNT_BOX(widget)); - node = g_hash_table_lookup(nodes, widget); - if (node && !node->panel) - { - if (wm.new_window && node->me != _list.window) - node->panel = wm.new_window(node->me); - else - node->panel = new_panel(node->me->window); - set_panel_userptr(node->panel, node); - if (!GNT_WIDGET_IS_FLAG_SET(node->me, GNT_WIDGET_TRANSIENT)) { - if (!g_object_get_data(G_OBJECT(node->me), "give_focus")) { - bottom_panel(node->panel); /* New windows should not grab focus */ - gnt_widget_set_urgent(node->me); - } - else { - bring_on_top(node->me); - } - } - } - - if (_list.window) - { - GntNode *nd = g_hash_table_lookup(nodes, _list.window); - top_panel(nd->panel); - } - - update_screen(NULL); + gnt_wm_update_window(wm, widget); } gboolean gnt_widget_has_focus(GntWidget *widget) @@ -1293,16 +387,13 @@ while (widget->parent) widget = widget->parent; - if (widget == _list.window) + if (widget == wm->_list.window) return TRUE; - - if (ordered && ordered->data == widget) - { + if (wm->ordered && wm->ordered->data == widget) { if (GNT_IS_BOX(widget) && (GNT_BOX(widget)->active == w || widget == w)) return TRUE; } - return FALSE; } @@ -1311,21 +402,19 @@ while (widget->parent) widget = widget->parent; - if (ordered && ordered->data == widget) + if (wm->ordered && wm->ordered->data == widget) return; GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_URGENT); - if (wm.window_update) { - GntNode *node = g_hash_table_lookup(nodes, widget); - wm.window_update(node ? node->panel : NULL, widget); - } - - draw_taskbar(FALSE); + gnt_wm_update_window(wm, widget); } void gnt_quit() { + g_hash_table_destroy(wm->nodes); /* XXX: */ + update_panels(); + doupdate(); gnt_uninit_colors(); gnt_uninit_styles(); endwin(); @@ -1338,145 +427,48 @@ void gnt_screen_resize_widget(GntWidget *widget, int width, int height) { - if (widget->parent == NULL) - { - GntNode *node = g_hash_table_lookup(nodes, widget); - if (!node) - return; - - if (wm.window_resize_confirm && !wm.window_resize_confirm(widget, &width, &height)) - return; - - hide_panel(node->panel); - gnt_widget_set_size(widget, width, height); - gnt_widget_draw(widget); - if (wm.window_resized) - node->panel = wm.window_resized(node->panel, widget); - else - replace_panel(node->panel, widget->window); - show_panel(node->panel); - update_screen(NULL); - } + gnt_wm_resize_window(wm, widget, width, height); } void gnt_screen_move_widget(GntWidget *widget, int x, int y) { - GntNode *node = g_hash_table_lookup(nodes, widget); - - if (wm.window_move_confirm && !wm.window_move_confirm(widget, &x, &y)) - return; - - gnt_widget_set_position(widget, x, y); - move_panel(node->panel, y, x); - - if (wm.window_moved) - wm.window_moved(node->panel, widget); - - update_screen(NULL); + gnt_wm_move_window(wm, widget, x, y); } void gnt_screen_rename_widget(GntWidget *widget, const char *text) { gnt_box_set_title(GNT_BOX(widget), text); gnt_widget_draw(widget); - - if (wm.window_update) { - GntNode *node = g_hash_table_lookup(nodes, widget); - wm.window_update(node ? node->panel : NULL, widget); - } - - draw_taskbar(FALSE); + gnt_wm_update_window(wm, widget); } -/** - * An application can register actions which will show up in a 'start-menu' like popup - */ -typedef struct _GnAction -{ - const char *label; - void (*callback)(); -} GntAction; - -static GList *actions; - void gnt_register_action(const char *label, void (*callback)()) { GntAction *action = g_new0(GntAction, 1); action->label = g_strdup(label); action->callback = callback; - actions = g_list_append(actions, action); + wm->acts = g_list_append(wm->acts, action); } static void -action_list_activate(GntTree *tree, gpointer null) -{ - GntAction *action = gnt_tree_get_selection_data(tree); - action->callback(); -} - -static int -compare_action(gconstpointer p1, gconstpointer p2) -{ - const GntAction *a1 = p1; - const GntAction *a2 = p2; - - return g_utf8_collate(a1->label, a2->label); -} - -static void -show_actions_list() -{ - GntWidget *tree, *win; - GList *iter; - int h; - - if (action_list) - return; - - setup__list(); - action_list = &_list; - win = action_list->window; - tree = action_list->tree; - - gnt_box_set_title(GNT_BOX(win), "Actions"); - GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER); - /* XXX: Do we really want this? */ - gnt_tree_set_compare_func(GNT_TREE(tree), compare_action); - - for (iter = actions; iter; iter = iter->next) { - GntAction *action = iter->data; - gnt_tree_add_row_last(GNT_TREE(tree), action, - gnt_tree_create_row(GNT_TREE(tree), action->label), NULL); - } - g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(action_list_activate), NULL); - gnt_widget_set_size(tree, 0, g_list_length(actions)); - gnt_widget_get_size(win, NULL, &h); - gnt_widget_set_position(win, 0, getmaxy(stdscr) - 1 - h); - - lock_focus_list = 1; - gnt_widget_show(win); - lock_focus_list = 0; -} - -static void reset_menu(GntWidget *widget, gpointer null) { - menu = NULL; + wm->menu = NULL; } gboolean gnt_screen_menu_show(gpointer newmenu) { - if (menu) { + if (wm->menu) { /* For now, if a menu is being displayed, then another menu * can NOT take over. */ return FALSE; } - menu = newmenu; - gnt_widget_draw(GNT_WIDGET(menu)); + wm->menu = newmenu; + gnt_widget_draw(GNT_WIDGET(wm->menu)); - g_signal_connect(G_OBJECT(menu), "hide", G_CALLBACK(reset_menu), NULL); + g_signal_connect(G_OBJECT(wm->menu), "hide", G_CALLBACK(reset_menu), NULL); return TRUE; } Modified: trunk/console/libgnt/gntmarshal.c =================================================================== --- trunk/console/libgnt/gntmarshal.c 2006-11-05 14:57:05 UTC (rev 17671) +++ trunk/console/libgnt/gntmarshal.c 2006-11-05 17:28:33 UTC (rev 17672) @@ -1,237 +1,427 @@ -#include "gntmarshal.h" -void gnt_closure_marshal_BOOLEAN__VOID(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) +#include <glib-object.h> + + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_char (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + + +/* BOOLEAN:VOID (/dev/stdin:1) */ +void +gnt_closure_marshal_BOOLEAN__VOID (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) { - typedef gboolean (*func) (gpointer data1, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - gboolean ret; + typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, + gpointer data2); + register GMarshalFunc_BOOLEAN__VOID callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; - g_return_if_fail(ret_value != NULL); - g_return_if_fail(n_param_values == 1); + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 1); - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback); - callback = (func) (marshal_data ? marshal_data : cc->callback); - ret = callback(data1, data2); - g_value_set_boolean(ret_value, ret); + v_return = callback (data1, + data2); + + g_value_set_boolean (return_value, v_return); } -void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) +/* BOOLEAN:STRING (/dev/stdin:2) */ +void +gnt_closure_marshal_BOOLEAN__STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) { - typedef gboolean (*func) (gpointer data1, const char *arg1, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - gboolean ret; + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING) (gpointer data1, + gpointer arg_1, + gpointer data2); + register GMarshalFunc_BOOLEAN__STRING callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + gboolean v_return; - g_return_if_fail(ret_value != NULL); - g_return_if_fail(n_param_values == 2); + g_return_if_fail (return_value != NULL); + g_return_if_fail (n_param_values == 2); - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_BOOLEAN__STRING) (marshal_data ? marshal_data : cc->callback); - callback = (func) (marshal_data ? marshal_data : cc->callback); - ret = callback(data1, g_value_get_string(param_values + 1) , data2); - g_value_set_boolean(ret_value, ret); + v_return = callback (data1, + g_marshal_value_peek_string (param_values + 1), + data2); + + g_value_set_boolean (return_value, v_return); } -void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) +/* VOID:INT,INT,INT,INT (/dev/stdin:3) */ +void +gnt_clo... [truncated message content] |
From: <ebl...@us...> - 2006-11-05 14:57:12
|
Revision: 17671 http://svn.sourceforge.net/gaim/?rev=17671&view=rev Author: eblanton Date: 2006-11-05 06:57:05 -0800 (Sun, 05 Nov 2006) Log Message: ----------- (Attribution for r17670) Modified Paths: -------------- trunk/COPYRIGHT Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-11-05 14:54:50 UTC (rev 17670) +++ trunk/COPYRIGHT 2006-11-05 14:57:05 UTC (rev 17671) @@ -158,6 +158,7 @@ Akuke Kok Cole Kowalski Gary Kramlich +Jan Kratochvil Andrej Krivulčík Patrik Kullman Tuomas Kuosmanen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-11-05 14:54:54
|
Revision: 17670 http://svn.sourceforge.net/gaim/?rev=17670&view=rev Author: eblanton Date: 2006-11-05 06:54:50 -0800 (Sun, 05 Nov 2006) Log Message: ----------- This fixes the dbus exit(1) problem -- we may still have a bug, or dbus may. Modified Paths: -------------- trunk/libgaim/dbus-server.c Modified: trunk/libgaim/dbus-server.c =================================================================== --- trunk/libgaim/dbus-server.c 2006-11-05 08:22:33 UTC (rev 17669) +++ trunk/libgaim/dbus-server.c 2006-11-05 14:54:50 UTC (rev 17670) @@ -579,6 +579,10 @@ return; } + /* Do not allow libdbus to exit on connection failure (This may + work around random exit(1) on SIGPIPE errors) */ + dbus_connection_set_exit_on_disconnect (gaim_dbus_connection, FALSE); + if (!dbus_connection_register_object_path(gaim_dbus_connection, DBUS_PATH_GAIM, &vtable, NULL)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-11-05 08:22:44
|
Revision: 17669 http://svn.sourceforge.net/gaim/?rev=17669&view=rev Author: datallah Date: 2006-11-05 00:22:33 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Vista needs a bigger buffer for the NLA lookup stuff. This will fix network detection on Vista. Modified Paths: -------------- trunk/libgaim/network.c Modified: trunk/libgaim/network.c =================================================================== --- trunk/libgaim/network.c 2006-11-05 00:11:52 UTC (rev 17668) +++ trunk/libgaim/network.c 2006-11-05 08:22:33 UTC (rev 17669) @@ -409,7 +409,7 @@ return -1; } else { - char buf[1024]; + char buf[4096]; WSAQUERYSET *res = (LPWSAQUERYSET) buf; DWORD size = sizeof(buf); while ((retval = WSALookupServiceNext(h, 0, &size, res)) == ERROR_SUCCESS) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-11-05 00:12:18
|
Revision: 17668 http://svn.sourceforge.net/gaim/?rev=17668&view=rev Author: markhuetsch Date: 2006-11-04 16:11:52 -0800 (Sat, 04 Nov 2006) Log Message: ----------- Eliminate this union, as suggested by elb and nosnilmot. Modified Paths: -------------- trunk/libgaim/protocols/qq/file_trans.c trunk/libgaim/protocols/qq/send_file.c trunk/libgaim/protocols/qq/send_file.h Modified: trunk/libgaim/protocols/qq/file_trans.c =================================================================== --- trunk/libgaim/protocols/qq/file_trans.c 2006-11-04 22:00:22 UTC (rev 17667) +++ trunk/libgaim/protocols/qq/file_trans.c 2006-11-05 00:11:52 UTC (rev 17668) @@ -218,8 +218,8 @@ static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer) { ft_info *info = xfer->data; - info->u.dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); - if (info->u.dest_fp == NULL) { + info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); + if (info->dest_fp == NULL) { return -1; } return 0; @@ -229,22 +229,22 @@ { ft_info *info = xfer->data; - fseek(info->u.dest_fp, index * len, SEEK_SET); - return fread(buffer, 1, len, info->u.dest_fp); + fseek(info->dest_fp, index * len, SEEK_SET); + return fread(buffer, 1, len, info->dest_fp); } static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) { ft_info *info = xfer->data; - fseek(info->u.dest_fp, index * len, SEEK_SET); - return fwrite(buffer, 1, len, info->u.dest_fp); + fseek(info->dest_fp, index * len, SEEK_SET); + return fwrite(buffer, 1, len, info->dest_fp); } void qq_xfer_close_file(GaimXfer *xfer) { ft_info *info = xfer->data; - if (info->u.dest_fp) fclose(info->u.dest_fp); + if (info->dest_fp) fclose(info->dest_fp); } #endif Modified: trunk/libgaim/protocols/qq/send_file.c =================================================================== --- trunk/libgaim/protocols/qq/send_file.c 2006-11-04 22:00:22 UTC (rev 17667) +++ trunk/libgaim/protocols/qq/send_file.c 2006-11-05 00:11:52 UTC (rev 17668) @@ -204,8 +204,8 @@ info = (ft_info *) xfer->data; qq_xfer_close_file(xfer); - if (info->u.dest_fp != NULL) { - fclose(info->u.dest_fp); + if (info->dest_fp != NULL) { + fclose(info->dest_fp); gaim_debug(GAIM_DEBUG_INFO, "QQ", "file closed\n"); } if (info->major_fd != 0) { @@ -217,8 +217,8 @@ gaim_debug(GAIM_DEBUG_INFO, "QQ", "minor port closed\n"); } /* - if (info->u.buffer != NULL) { - munmap(info->u.buffer, gaim_xfer_get_size(xfer)); + if (info->buffer != NULL) { + munmap(info->buffer, gaim_xfer_get_size(xfer)); gaim_debug(GAIM_DEBUG_INFO, "QQ", "file mapping buffer is freed.\n"); } */ Modified: trunk/libgaim/protocols/qq/send_file.h =================================================================== --- trunk/libgaim/protocols/qq/send_file.h 2006-11-04 22:00:22 UTC (rev 17667) +++ trunk/libgaim/protocols/qq/send_file.h 2006-11-05 00:11:52 UTC (rev 17668) @@ -37,10 +37,8 @@ int minor_fd; int sender_fd; int recv_fd; - union { - FILE *dest_fp; - guint8 *buffer; - } u; + FILE *dest_fp; + /* guint8 *buffer; */ gboolean use_major; } ft_info; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-11-04 22:00:31
|
Revision: 17667 http://svn.sourceforge.net/gaim/?rev=17667&view=rev Author: datallah Date: 2006-11-04 14:00:22 -0800 (Sat, 04 Nov 2006) Log Message: ----------- Add further error checking and fallbacks to the Network awareness code. Modified Paths: -------------- trunk/libgaim/network.c Modified: trunk/libgaim/network.c =================================================================== --- trunk/libgaim/network.c 2006-11-04 03:42:04 UTC (rev 17666) +++ trunk/libgaim/network.c 2006-11-04 22:00:22 UTC (rev 17667) @@ -390,7 +390,8 @@ WSAQUERYSET qs; HANDLE h; - int retval; + gint retval; + int errorid; memset(&qs, 0, sizeof(WSAQUERYSET)); qs.dwSize = sizeof(WSAQUERYSET); @@ -398,8 +399,9 @@ retval = WSALookupServiceBegin(&qs, LUP_RETURN_ALL, &h); if (retval != ERROR_SUCCESS) { - int errorid = WSAGetLastError(); - gchar *msg = g_win32_error_message(errorid); + gchar *msg; + errorid = WSAGetLastError(); + msg = g_win32_error_message(errorid); gaim_debug_warning("network", "Couldn't retrieve NLA SP lookup handle. " "NLA service is probably not running. Message: %s (%d).\n", msg, errorid); @@ -410,14 +412,23 @@ char buf[1024]; WSAQUERYSET *res = (LPWSAQUERYSET) buf; DWORD size = sizeof(buf); - while (WSALookupServiceNext(h, 0, &size, res) == ERROR_SUCCESS) { + while ((retval = WSALookupServiceNext(h, 0, &size, res)) == ERROR_SUCCESS) { net_cnt++; gaim_debug_info("network", "found network '%s'\n", res->lpszServiceInstanceName ? res->lpszServiceInstanceName : "(NULL)"); size = sizeof(buf); } - WSALookupServiceEnd(h); + errorid = WSAGetLastError(); + if (!(errorid == WSA_E_NO_MORE || errorid == WSAENOMORE)) { + gchar *msg = g_win32_error_message(errorid); + gaim_debug_error("network", "got unexpected NLA response %s (%d)\n", msg, errorid); + g_free(msg); + + net_cnt = -1; + } + + retval = WSALookupServiceEnd(h); } return net_cnt; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-11-04 03:42:42
|
Revision: 17666 http://svn.sourceforge.net/gaim/?rev=17666&view=rev Author: eblanton Date: 2006-11-03 19:42:04 -0800 (Fri, 03 Nov 2006) Log Message: ----------- This fixes breakage from r17543. In fact, I'm not precisely sure what that revision was supposed to accomplish. Thanks to rewster on IRC for pointing this out. Modified Paths: -------------- trunk/gtk/sounds/Makefile.am Modified: trunk/gtk/sounds/Makefile.am =================================================================== --- trunk/gtk/sounds/Makefile.am 2006-11-03 22:15:51 UTC (rev 17665) +++ trunk/gtk/sounds/Makefile.am 2006-11-04 03:42:04 UTC (rev 17666) @@ -1,6 +1,3 @@ -EXTRA_DIST = \ - Makefile.mingw - soundsdir = $(datadir)/sounds/gaim sounds_DATA = \ alert.wav \ @@ -8,3 +5,8 @@ logout.wav \ receive.wav \ send.wav + +EXTRA_DIST = \ + Makefile.mingw \ + $(sounds_DATA) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-03 22:16:05
|
Revision: 17665 http://svn.sourceforge.net/gaim/?rev=17665&view=rev Author: seanegan Date: 2006-11-03 14:15:51 -0800 (Fri, 03 Nov 2006) Log Message: ----------- I just noticed this was broken Modified Paths: -------------- trunk/libgaim/plugins/codeinline.c Modified: trunk/libgaim/plugins/codeinline.c =================================================================== --- trunk/libgaim/plugins/codeinline.c 2006-11-03 19:17:08 UTC (rev 17664) +++ trunk/libgaim/plugins/codeinline.c 2006-11-03 22:15:51 UTC (rev 17665) @@ -51,6 +51,8 @@ plugin_handle = plugin; gaim_signal_connect(handle, "writing-im-msg", plugin, GAIM_CALLBACK(outgoing_msg_cb), NULL); + gaim_signal_connect(handle, "sending-im-msg", plugin, + GAIM_CALLBACK(outgoing_msg_cb), NULL); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-03 19:17:19
|
Revision: 17664 http://svn.sourceforge.net/gaim/?rev=17664&view=rev Author: seanegan Date: 2006-11-03 11:17:08 -0800 (Fri, 03 Nov 2006) Log Message: ----------- Removing the docklet requests that the buddy list gets focus, which is ass-annoying if you're using Pending mode. Modified Paths: -------------- trunk/gtk/gtkdocklet.c Modified: trunk/gtk/gtkdocklet.c =================================================================== --- trunk/gtk/gtkdocklet.c 2006-11-03 17:21:18 UTC (rev 17663) +++ trunk/gtk/gtkdocklet.c 2006-11-03 19:17:08 UTC (rev 17664) @@ -604,7 +604,8 @@ gaim_gtk_docklet_remove() { if (visibility_manager) { - gaim_gtk_blist_visibility_manager_remove(); + if (strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"),"pending")) + gaim_gtk_blist_visibility_manager_remove(); if (docklet_blinking_timer) { g_source_remove(docklet_blinking_timer); docklet_blinking_timer = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-11-03 17:38:21
|
Revision: 17662 http://svn.sourceforge.net/gaim/?rev=17662&view=rev Author: thekingant Date: 2006-11-03 09:11:43 -0800 (Fri, 03 Nov 2006) Log Message: ----------- If an oscar account is unable to connect because the password is wrong, then set the password to the empty string. This might help address bug 1414151, "Too many steps to be able to re-enter a password." How do people feel about this? We could probably do it for MSN, too. Also, beta 5 on Sunday? Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-11-03 04:41:50 UTC (rev 17661) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-11-03 17:11:43 UTC (rev 17662) @@ -1282,8 +1282,9 @@ gaim_connection_error(gc, _("Invalid screen name.")); break; case 0x05: - /* Incorrect nick/password */ + /* Incorrect password */ gc->wants_to_die = TRUE; + gaim_account_set_password(account, NULL); gaim_connection_error(gc, _("Incorrect password.")); break; case 0x11: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-11-03 17:28:38
|
Revision: 17663 http://svn.sourceforge.net/gaim/?rev=17663&view=rev Author: rlaager Date: 2006-11-03 09:21:18 -0800 (Fri, 03 Nov 2006) Log Message: ----------- SF Patch #1589599 Make gaim_gtk_cell_renderer_expander_activate()'s prototype match its definition. This is for consistency reasons only, since fixing the flags definition is all that was necessary to make this build on Solaris. Modified Paths: -------------- trunk/COPYRIGHT trunk/gtk/gtkcellrendererexpander.c Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-11-03 17:11:43 UTC (rev 17662) +++ trunk/COPYRIGHT 2006-11-03 17:21:18 UTC (rev 17663) @@ -44,6 +44,7 @@ Sean Burke Thomas Butter Andrea Canciani +Damien Carbery Michael Carlson Keegan Carruthers-Smith Steve Cavilia Modified: trunk/gtk/gtkcellrendererexpander.c =================================================================== --- trunk/gtk/gtkcellrendererexpander.c 2006-11-03 17:11:43 UTC (rev 17662) +++ trunk/gtk/gtkcellrendererexpander.c 2006-11-03 17:21:18 UTC (rev 17663) @@ -56,12 +56,12 @@ GdkRectangle *cell_area, GdkRectangle *expose_area, guint flags); -static gboolean gaim_gtk_cell_renderer_expander_activate (GtkCellRenderer *cell, +static gboolean gaim_gtk_cell_renderer_expander_activate (GtkCellRenderer *r, GdkEvent *event, GtkWidget *widget, - const gchar *path, - GdkRectangle *background_area, - GdkRectangle *cell_area, + const gchar *p, + GdkRectangle *bg, + GdkRectangle *cell, GtkCellRendererState flags); static void gaim_gtk_cell_renderer_expander_finalize (GObject *gobject); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-03 04:42:10
|
Revision: 17661 http://svn.sourceforge.net/gaim/?rev=17661&view=rev Author: sadrul Date: 2006-11-02 20:41:50 -0800 (Thu, 02 Nov 2006) Log Message: ----------- 'Send IM...' in the buddylist menu to be able to send IM to people not in the buddylist. Modified Paths: -------------- trunk/console/gntblist.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-11-03 03:13:26 UTC (rev 17660) +++ trunk/console/gntblist.c 2006-11-03 04:41:50 UTC (rev 17661) @@ -1873,7 +1873,55 @@ gaim_prefs_set_string(PREF_ROOT "/sort_type", n); } +/* XXX: send_im_select* -- Xerox */ static void +send_im_select_cb(gpointer data, GaimRequestFields *fields) +{ + GaimAccount *account; + const char *username; + + account = gaim_request_fields_get_account(fields, "account"); + username = gaim_request_fields_get_string(fields, "screenname"); + + gaim_conversation_new(GAIM_CONV_TYPE_IM, account, username); +} + +static void +send_im_select(void) +{ + GaimRequestFields *fields; + GaimRequestFieldGroup *group; + GaimRequestField *field; + + fields = gaim_request_fields_new(); + + group = gaim_request_field_group_new(NULL); + gaim_request_fields_add_group(fields, group); + + field = gaim_request_field_string_new("screenname", _("_Name"), NULL, FALSE); + gaim_request_field_set_type_hint(field, "screenname"); + gaim_request_field_set_required(field, TRUE); + gaim_request_field_group_add_field(group, field); + + field = gaim_request_field_account_new("account", _("_Account"), NULL); + gaim_request_field_set_type_hint(field, "account"); + gaim_request_field_set_visible(field, + (gaim_connections_get_all() != NULL && + gaim_connections_get_all()->next != NULL)); + gaim_request_field_set_required(field, TRUE); + gaim_request_field_group_add_field(group, field); + + gaim_request_fields(gaim_get_blist(), _("New Instant Message"), + NULL, + _("Please enter the screen name or alias of the person " + "you would like to IM."), + fields, + _("OK"), G_CALLBACK(send_im_select_cb), + _("Cancel"), NULL, + NULL); +} + +static void create_menu() { GntWidget *menu, *sub; @@ -1893,6 +1941,10 @@ sub = gnt_menu_new(GNT_MENU_POPUP); gnt_menuitem_set_submenu(item, GNT_MENU(sub)); + item = gnt_menuitem_new(_("Send IM...")); + gnt_menu_add_item(GNT_MENU(sub), item); + gnt_menuitem_set_callback(GNT_MENUITEM(item), send_im_select, NULL); + item = gnt_menuitem_new(_("Toggle offline buddies")); gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(GNT_MENUITEM(item), show_offline_cb, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-11-03 03:13:46
|
Revision: 17660 http://svn.sourceforge.net/gaim/?rev=17660&view=rev Author: rlaager Date: 2006-11-02 19:13:26 -0800 (Thu, 02 Nov 2006) Log Message: ----------- * Add a label for Default Formatting, so the imhtml doesn't look so out of place. * Modify a few things for consistency. Modified Paths: -------------- trunk/gtk/gtkprefs.c Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-11-03 02:30:50 UTC (rev 17659) +++ trunk/gtk/gtkprefs.c 2006-11-03 03:13:26 UTC (rev 17660) @@ -632,7 +632,7 @@ GtkWidget *label; GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; - ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER); label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); @@ -808,13 +808,13 @@ GtkSizeGroup *sg; GList *names = NULL; - ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); vbox = gaim_gtk_make_frame(ret, _("System Tray Icon")); - label = gaim_gtk_prefs_dropdown(vbox, _("_Show System Tray Icon:"), GAIM_PREF_STRING, + label = gaim_gtk_prefs_dropdown(vbox, _("_Show system tray icon:"), GAIM_PREF_STRING, "/gaim/gtk/docklet/show", _("Always"), "always", _("Never"), "never", @@ -824,7 +824,7 @@ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); vbox = gaim_gtk_make_frame(ret, _("Conversation Window Hiding")); - label = gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), + label = gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations:"), GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", _("Never"), "never", _("When away"), "away", @@ -835,7 +835,7 @@ /* All the tab options! */ - vbox = gaim_gtk_make_frame(ret, _("Tab Options")); + vbox = gaim_gtk_make_frame(ret, _("Tabs")); gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), "/gaim/gtk/conversations/tabs", vbox); @@ -892,7 +892,7 @@ GtkWidget *imhtml; GtkWidget *frame; - ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); vbox = gaim_gtk_make_frame(ret, _("Conversations")); @@ -922,6 +922,8 @@ gaim_gtk_prefs_checkbox(_("F_lash window when IMs are received"), "/gaim/gtk/win32/blink_im", vbox); #endif + vbox = gaim_gtk_make_frame(ret, _("Default Formatting")); + frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar, NULL); gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml"); gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); @@ -1002,7 +1004,7 @@ GtkSizeGroup *sg; GaimProxyInfo *proxy_info = NULL; - ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER); vbox = gaim_gtk_make_frame (ret, _("IP Address")); @@ -1343,6 +1345,7 @@ ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE); gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER); + vbox = gaim_gtk_make_frame (ret, _("Logging")); names = gaim_log_logger_get_options(); @@ -1761,6 +1764,7 @@ button = gtk_button_new_with_label(_("Choose...")); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); + gtk_widget_show_all(ret); return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-11-03 02:30:59
|
Revision: 17659 http://svn.sourceforge.net/gaim/?rev=17659&view=rev Author: evands Date: 2006-11-02 18:30:50 -0800 (Thu, 02 Nov 2006) Log Message: ----------- Having no contact info here was lame. Modified Paths: -------------- web/htdocs/contactinfo.php Modified: web/htdocs/contactinfo.php =================================================================== --- web/htdocs/contactinfo.php 2006-11-02 23:23:09 UTC (rev 17658) +++ web/htdocs/contactinfo.php 2006-11-03 02:30:50 UTC (rev 17659) @@ -134,6 +134,8 @@ Evan Schoenberg </dt> <dd> + <b>AIM:</b> tekjew<br /> + <b>Jabber:</b> te...@gm...<br /> <i>libgaim</i> </dd> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-02 23:23:12
|
Revision: 17658 http://svn.sourceforge.net/gaim/?rev=17658&view=rev Author: seanegan Date: 2006-11-02 15:23:09 -0800 (Thu, 02 Nov 2006) Log Message: ----------- no align Modified Paths: -------------- web/htdocs/sean/posts/prefs.txt Modified: web/htdocs/sean/posts/prefs.txt =================================================================== --- web/htdocs/sean/posts/prefs.txt 2006-11-02 23:20:11 UTC (rev 17657) +++ web/htdocs/sean/posts/prefs.txt 2006-11-02 23:23:09 UTC (rev 17658) @@ -1,5 +1,5 @@ System Tray Icon Preference -<img src='http://gaim.sf.net/sean/images/prefs.png' align='left' /> +<img src='http://gaim.sf.net/sean/images/prefs.png' /> <p>I just added a preference to Gaim to control when the system tray icon is shown, as discussed in my previous post. Because there was no obvious place in the preferences dialog to add this, I added a new tab and moved some of the Conversations preferences to it.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-02 23:20:23
|
Revision: 17657 http://svn.sourceforge.net/gaim/?rev=17657&view=rev Author: seanegan Date: 2006-11-02 15:20:11 -0800 (Thu, 02 Nov 2006) Log Message: ----------- blog Added Paths: ----------- web/htdocs/sean/images/prefs.png web/htdocs/sean/posts/prefs.txt Added: web/htdocs/sean/images/prefs.png =================================================================== (Binary files differ) Property changes on: web/htdocs/sean/images/prefs.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: web/htdocs/sean/posts/prefs.txt =================================================================== --- web/htdocs/sean/posts/prefs.txt (rev 0) +++ web/htdocs/sean/posts/prefs.txt 2006-11-02 23:20:11 UTC (rev 17657) @@ -0,0 +1,7 @@ +System Tray Icon Preference +<img src='http://gaim.sf.net/sean/images/prefs.png' align='left' /> +<p>I just added a preference to Gaim to control when the system tray icon is shown, as discussed in my previous post. Because there was +no obvious place in the preferences dialog to add this, I added a new tab and moved some of the Conversations preferences to it.</p> + +<p>This has the added benefit of making the dialog smaller, such that it now fits on the screens of older machines with poorer +resolution.</p> Property changes on: web/htdocs/sean/posts/prefs.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-02 21:40:19
|
Revision: 17656 http://svn.sourceforge.net/gaim/?rev=17656&view=rev Author: seanegan Date: 2006-11-02 13:40:11 -0800 (Thu, 02 Nov 2006) Log Message: ----------- SimGuy: seanegan: Hide new IM conversations is currently in botht he Conversations and Interface tab Modified Paths: -------------- trunk/gtk/gtkprefs.c Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-11-02 21:24:46 UTC (rev 17655) +++ trunk/gtk/gtkprefs.c 2006-11-02 21:40:11 UTC (rev 17656) @@ -897,13 +897,6 @@ vbox = gaim_gtk_make_frame(ret, _("Conversations")); - gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), - GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", - _("Never"), "never", - _("When away"), "away", - _("Always"), "always", - NULL); - gaim_gtk_prefs_checkbox(_("Show _formatting on incoming messages"), "/gaim/gtk/conversations/show_incoming_formatting", vbox); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-02 21:24:50
|
Revision: 17655 http://svn.sourceforge.net/gaim/?rev=17655&view=rev Author: seanegan Date: 2006-11-02 13:24:46 -0800 (Thu, 02 Nov 2006) Log Message: ----------- Sizegroup those mofos. Modified Paths: -------------- trunk/gtk/gtkprefs.c Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-11-02 21:09:12 UTC (rev 17654) +++ trunk/gtk/gtkprefs.c 2006-11-02 21:24:46 UTC (rev 17655) @@ -805,10 +805,13 @@ GtkWidget *vbox; GtkWidget *vbox2; GtkWidget *label; + GtkSizeGroup *sg; GList *names = NULL; ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); + + sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); vbox = gaim_gtk_make_frame(ret, _("System Tray Icon")); label = gaim_gtk_prefs_dropdown(vbox, _("_Show System Tray Icon:"), GAIM_PREF_STRING, @@ -817,16 +820,20 @@ _("Never"), "never", _("On unread messages"), "pending", NULL); - + gtk_size_group_add_widget(sg, label); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + vbox = gaim_gtk_make_frame(ret, _("Conversation Window Hiding")); - gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), - GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", - _("Never"), "never", - _("When away"), "away", - _("Always"), "always", - NULL); + label = gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), + GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", + _("Never"), "never", + _("When away"), "away", + _("Always"), "always", + NULL); + gtk_size_group_add_widget(sg, label); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + - /* All the tab options! */ vbox = gaim_gtk_make_frame(ret, _("Tab Options")); @@ -858,10 +865,16 @@ _("Right Vertical"), GTK_POS_RIGHT|8, #endif NULL); - + gtk_size_group_add_widget(sg, label); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + names = gaim_gtkconv_placement_get_options(); label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), - GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); + GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + + gtk_size_group_add_widget(sg, label); + g_list_free(names); gtk_widget_show_all(ret); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-11-02 21:09:25
|
Revision: 17654 http://svn.sourceforge.net/gaim/?rev=17654&view=rev Author: seanegan Date: 2006-11-02 13:09:12 -0800 (Thu, 02 Nov 2006) Log Message: ----------- This seems good. Change prefs dialog around a bit to add docklet pref. beta5 time? Modified Paths: -------------- trunk/gtk/gtkdocklet.c trunk/gtk/gtkprefs.c Modified: trunk/gtk/gtkdocklet.c =================================================================== --- trunk/gtk/gtkdocklet.c 2006-11-02 02:57:25 UTC (rev 17653) +++ trunk/gtk/gtkdocklet.c 2006-11-02 21:09:12 UTC (rev 17654) @@ -127,11 +127,12 @@ } else if (!convs && ui_ops->destroy && visibility_manager) { ui_ops->destroy(); return FALSE; - } else if (!visibility_manager) { - return FALSE; } } + if (!visibility_manager) + return FALSE; + if (convs != NULL) { pending = TRUE; @@ -292,6 +293,23 @@ docklet_update_status(); } +static void +docklet_show_pref_changed_cb(const char *name, GaimPrefType type, + gconstpointer value, gpointer data) +{ + const char *val = value; + if (!strcmp(val, "always")) { + if (!visibility_manager && ui_ops->create) + ui_ops->create(); + } else if (!strcmp(val, "never")) { + if (visibility_manager && ui_ops->destroy) + ui_ops->destroy(); + } else { + docklet_update_status(); + } + +} + /************************************************************************** * docklet pop-up menu **************************************************************************/ @@ -620,6 +638,8 @@ gaim_prefs_add_none("/gaim/gtk/docklet"); gaim_prefs_add_bool("/gaim/gtk/docklet/blink", FALSE); gaim_prefs_add_string("/gaim/gtk/docklet/show", "always"); + gaim_prefs_connect_callback(docklet_handle, "/gaim/gtk/docklet/show", + docklet_show_pref_changed_cb, NULL); docklet_ui_init(); if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "always") && ui_ops && ui_ops->create) Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-11-02 02:57:25 UTC (rev 17653) +++ trunk/gtk/gtkprefs.c 2006-11-02 21:09:12 UTC (rev 17654) @@ -70,9 +70,6 @@ /* * PROTOTYPES */ -static int prefs_notebook_add_page(const char*, GdkPixbuf*, - GtkWidget*, GtkTreeIter*, - GtkTreeIter*, int); static void delete_prefs(GtkWidget *, void *); static void @@ -802,19 +799,85 @@ } static GtkWidget * -conv_page() +interface_page() { GtkWidget *ret; GtkWidget *vbox; + GtkWidget *vbox2; GtkWidget *label; GList *names = NULL; - GtkWidget *frame; - GtkWidget *imhtml; + + ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); + gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); + + vbox = gaim_gtk_make_frame(ret, _("System Tray Icon")); + label = gaim_gtk_prefs_dropdown(vbox, _("_Show System Tray Icon:"), GAIM_PREF_STRING, + "/gaim/gtk/docklet/show", + _("Always"), "always", + _("Never"), "never", + _("On unread messages"), "pending", + NULL); + + vbox = gaim_gtk_make_frame(ret, _("Conversation Window Hiding")); + gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), + GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", + _("Never"), "never", + _("When away"), "away", + _("Always"), "always", + NULL); + + + /* All the tab options! */ + vbox = gaim_gtk_make_frame(ret, _("Tab Options")); + + gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), + "/gaim/gtk/conversations/tabs", vbox); + + /* + * Connect a signal to the above preference. When conversations are not + * shown in a tabbed window then all tabbing options should be disabled. + */ + vbox2 = gtk_vbox_new(FALSE, 9); + gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); + gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", + conversation_usetabs_cb, vbox2); + if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) + gtk_widget_set_sensitive(vbox2, FALSE); + + gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), + "/gaim/gtk/conversations/close_on_tabs", vbox2); + + label = gaim_gtk_prefs_dropdown(vbox2, _("_Placement:"), GAIM_PREF_INT, + "/gaim/gtk/conversations/tab_side", + _("Top"), GTK_POS_TOP, + _("Bottom"), GTK_POS_BOTTOM, + _("Left"), GTK_POS_LEFT, + _("Right"), GTK_POS_RIGHT, +#if GTK_CHECK_VERSION(2,6,0) + _("Left Vertical"), GTK_POS_LEFT|8, + _("Right Vertical"), GTK_POS_RIGHT|8, +#endif + NULL); + + names = gaim_gtkconv_placement_get_options(); + label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), + GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); + g_list_free(names); + + gtk_widget_show_all(ret); + return ret; +} + +static GtkWidget * +conv_page() +{ + GtkWidget *ret; + GtkWidget *vbox; GtkWidget *toolbar; - GtkWidget *hbox; - GtkWidget *vbox2; GtkWidget *iconpref1; GtkWidget *iconpref2; + GtkWidget *imhtml; + GtkWidget *frame; ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); @@ -888,46 +951,7 @@ g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", G_CALLBACK(formatting_clear_cb), NULL); - /* All the tab options! */ - vbox = gaim_gtk_make_frame(ret, _("Tab Options")); - gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), - "/gaim/gtk/conversations/tabs", vbox); - - /* - * Connect a signal to the above preference. When conversations are not - * shown in a tabbed window then all tabbing options should be disabled. - */ - vbox2 = gtk_vbox_new(FALSE, 9); - gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); - gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", - conversation_usetabs_cb, vbox2); - if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) - gtk_widget_set_sensitive(vbox2, FALSE); - - gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), - "/gaim/gtk/conversations/close_on_tabs", vbox2); - - hbox = gtk_hbox_new(FALSE, 9); - gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); - - label = gaim_gtk_prefs_dropdown(hbox, _("_Placement:"), GAIM_PREF_INT, - "/gaim/gtk/conversations/tab_side", - _("Top"), GTK_POS_TOP, - _("Bottom"), GTK_POS_BOTTOM, - _("Left"), GTK_POS_LEFT, - _("Right"), GTK_POS_RIGHT, -#if GTK_CHECK_VERSION(2,6,0) - _("Left Vertical"), GTK_POS_LEFT|8, - _("Right Vertical"), GTK_POS_RIGHT|8, -#endif - NULL); - - names = gaim_gtkconv_placement_get_options(); - label = gaim_gtk_prefs_dropdown_from_list(hbox, _("N_ew conversations:"), - GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); - g_list_free(names); - gtk_widget_show_all(ret); return ret; @@ -1861,22 +1885,11 @@ return ret; } -int prefs_notebook_add_page(const char *text, - GdkPixbuf *pixbuf, - GtkWidget *page, - GtkTreeIter *iter, - GtkTreeIter *parent, - int ind) { - GdkPixbuf *icon = NULL; +static int +prefs_notebook_add_page(const char *text, + GtkWidget *page, + int ind) { - if (pixbuf) - icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); - - if (pixbuf) - g_object_unref(pixbuf); - if (icon) - g_object_unref(icon); - #if GTK_CHECK_VERSION(2,4,0) return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); #else @@ -1886,20 +1899,20 @@ } static void prefs_notebook_init() { - GtkTreeIter p, c, c2; - prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &c, &p, notebook_page++); - prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c2, &c, notebook_page++); - prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &c, &p, notebook_page++); - prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); + prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); + prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); + prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); + prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); #ifndef _WIN32 /* We use the registered default browser in windows */ /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ if ((gaim_running_gnome() == FALSE) && (gaim_running_osx() == FALSE)) { - prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); } #endif - prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); - prefs_notebook_add_page(_("Status / Idle"), NULL, away_page(), &p, NULL, notebook_page++); + prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); + prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); } void gaim_gtk_prefs_show(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-11-02 02:57:44
|
Revision: 17653 http://svn.sourceforge.net/gaim/?rev=17653&view=rev Author: rlaager Date: 2006-11-01 18:57:25 -0800 (Wed, 01 Nov 2006) Log Message: ----------- nosnilmot claims Gaim supports SIP/SIMPLE and Bonjour. Now I can believe him. Modified Paths: -------------- trunk/gtk/gtkdialogs.c Modified: trunk/gtk/gtkdialogs.c =================================================================== --- trunk/gtk/gtkdialogs.c 2006-11-02 00:18:34 UTC (rev 17652) +++ trunk/gtk/gtkdialogs.c 2006-11-02 02:57:25 UTC (rev 17653) @@ -329,9 +329,10 @@ g_string_append(str, _("Gaim is a modular messaging client capable of using " - "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, " - "Novell GroupWise, Lotus Sametime, Zephyr, Gadu-Gadu, " - "and QQ all at once. It is written using GTK+.<BR><BR>" + "AIM, MSN, Yahoo!, Jabber, ICQ, IRC, SILC, SIP/SIMPLE" + "Novell GroupWise, Lotus Sametime, Bonjour, Zephyr, " + "Gadu-Gadu, and QQ all at once. " + "It is written using GTK+.<BR><BR>" "You may modify and redistribute the program under " "the terms of the GPL (version 2 or later). A copy of the GPL is " "contained in the 'COPYING' file distributed with Gaim. " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-02 00:18:42
|
Revision: 17652 http://svn.sourceforge.net/gaim/?rev=17652&view=rev Author: sadrul Date: 2006-11-01 16:18:34 -0800 (Wed, 01 Nov 2006) Log Message: ----------- Add a 'Plugins' item in the buddylist menu (ctrl-o). Modified Paths: -------------- trunk/console/gntblist.c trunk/console/libgnt/gntmenuitem.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-11-01 21:39:36 UTC (rev 17651) +++ trunk/console/gntblist.c 2006-11-02 00:18:34 UTC (rev 17652) @@ -69,6 +69,11 @@ GntWidget *status; /* Dropdown with the statuses */ GntWidget *statustext; /* Status message */ int typing; + + GntWidget *menu; + /* These are the menuitems that get regenerated */ + GntMenuItem *accounts; + GntMenuItem *plugins; } GGBlist; typedef enum @@ -1766,17 +1771,76 @@ action->callback(action); } -static GntMenuItem *reconstruct_accounts_menu() +static void +build_plugin_actions(GntMenuItem *item, GaimPlugin *plugin, gpointer context) { + GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP); + GList *actions; + GntMenuItem *menuitem; + + gnt_menuitem_set_submenu(item, GNT_MENU(sub)); + for (actions = GAIM_PLUGIN_ACTIONS(plugin, context); actions; + actions = g_list_delete_link(actions, actions)) { + if (actions->data) { + GaimPluginAction *action = actions->data; + action->plugin = plugin; + action->context = context; + menuitem = gnt_menuitem_new(action->label); + gnt_menu_add_item(GNT_MENU(sub), menuitem); + + gnt_menuitem_set_callback(menuitem, plugin_action, action); + g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", + action, (GDestroyNotify)gaim_plugin_action_free); + } + } +} + +static void +reconstruct_plugins_menu() +{ GntWidget *sub; + GntMenuItem *plg; + GList *iter; + + if (!ggblist) + return; + + if (ggblist->plugins == NULL) + ggblist->plugins = gnt_menuitem_new(_("Plugins")); + + plg = ggblist->plugins; + sub = gnt_menu_new(GNT_MENU_POPUP); + gnt_menuitem_set_submenu(plg, GNT_MENU(sub)); + + for (iter = gaim_plugins_get_loaded(); iter; iter = iter->next) { + GaimPlugin *plugin = iter->data; + GntMenuItem *item; + if (GAIM_IS_PROTOCOL_PLUGIN(plugin)) + continue; + + if (!GAIM_PLUGIN_HAS_ACTIONS(plugin)) + continue; + + item = gnt_menuitem_new(_(plugin->info->name)); + gnt_menu_add_item(GNT_MENU(sub), item); + build_plugin_actions(item, plugin, NULL); + } +} + +static void +reconstruct_accounts_menu() +{ + GntWidget *sub; GntMenuItem *acc, *item; GList *iter; if (!ggblist) - return NULL; + return; - acc = gnt_menuitem_new(_("Accounts")); + if (ggblist->accounts == NULL) + ggblist->accounts = gnt_menuitem_new(_("Accounts")); + acc = ggblist->accounts; sub = gnt_menu_new(GNT_MENU_POPUP); gnt_menuitem_set_submenu(acc, GNT_MENU(sub)); @@ -1791,33 +1855,11 @@ prpl = gc->prpl; if (GAIM_PLUGIN_HAS_ACTIONS(prpl)) { - GList *acts; - GntWidget *s; - item = gnt_menuitem_new(gaim_account_get_username(account)); - s = gnt_menu_new(GNT_MENU_POPUP); - gnt_menuitem_set_submenu(item, GNT_MENU(s)); gnt_menu_add_item(GNT_MENU(sub), item); - - for (acts = GAIM_PLUGIN_ACTIONS(prpl, gc); acts; - acts = g_list_delete_link(acts, acts)) { - GaimPluginAction *action = acts->data; - if (!action) - continue; - - action->plugin = prpl; - action->context = gc; - - item = gnt_menuitem_new(action->label); - gnt_menuitem_set_callback(item, plugin_action, action); - /* This is to make sure the action is freed when the menu is destroyed */ - g_object_set_data_full(G_OBJECT(item), "plugin_action", action, - (GDestroyNotify)gaim_plugin_action_free); - gnt_menu_add_item(GNT_MENU(s), item); - } + build_plugin_actions(item, prpl, gc); } } - return acc; } static void show_offline_cb(GntMenuItem *item, gpointer n) @@ -1842,7 +1884,7 @@ return; window = GNT_WINDOW(ggblist->window); - menu = gnt_menu_new(GNT_MENU_TOPLEVEL); + ggblist->menu = menu = gnt_menu_new(GNT_MENU_TOPLEVEL); gnt_window_set_menu(window, GNT_MENU(menu)); item = gnt_menuitem_new(_("Options")); @@ -1867,8 +1909,11 @@ gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(GNT_MENUITEM(item), sort_blist_change_cb, "log"); - item = reconstruct_accounts_menu(); - gnt_menu_add_item(GNT_MENU(menu), item); + reconstruct_accounts_menu(); + gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts); + + reconstruct_plugins_menu(); + gnt_menu_add_item(GNT_MENU(menu), ggblist->plugins); } void gg_blist_show() @@ -1911,14 +1956,19 @@ gnt_widget_show(ggblist->window); gaim_signal_connect(gaim_connections_get_handle(), "signed-on", gg_blist_get_handle(), - GAIM_CALLBACK(create_menu), NULL); + GAIM_CALLBACK(reconstruct_accounts_menu), NULL); gaim_signal_connect(gaim_connections_get_handle(), "signed-off", gg_blist_get_handle(), - GAIM_CALLBACK(create_menu), NULL); + GAIM_CALLBACK(reconstruct_accounts_menu), NULL); gaim_signal_connect(gaim_blist_get_handle(), "buddy-status-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_status_changed), ggblist); gaim_signal_connect(gaim_blist_get_handle(), "buddy-idle-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_idle_changed), ggblist); + gaim_signal_connect(gaim_plugins_get_handle(), "plugin-load", gg_blist_get_handle(), + GAIM_CALLBACK(reconstruct_plugins_menu), NULL); + gaim_signal_connect(gaim_plugins_get_handle(), "plugin-unload", gg_blist_get_handle(), + GAIM_CALLBACK(reconstruct_plugins_menu), NULL); + #if 0 gaim_signal_connect(gaim_blist_get_handle(), "buddy-signed-on", gg_blist_get_handle(), GAIM_CALLBACK(buddy_signed_on), ggblist); Modified: trunk/console/libgnt/gntmenuitem.c =================================================================== --- trunk/console/libgnt/gntmenuitem.c 2006-11-01 21:39:36 UTC (rev 17651) +++ trunk/console/libgnt/gntmenuitem.c 2006-11-02 00:18:34 UTC (rev 17652) @@ -74,6 +74,8 @@ void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu) { + if (item->submenu) + gnt_widget_destroy(item->submenu); item->submenu = menu; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-01 21:39:44
|
Revision: 17651 http://svn.sourceforge.net/gaim/?rev=17651&view=rev Author: sadrul Date: 2006-11-01 13:39:36 -0800 (Wed, 01 Nov 2006) Log Message: ----------- Fix the keycodes here too. Modified Paths: -------------- trunk/console/plugins/lastlog.c Modified: trunk/console/plugins/lastlog.c =================================================================== --- trunk/console/plugins/lastlog.c 2006-11-01 20:59:23 UTC (rev 17650) +++ trunk/console/plugins/lastlog.c 2006-11-01 21:39:36 UTC (rev 17651) @@ -42,13 +42,13 @@ { if (key[0] == 27) { - if (strcmp(key+1, GNT_KEY_DOWN) == 0) + if (strcmp(key, GNT_KEY_DOWN) == 0) gnt_text_view_scroll(view, 1); - else if (strcmp(key+1, GNT_KEY_UP) == 0) + else if (strcmp(key, GNT_KEY_UP) == 0) gnt_text_view_scroll(view, -1); - else if (strcmp(key+1, GNT_KEY_PGDOWN) == 0) + else if (strcmp(key, GNT_KEY_PGDOWN) == 0) gnt_text_view_scroll(view, wid->priv.height - 2); - else if (strcmp(key+1, GNT_KEY_PGUP) == 0) + else if (strcmp(key, GNT_KEY_PGUP) == 0) gnt_text_view_scroll(view, -(wid->priv.height - 2)); else return FALSE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-11-01 20:59:35
|
Revision: 17650 http://svn.sourceforge.net/gaim/?rev=17650&view=rev Author: sadrul Date: 2006-11-01 12:59:23 -0800 (Wed, 01 Nov 2006) Log Message: ----------- Print a debug message if someone tries to specify a binding for some non-existent action. Make sure the conversation windows aren't too large to cause a crash. raise(SIGABRT) instead of exit() to force a coredump if something goes wrong with stdin. Modified Paths: -------------- trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gntwidget.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-11-01 19:23:39 UTC (rev 17649) +++ trunk/console/libgnt/gntmain.c 2006-11-01 20:59:23 UTC (rev 17650) @@ -774,16 +774,17 @@ int rd = read(STDIN_FILENO, keys, sizeof(keys) - 1); if (rd < 0) { + int ch = getch(); /* This should return ERR, but let's see what it really returns */ endwin(); printf("ERROR: %s\n", strerror(errno)); - printf("File descriptor is: %d\n\nGIOChannel is: %p", STDIN_FILENO, source); - exit(1); + printf("File descriptor is: %d\n\nGIOChannel is: %p\ngetch() = %d\n", STDIN_FILENO, source, ch); + raise(SIGABRT); } else if (rd == 0) { endwin(); printf("EOF\n"); - exit(1); + raise(SIGABRT); } event_stack = TRUE; @@ -1115,12 +1116,12 @@ (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI | G_IO_NVAL), io_invoke, NULL, NULL); + g_io_channel_unref(channel); /* Apparently this caused crashes for some people. + But irssi does this, so I am going to assume the + crashes were caused by some other stuff. */ + locale = setlocale(LC_ALL, ""); -#if 0 - g_io_channel_unref(channel); /* Apparently this causes crash for some people */ -#endif - if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) ascii_only = FALSE; else Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-11-01 19:23:39 UTC (rev 17649) +++ trunk/console/libgnt/gnttextview.c 2006-11-01 20:59:23 UTC (rev 17650) @@ -211,7 +211,8 @@ } view->list = list; GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(view), GNT_WIDGET_DRAWING); - gnt_widget_draw(GNT_WIDGET(view)); + if (GNT_WIDGET(view)->window) + gnt_widget_draw(GNT_WIDGET(view)); g_string_free(string, TRUE); } Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-11-01 19:23:39 UTC (rev 17649) +++ trunk/console/libgnt/gntwidget.c 2006-11-01 20:59:23 UTC (rev 17650) @@ -711,14 +711,24 @@ register_binding(GntWidgetClass *klass, const char *name, const char *trigger, GList *list) { GntWidgetActionParam *param; + GntWidgetAction *action; if (name == NULL || *name == '\0') { g_hash_table_remove(klass->bindings, (char*)trigger); return; } + action = g_hash_table_lookup(klass->actions, name); + if (!action) { + g_printerr("GntWidget: Invalid action name %s for %s\n", + name, g_type_name(G_OBJECT_CLASS_TYPE(klass))); + if (list) + g_list_free(list); + return; + } + param = g_new0(GntWidgetActionParam, 1); - param->action = g_hash_table_lookup(klass->actions, name); + param->action = action; param->list = list; g_hash_table_replace(klass->bindings, g_strdup(trigger), param); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |