# HG changeset patch # User Luke Schierer # Date 1049378743 0 # Node ID 307c16c4b57e2545edfae1aba95f25ebc31018d4 # Parent 503f61301b810c6d82ce0bdf3c5eb4b16469d9d6 [gaim-migrate @ 5313] (08:55:48) Robot101: patch to: (08:56:07) Robot101: * make online buddies appear black, not grey, when you have 'show offline buddies' turned on (08:56:21) Robot101: * random cleanup in buddy.c (tooltip/timer freeing) (08:56:43) Robot101: * stop the add buddy dialog resetting your choice of group when you choose an account (08:57:03) Robot101: * fix little memleak when loading the default window icon (08:57:16) Robot101: * make the main window use the default instead of loading the same icon itself (08:57:42) Robot101: * make the manual browser pref validate and save when the entry widget loses focus, not with a crappy button committer: Tailor Script diff -r 503f61301b81 -r 307c16c4b57e src/buddy.c --- a/src/buddy.c Thu Apr 03 14:04:02 2003 +0000 +++ b/src/buddy.c Thu Apr 03 14:05:43 2003 +0000 @@ -617,15 +617,15 @@ static void gaim_gtk_blist_leave_cb (GtkWidget *w, GdkEventCrossing *e, gpointer n) { - if (gtkblist->timeout == 0) - return; + if (gtkblist->timeout) { + g_source_remove(gtkblist->timeout); + gtkblist->timeout = 0; + } if (gtkblist->tipwindow) { gtk_widget_destroy(gtkblist->tipwindow); gtkblist->tipwindow = NULL; } - g_source_remove(gtkblist->timeout); - gtkblist->timeout = 0; -} +} /*************************************************** * Crap * @@ -948,7 +948,7 @@ time_t t; if (!(blist_options & OPT_BLIST_SHOW_ICONS)) { - if ((b->idle > 0 && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || blist_options & OPT_BLIST_SHOW_OFFLINE) { + if ((b->idle > 0 && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || b->present == 0) { text = g_strdup_printf("%s", esc); g_free(esc); diff -r 503f61301b81 -r 307c16c4b57e src/dialogs.c --- a/src/dialogs.c Thu Apr 03 14:04:02 2003 +0000 +++ b/src/dialogs.c Thu Apr 03 14:05:43 2003 +0000 @@ -956,7 +956,7 @@ } -static GList *groups_tree(struct gaim_connection *gc) +static GList *groups_tree() { GList *tmp = NULL; char *tmp2; @@ -1047,9 +1047,6 @@ /* Save our account */ b->gc = gc; - - /* We also want to update our group list */ - gtk_combo_set_popdown_strings(GTK_COMBO(b->combo), groups_tree(gc)); } static void create_online_user_names(struct addbuddy *b) @@ -1181,7 +1178,7 @@ gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); a->combo = gtk_combo_new(); - gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree(a->gc)); + gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree()); gtk_table_attach_defaults(GTK_TABLE(table), a->combo, 1, 2, 2, 3); /* Set up stuff for the account box */ diff -r 503f61301b81 -r 307c16c4b57e src/main.c --- a/src/main.c Thu Apr 03 14:04:02 2003 +0000 +++ b/src/main.c Thu Apr 03 14:05:43 2003 +0000 @@ -286,7 +286,6 @@ void show_login() { - GdkPixbuf *icon; GtkWidget *image; GtkWidget *vbox; GtkWidget *button; @@ -294,6 +293,7 @@ GtkWidget *label; GtkWidget *vbox2; GList *tmp; + char *filename; /* Do we already have a main window opened? If so, bring it back, baby... ribs... yeah */ if (mainwindow) { @@ -312,17 +312,12 @@ g_signal_connect(G_OBJECT(mainwindow), "delete_event", G_CALLBACK(login_window_closed), mainwindow); - - icon = gaim_pixbuf(NULL, "gaim.png"); - if (icon) { - gtk_window_set_icon(GTK_WINDOW(mainwindow), icon); - g_object_unref(G_OBJECT(icon)); - } - vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(mainwindow), vbox); - image = gaim_pixmap(NULL, "logo.png"); + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL); + image = gtk_image_new_from_file(filename); + g_free(filename); gtk_box_pack_start(GTK_BOX(vbox), image, FALSE, FALSE, 0); vbox2 = gtk_vbox_new(FALSE, 0); @@ -530,6 +525,7 @@ GdkPixbuf *icon = NULL; char *icon_path; #endif + if (current_smiley_theme == NULL) { smiley_theme_probe(); if (smiley_themes) { @@ -549,8 +545,9 @@ icons = g_list_append(icons,icon); gtk_window_set_default_icon_list(icons); g_object_unref(G_OBJECT(icon)); + g_list_free(icons); } else { - debug_printf("Failed to load icon from %s" G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "gaim.png\n",DATADIR); + debug_printf("Failed to load default window icon!\n"); } g_snprintf(name, sizeof(name), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session); @@ -561,6 +558,7 @@ channel = g_io_channel_unix_new(UI_fd); g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, socket_readable, NULL); #endif + return 0; } diff -r 503f61301b81 -r 307c16c4b57e src/prefs.c --- a/src/prefs.c Thu Apr 03 14:04:02 2003 +0000 +++ b/src/prefs.c Thu Apr 03 14:05:43 2003 +0000 @@ -812,9 +812,9 @@ } #ifndef _WIN32 -static void manual_browser_set(GtkButton *button, GtkEntry *entry) { - - const char *program = gtk_entry_get_text(entry); +static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { + const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); + if (!program_is_valid(program)) { char *error = g_strdup_printf(_("The entered manual browser " "'%s' is not valid. Hyperlinks will " @@ -823,10 +823,9 @@ } g_strlcpy(web_command, program, sizeof(web_command)); -} - -static void manual_browser_reset(GtkButton *button, GtkEntry *entry) { - gtk_entry_set_text(entry, web_command); + + /* carry on normally */ + return FALSE; } static GList *get_available_browsers() @@ -890,6 +889,7 @@ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_size_group_add_widget(sg, label); + browser_entry = gtk_entry_new(); gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); if (web_browser != BROWSER_MANUAL) @@ -897,16 +897,7 @@ gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); - g_signal_connect_swapped(GTK_OBJECT(browser_entry), "activate", - G_CALLBACK(manual_browser_set), NULL); - label = gtk_button_new_with_label(_("Set")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - g_signal_connect(GTK_OBJECT(label), "clicked", - G_CALLBACK(manual_browser_set), browser_entry); - label = gtk_button_new_with_label(_("Reset")); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - g_signal_connect(GTK_OBJECT(label), "clicked", - G_CALLBACK(manual_browser_reset), browser_entry); + g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); if (browsers != NULL) { vbox = make_frame (ret, _("Browser Options"));