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: <de...@us...> - 2006-09-25 07:27:07
|
Revision: 17347 http://svn.sourceforge.net/gaim/?rev=17347&view=rev Author: deryni9 Date: 2006-09-25 00:27:02 -0700 (Mon, 25 Sep 2006) Log Message: ----------- conversation-timestamp takes a GaimConversation, somehow the two -timestamp signals got a little crossed (or miscopied and pasted). Modified Paths: -------------- trunk/gtk/gtkconv.c Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-09-25 06:01:12 UTC (rev 17346) +++ trunk/gtk/gtkconv.c 2006-09-25 07:27:02 UTC (rev 17347) @@ -6573,7 +6573,7 @@ #endif gaim_value_new(GAIM_TYPE_POINTER), 2, gaim_value_new(GAIM_TYPE_SUBTYPE, - GAIM_SUBTYPE_LOG), + GAIM_SUBTYPE_CONVERSATION), #if SIZEOF_TIME_T == 4 gaim_value_new(GAIM_TYPE_INT)); #elif SIZEOF_TIME_T == 8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-09-25 06:01:17
|
Revision: 17346 http://svn.sourceforge.net/gaim/?rev=17346&view=rev Author: deryni9 Date: 2006-09-24 23:01:12 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Fix the argument GaimValue types in a handful of signal registrations. These being wrong didn't matter to things that knew/guessed what their arguments were (i.e. C functions) but did matter to things that needed to trust the GaimValue type information for the types (i.e plugin loaders). I'm pretty sure I got this all right, it matches the docs at least. I still think there are a couple problems (namely the *-timestamp functions returning a GAIM_TYPE_POINTER instead of a GAIM_TYPE_STRING) but these were much more obvious. Modified Paths: -------------- trunk/libgaim/ft.c trunk/libgaim/sound.c Modified: trunk/libgaim/ft.c =================================================================== --- trunk/libgaim/ft.c 2006-09-25 03:35:02 UTC (rev 17345) +++ trunk/libgaim/ft.c 2006-09-25 06:01:12 UTC (rev 17346) @@ -1183,41 +1183,41 @@ /* register signals */ gaim_signal_register(handle, "file-recv-accept", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-send-accept", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-recv-start", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-send-start", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-send-cancel", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-recv-cancel", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-send-complete", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-recv-complete", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); gaim_signal_register(handle, "file-recv-request", - gaim_marshal_VOID__POINTER, - NULL, 1, - gaim_value_new(GAIM_TYPE_POINTER, GAIM_SUBTYPE_XFER)); + gaim_marshal_VOID__POINTER, NULL, 1, + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_XFER)); } void Modified: trunk/libgaim/sound.c =================================================================== --- trunk/libgaim/sound.c 2006-09-25 03:35:02 UTC (rev 17345) +++ trunk/libgaim/sound.c 2006-09-25 06:01:12 UTC (rev 17346) @@ -103,7 +103,8 @@ gaim_marshal_BOOLEAN__INT_POINTER, gaim_value_new(GAIM_TYPE_BOOLEAN), 2, gaim_value_new(GAIM_TYPE_INT), - gaim_value_new(GAIM_TYPE_POINTER)); + gaim_value_new(GAIM_TYPE_SUBTYPE, + GAIM_SUBTYPE_ACCOUNT)); gaim_prefs_add_none("/core/sound"); gaim_prefs_add_bool("/core/sound/while_away", FALSE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-09-25 03:35:07
|
Revision: 17345 http://svn.sourceforge.net/gaim/?rev=17345&view=rev Author: deryni9 Date: 2006-09-24 20:35:02 -0700 (Sun, 24 Sep 2006) Log Message: ----------- This seems to be what the signal actually looks like. Modified Paths: -------------- trunk/doc/log-signals.dox Modified: trunk/doc/log-signals.dox =================================================================== --- trunk/doc/log-signals.dox 2006-09-24 17:07:38 UTC (rev 17344) +++ trunk/doc/log-signals.dox 2006-09-25 03:35:02 UTC (rev 17345) @@ -8,7 +8,7 @@ @signaldef log-timestamp @signalproto -char *(*log_timestamp)(GaimConversation *conv, time_t when); +char *(*log_timestamp)(GaimLog *log, time_t when); @endsignalproto @signaldesc Emitted to allow plugins to customize the timestamp on a message This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-24 17:07:45
|
Revision: 17344 http://svn.sourceforge.net/gaim/?rev=17344&view=rev Author: sadrul Date: 2006-09-24 10:07:38 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Add a barebone menu in the buddylist for account actions. (Press Ctrl+o) Modified Paths: -------------- trunk/console/gntblist.c trunk/console/libgnt/gntmenu.c trunk/console/libgnt/gntmenuitem.c trunk/console/libgnt/gntmenuitem.h trunk/console/libgnt/gnttree.c trunk/console/libgnt/gnttree.h trunk/console/libgnt/gntwindow.c trunk/console/libgnt/test/menu.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/gntblist.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -39,6 +39,7 @@ #include "gntlabel.h" #include "gntline.h" #include "gnttree.h" +#include "gntwindow.h" #include "gntblist.h" #include "gntconv.h" @@ -483,6 +484,8 @@ gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), group, NULL); + /* XXX: This causes problem because you can close a chat window, hide the buddylist. + * When you show the buddylist, you automatically join the chat again. */ if (gaim_blist_node_get_bool((GaimBlistNode*)chat, "gnt-autojoin")) serv_join_chat(gaim_account_get_connection(chat->account), chat->components); } @@ -1608,6 +1611,75 @@ return FALSE; } +static void +plugin_action(GntMenuItem *item, gpointer data) +{ + GaimPluginAction *action = data; + if (action && action->callback) + action->callback(action); +} + +static void +reconstruct_accounts_menu() +{ + GntWidget *menu, *sub; + GntMenuItem *item; + GntWindow *window; + GList *iter; + + if (!ggblist) + return; + + window = GNT_WINDOW(ggblist->window); + + menu = gnt_menu_new(GNT_MENU_TOPLEVEL); + gnt_window_set_menu(window, GNT_MENU(menu)); + + item = gnt_menuitem_new(_("Accounts")); + gnt_menu_add_item(GNT_MENU(menu), item); + + sub = gnt_menu_new(GNT_MENU_POPUP); + gnt_menuitem_set_submenu(item, GNT_MENU(sub)); + + for (iter = gaim_accounts_get_all_active(); iter; + iter = g_list_delete_link(iter, iter)) { + GaimAccount *account = iter->data; + GaimConnection *gc = gaim_account_get_connection(account); + GaimPlugin *prpl; + + if (!GAIM_CONNECTION_IS_CONNECTED(gc)) + continue; + 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); + } + } + } +} + void gg_blist_show() { if (ggblist) @@ -1617,7 +1689,7 @@ gaim_get_blist()->ui_data = ggblist; - ggblist->window = gnt_vbox_new(FALSE); + ggblist->window = gnt_vwindow_new(FALSE); gnt_widget_set_name(ggblist->window, "buddylist"); gnt_box_set_toplevel(GNT_BOX(ggblist->window), TRUE); gnt_box_set_title(GNT_BOX(ggblist->window), _("Buddy List")); @@ -1641,6 +1713,10 @@ gnt_widget_show(ggblist->window); + gaim_signal_connect(gaim_connections_get_handle(), "signed-on", gg_blist_get_handle(), + GAIM_CALLBACK(reconstruct_accounts_menu), NULL); + gaim_signal_connect(gaim_connections_get_handle(), "signed-off", gg_blist_get_handle(), + 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(), @@ -1682,6 +1758,8 @@ g_signal_connect(G_OBJECT(ggblist->statustext), "key_pressed", G_CALLBACK(status_text_changed), NULL); + reconstruct_accounts_menu(ggblist); + populate_buddylist(); savedstatus_changed(gaim_savedstatus_get_current(), NULL); Modified: trunk/console/libgnt/gntmenu.c =================================================================== --- trunk/console/libgnt/gntmenu.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gntmenu.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -10,10 +10,10 @@ static GntTreeClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; -void (*org_draw)(GntWidget *wid); -void (*org_destroy)(GntWidget *wid); -void (*org_map)(GntWidget *wid); -gboolean (*org_key_pressed)(GntWidget *w, const char *t); +static void (*org_draw)(GntWidget *wid); +static void (*org_destroy)(GntWidget *wid); +static void (*org_map)(GntWidget *wid); +static gboolean (*org_key_pressed)(GntWidget *w, const char *t); static void gnt_menu_draw(GntWidget *widget) @@ -89,6 +89,7 @@ menu_tree_add(menu, item, NULL); } org_map(widget); + gnt_tree_adjust_columns(GNT_TREE(widget)); } GNTDEBUG; } @@ -267,7 +268,7 @@ GntWidget *widget = g_object_new(GNT_TYPE_MENU, NULL); GntMenu *menu = GNT_MENU(widget); menu->list = NULL; - menu->selected = -1; + menu->selected = 0; menu->type = type; if (type == GNT_MENU_TOPLEVEL) { Modified: trunk/console/libgnt/gntmenuitem.c =================================================================== --- trunk/console/libgnt/gntmenuitem.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gntmenuitem.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -56,14 +56,14 @@ return type; } -GObject *gnt_menuitem_new(const char *text) +GntMenuItem *gnt_menuitem_new(const char *text) { GObject *item = g_object_new(GNT_TYPE_MENUITEM, NULL); GntMenuItem *menuitem = GNT_MENUITEM(item); menuitem->text = g_strdup(text); - return item; + return menuitem; } void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data) Modified: trunk/console/libgnt/gntmenuitem.h =================================================================== --- trunk/console/libgnt/gntmenuitem.h 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gntmenuitem.h 2006-09-24 17:07:38 UTC (rev 17344) @@ -58,7 +58,7 @@ GType gnt_menuitem_get_gtype(void); -GObject *gnt_menuitem_new(const char *text); +GntMenuItem *gnt_menuitem_new(const char *text); void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data); Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gnttree.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -1,5 +1,6 @@ #include "gnttree.h" #include "gntmarshal.h" +#include "gntutils.h" #include <string.h> #include <ctype.h> @@ -1140,6 +1141,7 @@ { tree->columns[col].width = 15; } + tree->list = NULL; tree->show_title = FALSE; } @@ -1241,3 +1243,33 @@ tree->show_separator = set; } +void gnt_tree_adjust_columns(GntTree *tree) +{ + GntTreeRow *row = tree->root; + int *widths, i, twidth, height; + + widths = g_new0(int, tree->ncol); + while (row) { + GList *iter; + for (i = 0, iter = row->columns; iter; iter = iter->next, i++) { + GntTreeCol *col = iter->data; + int w = gnt_util_onscreen_width(col->text, NULL); + if (widths[i] < w) + widths[i] = w; + } + row = row->next; + } + + twidth = 1 + 2 * (!GNT_WIDGET_IS_FLAG_SET(GNT_WIDGET(tree), GNT_WIDGET_NO_BORDER)); + for (i = 0; i < tree->ncol; i++) { + gnt_tree_set_col_width(tree, i, widths[i]); + twidth += widths[i] + (tree->show_separator ? 1 : 0) + 1; + fprintf(stderr, "column width for col %d: %d\n", i, widths[i]); + } + g_free(widths); + + fprintf(stderr, "tree width: %d\n", twidth); + gnt_widget_get_size(GNT_WIDGET(tree), NULL, &height); + gnt_widget_set_size(GNT_WIDGET(tree), twidth, height); +} + Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gnttree.h 2006-09-24 17:07:38 UTC (rev 17344) @@ -123,6 +123,9 @@ void gnt_tree_set_show_separator(GntTree *tree, gboolean set); +/* This will try to automatically adjust the width of the columns in the tree */ +void gnt_tree_adjust_columns(GntTree *tree); + G_END_DECLS /* The following functions should NOT be used by applications. */ Modified: trunk/console/libgnt/gntwindow.c =================================================================== --- trunk/console/libgnt/gntwindow.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/gntwindow.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -10,8 +10,8 @@ static GntBoxClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; -gboolean (*org_keypress)(GntWidget *widget, const char *text); -void (*org_destroy)(GntWidget *widget); +static gboolean (*org_keypress)(GntWidget *widget, const char *text); +static void (*org_destroy)(GntWidget *widget); static gboolean gnt_window_key_pressed(GntWidget *widget, const char *text) @@ -108,6 +108,9 @@ void gnt_window_set_menu(GntWindow *window, GntMenu *menu) { + /* If a menu already existed, then destroy that first. */ + if (window->menu) + gnt_widget_destroy(GNT_WIDGET(window->menu)); window->menu = menu; } Modified: trunk/console/libgnt/test/menu.c =================================================================== --- trunk/console/libgnt/test/menu.c 2006-09-24 16:35:31 UTC (rev 17343) +++ trunk/console/libgnt/test/menu.c 2006-09-24 17:07:38 UTC (rev 17344) @@ -48,7 +48,6 @@ gnt_screen_menu_show(menu); - GntWidget *win = gnt_window_new(); gnt_box_add_widget(GNT_BOX(win), gnt_label_new("...")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-24 16:35:35
|
Revision: 17343 http://svn.sourceforge.net/gaim/?rev=17343&view=rev Author: thekingant Date: 2006-09-24 09:35:31 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Add the Seamonkey patch contributor to the copyright file and fix a bug that would have caused Epiphany not to show up in the list. Thanks to Will Thompson and Sadrul Habib Chowdhury Modified Paths: -------------- trunk/COPYRIGHT trunk/gtk/gtkprefs.c Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-09-24 08:11:28 UTC (rev 17342) +++ trunk/COPYRIGHT 2006-09-24 16:35:31 UTC (rev 17343) @@ -130,6 +130,7 @@ Mike Heffner Benjamin Herrenschmidt Fernando Herrera +hjheins Hil Casey Ho Iain Holmes Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-09-24 08:11:28 UTC (rev 17342) +++ trunk/gtk/gtkprefs.c 2006-09-24 16:35:31 UTC (rev 17343) @@ -1184,7 +1184,7 @@ {N_("Firebird"), "mozilla-firebird"}, {N_("Epiphany"), "epiphany"} }; - static const int num_possible_browsers = 9; + static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers); GList *browsers = NULL; int i = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-24 08:11:32
|
Revision: 17342 http://svn.sourceforge.net/gaim/?rev=17342&view=rev Author: thekingant Date: 2006-09-24 01:11:28 -0700 (Sun, 24 Sep 2006) Log Message: ----------- sf patch #1563203, from hjheins Add Seamonkey to the list of browsers. This is the first patch I've accepted in a while. Mostly because Richard has been doing such an awesome job with the patch tracker. Three cheers for rlaager! hip-hip, hooray! hip-hip, hooray! hip-hip, hooray! Modified Paths: -------------- trunk/gtk/gtknotify.c trunk/gtk/gtkprefs.c Modified: trunk/gtk/gtknotify.c =================================================================== --- trunk/gtk/gtknotify.c 2006-09-24 07:14:26 UTC (rev 17341) +++ trunk/gtk/gtknotify.c 2006-09-24 08:11:28 UTC (rev 17342) @@ -966,7 +966,8 @@ } else if (!strcmp(web_browser, "mozilla") || !strcmp(web_browser, "mozilla-firebird") || - !strcmp(web_browser, "firefox")) + !strcmp(web_browser, "firefox") || + !strcmp(web_browser, "seamonkey")) { char *args = ""; Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-09-24 07:14:26 UTC (rev 17341) +++ trunk/gtk/gtkprefs.c 2006-09-24 08:11:28 UTC (rev 17342) @@ -1171,16 +1171,18 @@ char *command; }; + /* Sorted reverse alphabetically */ static struct browser possible_browsers[] = { - {N_("Epiphany"), "epiphany"}, + {N_("Seamonkey"), "seamonkey"}, + {N_("Opera"), "opera"}, + {N_("Netscape"), "netscape"}, + {N_("Mozilla"), "mozilla"}, + {N_("Konqueror"), "kfmclient"}, + {N_("GNOME Default"), "gnome-open"}, + {N_("Galeon"), "galeon"}, + {N_("Firefox"), "firefox"}, {N_("Firebird"), "mozilla-firebird"}, - {N_("Firefox"), "firefox"}, - {N_("Galeon"), "galeon"}, - {N_("GNOME Default"), "gnome-open"}, - {N_("Konqueror"), "kfmclient"}, - {N_("Mozilla"), "mozilla"}, - {N_("Netscape"), "netscape"}, - {N_("Opera"), "opera"} + {N_("Epiphany"), "epiphany"} }; static const int num_possible_browsers = 9; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-24 07:19:59
|
Revision: 17341 http://svn.sourceforge.net/gaim/?rev=17341&view=rev Author: sadrul Date: 2006-09-24 00:14:26 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Menus and windows. I have added a test-app test/menu.c to show how to use it. Pressing Ctrl+o brings up the menu for the window (if it has one). It should now be possible to add menus for account-actions and all that stuff. Patches are very welcome. Modified Paths: -------------- trunk/console/libgnt/Makefile.am trunk/console/libgnt/gnt.h trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/gnttree.h trunk/console/libgnt/gntwidget.c trunk/console/libgnt/gntwidget.h trunk/console/libgnt/test/Makefile trunk/console/libgnt/test/focus.c trunk/console/libgnt/wms/s.c Added Paths: ----------- trunk/console/libgnt/gntmenu.c trunk/console/libgnt/gntmenu.h trunk/console/libgnt/gntmenuitem.c trunk/console/libgnt/gntmenuitem.h trunk/console/libgnt/gntwindow.c trunk/console/libgnt/gntwindow.h trunk/console/libgnt/test/menu.c Modified: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/Makefile.am 2006-09-24 07:14:26 UTC (rev 17341) @@ -16,10 +16,13 @@ gntlabel.c \ gntline.c \ gntmarshal.c \ + gntmenu.c \ + gntmenuitem.c \ gntstyle.c \ gnttextview.c \ gnttree.c \ gntutils.c \ + gntwindow.c \ gntmain.c libgnt_la_headers = \ @@ -34,10 +37,13 @@ gntlabel.h \ gntline.h \ gntmarshal.h \ + gntmenu.h \ + gntmenuitem.h \ gntstyle.h \ gnttextview.h \ gnttree.h \ gntutils.h \ + gntwindow.h \ gntwm.h \ gnt.h Modified: trunk/console/libgnt/gnt.h =================================================================== --- trunk/console/libgnt/gnt.h 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gnt.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -29,5 +29,7 @@ void gnt_register_action(const char *label, void (*callback)()); +gboolean gnt_screen_menu_show(gpointer menu); + void gnt_quit(); Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gntbox.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -504,9 +504,15 @@ static void gnt_box_init(GTypeInstance *instance, gpointer class) { + GntWidget *widget = GNT_WIDGET(instance); + GntBox *box = GNT_BOX(widget); /* Initially make both the height and width resizable. * Update the flags as necessary when widgets are added to it. */ - GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_CAN_TAKE_FOCUS); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); + box->pad = 1; + box->fill = TRUE; GNTDEBUG; } @@ -547,14 +553,7 @@ box->homogeneous = homo; box->vertical = vert; - box->pad = 1; - box->fill = TRUE; - gnt_widget_set_take_focus(widget, TRUE); - GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); - if (vert) - box->alignment = GNT_ALIGN_LEFT; - else - box->alignment = GNT_ALIGN_MID; + box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID; return widget; } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gntmain.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -8,6 +8,7 @@ #include "gntbox.h" #include "gntcolors.h" #include "gntkeys.h" +#include "gntmenu.h" #include "gntstyle.h" #include "gnttree.h" #include "gntutils.h" @@ -34,6 +35,14 @@ * 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 int lock_focus_list; static GList *focus_list; static GList *ordered; @@ -120,6 +129,15 @@ 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; @@ -685,7 +703,7 @@ static int reverse_char(WINDOW *d, int y, int x, gboolean set) { -#define DECIDE(ch) (set ? ((ch) | WA_REVERSE) : ((ch) & ~WA_REVERSE)) +#define DECIDE(ch) (set ? ((ch) | A_REVERSE) : ((ch) & ~A_REVERSE)) #ifdef NO_WIDECHAR chtype ch; @@ -777,8 +795,9 @@ if (mode == GNT_KP_MODE_NORMAL) { - if (ordered) - { + if (menu) { + ret = gnt_widget_key_pressed(GNT_WIDGET(menu), buffer); + } else if (ordered) { ret = gnt_widget_key_pressed(ordered->data, buffer); } @@ -1209,8 +1228,8 @@ while (widget->parent) widget = widget->parent; - - gnt_box_sync_children(GNT_BOX(widget)); + if (!GNT_IS_MENU(widget)) + gnt_box_sync_children(GNT_BOX(widget)); node = g_hash_table_lookup(nodes, widget); if (node && !node->panel) { @@ -1244,6 +1263,9 @@ GntWidget *w; if (!widget) return FALSE; + + if (GNT_IS_MENU(widget)) + return TRUE; w = widget; @@ -1416,3 +1438,25 @@ lock_focus_list = 0; } +static void +reset_menu(GntWidget *widget, gpointer null) +{ + menu = NULL; +} + +gboolean gnt_screen_menu_show(gpointer newmenu) +{ + if (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)); + + g_signal_connect(G_OBJECT(menu), "hide", G_CALLBACK(reset_menu), NULL); + + return TRUE; +} + Added: trunk/console/libgnt/gntmenu.c =================================================================== --- trunk/console/libgnt/gntmenu.c (rev 0) +++ trunk/console/libgnt/gntmenu.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,290 @@ +#include "gntmenu.h" + +#include <string.h> + +enum +{ + SIGS = 1, +}; + +static GntTreeClass *parent_class = NULL; +static guint signals[SIGS] = { 0 }; + +void (*org_draw)(GntWidget *wid); +void (*org_destroy)(GntWidget *wid); +void (*org_map)(GntWidget *wid); +gboolean (*org_key_pressed)(GntWidget *w, const char *t); + +static void +gnt_menu_draw(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + GList *iter; + chtype type; + int i; + + if (menu->type == GNT_MENU_TOPLEVEL) { + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + werase(widget->window); + + for (i = 0, iter = menu->list; iter; iter = iter->next, i++) { + GntMenuItem *item = GNT_MENUITEM(iter->data); + type = ' ' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT); + if (i == menu->selected) + type |= A_REVERSE; + item->priv.x = getcurx(widget->window) + widget->priv.x; + item->priv.y = getcury(widget->window) + widget->priv.y + 1; + wbkgdset(widget->window, type); + wprintw(widget->window, " %s ", item->text); + } + } else { + org_draw(widget); + } + + GNTDEBUG; +} + +static void +gnt_menu_size_request(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + + if (menu->type == GNT_MENU_TOPLEVEL) { + widget->priv.height = 1; + widget->priv.width = getmaxx(stdscr); + } else { + widget->priv.height = g_list_length(menu->list) + 2; + widget->priv.width = 25; /* XXX: */ + } +} + +static void +menu_tree_add(GntMenu *menu, GntMenuItem *item, GntMenuItem *parent) +{ + gnt_tree_add_row_last(GNT_TREE(menu), item, + gnt_tree_create_row(GNT_TREE(menu), item->text, item->submenu ? ">" : " "), parent); + if (0 && item->submenu) { + GntMenu *sub = GNT_MENU(item->submenu); + GList *iter; + for (iter = sub->list; iter; iter = iter->next) { + GntMenuItem *it = GNT_MENUITEM(iter->data); + menu_tree_add(menu, it, item); + } + } +} + +static void +gnt_menu_map(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + + if (menu->type == GNT_MENU_TOPLEVEL) { + gnt_widget_size_request(widget); + } else { + /* Populate the tree */ + GList *iter; + gnt_tree_remove_all(GNT_TREE(widget)); + for (iter = menu->list; iter; iter = iter->next) { + GntMenuItem *item = GNT_MENUITEM(iter->data); + menu_tree_add(menu, item, NULL); + } + org_map(widget); + } + GNTDEBUG; +} + +static void +menuitem_activate(GntMenu *menu, GntMenuItem *item) +{ + if (item) { + if (item->submenu) { + GntMenu *sub = GNT_MENU(item->submenu); + menu->submenu = sub; + sub->type = GNT_MENU_POPUP; /* Submenus are *never* toplevel */ + sub->parentmenu = menu; + if (menu->type != GNT_MENU_TOPLEVEL) { + GntWidget *widget = GNT_WIDGET(menu); + item->priv.x = widget->priv.x + widget->priv.width - 1; + item->priv.y = widget->priv.y + gnt_tree_get_selection_visible_line(GNT_TREE(menu)); + } + gnt_widget_set_position(GNT_WIDGET(sub), item->priv.x, item->priv.y); + gnt_widget_draw(GNT_WIDGET(sub)); + } else if (item->callback) { + item->callback(item, item->callbackdata); + while (menu) { + gnt_widget_hide(GNT_WIDGET(menu)); + menu = menu->parentmenu; + } + } + } +} + +static gboolean +gnt_menu_key_pressed(GntWidget *widget, const char *text) +{ + GntMenu *menu = GNT_MENU(widget); + int current = menu->selected; + + if (menu->submenu) { + /*if (gnt_widget_key_pressed(GNT_WIDGET(menu->submenu), text))*/ + /*return TRUE;*/ + return (gnt_widget_key_pressed(GNT_WIDGET(menu->submenu), text)); + } + + if (text[0] == 27 && text[1] == 0) { + /* Escape closes menu */ + GntMenu *par = menu->parentmenu; + if (par != NULL) { + par->submenu = NULL; + gnt_widget_hide(widget); + } else + gnt_widget_hide(widget); + return TRUE; + } + + if (menu->type == GNT_MENU_TOPLEVEL) { + if (text[0] == 27) { + if (strcmp(text + 1, GNT_KEY_LEFT) == 0) { + menu->selected--; + if (menu->selected < 0) + menu->selected = g_list_length(menu->list) - 1; + } else if (strcmp(text + 1, GNT_KEY_RIGHT) == 0) { + menu->selected++; + if (menu->selected >= g_list_length(menu->list)) + menu->selected = 0; + } + } else if (text[0] == '\r' && text[1] == 0) { + gnt_widget_activate(widget); + } + + if (current != menu->selected) { + gnt_widget_draw(widget); + return TRUE; + } + } else { + return org_key_pressed(widget, text); + } + + return FALSE; +} + +static void +gnt_menu_destroy(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + g_list_foreach(menu->list, (GFunc)g_object_run_dispose, NULL); + g_list_free(menu->list); + org_destroy(widget); +} + +static void +gnt_menu_activate(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + GntMenuItem *item; + + if (menu->type == GNT_MENU_TOPLEVEL) { + item = g_list_nth_data(menu->list, menu->selected); + } else { + item = gnt_tree_get_selection_data(GNT_TREE(menu)); + } + + if (item) + menuitem_activate(menu, item); +} + +static void +gnt_menu_hide(GntWidget *widget) +{ + GntMenu *menu = GNT_MENU(widget); + if (menu->parentmenu) + menu->parentmenu->submenu = NULL; +} + +static void +gnt_menu_class_init(GntMenuClass *klass) +{ + GntWidgetClass *wid_class = GNT_WIDGET_CLASS(klass); + parent_class = GNT_TREE_CLASS(klass); + + org_destroy = wid_class->destroy; + org_map = wid_class->map; + org_draw = wid_class->draw; + org_key_pressed = wid_class->key_pressed; + + wid_class->destroy = gnt_menu_destroy; + wid_class->draw = gnt_menu_draw; + wid_class->map = gnt_menu_map; + wid_class->size_request = gnt_menu_size_request; + wid_class->key_pressed = gnt_menu_key_pressed; + wid_class->activate = gnt_menu_activate; + wid_class->hide = gnt_menu_hide; + + GNTDEBUG; +} + +static void +gnt_menu_init(GTypeInstance *instance, gpointer class) +{ + GntWidget *widget = GNT_WIDGET(instance); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER | + GNT_WIDGET_CAN_TAKE_FOCUS); + GNTDEBUG; +} + +/****************************************************************************** + * GntMenu API + *****************************************************************************/ +GType +gnt_menu_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) + { + static const GTypeInfo info = { + sizeof(GntMenuClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_menu_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GntMenu), + 0, /* n_preallocs */ + gnt_menu_init, /* instance_init */ + }; + + type = g_type_register_static(GNT_TYPE_TREE, + "GntMenu", + &info, 0); + } + + return type; +} + +GntWidget *gnt_menu_new(GntMenuType type) +{ + GntWidget *widget = g_object_new(GNT_TYPE_MENU, NULL); + GntMenu *menu = GNT_MENU(widget); + menu->list = NULL; + menu->selected = -1; + menu->type = type; + + if (type == GNT_MENU_TOPLEVEL) { + widget->priv.x = 0; + widget->priv.y = 0; + } else { + GNT_TREE(widget)->show_separator = FALSE; + _gnt_tree_init_internals(GNT_TREE(widget), 2); + gnt_tree_set_col_width(GNT_TREE(widget), 1, 1); /* The second column is to indicate that it has a submenu */ + GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_NO_BORDER); + } + + return widget; +} + +void gnt_menu_add_item(GntMenu *menu, GntMenuItem *item) +{ + menu->list = g_list_append(menu->list, item); +} + Property changes on: trunk/console/libgnt/gntmenu.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntmenu.h =================================================================== --- trunk/console/libgnt/gntmenu.h (rev 0) +++ trunk/console/libgnt/gntmenu.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,70 @@ +#ifndef GNT_MENU_H +#define GNT_MENU_H + +#include "gnttree.h" +#include "gntcolors.h" +#include "gntkeys.h" + +#define GNT_TYPE_MENU (gnt_menu_get_gtype()) +#define GNT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENU, GntMenu)) +#define GNT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENU, GntMenuClass)) +#define GNT_IS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENU)) +#define GNT_IS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENU)) +#define GNT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENU, GntMenuClass)) + +#define GNT_MENU_FLAGS(obj) (GNT_MENU(obj)->priv.flags) +#define GNT_MENU_SET_FLAGS(obj, flags) (GNT_MENU_FLAGS(obj) |= flags) +#define GNT_MENU_UNSET_FLAGS(obj, flags) (GNT_MENU_FLAGS(obj) &= ~(flags)) + +typedef struct _GnMenu GntMenu; +typedef struct _GnMenuPriv GntMenuPriv; +typedef struct _GnMenuClass GntMenuClass; + +#include "gntmenuitem.h" + +/** + * A toplevel-menu is displayed at the top of the screen, and it spans accross + * the entire width of the screen. + * A popup-menu could be displayed, for example, as a context menu for widgets. + */ +typedef enum +{ + GNT_MENU_TOPLEVEL = 1, /* Menu for a toplevel window */ + GNT_MENU_POPUP, /* A popup menu */ +} GntMenuType; + +struct _GnMenu +{ + GntTree parent; + GntMenuType type; + + GList *list; + int selected; + + /* This will keep track of its immediate submenu which is visible so that + * keystrokes can be passed to it. */ + GntMenu *submenu; + GntMenu *parentmenu; +}; + +struct _GnMenuClass +{ + GntTreeClass parent; + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +}; + +G_BEGIN_DECLS + +GType gnt_menu_get_gtype(void); + +GntWidget *gnt_menu_new(GntMenuType type); + +void gnt_menu_add_item(GntMenu *menu, GntMenuItem *item); + +G_END_DECLS + +#endif /* GNT_MENU_H */ Property changes on: trunk/console/libgnt/gntmenu.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntmenuitem.c =================================================================== --- trunk/console/libgnt/gntmenuitem.c (rev 0) +++ trunk/console/libgnt/gntmenuitem.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,79 @@ +#include "gntmenu.h" +#include "gntmenuitem.h" + +static GObjectClass *parent_class = NULL; + +static void +gnt_menuitem_destroy(GObject *obj) +{ + GntMenuItem *item = GNT_MENUITEM(obj); + g_free(item->text); + item->text = NULL; + if (item->submenu) + gnt_widget_destroy(GNT_WIDGET(item->submenu)); +} + +static void +gnt_menuitem_class_init(GntMenuItemClass *klass) +{ + parent_class = G_OBJECT_CLASS(klass); + + parent_class->dispose = gnt_menuitem_destroy; +} + +static void +gnt_menuitem_init(GTypeInstance *instance, gpointer class) +{ +} + +/****************************************************************************** + * GntMenuItem API + *****************************************************************************/ +GType +gnt_menuitem_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) + { + static const GTypeInfo info = { + sizeof(GntMenuItemClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_menuitem_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GntMenuItem), + 0, /* n_preallocs */ + gnt_menuitem_init, /* instance_init */ + }; + + type = g_type_register_static(G_TYPE_OBJECT, + "GntMenuItem", + &info, 0); + } + + return type; +} + +GObject *gnt_menuitem_new(const char *text) +{ + GObject *item = g_object_new(GNT_TYPE_MENUITEM, NULL); + GntMenuItem *menuitem = GNT_MENUITEM(item); + + menuitem->text = g_strdup(text); + + return item; +} + +void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data) +{ + item->callback = callback; + item->callbackdata = data; +} + +void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu) +{ + item->submenu = menu; +} + Property changes on: trunk/console/libgnt/gntmenuitem.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntmenuitem.h =================================================================== --- trunk/console/libgnt/gntmenuitem.h (rev 0) +++ trunk/console/libgnt/gntmenuitem.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,69 @@ +#ifndef GNT_MENUITEM_H +#define GNT_MENUITEM_H + +#include <glib.h> +#include <glib-object.h> + +#define GNT_TYPE_MENUITEM (gnt_menuitem_get_gtype()) +#define GNT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENUITEM, GntMenuItem)) +#define GNT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENUITEM, GntMenuItemClass)) +#define GNT_IS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENUITEM)) +#define GNT_IS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENUITEM)) +#define GNT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENUITEM, GntMenuItemClass)) + +#define GNT_MENUITEM_FLAGS(obj) (GNT_MENUITEM(obj)->priv.flags) +#define GNT_MENUITEM_SET_FLAGS(obj, flags) (GNT_MENUITEM_FLAGS(obj) |= flags) +#define GNT_MENUITEM_UNSET_FLAGS(obj, flags) (GNT_MENUITEM_FLAGS(obj) &= ~(flags)) + +typedef struct _GnMenuItem GntMenuItem; +typedef struct _GnMenuItemPriv GntMenuItemPriv; +typedef struct _GnMenuItemClass GntMenuItemClass; + +struct _GnMenuItemPriv +{ + /* These will be used to determine the position of the submenu */ + int x; + int y; +}; + +typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data); + +struct _GnMenuItem +{ + GObject parent; + GntMenuItemPriv priv; + + char *text; + + /* A GntMenuItem can have a callback associated with it. + * The callback will be activated whenever the suer selects it and presses enter (or clicks). + * However, if the GntMenuItem has some child, then the callback and callbackdata will be ignored. */ + gpointer callbackdata; + GntMenuItemCallback callback; + + GntMenu *submenu; +}; + +struct _GnMenuItemClass +{ + GObjectClass parent; + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +}; + +G_BEGIN_DECLS + +GType gnt_menuitem_get_gtype(void); + +GObject *gnt_menuitem_new(const char *text); + +void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data); + +void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu); + +G_END_DECLS + +#endif /* GNT_MENUITEM_H */ Property changes on: trunk/console/libgnt/gntmenuitem.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gnttree.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -288,8 +288,10 @@ tree_mark_columns(tree, pos, widget->priv.height - pos, ACS_BTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); } - tree_mark_columns(tree, pos, pos + 1, ACS_PLUS | COLOR_PAIR(GNT_COLOR_NORMAL)); - tree_mark_columns(tree, pos, pos, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL)); + tree_mark_columns(tree, pos, pos + 1, + (tree->show_separator ? ACS_PLUS : ACS_HLINE) | COLOR_PAIR(GNT_COLOR_NORMAL)); + tree_mark_columns(tree, pos, pos, + (tree->show_separator ? ACS_VLINE : ' ') | COLOR_PAIR(GNT_COLOR_NORMAL)); start = 2; } @@ -356,7 +358,8 @@ whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1) - 1); tree->bottom = row; g_free(str); - tree_mark_columns(tree, pos, i, ACS_VLINE | attr); + tree_mark_columns(tree, pos, i, + (tree->show_separator ? ACS_VLINE : ' ') | attr); } wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); @@ -364,7 +367,8 @@ { mvwhline(widget->window, i, pos, ' ', widget->priv.width - pos * 2 - 1); - tree_mark_columns(tree, pos, i, ACS_VLINE); + tree_mark_columns(tree, pos, i, + (tree->show_separator ? ACS_VLINE : ' ')); i++; } @@ -696,6 +700,8 @@ gnt_tree_init(GTypeInstance *instance, gpointer class) { GntWidget *widget = GNT_WIDGET(instance); + GntTree *tree = GNT_TREE(widget); + tree->show_separator = TRUE; GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); widget->priv.minw = 4; widget->priv.minh = 4; @@ -1125,19 +1131,24 @@ redraw_tree(tree); } -GntWidget *gnt_tree_new_with_columns(int col) +void _gnt_tree_init_internals(GntTree *tree, int col) { - GntWidget *widget = g_object_new(GNT_TYPE_TREE, NULL); - GntTree *tree = GNT_TREE(widget); - + tree->ncol = col; tree->hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_tree_row); - tree->ncol = col; tree->columns = g_new0(struct _GntTreeColInfo, col); while (col--) { tree->columns[col].width = 15; } tree->show_title = FALSE; +} + +GntWidget *gnt_tree_new_with_columns(int col) +{ + GntWidget *widget = g_object_new(GNT_TYPE_TREE, NULL); + GntTree *tree = GNT_TREE(widget); + + _gnt_tree_init_internals(tree, col); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW); gnt_widget_set_take_focus(widget, TRUE); @@ -1224,3 +1235,9 @@ gnt_widget_draw(GNT_WIDGET(tree)); } } + +void gnt_tree_set_show_separator(GntTree *tree, gboolean set) +{ + tree->show_separator = set; +} + Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gnttree.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -46,6 +46,7 @@ char *title; } *columns; /* Would a GList be better? */ gboolean show_title; + gboolean show_separator; /* Whether to show column separators */ GCompareFunc compare; }; @@ -54,7 +55,7 @@ { GntWidgetClass parent; - void (*selection_changed)(int old, int current); + void (*selection_changed)(GntTreeRow *old, GntTreeRow * current); void (*gnt_reserved1)(void); void (*gnt_reserved2)(void); @@ -120,6 +121,13 @@ void gnt_tree_set_expanded(GntTree *tree, void *key, gboolean expanded); +void gnt_tree_set_show_separator(GntTree *tree, gboolean set); + G_END_DECLS +/* The following functions should NOT be used by applications. */ + +/* This should be called by the subclasses of GntTree's in their _new function */ +void _gnt_tree_init_internals(GntTree *tree, int col); + #endif /* GNT_TREE_H */ Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gntwidget.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -9,6 +9,7 @@ { SIG_DESTROY, SIG_DRAW, + SIG_HIDE, SIG_GIVE_FOCUS, SIG_LOST_FOCUS, SIG_KEY_PRESSED, @@ -167,6 +168,14 @@ NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[SIG_HIDE] = + g_signal_new("hide", + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GntWidgetClass, hide), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); signals[SIG_EXPOSE] = g_signal_new("expose", G_TYPE_FROM_CLASS(klass), @@ -403,6 +412,7 @@ void gnt_widget_hide(GntWidget *widget) { + g_signal_emit(widget, signals[SIG_HIDE], 0); wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); #if 0 /* XXX: I have no clue why, but this seemed to be necessary. */ Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/gntwidget.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -93,6 +93,7 @@ void (*show)(GntWidget *obj); /* This will call draw() and take focus (if it can take focus) */ void (*destroy)(GntWidget *obj); void (*draw)(GntWidget *obj); /* This will draw the widget */ + void (*hide)(GntWidget *obj); void (*expose)(GntWidget *widget, int x, int y, int width, int height); void (*gained_focus)(GntWidget *widget); void (*lost_focus)(GntWidget *widget); Added: trunk/console/libgnt/gntwindow.c =================================================================== --- trunk/console/libgnt/gntwindow.c (rev 0) +++ trunk/console/libgnt/gntwindow.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,113 @@ +#include "gntwindow.h" + +#include <string.h> + +enum +{ + SIGS = 1, +}; + +static GntBoxClass *parent_class = NULL; +static guint signals[SIGS] = { 0 }; + +gboolean (*org_keypress)(GntWidget *widget, const char *text); +void (*org_destroy)(GntWidget *widget); + +static gboolean +gnt_window_key_pressed(GntWidget *widget, const char *text) +{ + if (strcmp(text, GNT_KEY_CTRL_O) == 0 && GNT_WINDOW(widget)->menu) { + gnt_screen_menu_show(GNT_WINDOW(widget)->menu); + return TRUE; + } else + return org_keypress(widget, text); + +} + +static void +gnt_window_destroy(GntWidget *widget) +{ + GntWindow *window = GNT_WINDOW(widget); + if (window->menu) + gnt_widget_destroy(GNT_WIDGET(window->menu)); + org_destroy(widget); +} + +static void +gnt_window_class_init(GntWindowClass *klass) +{ + GntWidgetClass *wid_class = GNT_WIDGET_CLASS(klass); + parent_class = GNT_BOX_CLASS(klass); + + org_keypress = wid_class->key_pressed; + wid_class->key_pressed = gnt_window_key_pressed; + + org_destroy = wid_class->destroy; + wid_class->destroy = gnt_window_destroy; + + GNTDEBUG; +} + +static void +gnt_window_init(GTypeInstance *instance, gpointer class) +{ + GntWidget *widget = GNT_WIDGET(instance); + GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_CAN_TAKE_FOCUS); + GNTDEBUG; +} + +/****************************************************************************** + * GntWindow API + *****************************************************************************/ +GType +gnt_window_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) + { + static const GTypeInfo info = { + sizeof(GntWindowClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_window_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GntWindow), + 0, /* n_preallocs */ + gnt_window_init, /* instance_init */ + }; + + type = g_type_register_static(GNT_TYPE_BOX, + "GntWindow", + &info, 0); + } + + return type; +} + +GntWidget *gnt_window_new() +{ + GntWidget *widget = g_object_new(GNT_TYPE_WINDOW, NULL); + + return widget; +} + +GntWidget *gnt_window_box_new(gboolean homo, gboolean vert) +{ + GntWidget *wid = gnt_window_new(); + GntBox *box = GNT_BOX(wid); + + box->homogeneous = homo; + box->vertical = vert; + box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID; + + return wid; +} + +void gnt_window_set_menu(GntWindow *window, GntMenu *menu) +{ + window->menu = menu; +} + Property changes on: trunk/console/libgnt/gntwindow.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntwindow.h =================================================================== --- trunk/console/libgnt/gntwindow.h (rev 0) +++ trunk/console/libgnt/gntwindow.h 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,56 @@ +#ifndef GNT_WINDOW_H +#define GNT_WINDOW_H + +#include "gnt.h" +#include "gntbox.h" +#include "gntcolors.h" +#include "gntkeys.h" +#include "gntmenu.h" + +#define GNT_TYPE_WINDOW (gnt_window_get_gtype()) +#define GNT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WINDOW, GntWindow)) +#define GNT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WINDOW, GntWindowClass)) +#define GNT_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WINDOW)) +#define GNT_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WINDOW)) +#define GNT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WINDOW, GntWindowClass)) + +#define GNT_WINDOW_FLAGS(obj) (GNT_WINDOW(obj)->priv.flags) +#define GNT_WINDOW_SET_FLAGS(obj, flags) (GNT_WINDOW_FLAGS(obj) |= flags) +#define GNT_WINDOW_UNSET_FLAGS(obj, flags) (GNT_WINDOW_FLAGS(obj) &= ~(flags)) + +typedef struct _GnWindow GntWindow; +typedef struct _GnWindowPriv GntWindowPriv; +typedef struct _GnWindowClass GntWindowClass; + +struct _GnWindow +{ + GntBox parent; + GntMenu *menu; +}; + +struct _GnWindowClass +{ + GntBoxClass parent; + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +}; + +G_BEGIN_DECLS + +GType gnt_window_get_gtype(void); + +#define gnt_vwindow_new(homo) gnt_window_box_new(homo, TRUE) +#define gnt_hwindow_new(homo) gnt_window_box_new(homo, FALSE) + +GntWidget *gnt_window_new(); + +GntWidget *gnt_window_box_new(gboolean homo, gboolean vert); + +void gnt_window_set_menu(GntWindow *window, GntMenu *menu); + +G_END_DECLS + +#endif /* GNT_WINDOW_H */ Property changes on: trunk/console/libgnt/gntwindow.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/console/libgnt/test/Makefile =================================================================== --- trunk/console/libgnt/test/Makefile 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/test/Makefile 2006-09-24 07:14:26 UTC (rev 17341) @@ -2,7 +2,7 @@ CFLAGS=`pkg-config --cflags gobject-2.0 gmodule-2.0` -g -I../ -DSTANDALONE LDFLAGS=`pkg-config --libs gobject-2.0 gmodule-2.0 gnt` -pg -EXAMPLES=combo focus tv multiwin keys +EXAMPLES=combo focus tv multiwin keys menu all: make examples Modified: trunk/console/libgnt/test/focus.c =================================================================== --- trunk/console/libgnt/test/focus.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/test/focus.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -61,7 +61,7 @@ gnt_tree_add_choice(GNT_TREE(tree), "b", gnt_tree_create_row(GNT_TREE(tree), "b"), "d", NULL); GNT_WIDGET_UNSET_FLAGS(hbox, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); - gnt_box_set_title(GNT_BOX(hbox), "\u4e0a\u6d77\u6700\u4f4e\u6708\u5de5 …"); + gnt_box_set_title(GNT_BOX(hbox), "\u4e0a\u6d77\u6700\u4f4e\u6708\u5de5 \u4e0a\u6d77\u6700\u4f4e\u6708\u5de5 ……\u4e0a\u6d77\u6700\u4f4e\u6708\u5de5 …"); g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(toggled), NULL); Added: trunk/console/libgnt/test/menu.c =================================================================== --- trunk/console/libgnt/test/menu.c (rev 0) +++ trunk/console/libgnt/test/menu.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -0,0 +1,65 @@ +#include "gnt.h" +#include "gntbox.h" +#include "gntlabel.h" +#include "gntmenu.h" +#include "gntmenuitem.h" +#include "gntwindow.h" + +void dothis(GntMenuItem *item, gpointer null) +{ + GntWidget *w = gnt_vbox_new(FALSE); + gnt_box_set_toplevel(GNT_BOX(w), TRUE); + gnt_box_add_widget(GNT_BOX(w), + gnt_label_new("Callback to a menuitem")); + gnt_widget_show(w); +} + +int main() +{ + freopen(".error", "w", stderr); + gnt_init(); + + GntWidget *menu = gnt_menu_new(GNT_MENU_TOPLEVEL); + GObject *item = gnt_menuitem_new("File"); + + gnt_menu_add_item(GNT_MENU(menu), GNT_MENUITEM(item)); + + item = gnt_menuitem_new("Edit"); + gnt_menu_add_item(GNT_MENU(menu), GNT_MENUITEM(item)); + + item = gnt_menuitem_new("Help"); + gnt_menu_add_item(GNT_MENU(menu), GNT_MENUITEM(item)); + + GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP); + gnt_menuitem_set_submenu(GNT_MENUITEM(item), GNT_MENU(sub)); + + item = gnt_menuitem_new("Online Help"); + gnt_menu_add_item(GNT_MENU(sub), GNT_MENUITEM(item)); + + item = gnt_menuitem_new("About"); + gnt_menu_add_item(GNT_MENU(sub), GNT_MENUITEM(item)); + + sub = gnt_menu_new(GNT_MENU_POPUP); + gnt_menuitem_set_submenu(GNT_MENUITEM(item), GNT_MENU(sub)); + + item = gnt_menuitem_new("Online Help"); + gnt_menu_add_item(GNT_MENU(sub), GNT_MENUITEM(item)); + gnt_menuitem_set_callback(GNT_MENUITEM(item), dothis, NULL); + + gnt_screen_menu_show(menu); + + + GntWidget *win = gnt_window_new(); + gnt_box_add_widget(GNT_BOX(win), + gnt_label_new("...")); + gnt_box_set_title(GNT_BOX(win), "Title"); + gnt_window_set_menu(GNT_WINDOW(win), GNT_MENU(menu)); + gnt_widget_show(win); + + gnt_main(); + + gnt_quit(); + + return 0; +} + Property changes on: trunk/console/libgnt/test/menu.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/console/libgnt/wms/s.c =================================================================== --- trunk/console/libgnt/wms/s.c 2006-09-23 19:04:03 UTC (rev 17340) +++ trunk/console/libgnt/wms/s.c 2006-09-24 07:14:26 UTC (rev 17341) @@ -1,4 +1,6 @@ +#include "gnt.h" #include "gntbox.h" +#include "gntmenu.h" #include "gntwm.h" #include "gntblist.h" @@ -52,6 +54,8 @@ int maxx, maxy; const char *name; + if (GNT_IS_MENU(win)) + return new_panel(win->window); getmaxyx(stdscr, maxy, maxx); gnt_widget_get_position(win, &x, &y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-23 19:04:05
|
Revision: 17340 http://svn.sourceforge.net/gaim/?rev=17340&view=rev Author: thekingant Date: 2006-09-23 12:04:03 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Put gaim-text and the gnt stuff into a gaim-text RPM so that our main RPM doesn't depend on ncurses. rpmbuild -ta gaim-2.0.0dev.tar.bz2 doesn't work for me anymore. Did it used to? Does it work for other people? For me it prints error: Name field must be present in package: (main package) error: Version field must be present in package: (main package) error: Release field must be present in package: (main package) error: Summary field must be present in package: (main package) error: Group field must be present in package: (main package) error: License field must be present in package: (main package) And it creates a file called "tar: Pattern matching characters used in file n ames. Please," in my ~/rpmbuild/SPECS directory. It does not put gaim.spec in my ~/rpmbuild/SPECS directory, and it does not put anything in ~/rpmbuild/BUILD or ~/rpmbuild/SOURCES, either Modified Paths: -------------- trunk/gaim.spec.in Modified: trunk/gaim.spec.in =================================================================== --- trunk/gaim.spec.in 2006-09-22 17:03:54 UTC (rev 17339) +++ trunk/gaim.spec.in 2006-09-23 19:04:03 UTC (rev 17340) @@ -14,7 +14,7 @@ %define gaimver @VERSION@ %endif -Summary: A Gtk+ based multiprotocol instant messaging client +Summary: A GTK+ based multiprotocol instant messaging client Name: @PACKAGE@ Version: %gaimver Release: 0%{?beta:.beta%{beta}} @@ -39,22 +39,21 @@ %{?_with_sasl:BuildRequires: cyrus-sasl-devel >= 2} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} %{?_with_tcl:BuildRequires: tcl, tk, /usr/include/tcl.h} -# For some reason perl isn't always automatically detected as a requirement :( -Requires: perl +%{!?_without_text:BuildRequires: ncurses-devel} # Mandrake 10.1 and lower || Mandrake 10.2 (and higher?) %if "%{_vendor}" == "MandrakeSoft" || "%{_vendor}" == "Mandrakesoft" || "%{_vendor}" == "Mandriva" -# Mandrake/Mandriva requirements +# For Mandrake/Mandriva: BuildRequires: libgtk+2.0_0-devel, libnss3-devel, perl-devel Obsoletes: libgaim-remote0 %else - -# SuSE & Red Hat / Fedora requirements +# For SuSE, Red Hat, Fedora and others: BuildRequires: gtk2-devel - %if "%{_vendor}" == "suse" +# For SuSE: BuildRequires: gnutls-devel %else +# For Red Hat, Fedora and others: # let's assume RH & FC1 are the only brain-dead distros missing the # perl-XML-Parser dependency on intltool and that other RH/FC releases # don't care if we specify it here @@ -63,6 +62,9 @@ %endif %endif +# For some reason perl isn't always automatically detected as a requirement :( +Requires: perl + %package devel Summary: Development headers, documentation, and libraries for Gaim. Group: Applications/Internet @@ -110,37 +112,45 @@ Requires: gaim = %{epoch}:%{version} %endif +%if 0%{!?_without_text:1} +%package text +Summary: A text-based user interface for Gaim +Group: Applications/Internet +Requires: gaim = %{epoch}:%{version} +%endif + %description Gaim allows you to talk to anyone using a variety of messaging -protocols, including AIM, ICQ, IRC, Yahoo!, Novell Groupwise, MSN -Messenger, Jabber, Gadu-Gadu, Lotus Sametime and Zephyr. -These protocols are implemented using a modular, easy to use design. -To use a protocol, just add an account using the account editor. +protocols including AIM, MSN, Yahoo!, Jabber, Bonjour, Gadu-Gadu, +ICQ, IRC, Novell Groupwise, QQ, Lotus Sametime, SILC, Simple and +Zephyr. These protocols are implemented using a modular, easy to +use design. To use a protocol, just add an account using the +account editor. Gaim supports many common features of other clients, as well as many unique features, such as perl scripting, TCL scripting and C plugins. -Gaim is NOT affiliated with or endorsed by America Online, Inc., +Gaim is not affiliated with or endorsed by America Online, Inc., Microsoft Corporation, Yahoo! Inc., or ICQ Inc. %description devel The gaim-devel package contains the header files, developer -documentation, and libraries required for development of gaim scripts +documentation, and libraries required for development of Gaim scripts and plugins. %if 0%{?_with_howl:1} || 0%{?_with_avahi:1} %description bonjour -Bonjour plugin for Gaim +Bonjour plugin for Gaim. %endif %if 0%{?_with_gadugadu:1} %description gadugadu -Gadu-Gadu plugin for Gaim using the libgadu library +Gadu-Gadu plugin for Gaim using the libgadu library. %endif %if 0%{?_with_meanwhile:1} %description meanwhile -Lotus Sametime plugin for Gaim using the Meanwhile library +Lotus Sametime plugin for Gaim using the Meanwhile library. %endif %if 0%{?_with_mono:1} @@ -151,9 +161,17 @@ %if 0%{?_with_silc:1} %description silc -SILC (Secure Internet Live Conferencing) plugin for Gaim +SILC (Secure Internet Live Conferencing) plugin for Gaim. %endif +%if 0%{!?without_text:1} +%description text +A text-based user interface for Gaim. This can be run from a +standard text console or from a terminal within X Windows. It +uses ncurses and our homegrown gnt library for drawing windows +and text. +%endif + %if 0%{?_with_tcl:1} %description tcl Tcl plugin loader for Gaim. This package will allow you to write or @@ -232,12 +250,15 @@ find $RPM_BUILD_ROOT%{_libdir}/gaim -type f -print | \ sed "s@^$RPM_BUILD_ROOT@@g" | \ - grep -v libbonjour.so | \ - grep -v libsilcgaim.so | \ - grep -v libsametime.so | \ - grep -v libgg.so | \ - grep -v tcl.so | \ - grep -v mono.so | \ + grep -v /gntgf.so | \ + grep -v /gnthistory.so | \ + grep -v /libbonjour.so | \ + grep -v /libgg.so | \ + grep -v /libsilcgaim.so | \ + grep -v /libsametime.so | \ + grep -v /mono.so | \ + grep -v /s.so | \ + grep -v /tcl.so | \ grep -v ".dll$" | \ grep -v ".tcl$" > %{name}-%{version}-coreplugins @@ -260,21 +281,25 @@ %doc README.SVN %doc doc/FAQ %doc doc/the_penguin.txt -%doc %{_mandir}/man1/* +%doc %{_mandir}/man1/gaim.* %doc %{_mandir}/man3*/* %dir %{_libdir}/gaim %attr(755, root, root) %{perl_vendorarch}/Gaim* %attr(755, root, root) %{perl_vendorarch}/auto/Gaim -%{_bindir}/* +%{_bindir}/gaim +%{_bindir}/gaim-client-example +%{_bindir}/gaim-remote +%{_bindir}/gaim-send +%{_bindir}/gaim-send-async +%{_bindir}/gaim-url-handler %{_datadir}/locale/*/*/* %{_datadir}/pixmaps/* %dir %{_datadir}/sounds/gaim %{_datadir}/sounds/gaim/* %{_datadir}/applications/* %{_libdir}/libgaim.so.* -%{_libdir}/libgnt.so.* %{_sysconfdir}/gconf/schemas/gaim.schemas %if 0%{?_with_dbus:1} @@ -350,6 +375,18 @@ %{_libdir}/gaim/tcl.so %endif +%if 0%{!?without_text:1} +%files text +%defattr(-, root, root) + +%doc %{_mandir}/man1/gaim-text.* +%{_bindir}/gaim-text +%{_libdir}/gaim/gntgf.so +%{_libdir}/gaim/gnthistory.so +%{_libdir}/gaim/s.so +%{_libdir}/libgnt.so.* +%endif + %changelog * Sun Aug 20 2006 Stu Tomlinson <st...@no...> - Make the gstreamer-devel dependency overridable with '--without-gstreamer' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-09-22 17:03:57
|
Revision: 17339 http://svn.sourceforge.net/gaim/?rev=17339&view=rev Author: markhuetsch Date: 2006-09-22 10:03:54 -0700 (Fri, 22 Sep 2006) Log Message: ----------- My previous implementation was a bit awkward. This requires less overhead. Also, let's only show those info fields that a buddy has actually filled out. Modified Paths: -------------- trunk/libgaim/protocols/qq/buddy_info.c trunk/libgaim/protocols/qq/buddy_info.h Modified: trunk/libgaim/protocols/qq/buddy_info.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.c 2006-09-22 16:05:09 UTC (rev 17338) +++ trunk/libgaim/protocols/qq/buddy_info.c 2006-09-22 17:03:54 UTC (rev 17339) @@ -34,253 +34,200 @@ #include "keep_alive.h" #include "send_core.h" -/* Below is all of the information necessary to reconstruct the various - * information fields that one can set in the official client. When we need - * to know about a specific field (e.g., should "city" be a choice - * or text field?), we can simply look it up from the template. Note that - * there are a number of unidentified fields. */ -typedef struct _info_field { - gchar *title; - gchar *id; /* used by gaim_request fields */ - gint pos; - gchar *group; - gint group_pos; /* for display order in the UI */ - gint choice; /* indicates which character array contains the choices */ - gboolean customizable; /* whether a user can enter any text as a value, regardless of choice arrays */ - gchar *value; -} info_field; +#define QQ_PRIMARY_INFORMATION _("Primary Information") +#define QQ_ADDITIONAL_INFORMATION _("Additional Information") +#define QQ_INTRO _("Personal Introduction") +#define QQ_NUMBER _("QQ Number") +#define QQ_NICKNAME _("Nickname") +#define QQ_NAME _("Name") +#define QQ_AGE _("Age") +#define QQ_GENDER _("Gender") +#define QQ_COUNTRY _("Country/Region") +#define QQ_PROVINCE _("Province/State") +#define QQ_CITY _("City") +#define QQ_HOROSCOPE _("Horoscope Symbol") +#define QQ_OCCUPATION _("Occupation") +#define QQ_ZODIAC _("Zodiac Sign") +#define QQ_BLOOD _("Blood Type") +#define QQ_COLLEGE _("College") +#define QQ_EMAIL _("Email") +#define QQ_ADDRESS _("Address") +#define QQ_ZIPCODE _("Zipcode") +#define QQ_CELL _("Cellphone Number") +#define QQ_TELEPHONE _("Phone Number") +#define QQ_HOMEPAGE _("Homepage") -static const info_field info_template_data[] = { - { N_("User ID"), "uid", 0, QQ_MAIN_INFO, 0, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Nickname"), "nick", 1, QQ_MAIN_INFO, 1, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Country/Region"), "country", 2, QQ_MAIN_INFO, 5, QQ_COUNTRY, TRUE, NULL }, - { N_("Province/State"), "province", 3, QQ_MAIN_INFO, 6, QQ_PROVINCE, TRUE, NULL }, - { N_("Zipcode"), "zipcode", 4, QQ_EXTRA_INFO, 7, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Address"), "address", 5, QQ_EXTRA_INFO, 6, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Phone Number"), "tel", 6, QQ_EXTRA_INFO, 9, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Age"), "age", 7, QQ_MAIN_INFO, 3, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Gender"), "gender", 8, QQ_MAIN_INFO, 4, QQ_GENDER, FALSE, NULL }, - { N_("Name"), "name", 9, QQ_MAIN_INFO, 2, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Email"), "email", 10, QQ_EXTRA_INFO, 5, QQ_NO_CHOICE, TRUE, NULL }, - { "pager_sn", "pager_sn", 11, QQ_MISC, 0, QQ_NO_CHOICE, TRUE, NULL }, - { "pager_num", "pager_num", 12, QQ_MISC, 1, QQ_NO_CHOICE, TRUE, NULL }, - { "pager_sp", "pager_sp", 13, QQ_MISC, 2, QQ_NO_CHOICE, TRUE, NULL }, - { "pager_base_num", "pager_base_num", 14, QQ_MISC, 3, QQ_NO_CHOICE, TRUE, NULL }, - { "pager_type", "pager_type", 15, QQ_MISC, 4, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Occupation"), "occupation", 16, QQ_EXTRA_INFO, 1, QQ_OCCUPATION, TRUE, NULL }, - { N_("Homepage"), "homepage", 17, QQ_EXTRA_INFO, 10, QQ_NO_CHOICE, TRUE, NULL }, - { "auth_type", "auth_type", 18, QQ_MISC, 5, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown1", "unknown1", 19, QQ_MISC, 6, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown2", "unknown2", 20, QQ_MISC, 7, QQ_NO_CHOICE, TRUE, NULL }, - { "face", "face", 21, QQ_MISC, 8, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Cellphone Number"), "hp_num", 22, QQ_EXTRA_INFO, 8, QQ_NO_CHOICE, TRUE, NULL }, - { "hp_type", "hp_type", 23, QQ_MISC, 9, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Personal Introduction"), "intro", 24, QQ_PERSONAL_INTRO, 0, QQ_NO_CHOICE, TRUE, NULL }, - { N_("City"), "city", 25, QQ_MAIN_INFO, 7, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown3", "unknown3", 26, QQ_MISC, 10, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown4", "unknown4", 27, QQ_MISC, 11, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown5", "unknown5", 28, QQ_MISC, 12, QQ_NO_CHOICE, TRUE, NULL }, - { "is_open_hp", "is_open_hp", 29, QQ_MISC, 13, QQ_NO_CHOICE, TRUE, NULL }, - { "is_open_contact", "is_open_contact", 30, QQ_MISC, 14, QQ_NO_CHOICE, TRUE, NULL }, - { N_("College"), "college", 31, QQ_EXTRA_INFO, 4, QQ_NO_CHOICE, TRUE, NULL }, - { N_("Horoscope Symbol"), "horoscope", 32, QQ_EXTRA_INFO, 0, QQ_HOROSCOPE, FALSE, NULL }, - { N_("Zodiac Symbol"), "zodiac", 33, QQ_EXTRA_INFO, 2, QQ_ZODIAC, FALSE, NULL }, - { N_("Blood Type"), "blood", 34, QQ_EXTRA_INFO, 3, QQ_BLOOD, FALSE, NULL }, - { "qq_show", "qq_show", 35, QQ_MISC, 15, QQ_NO_CHOICE, TRUE, NULL }, - { "unknown6", "unknown6", 36, QQ_MISC, 16, QQ_NO_CHOICE, TRUE, NULL }, - { NULL, NULL, 0, NULL, 0, 0, 0, NULL } -}; - -/* TODO: translate these arrays to their English equivalents - * and move these characters to the zh_CN po file */ +#define QQ_HOROSCOPE_SIZE 13 static const gchar *horoscope_names[] = { - "-", "水瓶座", "双鱼座", "牡羊座", "金牛座", - "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", - "天蝎座", "射手座", "魔羯座", NULL + "-", N_("Aquarius"), N_("Pisces"), N_("Aries"), N_("Taurus"), + N_("Gemini"), N_("Cancer"), N_("Leo"), N_("Virgo"), N_("Libra"), + N_("Scorpio"), N_("Sagittarius"), N_("Capricorn") }; +#define QQ_ZODIAC_SIZE 13 static const gchar *zodiac_names[] = { - "-", "鼠", "牛", "虎", "兔", - "龙", "蛇", "马", "羊", "猴", - "鸡", "狗", "猪", NULL + "-", N_("Rat"), N_("Ox"), N_("Tiger"), N_("Rabbit"), + N_("Dragon"), N_("Snake"), N_("Horse"), N_("Goat"), N_("Monkey"), + N_("Rooster"), N_("Dog"), N_("Pig") }; +#define QQ_BLOOD_SIZE 6 static const gchar *blood_types[] = { - "-", N_("A"), N_("B"), N_("O"), N_("AB"), N_("Other"), NULL + "-", "A", "B", "O", "AB", N_("Other") }; +#define QQ_GENDER_SIZE 2 static const gchar *genders[] = { N_("Male"), - N_("Female"), - NULL + N_("Female") }; -static const gchar *country_names[] = { - "中国", "中国香港", "中国澳门", "中国台湾", - "新加坡", "马来西亚", "美国", NULL -}; +#define QQ_CONTACT_FIELDS 37 -static const gchar *province_names[] = { - "北京", "天津", "上海", "重庆", "香港", - "河北", "山西", "内蒙古", "辽宁", "吉林", - "黑龙江", "江西", "浙江", "江苏", "安徽", - "福建", "山东", "河南", "湖北", "湖南", - "广东", "广西", "海南", "四川", "贵州", - "云南", "西藏", "陕西", "甘肃", "宁夏", - "青海", "新疆", "台湾", "澳门", NULL -}; +/* There is no user id stored in the reply packet for information query + * we have to manually store the query, so that we know the query source */ +typedef struct _qq_info_query { + guint32 uid; + gboolean show_window; + gboolean modify_info; +} qq_info_query; -static const gchar *occupation_names[] = { - "全职", "兼职", "制造业", "商业", "失业中", - "学生", "工程师", "政府部门", "教育业", "服务行业", - "老板", "计算机业", "退休", "金融业", - "销售/广告/市场", NULL -}; +/* We get an info packet on ourselves before we modify our information. + * Even though not all of the information is modifiable, it still + * all needs to be there when we send out the modify info packet */ +typedef struct _modify_info_data { + GaimConnection *gc; + contact_info *info; +} modify_info_data; -static const gint choice_sizes[] = { 0, 13, 13, 6, 2, 7, 34, 15 }; - - -static const gchar *info_group_headers[] = { - QQ_MAIN_INFO, - QQ_EXTRA_INFO, - QQ_PERSONAL_INTRO, - QQ_MISC -}; - -static const gchar **choices[] = { - NULL, - horoscope_names, - zodiac_names, - blood_types, - genders, - country_names, - province_names, - occupation_names -}; - -/************************ info and info_field methods ************************/ - -/* Given an id, return the template for that field. - * Returns NULL if the id is not found. */ -static const info_field *info_field_get_template(const gchar *id) +/* return -1 as a sentinel */ +static gint choice_index(const gchar *value, const gchar **choice, gint choice_size) { - const info_field *cur_field; - const gchar *cur_id; - - cur_field = info_template_data; - cur_id = cur_field->id; - while(cur_id != NULL) { - if (g_ascii_strcasecmp(cur_id, id) == 0) - return cur_field; - cur_field++; - cur_id = cur_field->id; + gint len, i; + + len = strlen(value); + if (len > 3 || len == 0) return -1; + for (i = 0; i < len; i++) { + if (!g_ascii_isdigit(value[i])) + return -1; } - gaim_debug(GAIM_DEBUG_WARNING, "QQ", "Info field with id %s not found!", id); - return NULL; -} + i = strtol(value, NULL, 10); + if (i >= choice_size) + return -1; -/* info_fields are compared by their group positions */ -static gint info_field_compare(gconstpointer a, gconstpointer b) -{ - return ((info_field *) a)->group_pos - ((info_field *) b)->group_pos; + return i; } -static void info_field_free(info_field *i) +/* return should be freed */ +static gchar *field_value(const gchar *field, const gchar **choice, gint choice_size) { - g_free(i->value); - g_free(i); -} + gint index, len; -/* Parses the info_template_data above and returns a newly-allocated list - * containing the desired fields from segments. This list is ordered by - * group_pos. */ -static GList *info_get_group(const gchar **info, const gchar *group_name) -{ - const info_field *cur; - info_field *entry; - GList *group = NULL; - - cur = info_template_data; - while (cur->id != NULL) { - if (g_ascii_strcasecmp(group_name, cur->group) == 0) { - entry = g_memdup(cur, sizeof(info_field)); - entry->value = g_strdup(info[entry->pos]); - group = g_list_insert_sorted(group, entry, info_field_compare); + len = strlen(field); + if (len == 0) { + return NULL; + } else if (choice != NULL) { + /* some choice fields are also customizable */ + index = choice_index(field, choice, choice_size); + if (index == -1) { + if (strcmp(field, "-") != 0) { + return qq_to_utf8(field, QQ_CHARSET_DEFAULT); + } else { + return NULL; + } + /* else ASCIIized index */ + } else { + if (strcmp(choice[index], "-") != 0) + return g_strdup(choice[index]); + else + return NULL; } - cur++; + } else { + if (strcmp(field, "-") != 0) { + return qq_to_utf8(field, QQ_CHARSET_DEFAULT); + } else { + return NULL; + } } - - return group; } -/* Determines if the given text value and choice group require - * a lookup from the choice arrays. */ -static gboolean is_valid_index(gchar *value, gint choice) +static void append_field_value(GString *info_text, const gchar *field, + const gchar *title, const gchar **choice, gint choice_size) { - gint len, i; - - if (choice == 0) return FALSE; - len = strlen(value); - /* the server sends us an ascii index and none of the arrays has more than 99 - * elements */ - if (len > 3 || len == 0) return FALSE; - for (i = 0; i < len; i++) - if (!g_ascii_isdigit(value[i])) - return FALSE; - i = atoi(value); - if (i < 0 || i >= choice_sizes[choice]) - return FALSE; - return TRUE; + gchar *value = field_value(field, choice, choice_size); + + if (value != NULL) { + g_string_append_printf(info_text, "<br /><b>%s:</b> %s", title, value); + g_free(value); + } } -/* formats a field for printing */ -static void append_field_to_str(gpointer field, gpointer str) +static GString *info_to_str(const contact_info *info) { - info_field *f; - gint choice; - gboolean valid_index; - gchar *value; + GString *info_text, *extra_info; + const gchar *intro; + gint len; - f = (info_field *) field; - choice = f->choice; - valid_index = is_valid_index(f->value, choice); - if (choice && valid_index) value = g_strdup(choices[choice][atoi(f->value)]); - else value = qq_to_utf8(f->value, QQ_CHARSET_DEFAULT); - g_string_append_printf((GString *) str, "<b>%s:</b> %s<br />", - f->title, value); - g_free(value); - info_field_free(f); -} + info_text = g_string_new(""); + g_string_append_printf(info_text, "<b>%s</b><br /><br />", QQ_PRIMARY_INFORMATION); + g_string_append_printf(info_text, "<b>%s:</b> %s", QQ_NUMBER, info->uid); + append_field_value(info_text, info->nick, QQ_NICKNAME, NULL, 0); + append_field_value(info_text, info->name, QQ_NAME, NULL, 0); + append_field_value(info_text, info->age, QQ_AGE, NULL, 0); + append_field_value(info_text, info->gender, QQ_GENDER, genders, QQ_GENDER_SIZE); + append_field_value(info_text, info->country, QQ_COUNTRY, NULL, 0); + append_field_value(info_text, info->province, QQ_PROVINCE, NULL, 0); + append_field_value(info_text, info->city, QQ_CITY, NULL, 0); -/* formats a group of information for printing */ -static void append_group_to_str(GString *str, const gchar *group_name, const gchar **info) -{ - GList *group; + extra_info = g_string_new(""); + g_string_append_printf(extra_info, "<br /><br /><b>%s</b><br />", QQ_ADDITIONAL_INFORMATION); + len = extra_info->len; + append_field_value(extra_info, info->horoscope, QQ_HOROSCOPE, horoscope_names, QQ_HOROSCOPE_SIZE); + append_field_value(extra_info, info->occupation, QQ_OCCUPATION, NULL, 0); + append_field_value(extra_info, info->zodiac, QQ_ZODIAC, zodiac_names, QQ_ZODIAC_SIZE); + append_field_value(extra_info, info->blood, QQ_BLOOD, blood_types, QQ_BLOOD_SIZE); + append_field_value(extra_info, info->college, QQ_COLLEGE, NULL, 0); + append_field_value(extra_info, info->email, QQ_EMAIL, NULL, 0); + append_field_value(extra_info, info->address, QQ_ADDRESS, NULL, 0); + append_field_value(extra_info, info->zipcode, QQ_ZIPCODE, NULL, 0); + append_field_value(extra_info, info->hp_num, QQ_CELL, NULL, 0); + append_field_value(extra_info, info->tel, QQ_TELEPHONE, NULL, 0); + append_field_value(extra_info, info->homepage, QQ_HOMEPAGE, NULL, 0); + if (len != extra_info->len) + g_string_append(info_text, extra_info->str); + g_string_free(extra_info, TRUE); - group = info_get_group(info, group_name); - g_string_append_printf(str, "<b>%s</b><br /><br />", (*(info_field *) group->data).group); - g_list_foreach(group, append_field_to_str, str); - g_list_free(group); - g_string_append_printf(str, "<br />"); -} + intro = field_value(info->intro, NULL, 0); + if (intro) { + g_string_append_printf(info_text, "<br /><br /><b>%s</b><br /><br />", QQ_INTRO); + g_string_append(info_text, intro); + } -/* Takes a contact_info struct and outputs the appropriate fields in - * a printable format for our upcoming call to gaim_notify_userinfo. */ -static GString *info_to_str(const gchar **info) -{ - GString *info_text; + /* for debugging */ + /* + g_string_append_printf(info_text, "<br /><br /><b>%s</b><br />", "Miscellaneous"); + append_field_value(info_text, info->pager_sn, "pager_sn", NULL, 0); + append_field_value(info_text, info->pager_num, "pager_num", NULL, 0); + append_field_value(info_text, info->pager_sp, "pager_sp", NULL, 0); + append_field_value(info_text, info->pager_base_num, "pager_base_num", NULL, 0); + append_field_value(info_text, info->pager_type, "pager_type", NULL, 0); + append_field_value(info_text, info->auth_type, "auth_type", NULL, 0); + append_field_value(info_text, info->unknown1, "unknown1", NULL, 0); + append_field_value(info_text, info->unknown2, "unknown2", NULL, 0); + append_field_value(info_text, info->face, "face", NULL, 0); + append_field_value(info_text, info->hp_type, "hp_type", NULL, 0); + append_field_value(info_text, info->unknown3, "unknown3", NULL, 0); + append_field_value(info_text, info->unknown4, "unknown4", NULL, 0); + append_field_value(info_text, info->unknown5, "unknown5", NULL, 0); + append_field_value(info_text, info->is_open_hp, "is_open_hp", NULL, 0); + append_field_value(info_text, info->is_open_contact, "is_open_contact", NULL, 0); + append_field_value(info_text, info->qq_show, "qq_show", NULL, 0); + append_field_value(info_text, info->unknown6, "unknown6", NULL, 0); + */ - info_text = g_string_new(""); - append_group_to_str(info_text, QQ_MAIN_INFO, info); - append_group_to_str(info_text, QQ_EXTRA_INFO, info); - append_group_to_str(info_text, QQ_PERSONAL_INTRO, info); - /* append_group_to_str(info_text, QQ_MISC, info); */ - return info_text; } -/************************ packets and UI management **************************/ - /* send a packet to get detailed information of uid */ void qq_send_packet_get_info(GaimConnection *gc, guint32 uid, gboolean show_window) { @@ -320,26 +267,23 @@ } /* send packet to modify personal information */ -void qq_send_packet_modify_info(GaimConnection *gc, contact_info *info) +static void qq_send_packet_modify_info(GaimConnection *gc, gchar **segments) { - gchar *info_field[QQ_CONTACT_FIELDS]; gint i; guint8 *raw_data, *cursor, bar; - g_return_if_fail(gc != NULL && info != NULL); + g_return_if_fail(gc != NULL && segments != NULL); bar = 0x1f; raw_data = g_newa(guint8, MAX_PACKET_SIZE - 128); cursor = raw_data; - g_memmove(info_field, info, sizeof(gchar *) * QQ_CONTACT_FIELDS); - create_packet_b(raw_data, &cursor, bar); - /* important!, skip the first uid entry */ + /* important! skip the first uid entry */ for (i = 1; i < QQ_CONTACT_FIELDS; i++) { create_packet_b(raw_data, &cursor, bar); - create_packet_data(raw_data, &cursor, (guint8 *) info_field[i], strlen(info_field[i])); + create_packet_data(raw_data, &cursor, (guint8 *) segments[i], strlen(segments[i])); } create_packet_b(raw_data, &cursor, bar); @@ -354,133 +298,122 @@ qd = (qq_data *) mid->gc->proto_data; qd->modifying_info = FALSE; - g_list_free(mid->misc); + g_strfreev((gchar **) mid->info); g_free(mid); } -/* Runs through all of the fields in the modify info UI and puts - * their values into the outgoing packet. */ -static void parse_field(gpointer field, gpointer outgoing_info) +static gchar *parse_field(GList **list, gboolean choice) { - GaimRequestField *f; - gchar **segments, *value; - const info_field *ft; - const gchar *id; + gchar *value; + GaimRequestField *field; - f = (GaimRequestField *) field; - segments = (gchar **) outgoing_info; - id = gaim_request_field_get_id(f); - ft = info_field_get_template(id); - if (ft->choice && !ft->customizable) { - value = g_strdup_printf("%d", gaim_request_field_choice_get_value(f)); + field = (GaimRequestField *) (*list)->data; + if (choice) { + value = g_strdup_printf("%d", gaim_request_field_choice_get_value(field)); } else { - value = (gchar *) gaim_request_field_string_get_value(f); + value = (gchar *) gaim_request_field_string_get_value(field); if (value == NULL) value = g_strdup("-"); else value = utf8_to_qq(value, QQ_CHARSET_DEFAULT); } - segments[ft->pos] = value; -} + *list = g_list_remove_link(*list, *list); -/* dumps the uneditable information straight into the outgoing packet */ -static void parse_misc_field(gpointer field, gpointer outgoing_info) -{ - info_field *f; - gchar **segments; - - f = (info_field *) field; - segments = (gchar **) outgoing_info; - segments[f->pos] = g_strdup(f->value); - info_field_free(f); + return value; } -/* Runs through all of the information fields and copies them into an - * outgoing packet, then sends that packet. */ +/* parse fields and send info packet */ static void modify_info_ok_cb(modify_info_data *mid, GaimRequestFields *fields) { GaimConnection *gc; qq_data *qd; - GList *list, *groups, *group_node; - gchar *info_field[QQ_CONTACT_FIELDS]; + GList *list, *groups; contact_info *info; - gint i; gc = mid->gc; qd = (qq_data *) gc->proto_data; qd->modifying_info = FALSE; - list = mid->misc; - g_list_foreach(list, parse_misc_field, info_field); - g_list_free(list); + + info = mid->info; + groups = gaim_request_fields_get_groups(fields); - while(groups) { - group_node = groups; - list = gaim_request_field_group_get_fields(group_node->data); - g_list_foreach(list, parse_field, info_field); - groups = g_list_remove_link(groups, group_node); - } - info = (contact_info *) info_field; + list = gaim_request_field_group_get_fields(groups->data); + info->uid = parse_field(&list, FALSE); + info->nick = parse_field(&list, FALSE); + info->name = parse_field(&list, FALSE); + info->age = parse_field(&list, FALSE); + info->gender = parse_field(&list, TRUE); + info->country = parse_field(&list, FALSE); + info->province = parse_field(&list, FALSE); + info->city = parse_field(&list, FALSE); + groups = g_list_remove_link(groups, groups); + list = gaim_request_field_group_get_fields(groups->data); + info->horoscope = parse_field(&list, TRUE); + info->occupation = parse_field(&list, FALSE); + info->zodiac = parse_field(&list, TRUE); + info->blood = parse_field(&list, TRUE); + info->college = parse_field(&list, FALSE); + info->email = parse_field(&list, FALSE); + info->address = parse_field(&list, FALSE); + info->zipcode = parse_field(&list, FALSE); + info->hp_num = parse_field(&list, FALSE); + info->tel = parse_field(&list, FALSE); + info->homepage = parse_field(&list, FALSE); + groups = g_list_remove_link(groups, groups); + list = gaim_request_field_group_get_fields(groups->data); + info->intro = parse_field(&list, FALSE); + groups = g_list_remove_link(groups, groups); - qq_send_packet_modify_info(gc, info); + qq_send_packet_modify_info(gc, (gchar **) info); + + g_strfreev((gchar **) mid->info); g_free(mid); - for (i = 0; i < QQ_CONTACT_FIELDS; i++) - g_free(info_field[i]); } -/* Sets up the display for one group of information. This includes - * managing which fields in the UI should be textfields and - * which choices, and also mapping ints to choice values when appropriate. */ -static void setup_group(gpointer field, gpointer group) +static GaimRequestFieldGroup *setup_field_group(GaimRequestFields *fields, const gchar *title) { - info_field *f; - GaimRequestFieldGroup *g; - GaimRequestField *rf; - gint choice, index, j; - gboolean customizable, valid_index, multiline; - gchar *id, *value; + GaimRequestFieldGroup *group; - f = (info_field *) field; - g = (GaimRequestFieldGroup *) group; - choice = f->choice; - customizable = f->customizable; - id = f->id; - valid_index = TRUE; + group = gaim_request_field_group_new(title); + gaim_request_fields_add_group(fields, group); - if (!choice || customizable) { - valid_index = is_valid_index(f->value, choice); - multiline = id == "intro"; - if (valid_index) { - index = atoi(f->value); - value = (gchar *) choices[choice][index]; - } else { - value = qq_to_utf8(f->value, QQ_CHARSET_DEFAULT); - } - rf = gaim_request_field_string_new(id, f->title, value, multiline); - } else { - index = atoi(f->value); - value = (gchar *) choices[choice][index]; - rf = gaim_request_field_choice_new(id, f->title, index); - j = 0; - while(choices[choice][j] != NULL) - gaim_request_field_choice_add(rf, choices[choice][j++]); - } - gaim_request_field_group_add_field(g, rf); - if (!valid_index) - g_free(value); - info_field_free(f); + return group; } -/* Takes the info returned by a get_info packet for the user and sets up - * a form using those values and the info_template. */ -static void create_modify_info_dialogue(GaimConnection *gc, const gchar **info) +static void add_string_field_to_group(GaimRequestFieldGroup *group, + const gchar *id, const gchar *title, const gchar *value) { + GaimRequestField *field; + gchar *utf8_value; + + utf8_value = qq_to_utf8(value, QQ_CHARSET_DEFAULT); + field = gaim_request_field_string_new(id, title, utf8_value, FALSE); + gaim_request_field_group_add_field(group, field); + g_free(utf8_value); +} + +static void add_choice_field_to_group(GaimRequestFieldGroup *group, + const gchar *id, const gchar *title, const gchar *value, + const gchar **choice, gint choice_size) +{ + GaimRequestField *field; + gint i, index; + + index = choice_index(value, choice, choice_size); + field = gaim_request_field_choice_new(id, title, index); + for (i = 0; i < choice_size; i++) + gaim_request_field_choice_add(field, choice[i]); + gaim_request_field_group_add_field(group, field); +} + +/* take the info returned by a get_info packet for myself and set up a request form */ +static void create_modify_info_dialogue(GaimConnection *gc, const contact_info *info) +{ qq_data *qd; - GaimRequestFields *fields; GaimRequestFieldGroup *group; + GaimRequestFields *fields; GaimRequestField *field; - GList *group_list; modify_info_data *mid; - gint i; /* so we only have one dialog open at a time */ qd = (qq_data *) gc->proto_data; @@ -488,22 +421,58 @@ qd->modifying_info = TRUE; fields = gaim_request_fields_new(); - - /* we only care about the first 3 groups, not the miscellaneous stuff */ - for (i = 0; i < 3; i++) { - group = gaim_request_field_group_new(info_group_headers[i]); - gaim_request_fields_add_group(fields, group); - group_list = info_get_group(info, info_group_headers[i]); - g_list_foreach(group_list, setup_group, group); - g_list_free(group_list); - } - field = gaim_request_fields_get_field(fields, "uid"); + group = setup_field_group(fields, QQ_PRIMARY_INFORMATION); + field = gaim_request_field_string_new("uid", QQ_NUMBER, info->uid, FALSE); + gaim_request_field_group_add_field(group, field); gaim_request_field_string_set_editable(field, FALSE); + add_string_field_to_group(group, "nick", QQ_NICKNAME, info->nick); + add_string_field_to_group(group, "name", QQ_NAME, info->name); + add_string_field_to_group(group, "age", QQ_AGE, info->age); + add_choice_field_to_group(group, "gender", QQ_GENDER, info->gender, genders, QQ_GENDER_SIZE); + add_string_field_to_group(group, "country", QQ_COUNTRY, info->country); + add_string_field_to_group(group, "province", QQ_PROVINCE, info->province); + add_string_field_to_group(group, "city", QQ_CITY, info->city); + group = setup_field_group(fields, QQ_ADDITIONAL_INFORMATION); + add_choice_field_to_group(group, "horoscope", QQ_HOROSCOPE, info->horoscope, horoscope_names, QQ_HOROSCOPE_SIZE); + add_string_field_to_group(group, "occupation", QQ_OCCUPATION, info->occupation); + add_choice_field_to_group(group, "zodiac", QQ_ZODIAC, info->zodiac, zodiac_names, QQ_ZODIAC_SIZE); + add_choice_field_to_group(group, "blood", QQ_BLOOD, info->blood, blood_types, QQ_BLOOD_SIZE); + add_string_field_to_group(group, "college", QQ_COLLEGE, info->college); + add_string_field_to_group(group, "email", QQ_EMAIL, info->email); + add_string_field_to_group(group, "address", QQ_ADDRESS, info->address); + add_string_field_to_group(group, "zipcode", QQ_ZIPCODE, info->zipcode); + add_string_field_to_group(group, "hp_num", QQ_CELL, info->hp_num); + add_string_field_to_group(group, "tel", QQ_TELEPHONE, info->tel); + add_string_field_to_group(group, "homepage", QQ_HOMEPAGE, info->homepage); + group = setup_field_group(fields, QQ_INTRO); + field = gaim_request_field_string_new("intro", QQ_INTRO, info->intro, TRUE); + gaim_request_field_group_add_field(group, field); + + /* prepare unmodifiable info */ mid = g_new0(modify_info_data, 1); mid->gc = gc; - mid->misc = info_get_group(info, info_group_headers[3]); + /* QQ_CONTACT_FIELDS+1 so that the array is NULL-terminated and can be g_strfreev()'ed later */ + mid->info = (contact_info *) g_new0(gchar *, QQ_CONTACT_FIELDS+1); + mid->info->pager_sn = g_strdup(info->pager_sn); + mid->info->pager_num = g_strdup(info->pager_num); + mid->info->pager_sp = g_strdup(info->pager_sp); + mid->info->pager_base_num = g_strdup(info->pager_base_num); + mid->info->pager_type = g_strdup(info->pager_type); + mid->info->auth_type = g_strdup(info->auth_type); + mid->info->unknown1 = g_strdup(info->unknown1); + mid->info->unknown2 = g_strdup(info->unknown2); + mid->info->face = g_strdup(info->face); + mid->info->hp_type = g_strdup(info->hp_type); + mid->info->unknown3 = g_strdup(info->unknown3); + mid->info->unknown4 = g_strdup(info->unknown4); + mid->info->unknown5 = g_strdup(info->unknown5); + /* TODO stop hiding these 2 */ + mid->info->is_open_hp = g_strdup(info->is_open_hp); + mid->info->is_open_contact = g_strdup(info->is_open_contact); + mid->info->qq_show = g_strdup(info->qq_show); + mid->info->unknown6 = g_strdup(info->unknown6); gaim_request_fields(gc, _("Modify my information"), _("Modify my information"), NULL, fields, @@ -599,7 +568,7 @@ gchar *icon = g_strdup_printf("%i", qd->my_icon); qd->modifying_face = FALSE; memcpy(info->face, icon, 2); - qq_send_packet_modify_info(gc, info); + qq_send_packet_modify_info(gc, segments); g_free(icon); } @@ -611,11 +580,11 @@ query = (qq_info_query *) query_list->data; if (query->uid == atoi(info->uid)) { if (query->show_window) { - info_text = info_to_str((const gchar **) segments); + info_text = info_to_str(info); gaim_notify_userinfo(gc, info->uid, info_text->str, NULL, NULL); g_string_free(info_text, TRUE); } else if (query->modify_info) { - create_modify_info_dialogue(gc, (const gchar **) segments); + create_modify_info_dialogue(gc, info); } qd->info_query = g_list_remove(qd->info_query, qd->info_query->data); g_free(query); Modified: trunk/libgaim/protocols/qq/buddy_info.h =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.h 2006-09-22 16:05:09 UTC (rev 17338) +++ trunk/libgaim/protocols/qq/buddy_info.h 2006-09-22 17:03:54 UTC (rev 17339) @@ -25,6 +25,7 @@ #include <glib.h> #include "connection.h" + #include "buddy_opt.h" #include "qq.h" @@ -39,80 +40,47 @@ #define QQ_BUDDY_GENDER_UNKNOWN 0xff typedef struct _contact_info { - gchar *uid; - gchar *nick; - gchar *country; - gchar *province; - gchar *zipcode; - gchar *address; - gchar *tel; - gchar *age; - gchar *gender; - gchar *name; - gchar *email; - gchar *pager_sn; - gchar *pager_num; - gchar *pager_sp; - gchar *pager_base_num; - gchar *pager_type; - gchar *occupation; - gchar *homepage; - gchar *auth_type; - gchar *unknown1; - gchar *unknown2; - gchar *face; - gchar *hp_num; - gchar *hp_type; - gchar *intro; - gchar *city; - gchar *unknown3; - gchar *unknown4; - gchar *unknown5; - gchar *is_open_hp; - gchar *is_open_contact; - gchar *college; - gchar *horoscope; - gchar *zodiac; - gchar *blood; - gchar *qq_show; - gchar *unknown6; /* always 0x2D */ + gchar *uid; + gchar *nick; + gchar *country; + gchar *province; + gchar *zipcode; + gchar *address; + gchar *tel; + gchar *age; + gchar *gender; + gchar *name; + gchar *email; + gchar *pager_sn; + gchar *pager_num; + gchar *pager_sp; + gchar *pager_base_num; + gchar *pager_type; + gchar *occupation; + gchar *homepage; + gchar *auth_type; + gchar *unknown1; + gchar *unknown2; + gchar *face; + gchar *hp_num; + gchar *hp_type; + gchar *intro; + gchar *city; + gchar *unknown3; + gchar *unknown4; + gchar *unknown5; + gchar *is_open_hp; + gchar *is_open_contact; + gchar *college; + gchar *horoscope; + gchar *zodiac; + gchar *blood; + gchar *qq_show; + gchar *unknown6; /* always 0x2D */ } contact_info; -/* There is no user id stored in the reply packet for information query - * we have to manually store the query, so that we know the query source */ -typedef struct _qq_info_query { - guint32 uid; - gboolean show_window; - gboolean modify_info; -} qq_info_query; - -/* We get an info packet on ourselves before we modify our information. - * Even though not all of the information is currently modifiable, it still - * all needs to be there when we send out the modify info packet */ -typedef struct _modify_info_data { - GaimConnection *gc; - GList *misc, *node; -} modify_info_data; - -#define QQ_CONTACT_FIELDS 37 - -#define QQ_MAIN_INFO "Primary Information" -#define QQ_EXTRA_INFO "Detailed Information" -#define QQ_PERSONAL_INTRO "Personal Introduction" -#define QQ_MISC "Miscellaneous" - -#define QQ_NO_CHOICE 0 -#define QQ_HOROSCOPE 1 -#define QQ_ZODIAC 2 -#define QQ_BLOOD 3 -#define QQ_GENDER 4 -#define QQ_COUNTRY 5 -#define QQ_PROVINCE 6 -#define QQ_OCCUPATION 7 - void qq_refresh_buddy_and_myself(contact_info *info, GaimConnection *gc); void qq_send_packet_get_info(GaimConnection *gc, guint32 uid, gboolean show_window); -void qq_send_packet_modify_info(GaimConnection *gc, contact_info *info); void qq_prepare_modify_info(GaimConnection *gc); void qq_process_modify_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); void qq_process_get_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-09-22 16:05:28
|
Revision: 17338 http://svn.sourceforge.net/gaim/?rev=17338&view=rev Author: markhuetsch Date: 2006-09-22 09:05:09 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Eliminate a dependency in crypt.c by replacing ntohl() (etc) with g_ntohl() (etc). Also replace those calls in the rest of the QQ prpl, to be consistent. Modified Paths: -------------- trunk/libgaim/protocols/qq/crypt.c trunk/libgaim/protocols/qq/packet_parse.c trunk/libgaim/protocols/qq/qq_proxy.c trunk/libgaim/protocols/qq/send_file.c trunk/libgaim/protocols/qq/udp_proxy_s5.c Modified: trunk/libgaim/protocols/qq/crypt.c =================================================================== --- trunk/libgaim/protocols/qq/crypt.c 2006-09-22 06:45:01 UTC (rev 17337) +++ trunk/libgaim/protocols/qq/crypt.c 2006-09-22 16:05:09 UTC (rev 17338) @@ -38,12 +38,6 @@ 0x61C88647 is what we can track on the ASM codes.!! */ -#ifdef _WIN32 -#include "win32dep.h" -#else -#include <arpa/inet.h> -#endif - #include <string.h> #include "crypt.h" @@ -56,12 +50,12 @@ /* Tiny Encryption Algorithm (TEA) */ static void qq_encipher(guint32 *const v, const guint32 *const k, guint32 *const w) { - register guint32 y = ntohl(v[0]), - z = ntohl(v[1]), - a = ntohl(k[0]), - b = ntohl(k[1]), - c = ntohl(k[2]), - d = ntohl(k[3]), + register guint32 y = g_ntohl(v[0]), + z = g_ntohl(v[1]), + a = g_ntohl(k[0]), + b = g_ntohl(k[1]), + c = g_ntohl(k[2]), + d = g_ntohl(k[3]), n = 0x10, sum = 0, delta = 0x9E3779B9; /* 0x9E3779B9 - 0x100000000 = -0x61C88647 */ @@ -72,8 +66,8 @@ z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d); } - w[0] = htonl(y); - w[1] = htonl(z); + w[0] = g_htonl(y); + w[1] = g_htonl(z); } static gint rand(void) { /* it can be the real random seed function */ @@ -175,12 +169,12 @@ static void qq_decipher(guint32 *const v, const guint32 *const k, guint32 *const w) { - register guint32 y = ntohl(v[0]), - z = ntohl(v[1]), - a = ntohl(k[0]), - b = ntohl(k[1]), - c = ntohl(k[2]), - d = ntohl(k[3]), + register guint32 y = g_ntohl(v[0]), + z = g_ntohl(v[1]), + a = g_ntohl(k[0]), + b = g_ntohl(k[1]), + c = g_ntohl(k[2]), + d = g_ntohl(k[3]), n = 0x10, sum = 0xE3779B90, /* why this ? must be related with n value */ delta = 0x9E3779B9; @@ -192,8 +186,8 @@ sum -= delta; } - w[0] = htonl(y); - w[1] = htonl(z); + w[0] = g_htonl(y); + w[1] = g_htonl(z); } static gint decrypt_block(const guint8 **crypt_buff, const gint instrlen, Modified: trunk/libgaim/protocols/qq/packet_parse.c =================================================================== --- trunk/libgaim/protocols/qq/packet_parse.c 2006-09-22 06:45:01 UTC (rev 17337) +++ trunk/libgaim/protocols/qq/packet_parse.c 2006-09-22 16:05:09 UTC (rev 17338) @@ -20,12 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _WIN32 -#include <arpa/inet.h> -#else -#include "win32dep.h" -#endif - #include <string.h> #include "packet_parse.h" @@ -48,7 +42,7 @@ gint read_packet_w(guint8 *buf, guint8 **cursor, gint buflen, guint16 *w) { if (*cursor <= buf + buflen - sizeof(*w)) { - *w = ntohs(**(guint16 **) cursor); + *w = g_ntohs(**(guint16 **) cursor); *cursor += sizeof(*w); return sizeof(*w); } else { @@ -61,7 +55,7 @@ gint read_packet_dw(guint8 *buf, guint8 **cursor, gint buflen, guint32 *dw) { if (*cursor <= buf + buflen - sizeof(*dw)) { - *dw = ntohl(**(guint32 **) cursor); + *dw = g_ntohl(**(guint32 **) cursor); *cursor += sizeof(*dw); return sizeof(*dw); } else { @@ -99,7 +93,7 @@ gint create_packet_w(guint8 *buf, guint8 **cursor, guint16 w) { if (*cursor <= buf + MAX_PACKET_SIZE - sizeof(guint16)) { - **(guint16 **) cursor = htons(w); + **(guint16 **) cursor = g_htons(w); *cursor += sizeof(guint16); return sizeof(guint16); } else { @@ -112,7 +106,7 @@ gint create_packet_dw(guint8 *buf, guint8 **cursor, guint32 dw) { if (*cursor <= buf + MAX_PACKET_SIZE - sizeof(guint32)) { - **(guint32 **) cursor = htonl(dw); + **(guint32 **) cursor = g_htonl(dw); *cursor += sizeof(guint32); return sizeof(guint32); } else { Modified: trunk/libgaim/protocols/qq/qq_proxy.c =================================================================== --- trunk/libgaim/protocols/qq/qq_proxy.c 2006-09-22 06:45:01 UTC (rev 17337) +++ trunk/libgaim/protocols/qq/qq_proxy.c 2006-09-22 16:05:09 UTC (rev 17338) @@ -50,7 +50,7 @@ socklen_t len = sizeof(sin); getsockname(fd, (struct sockaddr *)&sin, &len); gaim_debug(GAIM_DEBUG_INFO, desc, "%s:%d\n", - inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); + inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port)); } */ Modified: trunk/libgaim/protocols/qq/send_file.c =================================================================== --- trunk/libgaim/protocols/qq/send_file.c 2006-09-22 06:45:01 UTC (rev 17337) +++ trunk/libgaim/protocols/qq/send_file.c 2006-09-22 16:05:09 UTC (rev 17338) @@ -67,11 +67,11 @@ memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; if (!_qq_in_same_lan(info)) { - sin.sin_port = htons(info->remote_major_port); - sin.sin_addr.s_addr = htonl(info->remote_internet_ip); + sin.sin_port = g_htons(info->remote_major_port); + sin.sin_addr.s_addr = g_htonl(info->remote_internet_ip); } else { - sin.sin_port = htons(info->remote_minor_port); - sin.sin_addr.s_addr = htonl(info->remote_real_ip); + sin.sin_port = g_htons(info->remote_minor_port); + sin.sin_addr.s_addr = g_htonl(info->remote_real_ip); } return 0; } @@ -89,7 +89,7 @@ r = recvfrom(info->recv_fd, buf, len, 0, (struct sockaddr *) &sin, &sinlen); gaim_debug(GAIM_DEBUG_INFO, "QQ", "==> recv %d bytes from File UDP Channel, remote ip[%s], remote port[%d]\n", - r, inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); + r, inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port)); return r; } @@ -111,21 +111,21 @@ memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; if (!_qq_in_same_lan(info)) { - sin.sin_port = htons(info->remote_major_port); - sin.sin_addr.s_addr = htonl(info->remote_internet_ip); + sin.sin_port = g_htons(info->remote_major_port); + sin.sin_addr.s_addr = g_htonl(info->remote_internet_ip); } else if (info->use_major) { - sin.sin_port = htons(info->remote_major_port); - sin.sin_addr.s_addr = htonl(info->remote_real_ip); + sin.sin_port = g_htons(info->remote_major_port); + sin.sin_addr.s_addr = g_htonl(info->remote_real_ip); } else { - sin.sin_port = htons(info->remote_minor_port); - sin.sin_addr.s_addr = htonl(info->remote_real_ip); + sin.sin_port = g_htons(info->remote_minor_port); + sin.sin_addr.s_addr = g_htonl(info->remote_real_ip); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "sending to channel: %d.%d.%d.%d:%d\n", sin.sin_addr.s_addr & 0xff, (sin.sin_addr.s_addr >> 8) & 0xff, (sin.sin_addr.s_addr >> 16) & 0xff, sin.sin_addr.s_addr >> 24, - ntohs(sin.sin_port) + g_ntohs(sin.sin_port) ); return sendto(info->sender_fd, buf, len, 0, (struct sockaddr *) &sin, sizeof(sin)); } @@ -230,9 +230,9 @@ gchar *internet_ip_str, *real_ip_str; guint32 ip; - ip = htonl(info->remote_real_ip); + ip = g_htonl(info->remote_real_ip); real_ip_str = gen_ip_str((guint8 *) &ip); - ip = htonl(info->remote_internet_ip); + ip = g_htonl(info->remote_internet_ip); internet_ip_str = gen_ip_str((guint8 *) &ip); gaim_debug(GAIM_DEBUG_INFO, "QQ", "remote internet ip[%s:%d], major port[%d], real ip[%s], minor port[%d]\n", internet_ip_str, info->remote_internet_port, @@ -369,7 +369,7 @@ if (ioctl(fd, SIOCGIFADDR, (char *) &buf[i]) >= 0) { ret = (((struct sockaddr_in *)(&buf[i].ifr_addr))->sin_addr).s_addr; - if (ret == ntohl(0x7f000001)) continue; + if (ret == g_ntohl(0x7f000001)) continue; return ret; } } @@ -391,7 +391,7 @@ /* debug info->local_real_ip = 0x7f000001; */ - info->local_real_ip = ntohl(inet_addr(gaim_network_get_my_ip(-1))); + info->local_real_ip = g_ntohl(inet_addr(gaim_network_get_my_ip(-1))); gaim_debug(GAIM_DEBUG_INFO, "QQ", "local real ip is %x", info->local_real_ip); for (i = 0; i < 2; i++) { @@ -405,7 +405,7 @@ sin_len = sizeof(sin); bind(sockfd, (struct sockaddr *) &sin, sin_len); getsockname(sockfd, (struct sockaddr *) &sin, &sin_len); - listen_port = ntohs(sin.sin_port); + listen_port = g_ntohs(sin.sin_port); switch (i) { case 0: @@ -445,7 +445,7 @@ info = g_new0(ft_info, 1); info->to_uid = to_uid; info->send_seq = qd->send_seq; - info->local_internet_ip = ntohl(inet_addr(qd->my_ip)); + info->local_internet_ip = g_ntohl(inet_addr(qd->my_ip)); info->local_internet_port = qd->my_port; info->local_real_ip = 0x00000000; info->conn_method = 0x00; @@ -800,7 +800,7 @@ } info = g_new0(ft_info, 1); - info->local_internet_ip = ntohl(inet_addr(qd->my_ip)); + info->local_internet_ip = g_ntohl(inet_addr(qd->my_ip)); info->local_internet_port = qd->my_port; info->local_real_ip = 0x00000000; info->to_uid = sender_uid; Modified: trunk/libgaim/protocols/qq/udp_proxy_s5.c =================================================================== --- trunk/libgaim/protocols/qq/udp_proxy_s5.c 2006-09-22 06:45:01 UTC (rev 17337) +++ trunk/libgaim/protocols/qq/udp_proxy_s5.c 2006-09-22 16:05:09 UTC (rev 17338) @@ -134,11 +134,11 @@ fcntl(phb->udpsock, F_SETFL, O_NONBLOCK); - port = ntohs(ctlsin.sin_port) + 1; + port = g_ntohs(ctlsin.sin_port) + 1; while (1) { inet_aton("0.0.0.0", &(sin.sin_addr)); sin.sin_family = AF_INET; - sin.sin_port = htons(port); + sin.sin_port = g_htons(port); if (bind(phb->udpsock, (struct sockaddr *) &sin, sizeof(sin)) < 0) { port++; if (port > 65500) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-22 06:45:05
|
Revision: 17337 http://svn.sourceforge.net/gaim/?rev=17337&view=rev Author: thekingant Date: 2006-09-21 23:45:01 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Show the placeholder icon in the account editor. I didn't make it clickable, though. Can someone please do that for me? Pretty please with corn syrup on top? I'll be your best friend! Modified Paths: -------------- trunk/gtk/gtkaccount.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-09-22 06:21:00 UTC (rev 17336) +++ trunk/gtk/gtkaccount.c 2006-09-22 06:45:01 UTC (rev 17337) @@ -189,16 +189,24 @@ } static void -set_dialog_icon(AccountPrefsDialog *dialog) +set_dialog_icon(AccountPrefsDialog *dialog, gchar *new_icon_path) { - char *filename = gaim_buddy_icons_get_full_path(dialog->icon_path); + char *filename; GdkPixbuf *pixbuf = NULL; - if (filename) + + g_free(dialog->icon_path); + dialog->icon_path = new_icon_path; + + filename = gaim_buddy_icons_get_full_path(dialog->icon_path); + if (filename != NULL) { pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + } if (pixbuf && dialog->prpl_info && (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)) { + /* Scale the icon to something reasonable */ int width, height; GdkPixbuf *scale; @@ -210,10 +218,19 @@ pixbuf = scale; } + if (pixbuf == NULL) + { + /* Show a placeholder icon */ + gchar *filename; + filename = g_build_filename(DATADIR, "pixmaps", + "gaim", "insert-image.png", NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + } + gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); - g_free(filename); } static void @@ -279,12 +296,7 @@ dialog = data; - if (filename) { - g_free(dialog->icon_path); - dialog->icon_path = gaim_gtk_convert_buddy_icon(dialog->plugin, filename); - set_dialog_icon(dialog); - gtk_widget_show(dialog->icon_entry); - } + set_dialog_icon(dialog, gaim_gtk_convert_buddy_icon(dialog->plugin, filename)); dialog->icon_filesel = NULL; } @@ -299,13 +311,9 @@ static void icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) { - g_free(dialog->icon_path); - dialog->icon_path = NULL; - - gtk_widget_hide(dialog->icon_entry); + set_dialog_icon(dialog, NULL); } - static void account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *sd, guint info, guint t, AccountPrefsDialog *dialog) @@ -328,11 +336,7 @@ } if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) *rtmp = '\0'; - g_free(dialog->icon_path); - - dialog->icon_path = gaim_gtk_convert_buddy_icon(dialog->plugin, tmp); - set_dialog_icon(dialog); - gtk_widget_show(dialog->icon_entry); + set_dialog_icon(dialog, gaim_gtk_convert_buddy_icon(dialog->plugin, tmp)); g_free(tmp); } gtk_drag_finish(dc, TRUE, FALSE, t); @@ -612,8 +616,9 @@ !gaim_account_get_ui_bool(dialog->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)); - dialog->icon_path = g_strdup(gaim_account_get_ui_string(dialog->account, GAIM_GTK_UI, "non-global-buddyicon", NULL)); - set_dialog_icon(dialog); + set_dialog_icon(dialog, + g_strdup(gaim_account_get_ui_string(dialog->account, + GAIM_GTK_UI, "non-global-buddyicon", NULL))); } if (!dialog->prpl_info || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-22 06:21:04
|
Revision: 17336 http://svn.sourceforge.net/gaim/?rev=17336&view=rev Author: thekingant Date: 2006-09-21 23:21:00 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Get rid of a call to printf Modified Paths: -------------- trunk/gtk/gtkaccount.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-09-22 05:42:01 UTC (rev 17335) +++ trunk/gtk/gtkaccount.c 2006-09-22 06:21:00 UTC (rev 17336) @@ -607,7 +607,7 @@ if (dialog->account != NULL) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), gaim_account_get_check_mail(dialog->account)); - + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), !gaim_account_get_ui_bool(dialog->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)); @@ -1063,7 +1063,6 @@ /* The user set an icon, which would've been cached by convert_buddy_icon, * but didn't save the changes. Delete the cache file. */ char *filename = g_build_filename(gaim_buddy_icons_get_cache_dir(), dialog->icon_path, NULL); - printf("Deleting\n"); g_unlink(filename); g_free(filename); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-22 05:42:05
|
Revision: 17335 http://svn.sourceforge.net/gaim/?rev=17335&view=rev Author: thekingant Date: 2006-09-21 22:42:01 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Get rid of some checks to make sure gc is valid. They shouldn't be necessary (and a lot of them were poorly implemented anyway). Let me know if you notice any crashes. Modified Paths: -------------- trunk/libgaim/account.c trunk/libgaim/connection.c trunk/libgaim/privacy.c trunk/libgaim/protocols/jabber/buddy.c trunk/libgaim/server.c Modified: trunk/libgaim/account.c =================================================================== --- trunk/libgaim/account.c 2006-09-21 21:56:19 UTC (rev 17334) +++ trunk/libgaim/account.c 2006-09-22 05:42:01 UTC (rev 17335) @@ -1141,11 +1141,8 @@ GaimConnection *gc; gaim_account_set_user_info(account, user_info); - gc = gaim_account_get_connection(account); - - if (gc != NULL) - serv_set_info(gc, user_info); + serv_set_info(gc, user_info); } void @@ -1959,8 +1956,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info != NULL && g_list_find(gaim_connections_get_all(), gc) && - prpl_info->add_buddy != NULL) + if (prpl_info != NULL && prpl_info->add_buddy != NULL) prpl_info->add_buddy(gc, buddy, gaim_buddy_get_group(buddy)); } @@ -1973,7 +1969,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc)) { + if (prpl_info) { GList *cur, *groups = NULL; /* Make a list of what group each buddy is in */ @@ -2008,7 +2004,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->remove_buddy) + if (prpl_info && prpl_info->remove_buddy) prpl_info->remove_buddy(gc, buddy, group); } @@ -2018,13 +2014,10 @@ GaimPluginProtocolInfo *prpl_info = NULL; GaimConnection *gc = gaim_account_get_connection(account); - if (!g_list_find(gaim_connections_get_all(), gc)) - return; - if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc)) { + if (prpl_info) { if (prpl_info->remove_buddies) prpl_info->remove_buddies(gc, buddies, groups); else { @@ -2048,7 +2041,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->remove_group) + if (prpl_info && prpl_info->remove_group) prpl_info->remove_group(gc, group); } @@ -2064,7 +2057,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->change_passwd) + if (prpl_info && prpl_info->change_passwd) prpl_info->change_passwd(gc, orig_pw, new_pw); } Modified: trunk/libgaim/connection.c =================================================================== --- trunk/libgaim/connection.c 2006-09-21 21:56:19 UTC (rev 17334) +++ trunk/libgaim/connection.c 2006-09-22 05:42:01 UTC (rev 17335) @@ -428,7 +428,6 @@ GaimConnectionUiOps *ops; g_return_if_fail(gc != NULL); - g_return_if_fail(GAIM_CONNECTION_IS_VALID(gc)); g_return_if_fail(text != NULL); /* If we've already got one error, we don't need any more */ Modified: trunk/libgaim/privacy.c =================================================================== --- trunk/libgaim/privacy.c 2006-09-21 21:56:19 UTC (rev 17334) +++ trunk/libgaim/privacy.c 2006-09-22 05:42:01 UTC (rev 17335) @@ -46,10 +46,10 @@ break; } - if (l != NULL) + if (l != NULL) { g_free(name); - return FALSE; + return FALSE; } account->permit = g_slist_append(account->permit, name); Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2006-09-21 21:56:19 UTC (rev 17334) +++ trunk/libgaim/protocols/jabber/buddy.c 2006-09-22 05:42:01 UTC (rev 17335) @@ -506,15 +506,9 @@ p = xmlnode_to_str(vc_node, NULL); xmlnode_free(vc_node); - if (gc != NULL) { - GaimAccount *account = gaim_connection_get_account(gc); + gaim_account_set_user_info(gaim_connection_get_account(gc), p); + serv_set_info(gc, p); - if (account != NULL) { - gaim_account_set_user_info(account, p); - serv_set_info(gc, p); - } - } - g_free(p); } Modified: trunk/libgaim/server.c =================================================================== --- trunk/libgaim/server.c 2006-09-21 21:56:19 UTC (rev 17334) +++ trunk/libgaim/server.c 2006-09-22 05:42:01 UTC (rev 17335) @@ -173,8 +173,7 @@ if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && - prpl_info->set_info) { + if (prpl_info && prpl_info->set_info) { account = gaim_connection_get_account(gc); @@ -270,7 +269,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->add_permit) + if (prpl_info && prpl_info->add_permit) prpl_info->add_permit(g, name); } @@ -281,7 +280,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->add_deny) + if (prpl_info && prpl_info->add_deny) prpl_info->add_deny(g, name); } @@ -292,7 +291,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->rem_permit) + if (prpl_info && prpl_info->rem_permit) prpl_info->rem_permit(g, name); } @@ -303,7 +302,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->rem_deny) + if (prpl_info && prpl_info->rem_deny) prpl_info->rem_deny(g, name); } @@ -320,7 +319,7 @@ * in the prefs. In either case you should probably be resetting and * resending the permit/deny info when you get this. */ - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->set_permit_deny) + if (prpl_info && prpl_info->set_permit_deny) prpl_info->set_permit_deny(g); } @@ -331,7 +330,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->join_chat) + if (prpl_info && prpl_info->join_chat) prpl_info->join_chat(g, data); } @@ -343,7 +342,7 @@ if (g != NULL && g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->reject_chat) + if (prpl_info && prpl_info->reject_chat) prpl_info->reject_chat(g, data); } @@ -364,7 +363,7 @@ gaim_signal_emit(gaim_conversations_get_handle(), "chat-inviting-user", conv, name, &buffy); - if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->chat_invite) + if (prpl_info && prpl_info->chat_invite) prpl_info->chat_invite(g, id, buffy, name); gaim_signal_emit(gaim_conversations_get_handle(), "chat-invited-user", @@ -383,9 +382,6 @@ { GaimPluginProtocolInfo *prpl_info = NULL; - if (!g_list_find(gaim_connections_get_all(), g)) - return; - if (g->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-21 21:56:21
|
Revision: 17334 http://svn.sourceforge.net/gaim/?rev=17334&view=rev Author: seanegan Date: 2006-09-21 14:56:19 -0700 (Thu, 21 Sep 2006) Log Message: ----------- There are a bunch of things we don't send as an xmlnode, so here's a sending-text signal for plugins that care about that Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-21 12:47:44 UTC (rev 17333) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-21 21:56:19 UTC (rev 17334) @@ -255,7 +255,9 @@ /* If we've got a security layer, we need to encode the data, * splitting it on the maximum buffer length negotiated */ - + + gaim_signal_emit(my_protocol, "jabber-sending-text", js->gc, data); + #ifdef HAVE_CYRUS_SASL if (js->sasl_maxbuf>0) { int pos; @@ -1906,6 +1908,12 @@ gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONNECTION), gaim_value_new_outgoing(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_XMLNODE)); + gaim_signal_register(plugin, "jabber-sending-text", + gaim_marshal_VOID__POINTER_POINTER, NULL, 2, + gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONNECTION), + gaim_value_new(GAIM_TYPE_STRING)); + + return TRUE; } @@ -1914,7 +1922,9 @@ gaim_signal_unregister(plugin, "jabber-receiving-xmlnode"); gaim_signal_unregister(plugin, "jabber-sending-xmlnode"); - + + gaim_signal_unregister(plugin, "jabber-sending-text"); + return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-09-21 12:47:59
|
Revision: 17333 http://svn.sourceforge.net/gaim/?rev=17333&view=rev Author: nosnilmot Date: 2006-09-21 05:47:44 -0700 (Thu, 21 Sep 2006) Log Message: ----------- My gdk doesn't support writing gif files (do any of them?) and "jpeg" is the required identifier for jpeg images, jpg just doesn't cut it. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-09-21 03:07:04 UTC (rev 17332) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-09-21 12:47:44 UTC (rev 17333) @@ -6426,7 +6426,7 @@ OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE, NULL, /* user_splits */ NULL, /* protocol_options */ - {"gif,jpg,bmp,ico", 48, 48, 50, 50, + {"gif,jpeg,bmp,ico", 48, 48, 50, 50, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ oscar_list_icon, /* list_icon */ oscar_list_emblems, /* list_emblems */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-09-21 03:07:10
|
Revision: 17332 http://svn.sourceforge.net/gaim/?rev=17332&view=rev Author: rlaager Date: 2006-09-20 20:07:04 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Update the Help dialog in the GTK+ UI to properly show that an internal libgadu is being used on !win32. Modified Paths: -------------- trunk/configure.ac trunk/gtk/Makefile.am trunk/gtk/gtkdialogs.c trunk/libgaim/protocols/gg/Makefile.am Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-09-20 20:32:43 UTC (rev 17331) +++ trunk/configure.ac 2006-09-21 03:07:04 UTC (rev 17332) @@ -652,7 +652,7 @@ CPPFLAGS="$CPPFLAGS_save" fi -AM_CONDITIONAL(USE_INTERNAL_LIBGG, test "x$gadu_libs" != "xyes") +AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes") AC_SUBST(GADU_LIBS) AC_SUBST(GADU_CFLAGS) Modified: trunk/gtk/Makefile.am =================================================================== --- trunk/gtk/Makefile.am 2006-09-20 20:32:43 UTC (rev 17331) +++ trunk/gtk/Makefile.am 2006-09-21 03:07:04 UTC (rev 17332) @@ -165,6 +165,10 @@ $(GTK_LIBS) \ $(top_builddir)/libgaim/libgaim.la +if USE_INTERNAL_LIBGADU +INTGG_CFLAGS = -DUSE_INTERNAL_LIBGADU +endif + AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ -DDATADIR=\"$(datadir)\" \ @@ -179,5 +183,6 @@ $(DBUS_CFLAGS) \ $(GTKSPELL_CFLAGS) \ $(STARTUP_NOTIFICATION_CFLAGS) \ - $(LIBXML_CFLAGS) + $(LIBXML_CFLAGS) \ + $(INTGG_CFLAGS) endif # ENABLE_GTK Modified: trunk/gtk/gtkdialogs.c =================================================================== --- trunk/gtk/gtkdialogs.c 2006-09-20 20:32:43 UTC (rev 17331) +++ trunk/gtk/gtkdialogs.c 2006-09-21 03:07:04 UTC (rev 17332) @@ -497,15 +497,15 @@ #endif #endif -#ifdef HAVE_LIBGADU -#ifdef _WIN32 +#if defined(_WIN32) || defined(USE_INTERNAL_LIBGADU) g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Internal<br/>"); #else +#ifdef HAVE_LIBGADU g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Enabled<br/>"); -#endif #else g_string_append(str, " <b>Gadu-Gadu library (libgadu):</b> Disabled<br/>"); #endif +#endif #ifdef USE_GTKSPELL g_string_append(str, " <b>GtkSpell:</b> Enabled<br/>"); Modified: trunk/libgaim/protocols/gg/Makefile.am =================================================================== --- trunk/libgaim/protocols/gg/Makefile.am 2006-09-20 20:32:43 UTC (rev 17331) +++ trunk/libgaim/protocols/gg/Makefile.am 2006-09-21 03:07:04 UTC (rev 17332) @@ -27,7 +27,7 @@ gg.h \ gg.c -if USE_INTERNAL_LIBGG +if USE_INTERNAL_LIBGADU GGSOURCES += \ lib/common.c \ lib/compat.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-09-20 20:32:54
|
Revision: 17331 http://svn.sourceforge.net/gaim/?rev=17331&view=rev Author: datallah Date: 2006-09-20 13:32:43 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Don't remove the perl plugin if we can't find ActivePerl. We no longer have the annoying error popups when a dll dependency isn't found, so this isn't necessary anymore. Modified Paths: -------------- trunk/gaim-installer.nsi Modified: trunk/gaim-installer.nsi =================================================================== --- trunk/gaim-installer.nsi 2006-09-20 18:07:28 UTC (rev 17330) +++ trunk/gaim-installer.nsi 2006-09-20 20:32:43 UTC (rev 17331) @@ -444,19 +444,14 @@ SetOutPath "$INSTDIR" got_shfolder: - ; Check if Perl is installed, If not remove perl plugin + ; Check if Perl is installed, if so add it to the AppPaths ReadRegStr $R2 HKLM ${PERL_REG_KEY} "" StrCmp $R2 "" 0 perl_exists ReadRegStr $R2 HKCU ${PERL_REG_KEY} "" - StrCmp $R2 "" perl_remove perl_exists + StrCmp $R2 "" perl_done perl_exists - perl_remove: - Delete "$INSTDIR\plugins\perl.dll" - RMDir /r "$INSTDIR\perlmod" - Goto perl_done - perl_exists: - IfFileExists "$R2\bin\${PERL_DLL}" 0 perl_remove + IfFileExists "$R2\bin\${PERL_DLL}" 0 perl_done StrCmp $R0 "HKLM" 0 perl_done ReadRegStr $R3 HKLM "${HKLM_APP_PATHS_KEY}" "Path" WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R3;$R2\bin" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-09-20 18:07:39
|
Revision: 17330 http://svn.sourceforge.net/gaim/?rev=17330&view=rev Author: datallah Date: 2006-09-20 11:07:28 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Make the wingaim debugging instructions less version specific - this should avoid people trying to get 1.5.0 crash reports when using one of the new betas. Modified Paths: -------------- web/htdocs/win32/index.php Modified: web/htdocs/win32/index.php =================================================================== --- web/htdocs/win32/index.php 2006-09-20 11:52:35 UTC (rev 17329) +++ web/htdocs/win32/index.php 2006-09-20 18:07:28 UTC (rev 17330) @@ -151,7 +151,7 @@ <h2 id="debug">Debugging Windows Gaim</h2> <h3>What to do if Gaim crashes</h3> -<p>First make sure that you are not affected by 'Dll Hell' as described above. Download and install the <a href="http://prdownloads.sourceforge.net/gaim/gaim-<?php print $current_win32_version; ?>-debug.exe">debug version of WinGaim <?php print $current_win32_version; ?></a>. The next time you run Gaim and it crashes, the call stack will be dumped to <code>gaim.RPT</code> in your Gaim install dir. When submitting a bug report, give a detailed description on how to produce your bug and attach the most recent crash dump from your <code>gaim.RPT</code> file.</p> +<p>First make sure that you are not affected by 'Dll Hell' as described above. Download and install the debug version of WinGaim (<a href="http://prdownloads.sourceforge.net/gaim/gaim-<?php print $current_win32_version; ?>-debug.exe"><?php print $current_win32_version; ?> is here</a>; for other versions, go to <a href="http://sourceforge.net/project/showfiles.php?group_id=235&package_id=253">the gaim file releases area on SF.net</a>). The next time you run Gaim and it crashes, the call stack will be dumped to <code>gaim.RPT</code> in your Gaim install dir. When submitting a bug report, give a detailed description on how to produce your bug and attach the most recent crash dump from your <code>gaim.RPT</code> file.</p> <h2 id="portable">Running Windows Gaim From a USB Drive</h2> <p>It is relatively easy to set up Gaim to run from a USB Drive. Most of Gaim is very good about not assuming that it is installed; a slightly customized launcher makes it all come together nicely.</p> <p>The way that this is set up, other GTK+ applications can use the same GTK+ runtime.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-09-20 11:52:40
|
Revision: 17329 http://svn.sourceforge.net/gaim/?rev=17329&view=rev Author: nosnilmot Date: 2006-09-20 04:52:35 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Fix some more potential printf("%s", NULL) crashes due to changes in the passport info MSN provides when signing in. This might break email notifications for such cases, but that's better than crashing, right? Modified Paths: -------------- trunk/libgaim/protocols/msn/notification.c Modified: trunk/libgaim/protocols/msn/notification.c =================================================================== --- trunk/libgaim/protocols/msn/notification.c 2006-09-20 11:49:38 UTC (rev 17328) +++ trunk/libgaim/protocols/msn/notification.c 2006-09-20 11:52:35 UTC (rev 17329) @@ -999,17 +999,20 @@ gaim_account_get_username(account)); fprintf(fd, "<input type=\"hidden\" name=\"username\" value=\"%s\">\n", gaim_account_get_username(account)); - fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n", - session->passport_info.sid); - fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n", - session->passport_info.kv); + if (session->passport_info.sid != NULL) + fprintf(fd, "<input type=\"hidden\" name=\"sid\" value=\"%s\">\n", + session->passport_info.sid); + if (session->passport_info.kv != NULL) + fprintf(fd, "<input type=\"hidden\" name=\"kv\" value=\"%s\">\n", + session->passport_info.kv); fprintf(fd, "<input type=\"hidden\" name=\"id\" value=\"2\">\n"); fprintf(fd, "<input type=\"hidden\" name=\"sl\" value=\"%ld\">\n", time(NULL) - session->passport_info.sl); fprintf(fd, "<input type=\"hidden\" name=\"rru\" value=\"%s\">\n", rru); - fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n", - session->passport_info.mspauth); + if (session->passport_info.mspauth != NULL) + fprintf(fd, "<input type=\"hidden\" name=\"auth\" value=\"%s\">\n", + session->passport_info.mspauth); fprintf(fd, "<input type=\"hidden\" name=\"creds\" value=\"%s\">\n", sendbuf); /* TODO Digest me (huh? -- ChipX86) */ fprintf(fd, "<input type=\"hidden\" name=\"svc\" value=\"mail\">\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-09-20 11:49:46
|
Revision: 17328 http://svn.sourceforge.net/gaim/?rev=17328&view=rev Author: nosnilmot Date: 2006-09-20 04:49:38 -0700 (Wed, 20 Sep 2006) Log Message: ----------- We no longer use libao or audiofile, so we don't need to carry these checks for them any more. Modified Paths: -------------- trunk/acinclude.m4 Modified: trunk/acinclude.m4 =================================================================== --- trunk/acinclude.m4 2006-09-20 11:42:26 UTC (rev 17327) +++ trunk/acinclude.m4 2006-09-20 11:49:38 UTC (rev 17328) @@ -411,305 +411,6 @@ rm -f conf.gtktest ]) -dnl This is XIPH_PATH_AO renamed to GAIM_PATH_AO to prevent conflicts. -dnl It's a long story. --elb - -# ao.m4 -# Configure paths for libao -# Jack Moffitt <ja...@ic...> 10-21-2000 -# Shamelessly stolen from Owen Taylor and Manish Singh - -dnl GAIM_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl Test for libao, and define AO_CFLAGS and AO_LIBS -dnl -AC_DEFUN([GAIM_PATH_AO], -[dnl -dnl Get the cflags and libraries -dnl -AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="") -AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="") -AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="") -AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes) - - - if test "x$ao_libraries" != "x" ; then - AO_LIBS="-L$ao_libraries" - elif test "x$ao_prefix" != "x"; then - AO_LIBS="-L$ao_prefix/lib" - elif test "x$prefix" != "xNONE"; then - AO_LIBS="-L$prefix/lib" - fi - - if test "x$ao_includes" != "x" ; then - AO_CFLAGS="-I$ao_includes" - elif test "x$ao_prefix" != "x"; then - AO_CFLAGS="-I$ao_prefix/include" - elif test "x$prefix" != "xNONE"; then - AO_CFLAGS="-I$prefix/include" - fi - - # see where dl* and friends live - AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [ - AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [ - AC_MSG_WARN([could not find dlopen() needed by libao sound drivers - your system may not be supported.]) - ]) - ]) - - AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS" - - AC_MSG_CHECKING(for ao) - no_ao="" - - - if test "x$enable_aotest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $AO_CFLAGS" - LIBS="$LIBS $AO_LIBS" -dnl -dnl Now check if the installed ao is sufficiently new. -dnl - rm -f conf.aotest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ao/ao.h> - -int main () -{ - system("touch conf.aotest"); - return 0; -} - -],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - - if test "x$no_ao" = "x" ; then - AC_MSG_RESULT(yes) - ifelse([$1], , :, [$1]) - else - AC_MSG_RESULT(no) - if test -f conf.aotest ; then - : - else - echo "*** Could not run ao test program, checking why..." - CFLAGS="$CFLAGS $AO_CFLAGS" - LIBS="$LIBS $AO_LIBS" - AC_TRY_LINK([ -#include <stdio.h> -#include <ao/ao.h> -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ao or finding the wrong" - echo "*** version of ao. If it is not finding ao, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means ao was incorrectly installed" - echo "*** or that you have moved ao since it was installed." ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - AO_CFLAGS="" - AO_LIBS="" - ifelse([$2], , :, [$2]) - fi - AC_SUBST(AO_CFLAGS) - AC_SUBST(AO_LIBS) - rm -f conf.aotest -]) - -dnl audiofile.m4, included here for those people who don't have audiofile -dnl installed but would like to build CVS. - -# Configure paths for the Audio File Library -# Bertrand Guiheneuf 98-10-21 -# stolen from esd.m4 in esound : -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS. -dnl -AC_DEFUN([AM_PATH_AUDIOFILE], -[dnl -dnl Get compiler flags and libraries from the audiofile-config script. -dnl -AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where Audio File Library is installed (optional)], - audiofile_prefix="$withval", audiofile_prefix="") -AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)], - audiofile_exec_prefix="$withval", audiofile_exec_prefix="") -AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes) - - if test x$audiofile_exec_prefix != x ; then - audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix" - if test x${AUDIOFILE_CONFIG+set} != xset ; then - AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config - fi - fi - if test x$audiofile_prefix != x ; then - audiofile_args="$audiofile_args --prefix=$audiofile_prefix" - if test x${AUDIOFILE_CONFIG+set} != xset ; then - AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config - fi - fi - - AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no) - min_audiofile_version=ifelse([$1], ,0.2.5,$1) - AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version) - no_audiofile="" - if test "$AUDIOFILE_CONFIG" = "no" ; then - no_audiofile=yes - else - AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs` - AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags` - audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_audiofiletest" = "xyes" ; then - AC_LANG_SAVE - AC_LANG_C - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" - LIBS="$LIBS $AUDIOFILE_LIBS" -dnl -dnl Now check if the installed Audio File Library is sufficiently new. -dnl (Also checks the sanity of the results of audiofile-config to some extent.) -dnl - rm -f conf.audiofiletest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <audiofile.h> - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.audiofiletest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_audiofile_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_audiofile_version"); - exit(1); - } - - if (($audiofile_major_version > major) || - (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) || - (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version); - printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n"); - printf("*** to point to the correct copy of audiofile-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE - fi - fi - if test "x$no_audiofile" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$AUDIOFILE_CONFIG" = "no" ; then - cat <<END -*** The audiofile-config script installed by the Audio File Library could -*** not be found. If the Audio File Library was installed in PREFIX, make -*** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG -*** environment variable to the full path to audiofile-config. -END - else - if test -f conf.audiofiletest ; then - : - else - echo "*** Could not run Audio File Library test program; checking why..." - AC_LANG_SAVE - AC_LANG_C - CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" - LIBS="$LIBS $AUDIOFILE_LIBS" - AC_TRY_LINK([ -#include <stdio.h> -#include <audiofile.h> -], [ return 0; ], - [ cat <<END -*** The test program compiled, but did not run. This usually means that -*** the run-time linker is not finding Audio File Library or finding the -*** wrong version of Audio File Library. -*** -*** If it is not finding Audio File Library, you'll need to set your -*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point -*** to the installed location. Also, make sure you have run ldconfig if -*** that is required on your system. -*** -*** If you have an old version installed, it is best to remove it, although -*** you may also be able to get things to work by modifying -*** LD_LIBRARY_PATH. -END - ], - [ echo "*** The test program failed to compile or link. See the file config.log" - echo "*** for the exact error that occurred. This usually means the Audio File" - echo "*** Library was incorrectly installed or that you have moved the Audio" - echo "*** File Library since it was installed. In the latter case, you may want" - echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_RESTORE - fi - fi - AUDIOFILE_CFLAGS="" - AUDIOFILE_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(AUDIOFILE_CFLAGS) - AC_SUBST(AUDIOFILE_LIBS) - rm -f conf.audiofiletest -]) - dnl ac_var_timeszone_externals.m4 # Define 'timezone', 'altzone' and 'daylight' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-09-20 11:42:40
|
Revision: 17327 http://svn.sourceforge.net/gaim/?rev=17327&view=rev Author: nosnilmot Date: 2006-09-20 04:42:26 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Fall back to using internal libgadu if an external one is not found Modified Paths: -------------- trunk/configure.ac trunk/libgaim/protocols/gg/Makefile.am Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-09-20 09:13:17 UTC (rev 17326) +++ trunk/configure.ac 2006-09-20 11:42:26 UTC (rev 17327) @@ -652,6 +652,8 @@ CPPFLAGS="$CPPFLAGS_save" fi +AM_CONDITIONAL(USE_INTERNAL_LIBGG, test "x$gadu_libs" != "xyes") + AC_SUBST(GADU_LIBS) AC_SUBST(GADU_CFLAGS) @@ -676,9 +678,6 @@ if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc//'` fi -if test "x$gadu_libs" != "xyes"; then - STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/gg//'` -fi AC_SUBST(STATIC_PRPLS) STATIC_LINK_LIBS= extern_init= @@ -741,9 +740,6 @@ if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc//'` fi -if test "x$gadu_libs" != "xyes"; then - DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/gg//'` -fi AC_SUBST(DYNAMIC_PRPLS) for i in $DYNAMIC_PRPLS ; do case $i in Modified: trunk/libgaim/protocols/gg/Makefile.am =================================================================== --- trunk/libgaim/protocols/gg/Makefile.am 2006-09-20 09:13:17 UTC (rev 17326) +++ trunk/libgaim/protocols/gg/Makefile.am 2006-09-20 11:42:26 UTC (rev 17327) @@ -27,6 +27,23 @@ gg.h \ gg.c +if USE_INTERNAL_LIBGG +GGSOURCES += \ + lib/common.c \ + lib/compat.h \ + lib/dcc.c \ + lib/events.c \ + lib/http.c \ + lib/libgadu.c \ + lib/libgadu-config.h \ + lib/libgadu.h \ + lib/obsolete.c \ + lib/pubdir50.c \ + lib/pubdir.c + +INTGG_CFLAGS = -I$(top_srcdir)/libgaim/protocols/gg/lib +endif + AM_CFLAGS = $(st) libgg_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) @@ -54,6 +71,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libgaim \ + $(INTGG_CFLAGS) \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-20 09:13:23
|
Revision: 17326 http://svn.sourceforge.net/gaim/?rev=17326&view=rev Author: thekingant Date: 2006-09-20 02:13:17 -0700 (Wed, 20 Sep 2006) Log Message: ----------- Show a placeholder icon when there is no global buddy icon selected. Someone more familiar with gtk might want to look over there... Modified Paths: -------------- trunk/gtk/gtkstatusbox.c trunk/gtk/pixmaps/Makefile.am Added Paths: ----------- trunk/gtk/pixmaps/insert-image.png Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-09-19 23:46:17 UTC (rev 17325) +++ trunk/gtk/gtkstatusbox.c 2006-09-20 09:13:17 UTC (rev 17326) @@ -75,6 +75,7 @@ static void gtk_gaim_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_gaim_status_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_gaim_status_box_expose_event (GtkWidget *widget, GdkEventExpose *event); +static void gtk_gaim_status_box_redisplay_buddy_icon(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static void do_colorshift (GdkPixbuf *dest, GdkPixbuf *src, int shift); @@ -308,9 +309,9 @@ { gtk_gaim_status_box_set_buddy_icon(status_box, gaim_prefs_get_string("/gaim/gtk/accounts/buddyicon")); } - status_box->icon = gtk_image_new_from_pixbuf(status_box->buddy_icon); + status_box->icon = gtk_image_new(); status_box->icon_box = gtk_event_box_new(); - + status_box->hand_cursor = gdk_cursor_new (GDK_HAND2); status_box->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); @@ -321,7 +322,7 @@ dnd_targets, sizeof(dnd_targets) / sizeof(GtkTargetEntry), GDK_ACTION_COPY); - + g_signal_connect(G_OBJECT(status_box->icon_box), "drag_data_received", G_CALLBACK(icon_box_dnd_cb), status_box); g_signal_connect(G_OBJECT(status_box->icon_box), "enter-notify-event", G_CALLBACK(icon_box_enter_cb), status_box); g_signal_connect(G_OBJECT(status_box->icon_box), "leave-notify-event", G_CALLBACK(icon_box_leave_cb), status_box); @@ -1124,6 +1125,8 @@ } } gtk_gaim_status_box_set_buddy_icon(box, filename); + if (box->account == NULL) + gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); } box->buddy_icon_sel = NULL; @@ -1298,13 +1301,12 @@ GtkGaimStatusBox *status_box = GTK_GAIM_STATUS_BOX(widget); GtkRequisition req = {0,0}; GtkAllocation parent_alc, box_alc, icon_alc; - GdkPixbuf *scaled; gint border_width = GTK_CONTAINER (widget)->border_width; combo_box_size_request(widget, &req); box_alc = *allocation; - + box_alc.width -= (border_width * 2); box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2))); box_alc.x += border_width; @@ -1331,27 +1333,11 @@ icon_alc.x = allocation->width - (icon_alc.width + border_width); } icon_alc.y += border_width; - + if (status_box->icon_size != icon_alc.height) { - if (status_box->buddy_icon_hover) - g_object_unref(status_box->buddy_icon_hover); - if ((status_box->buddy_icon_path != NULL) && - (*status_box->buddy_icon_path != '\0')) - { - scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, - icon_alc.height, icon_alc.width, FALSE, NULL); - if (scaled != NULL) - { - status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); - if (status_box->buddy_icon) - g_object_unref(status_box->buddy_icon); - status_box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); - } - } status_box->icon_size = icon_alc.height; + gtk_gaim_status_box_redisplay_buddy_icon(status_box); } gtk_widget_size_allocate(status_box->icon_box, &icon_alc); } @@ -1497,34 +1483,50 @@ gtk_gaim_status_box_refresh(status_box); } -void -gtk_gaim_status_box_set_buddy_icon(GtkGaimStatusBox *box, const char *filename) +static void +gtk_gaim_status_box_redisplay_buddy_icon(GtkGaimStatusBox *status_box) { - GdkPixbuf *scaled; - g_free(box->buddy_icon_path); - box->buddy_icon_path = g_strdup(filename); - if ((filename != NULL) && (*filename != '\0')) + /* This is sometimes called before the box is shown, and we will not have a size */ + if (status_box->icon_size <= 0) + return; + + if (status_box->buddy_icon) + g_object_unref(status_box->buddy_icon); + if (status_box->buddy_icon_hover) + g_object_unref(status_box->buddy_icon_hover); + status_box->buddy_icon = NULL; + status_box->buddy_icon_hover = NULL; + + if ((status_box->buddy_icon_path != NULL) && + (*status_box->buddy_icon_path != '\0')) + status_box->buddy_icon = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, + status_box->icon_size, status_box->icon_size, FALSE, NULL); + + if (status_box->buddy_icon == NULL) { - if (box->buddy_icon != NULL) - g_object_unref(box->buddy_icon); + /* Show a placeholder icon */ + gchar *filename; + filename = g_build_filename(DATADIR, "pixmaps", + "gaim", "insert-image.png", NULL); + status_box->buddy_icon = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + } - /* This will get called before the box is shown and will not have a size */ - if (box->icon_size > 0) { - scaled = gdk_pixbuf_new_from_file_at_scale(filename, - box->icon_size, box->icon_size, FALSE, NULL); - if (scaled != NULL) - { - box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); - box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); - } - } + if (status_box->buddy_icon != NULL) { + gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); + status_box->buddy_icon_hover = gdk_pixbuf_copy(status_box->buddy_icon); + do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); } +} - if (box->account == NULL) - gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); +void +gtk_gaim_status_box_set_buddy_icon(GtkGaimStatusBox *status_box, const char *filename) +{ + g_free(status_box->buddy_icon_path); + status_box->buddy_icon_path = g_strdup(filename); + + gtk_gaim_status_box_redisplay_buddy_icon(status_box); } const char* Modified: trunk/gtk/pixmaps/Makefile.am =================================================================== --- trunk/gtk/pixmaps/Makefile.am 2006-09-19 23:46:17 UTC (rev 17325) +++ trunk/gtk/pixmaps/Makefile.am 2006-09-20 09:13:17 UTC (rev 17326) @@ -17,6 +17,7 @@ gaim_question.png \ gaim_warning.png \ info.png \ + insert-image.png \ insert-image-small.png \ insert-link-small.png \ insert-smiley-small.png \ @@ -82,7 +83,7 @@ gaimiconpix_DATA = away.png connect.png msgpend.png offline.png online.png msgunread.png stock_connect_16.png stock_disconnect_16.png gaimdistpixdir = $(datadir)/pixmaps/gaim -gaimdistpix_DATA = logo.png tb_drag_arrow_down.xpm tb_drag_arrow_left.xpm tb_drag_arrow_right.xpm tb_drag_arrow_up.xpm typed.png typing.png status-online.png status-offline.png status-away.png status-invisible.png status-typing0.png status-typing1.png status-typing2.png status-typing3.png status-connect0.png status-connect1.png status-connect2.png status-connect3.png phone.png +gaimdistpix_DATA = logo.png tb_drag_arrow_down.xpm tb_drag_arrow_left.xpm tb_drag_arrow_right.xpm tb_drag_arrow_up.xpm typed.png typing.png status-online.png status-offline.png status-away.png status-invisible.png status-typing0.png status-typing1.png status-typing2.png status-typing3.png status-connect0.png status-connect1.png status-connect2.png status-connect3.png phone.png insert-image.png distpixmapdir = $(datadir)/pixmaps distpixmap_DATA = gaim.png gaim.svg Added: trunk/gtk/pixmaps/insert-image.png =================================================================== (Binary files differ) Property changes on: trunk/gtk/pixmaps/insert-image.png ___________________________________________________________________ Name: svn:mime-type + image/png This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-19 23:46:20
|
Revision: 17325 http://svn.sourceforge.net/gaim/?rev=17325&view=rev Author: thekingant Date: 2006-09-19 16:46:17 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Why would someone not want to use TLS? Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-09-19 23:43:09 UTC (rev 17324) +++ trunk/libgaim/protocols/jabber/auth.c 2006-09-19 23:46:17 UTC (rev 17325) @@ -41,17 +41,12 @@ xmlnode *starttls; if((starttls = xmlnode_get_child(packet, "starttls"))) { - if(gaim_account_get_bool(js->gc->account, "use_tls", TRUE) && - gaim_ssl_is_supported()) { + if(gaim_ssl_is_supported()) { jabber_send_raw(js, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1); return TRUE; } else if(xmlnode_get_child(starttls, "required")) { - if(gaim_ssl_is_supported()) { - gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. Select \"Use TLS if available\" in account properties")); - } else { - gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. No TLS/SSL support found.")); - } + gaim_connection_error(js->gc, _("Server requires TLS/SSL for login. No TLS/SSL support found.")); return TRUE; } } Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:43:09 UTC (rev 17324) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:46:17 UTC (rev 17325) @@ -1961,11 +1961,6 @@ split = gaim_account_user_split_new(_("Resource"), "Home", '/'); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); - option = gaim_account_option_bool_new(_("Use TLS if available"), "use_tls", - TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, - option); - option = gaim_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-19 23:43:11
|
Revision: 17324 http://svn.sourceforge.net/gaim/?rev=17324&view=rev Author: thekingant Date: 2006-09-19 16:43:09 -0700 (Tue, 19 Sep 2006) Log Message: ----------- This "Require TLS" option isn't used anywhere... Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:27:17 UTC (rev 17323) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-19 23:43:09 UTC (rev 17324) @@ -1966,9 +1966,6 @@ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - option = gaim_account_option_bool_new(_("Require TLS"), "require_tls", TRUE); - prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); - option = gaim_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-09-19 23:27:23
|
Revision: 17323 http://svn.sourceforge.net/gaim/?rev=17323&view=rev Author: rlaager Date: 2006-09-19 16:27:17 -0700 (Tue, 19 Sep 2006) Log Message: ----------- SF Patch #1561792 from Mike Stoddard "The Novell prpl is currently not functional in the trunk. It is crashing in novell_login. This patch fixes it." Modified Paths: -------------- trunk/libgaim/protocols/novell/novell.c Modified: trunk/libgaim/protocols/novell/novell.c =================================================================== --- trunk/libgaim/protocols/novell/novell.c 2006-09-19 22:53:47 UTC (rev 17322) +++ trunk/libgaim/protocols/novell/novell.c 2006-09-19 23:27:17 UTC (rev 17323) @@ -1722,10 +1722,6 @@ if ((user == NULL) || (conn = user->conn) == NULL) return; - conn->ssl_conn = g_new0(NMSSLConn, 1); - conn->ssl_conn->read = (nm_ssl_read_cb) gaim_ssl_read; - conn->ssl_conn->write = (nm_ssl_write_cb) gaim_ssl_write; - gaim_connection_update_progress(gc, _("Authenticating..."), 2, NOVELL_CONNECT_STEPS); @@ -2181,7 +2177,7 @@ name = gaim_account_get_username(account); user = nm_initialize_user(name, server, port, account, _event_callback); - if (user) { + if (user && user->conn) { /* save user */ gc->proto_data = user; @@ -2190,9 +2186,14 @@ 1, NOVELL_CONNECT_STEPS); user->conn->use_ssl = TRUE; + + user->conn->ssl_conn = g_new0(NMSSLConn, 1); + user->conn->ssl_conn->read = (nm_ssl_read_cb) gaim_ssl_read; + user->conn->ssl_conn->write = (nm_ssl_write_cb) gaim_ssl_write; + user->conn->ssl_conn->data = gaim_ssl_connect(user->client_data, - user->conn->addr, user->conn->port, - novell_ssl_connected_cb, novell_ssl_connect_error, gc); + user->conn->addr, user->conn->port, + novell_ssl_connected_cb, novell_ssl_connect_error, gc); if (user->conn->ssl_conn->data == NULL) { gaim_connection_error(gc, _("Error." " SSL support is not installed.")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |