comparison src/gtkstatusbox.c @ 12256:0eed625872f7

[gaim-migrate @ 14558] When using GTK+ 2.2.1, starting Gaim would pop up 10 "Custom status" dialogs because clearing the non-per-account statusboxes to turn them into per-account statusboxes triggered every status in it. This fixes that by unsetting the model before screwing with it. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 29 Nov 2005 18:25:12 +0000
parents 65477e67a712
children 6e55515e4b39
comparison
equal deleted inserted replaced
12255:e0b512d67792 12256:0eed625872f7
179 if (statusbox->status_changed_signal) { 179 if (statusbox->status_changed_signal) {
180 gaim_signal_disconnect(gaim_accounts_get_handle(), "account-status-changed", 180 gaim_signal_disconnect(gaim_accounts_get_handle(), "account-status-changed",
181 statusbox, GAIM_CALLBACK(account_status_changed_cb)); 181 statusbox, GAIM_CALLBACK(account_status_changed_cb));
182 statusbox->status_changed_signal = 0; 182 statusbox->status_changed_signal = 0;
183 } 183 }
184
184 if (statusbox->account) 185 if (statusbox->account)
185 statusbox->status_changed_signal = gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", 186 statusbox->status_changed_signal = gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed",
186 statusbox, GAIM_CALLBACK(account_status_changed_cb), 187 statusbox, GAIM_CALLBACK(account_status_changed_cb),
187 statusbox); 188 statusbox);
188 gtk_gaim_status_box_regenerate(statusbox); 189 gtk_gaim_status_box_regenerate(statusbox);
190
189 break; 191 break;
190 default: 192 default:
191 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec); 193 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
192 break; 194 break;
193 } 195 }
381 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4; 383 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4;
382 GtkIconSize icon_size; 384 GtkIconSize icon_size;
383 385
384 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); 386 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS);
385 387
388 /* Unset the model while clearing it */
389 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), NULL);
386 gtk_list_store_clear(status_box->dropdown_store); 390 gtk_list_store_clear(status_box->dropdown_store);
387 391 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store));
392
388 account = GTK_GAIM_STATUS_BOX(status_box)->account; 393 account = GTK_GAIM_STATUS_BOX(status_box)->account;
389 if (account == NULL) 394 if (account == NULL)
390 { 395 {
391 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_ONLINE, 396 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_ONLINE,
392 icon_size, "GtkGaimStatusBox"); 397 icon_size, "GtkGaimStatusBox");
423 gaim_status_type_get_name(status_type), 428 gaim_status_type_get_name(status_type),
424 NULL); 429 NULL);
425 } 430 }
426 update_to_reflect_account_status(status_box, account, gaim_account_get_active_status(account)); 431 update_to_reflect_account_status(status_box, account, gaim_account_get_active_status(account));
427 } 432 }
428
429 } 433 }
430 434
431 static gboolean scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml) 435 static gboolean scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml)
432 { 436 {
433 if (event->direction == GDK_SCROLL_UP) 437 if (event->direction == GDK_SCROLL_UP)