From: <sa...@us...> - 2006-10-29 03:43:29
|
Revision: 17616 http://svn.sourceforge.net/gaim/?rev=17616&view=rev Author: sadrul Date: 2006-10-28 20:43:15 -0700 (Sat, 28 Oct 2006) Log Message: ----------- Fix bug #1582629. The terminal should now always go back to normal state after quitting from gaim-text. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntgaim.c trunk/console/gntui.c trunk/console/gntui.h trunk/console/libgnt/gntwidget.c trunk/console/libgnt/wms/s.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/gntblist.c 2006-10-29 03:43:15 UTC (rev 17616) @@ -101,6 +101,7 @@ static void remove_peripherals(GGBlist *ggblist); static const char * get_display_name(GaimBlistNode *node); static void savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old); +static void blist_show(GaimBuddyList *list); /* Sort functions */ static int blist_node_compare_text(GaimBlistNode *n1, GaimBlistNode *n2); @@ -228,6 +229,11 @@ static void new_list(GaimBuddyList *list) { + if (ggblist) + return; + + ggblist = g_new0(GGBlist, 1); + list->ui_data = ggblist; } static void @@ -398,7 +404,7 @@ { new_list, new_node, - NULL, + blist_show, node_update, node_remove, NULL, @@ -1470,8 +1476,6 @@ gaim_prefs_add_bool(PREF_ROOT "/showoffline", FALSE); gaim_prefs_add_string(PREF_ROOT "/sort_type", "text"); - gg_blist_show(); - gaim_prefs_connect_callback(gg_blist_get_handle(), PREF_ROOT "/showoffline", redraw_blist, NULL); gaim_prefs_connect_callback(gg_blist_get_handle(), @@ -1851,13 +1855,17 @@ void gg_blist_show() { - if (ggblist) + blist_show(gaim_get_blist()); +} + +static void +blist_show(GaimBuddyList *list) +{ + if (ggblist == NULL) + new_list(list); + else if (ggblist->window) return; - ggblist = g_new0(GGBlist, 1); - - gaim_get_blist()->ui_data = ggblist; - ggblist->window = gnt_vwindow_new(FALSE); gnt_widget_set_name(ggblist->window, "buddylist"); gnt_box_set_toplevel(GNT_BOX(ggblist->window), TRUE); Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/gntgaim.c 2006-10-29 03:43:15 UTC (rev 17616) @@ -57,8 +57,8 @@ { gg_prefs_init, debug_init, - NULL, /*gaim_gtk_ui_init,*/ - NULL, /*gaim_gtk_quit*/ + gnt_ui_init, + gnt_ui_uninit }; static GaimCoreUiOps * @@ -332,8 +332,9 @@ if (!init_libgaim(argc, argv)) return 0; - /* Initialize and run the UI */ - init_gnt_ui(); + gaim_blist_show(); + gnt_main(); + #ifdef STANDALONE gaim_core_quit(); #endif Modified: trunk/console/gntui.c =================================================================== --- trunk/console/gntui.c 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/gntui.c 2006-10-29 03:43:15 UTC (rev 17616) @@ -36,7 +36,7 @@ #include <prefs.h> -void init_gnt_ui() +void gnt_ui_init() { #ifdef STANDALONE gnt_init(); @@ -77,9 +77,10 @@ #ifdef STANDALONE gg_plugins_save_loaded(); +} - gnt_main(); - +void gnt_ui_uninit() +{ gaim_accounts_set_ui_ops(NULL); gg_accounts_uninit(); Modified: trunk/console/gntui.h =================================================================== --- trunk/console/gntui.h 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/gntui.h 2006-10-29 03:43:15 UTC (rev 17616) @@ -24,6 +24,7 @@ #include "gnt.h" -void init_gnt_ui(void); +void gnt_ui_init(void); +void gnt_ui_uninit(void); #endif Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/libgnt/gntwidget.c 2006-10-29 03:43:15 UTC (rev 17616) @@ -581,6 +581,10 @@ width--; height--; } + if (width <= 0) + width = widget->priv.width; + if (height <= 0) + height = widget->priv.height; if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_MAPPED)) { Modified: trunk/console/libgnt/wms/s.c =================================================================== --- trunk/console/libgnt/wms/s.c 2006-10-29 01:32:04 UTC (rev 17615) +++ trunk/console/libgnt/wms/s.c 2006-10-29 03:43:15 UTC (rev 17616) @@ -76,7 +76,7 @@ gnt_widget_set_position(win, x, y); mvwin(win->window, y, x); - gnt_widget_set_size(win, w, h); + gnt_widget_set_size(win, -1, h); gnt_widget_draw(win); envelope_buddylist(win); } else if (name && strcmp(name, "conversation-window") == 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |