# HG changeset patch # User Mark Doliner # Date 1185260310 0 # Node ID 1b032e320dbfc3d7866fffbf52062625e43731b9 # Parent f79b6bb6bb5f23f4196cefdba9f188503c0688de# Parent 9eb399e7cacd7ae0fa2f9da690d4c4e658971f31 merge of '59d4e50c5c3aa15eb6c2f90c182fa455ec83dccb' and 'ab82e7bb3b529a40d48c87899901054b2f4b490b' diff -r f79b6bb6bb5f -r 1b032e320dbf finch/gntblist.c --- a/finch/gntblist.c Tue Jul 24 06:57:38 2007 +0000 +++ b/finch/gntblist.c Tue Jul 24 06:58:30 2007 +0000 @@ -354,11 +354,13 @@ PurpleGroup *grp; GHashTable *hash = NULL; PurpleConnection *gc; + gboolean autojoin; account = purple_request_fields_get_account(allfields, "account"); name = purple_request_fields_get_string(allfields, "name"); alias = purple_request_fields_get_string(allfields, "alias"); group = purple_request_fields_get_string(allfields, "group"); + autojoin = purple_request_fields_get_bool(allfields, "autojoin"); if (!purple_account_is_connected(account) || !name || !*name) return; @@ -380,6 +382,9 @@ } purple_blist_add_chat(chat, grp, NULL); purple_blist_alias_chat(chat, alias); + purple_blist_node_set_bool((PurpleBlistNode*)chat, "gnt-autojoin", autojoin); + if (autojoin) + serv_join_chat(chat->account->gc, chat->components); } } @@ -407,6 +412,9 @@ field = purple_request_field_string_new("group", _("Group"), grp ? grp->name : NULL, FALSE); purple_request_field_group_add_field(group, field); + field = purple_request_field_bool_new("autojoin", _("Auto-join"), FALSE); + purple_request_field_group_add_field(group, field); + purple_request_fields(NULL, _("Add Chat"), NULL, _("You can edit more information from the context menu later."), fields, _("Add"), G_CALLBACK(add_chat_cb), _("Cancel"), NULL, diff -r f79b6bb6bb5f -r 1b032e320dbf libpurple/plugin.c --- a/libpurple/plugin.c Tue Jul 24 06:57:38 2007 +0000 +++ b/libpurple/plugin.c Tue Jul 24 06:58:30 2007 +0000 @@ -692,7 +692,10 @@ dependency = purple_plugins_find_with_id(dep_name); - dependency->dependent_plugins = g_list_remove(dependency->dependent_plugins, plugin->info->id); + if (dependency != NULL) + dependency->dependent_plugins = g_list_remove(dependency->dependent_plugins, plugin->info->id); + else + purple_debug_error("plugins", "Unable to remove from dependency list for %s\n", dep_name); } if (plugin->native_plugin) { diff -r f79b6bb6bb5f -r 1b032e320dbf libpurple/purple-remote --- a/libpurple/purple-remote Tue Jul 24 06:57:38 2007 +0000 +++ b/libpurple/purple-remote Tue Jul 24 06:58:30 2007 +0000 @@ -59,7 +59,7 @@ quit PurpleAccountsFindConnected?name=&protocol=prpl-jabber - PurpleAccountFindConnected(,prpl-jabber) + PurpleAccountsFindConnected(,prpl-jabber) """ % sys.argv[0] cpurple = CheckedObject(purple) diff -r f79b6bb6bb5f -r 1b032e320dbf pidgin/gtkconv.c --- a/pidgin/gtkconv.c Tue Jul 24 06:57:38 2007 +0000 +++ b/pidgin/gtkconv.c Tue Jul 24 06:58:30 2007 +0000 @@ -8269,8 +8269,8 @@ return FALSE; /* carry on normally */ /* store the position */ - purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/x", x); - purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/y", y); + purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/x", x); + purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/y", y); purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/width", event->width); purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/im/height", event->height); @@ -8279,6 +8279,38 @@ } +static void +pidgin_conv_restore_position(PidginWindow *win) { + int conv_x, conv_y, conv_width, conv_height; + + conv_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"); + + /* if the window exists, is hidden, we're saving positions, and the + * position is sane... */ + if (win && win->window && + !GTK_WIDGET_VISIBLE(win->window) && conv_width != 0) { + + conv_x = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/x"); + conv_y = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/y"); + conv_height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height"); + + /* ...check position is on screen... */ + if (conv_x >= gdk_screen_width()) + conv_x = gdk_screen_width() - 100; + else if (conv_x + conv_width < 0) + conv_x = 100; + + if (conv_y >= gdk_screen_height()) + conv_y = gdk_screen_height() - 100; + else if (conv_y + conv_height < 0) + conv_y = 100; + + /* ...and move it back. */ + gtk_window_move(GTK_WINDOW(win->window), conv_x, conv_y); + gtk_window_resize(GTK_WINDOW(win->window), conv_width, conv_height); + } +} + PidginWindow * pidgin_conv_window_new() { @@ -8293,8 +8325,7 @@ /* Create the window. */ win->window = pidgin_create_window(NULL, 0, "conversation", TRUE); - gtk_window_set_default_size(GTK_WINDOW(win->window), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/width"), - purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/im/height")); + pidgin_conv_restore_position(win); if (available_list == NULL) { create_icon_lists(win->window); @@ -8622,7 +8653,7 @@ TRUE, GTK_PACK_START); /* show the widgets */ -/* XXX gtk_widget_show(gtkconv->icon); */ + gtk_widget_show(gtkconv->icon); gtk_widget_show(gtkconv->tab_label); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/close_on_tabs")) gtk_widget_show(gtkconv->close); diff -r f79b6bb6bb5f -r 1b032e320dbf pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Tue Jul 24 06:57:38 2007 +0000 +++ b/pidgin/gtkrequest.c Tue Jul 24 06:58:30 2007 +0000 @@ -581,9 +581,14 @@ /* Create the dialog. */ data->dialog = dialog = gtk_dialog_new(); +#if GTK_CHECK_VERSION(2,10,0) + gtk_window_set_deletable(GTK_WINDOW(data->dialog), FALSE); +#endif + if (title != NULL) gtk_window_set_title(GTK_WINDOW(dialog), title); #ifdef _WIN32 + else gtk_window_set_title(GTK_WINDOW(dialog), PIDGIN_ALERT_TITLE); #endif diff -r f79b6bb6bb5f -r 1b032e320dbf pidgin/plugins/gtkbuddynote.c --- a/pidgin/plugins/gtkbuddynote.c Tue Jul 24 06:57:38 2007 +0000 +++ b/pidgin/plugins/gtkbuddynote.c Tue Jul 24 06:58:30 2007 +0000 @@ -107,8 +107,6 @@ bninfo->flags = PURPLE_PLUGIN_FLAG_INVISIBLE; - info.dependencies = g_list_append(info.dependencies, - "core-plugin_pack-buddynote"); /* If non-gtk buddy note plugin is loaded, but we are not, then load * ourselves, otherwise people upgrading from pre-gtkbuddynote days @@ -134,6 +132,9 @@ /* Use g_idle_add so that the rest of the plugins can get loaded * before we do our check. */ g_idle_add(check_for_buddynote, plugin); + + info.dependencies = g_list_append(info.dependencies, + "core-plugin_pack-buddynote"); } PURPLE_INIT_PLUGIN(gtkbuddynote, init_plugin, info)