Mercurial > pidgin.yaz
comparison src/gtkaccount.c @ 9482:b917acdc982f
[gaim-migrate @ 10307]
Alright, the buddy icon selector is done. It should rock now.
I also made a few tweaks to the debug save window.
gaim_notify_close_with_handle() and gaim_request_close_with_handle()
are sweet.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 08 Jul 2004 04:07:23 +0000 |
parents | d0380151c6d1 |
children | 27a595d413ff |
comparison
equal
deleted
inserted
replaced
9481:683660b4efeb | 9482:b917acdc982f |
---|---|
115 GtkWidget *auto_login_check; | 115 GtkWidget *auto_login_check; |
116 | 116 |
117 /* User Options */ | 117 /* User Options */ |
118 GtkWidget *user_frame; | 118 GtkWidget *user_frame; |
119 GtkWidget *new_mail_check; | 119 GtkWidget *new_mail_check; |
120 GtkWidget *buddy_icon_hbox; | 120 GtkWidget *icon_hbox; |
121 GtkWidget *buddy_icon_entry; | 121 GtkWidget *icon_entry; |
122 char *buddy_icon_path; | 122 char *icon_path; |
123 GtkWidget *buddy_icon_filesel; | 123 GtkWidget *icon_filesel; |
124 GtkWidget *buddy_icon_preview; | 124 GtkWidget *icon_preview; |
125 GtkWidget *buddy_icon_text; | 125 GtkWidget *icon_text; |
126 | 126 |
127 /* Protocol Options */ | 127 /* Protocol Options */ |
128 GtkWidget *protocol_frame; | 128 GtkWidget *protocol_frame; |
129 | 129 |
130 /* Proxy Options */ | 130 /* Proxy Options */ |
246 gtk_widget_set_sensitive(dialog->register_button, | 246 gtk_widget_set_sensitive(dialog->register_button, |
247 *gtk_entry_get_text(entry) != '\0'); | 247 *gtk_entry_get_text(entry) != '\0'); |
248 | 248 |
249 } | 249 } |
250 | 250 |
251 static void | 251 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ |
252 buddy_icon_filesel_delete_cb(GtkWidget *w, AccountPrefsDialog *dialog) | 252 static void |
253 { | 253 icon_filesel_choose_cb(GtkWidget *widget, gint response, AccountPrefsDialog *dialog) |
254 if (dialog->buddy_icon_filesel != NULL) | |
255 gtk_widget_destroy(dialog->buddy_icon_filesel); | |
256 | |
257 dialog->buddy_icon_filesel = NULL; | |
258 } | |
259 | |
260 static void | |
261 buddy_icon_filesel_choose(GtkWidget *w, AccountPrefsDialog *dialog) | |
262 { | 254 { |
263 const char *filename; | 255 const char *filename; |
264 | 256 |
257 if (response != GTK_RESPONSE_ACCEPT) { | |
258 if (response == GTK_RESPONSE_CANCEL) | |
259 gtk_widget_destroy(dialog->icon_filesel); | |
260 dialog->icon_filesel = NULL; | |
261 return; | |
262 } | |
263 | |
264 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog->icon_filesel)); | |
265 #else /* FILECHOOSER */ | |
266 static void | |
267 icon_filesel_choose_cb(GtkWidget *w, AccountPrefsDialog *dialog) | |
268 { | |
269 const char *filename; | |
270 | |
265 filename = gtk_file_selection_get_filename( | 271 filename = gtk_file_selection_get_filename( |
266 GTK_FILE_SELECTION(dialog->buddy_icon_filesel)); | 272 GTK_FILE_SELECTION(dialog->icon_filesel)); |
267 | 273 |
268 /* If they typed in a directory, change there */ | 274 /* If they typed in a directory, change there */ |
269 if (gaim_gtk_check_if_dir(filename, | 275 if (gaim_gtk_check_if_dir(filename, |
270 GTK_FILE_SELECTION(dialog->buddy_icon_filesel))) | 276 GTK_FILE_SELECTION(dialog->icon_filesel))) |
271 { | 277 { |
272 return; | 278 return; |
273 } | 279 } |
274 | 280 #endif /* FILECHOOSER */ |
275 if (dialog->buddy_icon_path) | 281 |
276 g_free(dialog->buddy_icon_path); | 282 if (dialog->icon_path) |
277 dialog->buddy_icon_path = g_strdup(filename); | 283 g_free(dialog->icon_path); |
278 gtk_image_set_from_file(GTK_IMAGE(dialog->buddy_icon_entry), filename); | 284 dialog->icon_path = g_strdup(filename); |
279 gtk_widget_show(dialog->buddy_icon_entry); | 285 gtk_image_set_from_file(GTK_IMAGE(dialog->icon_entry), filename); |
280 gtk_widget_destroy(dialog->buddy_icon_filesel); | 286 gtk_widget_show(dialog->icon_entry); |
281 } | 287 |
282 | 288 gtk_widget_destroy(dialog->icon_filesel); |
283 static void | 289 dialog->icon_filesel = NULL; |
284 buddy_icon_preview_change_cb(GtkTreeSelection *sel, AccountPrefsDialog *dialog) | 290 } |
291 | |
292 static void | |
293 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ | |
294 icon_preview_change_cb(GtkFileChooser *widget, AccountPrefsDialog *dialog) | |
295 #else /* FILECHOOSER */ | |
296 icon_preview_change_cb(GtkTreeSelection *sel, AccountPrefsDialog *dialog) | |
297 #endif /* FILECHOOSER */ | |
285 { | 298 { |
286 GdkPixbuf *pixbuf, *scale; | 299 GdkPixbuf *pixbuf, *scale; |
287 int height, width; | 300 int height, width; |
288 char *basename, *markup, *size; | 301 char *basename, *markup, *size; |
289 struct stat st; | 302 struct stat st; |
290 const char *filename; | 303 const char *filename; |
291 | 304 |
305 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ | |
306 filename = gtk_file_chooser_get_preview_filename( | |
307 GTK_FILE_CHOOSER(dialog->icon_filesel)); | |
308 #else /* FILECHOOSER */ | |
292 filename = gtk_file_selection_get_filename( | 309 filename = gtk_file_selection_get_filename( |
293 GTK_FILE_SELECTION(dialog->buddy_icon_filesel)); | 310 GTK_FILE_SELECTION(dialog->icon_filesel)); |
311 #endif /* FILECHOOSER */ | |
294 | 312 |
295 if (!filename || stat(filename, &st)) | 313 if (!filename || stat(filename, &st)) |
296 return; | 314 return; |
297 | 315 |
298 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); | 316 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
299 if (!pixbuf) { | 317 if (!pixbuf) { |
300 gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->buddy_icon_preview), NULL); | 318 gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_preview), NULL); |
301 gtk_label_set_markup(GTK_LABEL(dialog->buddy_icon_text), ""); | 319 gtk_label_set_markup(GTK_LABEL(dialog->icon_text), ""); |
320 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ | |
321 gtk_file_chooser_set_preview_widget_active( | |
322 GTK_FILE_CHOOSER(dialog->icon_filesel), FALSE); | |
323 #endif /* FILECHOOSER */ | |
302 return; | 324 return; |
303 } | 325 } |
304 | 326 |
305 width = gdk_pixbuf_get_width(pixbuf); | 327 width = gdk_pixbuf_get_width(pixbuf); |
306 height = gdk_pixbuf_get_height(pixbuf); | 328 height = gdk_pixbuf_get_height(pixbuf); |
311 "<b>Image size:</b> %dx%d"), | 333 "<b>Image size:</b> %dx%d"), |
312 basename, size, width, height); | 334 basename, size, width, height); |
313 | 335 |
314 scale = gdk_pixbuf_scale_simple(pixbuf, width * 50 / height, | 336 scale = gdk_pixbuf_scale_simple(pixbuf, width * 50 / height, |
315 50, GDK_INTERP_BILINEAR); | 337 50, GDK_INTERP_BILINEAR); |
316 gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->buddy_icon_preview), scale); | 338 gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_preview), scale); |
317 gtk_label_set_markup(GTK_LABEL(dialog->buddy_icon_text), markup); | 339 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ |
340 gtk_file_chooser_set_preview_widget_active( | |
341 GTK_FILE_CHOOSER(dialog->icon_filesel), TRUE); | |
342 #endif /* FILECHOOSER */ | |
343 gtk_label_set_markup(GTK_LABEL(dialog->icon_text), markup); | |
318 | 344 |
319 g_object_unref(G_OBJECT(pixbuf)); | 345 g_object_unref(G_OBJECT(pixbuf)); |
320 g_object_unref(G_OBJECT(scale)); | 346 g_object_unref(G_OBJECT(scale)); |
321 g_free(basename); | 347 g_free(basename); |
322 g_free(size); | 348 g_free(size); |
323 g_free(markup); | 349 g_free(markup); |
324 } | 350 } |
325 | 351 |
326 static void | 352 #if !GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ |
327 buddy_icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) | 353 static void |
328 { | 354 icon_filesel_delete_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
355 { | |
356 if (dialog->icon_filesel != NULL) | |
357 gtk_widget_destroy(dialog->icon_filesel); | |
358 | |
359 dialog->icon_filesel = NULL; | |
360 } | |
361 #endif /* FILECHOOSER */ | |
362 | |
363 static void | |
364 icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) | |
365 { | |
366 #if !GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ | |
329 GtkWidget *hbox; | 367 GtkWidget *hbox; |
330 GtkWidget *tv; | 368 GtkWidget *tv; |
331 GtkTreeSelection *sel; | 369 GtkTreeSelection *sel; |
332 | 370 #endif /* FILECHOOSER */ |
333 if (dialog->buddy_icon_filesel) | 371 |
334 { | 372 if (dialog->icon_filesel != NULL) { |
335 gtk_widget_show(GTK_WIDGET(dialog->buddy_icon_filesel)); | 373 gtk_window_present(GTK_WINDOW(dialog->icon_filesel)); |
336 gdk_window_raise(GDK_WINDOW(dialog->buddy_icon_filesel->window)); | |
337 return; | 374 return; |
338 } | 375 } |
339 | 376 |
340 dialog->buddy_icon_filesel = gtk_file_selection_new(_("Buddy Icon")); | 377 #if GTK_CHECK_VERSION(2,4,0) /* FILECHOOSER */ |
341 dialog->buddy_icon_preview = gtk_image_new(); | 378 dialog->icon_filesel = gtk_file_chooser_dialog_new(_("Buddy Icon"), |
342 dialog->buddy_icon_text = gtk_label_new(NULL); | 379 GTK_WINDOW(dialog->window), |
343 | 380 GTK_FILE_CHOOSER_ACTION_OPEN, |
344 gtk_widget_set_size_request(GTK_WIDGET(dialog->buddy_icon_preview), -1, 50); | 381 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
382 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, | |
383 NULL); | |
384 gtk_dialog_set_default_response(GTK_DIALOG(dialog->icon_filesel), GTK_RESPONSE_ACCEPT); | |
385 if (dialog->icon_path != NULL) | |
386 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog->icon_filesel), | |
387 dialog->icon_path); | |
388 dialog->icon_preview = gtk_image_new(); | |
389 dialog->icon_text = gtk_label_new(NULL); | |
390 gtk_widget_set_size_request(GTK_WIDGET(dialog->icon_preview), -1, 50); | |
391 gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(dialog->icon_filesel), | |
392 GTK_WIDGET(dialog->icon_preview)); | |
393 g_signal_connect(G_OBJECT(dialog->icon_filesel), "update-preview", | |
394 G_CALLBACK(icon_preview_change_cb), dialog); | |
395 g_signal_connect(G_OBJECT(dialog->icon_filesel), "response", | |
396 G_CALLBACK(icon_filesel_choose_cb), dialog); | |
397 icon_preview_change_cb(NULL, dialog); | |
398 #else /* FILECHOOSER */ | |
399 dialog->icon_filesel = gtk_file_selection_new(_("Buddy Icon")); | |
400 dialog->icon_preview = gtk_image_new(); | |
401 dialog->icon_text = gtk_label_new(NULL); | |
402 | |
403 gtk_widget_set_size_request(GTK_WIDGET(dialog->icon_preview), -1, 50); | |
345 hbox = gtk_hbox_new(FALSE, 6); | 404 hbox = gtk_hbox_new(FALSE, 6); |
346 gtk_box_pack_start( | 405 gtk_box_pack_start( |
347 GTK_BOX(GTK_FILE_SELECTION(dialog->buddy_icon_filesel)->main_vbox), | 406 GTK_BOX(GTK_FILE_SELECTION(dialog->icon_filesel)->main_vbox), |
348 hbox, FALSE, FALSE, 0); | 407 hbox, FALSE, FALSE, 0); |
349 gtk_box_pack_end(GTK_BOX(hbox), dialog->buddy_icon_preview, | 408 gtk_box_pack_end(GTK_BOX(hbox), dialog->icon_preview, |
350 FALSE, FALSE, 0); | 409 FALSE, FALSE, 0); |
351 gtk_box_pack_end(GTK_BOX(hbox), dialog->buddy_icon_text, FALSE, FALSE, 0); | 410 gtk_box_pack_end(GTK_BOX(hbox), dialog->icon_text, FALSE, FALSE, 0); |
352 | 411 |
353 tv = GTK_FILE_SELECTION(dialog->buddy_icon_filesel)->file_list; | 412 tv = GTK_FILE_SELECTION(dialog->icon_filesel)->file_list; |
354 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); | 413 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); |
355 | 414 |
356 g_signal_connect(G_OBJECT(sel), "changed", | 415 g_signal_connect(G_OBJECT(sel), "changed", |
357 G_CALLBACK(buddy_icon_preview_change_cb), dialog); | 416 G_CALLBACK(icon_preview_change_cb), dialog); |
358 | |
359 g_signal_connect(G_OBJECT(dialog->buddy_icon_filesel), "destroy", | |
360 G_CALLBACK(buddy_icon_filesel_delete_cb), dialog); | |
361 g_signal_connect( | 417 g_signal_connect( |
362 G_OBJECT(GTK_FILE_SELECTION(dialog->buddy_icon_filesel)->cancel_button), | 418 G_OBJECT(GTK_FILE_SELECTION(dialog->icon_filesel)->ok_button), |
363 "clicked", | 419 "clicked", |
364 G_CALLBACK(buddy_icon_filesel_delete_cb), dialog); | 420 G_CALLBACK(icon_filesel_choose_cb), dialog); |
365 g_signal_connect( | 421 g_signal_connect( |
366 G_OBJECT(GTK_FILE_SELECTION(dialog->buddy_icon_filesel)->ok_button), | 422 G_OBJECT(GTK_FILE_SELECTION(dialog->icon_filesel)->cancel_button), |
367 "clicked", | 423 "clicked", |
368 G_CALLBACK(buddy_icon_filesel_choose), dialog); | 424 G_CALLBACK(icon_filesel_delete_cb), dialog); |
369 | 425 g_signal_connect(G_OBJECT(dialog->icon_filesel), "destroy", |
370 gtk_widget_show_all(GTK_WIDGET(dialog->buddy_icon_filesel)); | 426 G_CALLBACK(icon_filesel_delete_cb), dialog); |
371 | 427 #endif /* FILECHOOSER */ |
372 /* | 428 |
373 The user doesn't know where his buddy icon is located anymore | 429 gtk_widget_show_all(GTK_WIDGET(dialog->icon_filesel)); |
374 if (dialog->account && | 430 } |
375 (gaim_account_get_buddy_icon(dialog->account) != NULL)) | 431 |
376 { | 432 static void |
377 gtk_file_selection_set_filename( | 433 icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
378 GTK_FILE_SELECTION(dialog->buddy_icon_filesel), | 434 { |
379 gaim_account_get_buddy_icon(dialog->account)); | 435 if (dialog->icon_path) |
380 | 436 g_free(dialog->icon_path); |
381 buddy_icon_preview_change_cb(NULL, dialog); | 437 dialog->icon_path = NULL; |
382 } | 438 |
383 */ | 439 gtk_widget_hide(dialog->icon_entry); |
384 } | |
385 | |
386 static void | |
387 buddy_icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) | |
388 { | |
389 if (dialog->buddy_icon_path) | |
390 g_free(dialog->buddy_icon_path); | |
391 dialog->buddy_icon_path = NULL; | |
392 gtk_widget_hide(dialog->buddy_icon_entry); | |
393 /*gtk_image_set_from_file(GTK_IMAGE(dialog->buddy_icon_entry), "");*/ | |
394 } | 440 } |
395 | 441 |
396 | 442 |
397 static void | 443 static void |
398 account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, | 444 account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, |
414 "g_filename_from_uri error")); | 460 "g_filename_from_uri error")); |
415 return; | 461 return; |
416 } | 462 } |
417 if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) | 463 if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) |
418 *rtmp = '\0'; | 464 *rtmp = '\0'; |
419 if (dialog->buddy_icon_path) | 465 if (dialog->icon_path) |
420 g_free(dialog->buddy_icon_path); | 466 g_free(dialog->icon_path); |
421 printf("Really huh? %s\n", tmp); | 467 dialog->icon_path = g_strdup(tmp); |
422 dialog->buddy_icon_path = g_strdup(tmp); | 468 gtk_image_set_from_file(GTK_IMAGE(dialog->icon_entry), tmp); |
423 gtk_image_set_from_file(GTK_IMAGE(dialog->buddy_icon_entry), tmp); | 469 gtk_widget_show(dialog->icon_entry); |
424 gtk_widget_show(dialog->buddy_icon_entry); | |
425 g_free(tmp); | 470 g_free(tmp); |
426 } | 471 } |
427 gtk_drag_finish(dc, TRUE, FALSE, t); | 472 gtk_drag_finish(dc, TRUE, FALSE, t); |
428 } | 473 } |
429 gtk_drag_finish(dc, FALSE, FALSE, t); | 474 gtk_drag_finish(dc, FALSE, FALSE, t); |
733 gtk_check_button_new_with_label(_("New mail notifications")); | 778 gtk_check_button_new_with_label(_("New mail notifications")); |
734 gtk_box_pack_start(GTK_BOX(vbox), dialog->new_mail_check, FALSE, FALSE, 0); | 779 gtk_box_pack_start(GTK_BOX(vbox), dialog->new_mail_check, FALSE, FALSE, 0); |
735 gtk_widget_show(dialog->new_mail_check); | 780 gtk_widget_show(dialog->new_mail_check); |
736 | 781 |
737 /* Buddy icon */ | 782 /* Buddy icon */ |
738 dialog->buddy_icon_hbox = hbox = gtk_hbox_new(FALSE, 6); | 783 dialog->icon_hbox = hbox = gtk_hbox_new(FALSE, 6); |
739 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 784 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
740 gtk_widget_show(hbox); | 785 gtk_widget_show(hbox); |
741 | 786 |
742 label = gtk_label_new(_("Buddy icon:")); | 787 label = gtk_label_new(_("Buddy icon:")); |
743 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); | 788 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); |
744 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | 789 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
745 gtk_widget_show(label); | 790 gtk_widget_show(label); |
746 | 791 |
747 dialog->buddy_icon_entry = gtk_image_new(); | 792 dialog->icon_entry = gtk_image_new(); |
748 gtk_box_pack_start(GTK_BOX(hbox), dialog->buddy_icon_entry, | 793 gtk_box_pack_start(GTK_BOX(hbox), dialog->icon_entry, |
749 FALSE, FALSE, 0); | 794 FALSE, FALSE, 0); |
750 gtk_widget_show(dialog->buddy_icon_entry); | 795 gtk_widget_show(dialog->icon_entry); |
751 gaim_set_accessible_label (dialog->buddy_icon_entry, label); | 796 gaim_set_accessible_label (dialog->icon_entry, label); |
752 dialog->buddy_icon_path = NULL; | 797 dialog->icon_path = NULL; |
753 | 798 |
754 vbox2 = gtk_vbox_new(FALSE, 0); | 799 vbox2 = gtk_vbox_new(FALSE, 0); |
755 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); | 800 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); |
756 gtk_widget_show(vbox2); | 801 gtk_widget_show(vbox2); |
757 | 802 |
760 gtk_widget_show(hbox2); | 805 gtk_widget_show(hbox2); |
761 | 806 |
762 button = gtk_button_new_from_stock(GTK_STOCK_OPEN); | 807 button = gtk_button_new_from_stock(GTK_STOCK_OPEN); |
763 gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); | 808 gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); |
764 g_signal_connect(G_OBJECT(button), "clicked", | 809 g_signal_connect(G_OBJECT(button), "clicked", |
765 G_CALLBACK(buddy_icon_select_cb), dialog); | 810 G_CALLBACK(icon_select_cb), dialog); |
766 gtk_widget_show(button); | 811 gtk_widget_show(button); |
767 | 812 |
768 button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); | 813 button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
769 g_signal_connect(G_OBJECT(button), "clicked", | 814 g_signal_connect(G_OBJECT(button), "clicked", |
770 G_CALLBACK(buddy_icon_reset_cb), dialog); | 815 G_CALLBACK(icon_reset_cb), dialog); |
771 gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); | 816 gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); |
772 gtk_widget_show(button); | 817 gtk_widget_show(button); |
773 | 818 |
774 if (dialog->prpl_info != NULL) { | 819 if (dialog->prpl_info != NULL) { |
775 if (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK)) | 820 if (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK)) |
776 gtk_widget_hide(dialog->new_mail_check); | 821 gtk_widget_hide(dialog->new_mail_check); |
777 | 822 |
778 if (!(dialog->prpl_info->icon_spec.format != NULL)) | 823 if (!(dialog->prpl_info->icon_spec.format != NULL)) |
779 gtk_widget_hide(dialog->buddy_icon_hbox); | 824 gtk_widget_hide(dialog->icon_hbox); |
780 } | 825 } |
781 | 826 |
782 if (dialog->account != NULL) { | 827 if (dialog->account != NULL) { |
783 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), | 828 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), |
784 gaim_account_get_check_mail(dialog->account)); | 829 gaim_account_get_check_mail(dialog->account)); |
785 | 830 |
786 if (gaim_account_get_buddy_icon(dialog->account) != NULL) { | 831 if (gaim_account_get_buddy_icon(dialog->account) != NULL) { |
787 dialog->buddy_icon_path = g_strdup(gaim_account_get_buddy_icon(dialog->account)); | 832 dialog->icon_path = g_strdup(gaim_account_get_buddy_icon(dialog->account)); |
788 gtk_image_set_from_file(GTK_IMAGE(dialog->buddy_icon_entry),dialog->buddy_icon_path); | 833 gtk_image_set_from_file(GTK_IMAGE(dialog->icon_entry),dialog->icon_path); |
789 } | 834 } |
790 } | 835 } |
791 | 836 |
792 if (!dialog->prpl_info || | 837 if (!dialog->prpl_info || |
793 (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) && | 838 (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) && |
1226 g_list_free(dialog->protocol_opt_entries); | 1271 g_list_free(dialog->protocol_opt_entries); |
1227 | 1272 |
1228 if (dialog->protocol_id != NULL) | 1273 if (dialog->protocol_id != NULL) |
1229 g_free(dialog->protocol_id); | 1274 g_free(dialog->protocol_id); |
1230 | 1275 |
1231 if (dialog->buddy_icon_filesel) | 1276 if (dialog->icon_filesel) |
1232 gtk_widget_destroy(dialog->buddy_icon_filesel); | 1277 gtk_widget_destroy(dialog->icon_filesel); |
1233 | 1278 |
1234 g_free(dialog); | 1279 g_free(dialog); |
1235 } | 1280 } |
1236 | 1281 |
1237 static void | 1282 static void |
1273 gaim_account_set_alias(dialog->account, value); | 1318 gaim_account_set_alias(dialog->account, value); |
1274 else | 1319 else |
1275 gaim_account_set_alias(dialog->account, NULL); | 1320 gaim_account_set_alias(dialog->account, NULL); |
1276 | 1321 |
1277 /* Buddy Icon */ | 1322 /* Buddy Icon */ |
1278 value = dialog->buddy_icon_path; | 1323 value = dialog->icon_path; |
1279 | 1324 |
1280 if (dialog->prpl_info && | 1325 if (dialog->prpl_info && |
1281 (dialog->prpl_info->icon_spec.format) && | 1326 (dialog->prpl_info->icon_spec.format) && |
1282 value != NULL) { | 1327 value != NULL) { |
1283 convert_and_set_buddy_icon(dialog->account, value); | 1328 convert_and_set_buddy_icon(dialog->account, value); |
2254 GtkWidget *sep; | 2299 GtkWidget *sep; |
2255 GtkWidget *button; | 2300 GtkWidget *button; |
2256 int width, height; | 2301 int width, height; |
2257 | 2302 |
2258 if (accounts_window != NULL) { | 2303 if (accounts_window != NULL) { |
2259 gdk_window_raise(accounts_window->window->window); | 2304 gtk_window_present(GTK_WINDOW(accounts_window->window)); |
2260 return; | 2305 return; |
2261 } | 2306 } |
2262 | 2307 |
2263 accounts_window = dialog = g_new0(AccountsWindow, 1); | 2308 accounts_window = dialog = g_new0(AccountsWindow, 1); |
2264 | 2309 |