| 404 } |
404 } |
| 405 |
405 |
| 406 gtk_container_add(GTK_CONTAINER(button), bbox); |
406 gtk_container_add(GTK_CONTAINER(button), bbox); |
| 407 |
407 |
| 408 if (icon) { |
408 if (icon) { |
| 409 gtk_box_pack_start_defaults(GTK_BOX(bbox), ibox); |
409 gtk_box_pack_start(GTK_BOX(bbox), ibox, TRUE, TRUE, 0); |
| 410 image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_BUTTON); |
410 image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_BUTTON); |
| 411 gtk_box_pack_end(GTK_BOX(ibox), image, FALSE, TRUE, 0); |
411 gtk_box_pack_end(GTK_BOX(ibox), image, FALSE, TRUE, 0); |
| 412 } |
412 } |
| 413 |
413 |
| 414 if (text) { |
414 if (text) { |
| 415 gtk_box_pack_start_defaults(GTK_BOX(bbox), lbox); |
415 gtk_box_pack_start(GTK_BOX(bbox), lbox, TRUE, TRUE, 0); |
| 416 label = gtk_label_new(NULL); |
416 label = gtk_label_new(NULL); |
| 417 gtk_label_set_text_with_mnemonic(GTK_LABEL(label), text); |
417 gtk_label_set_text_with_mnemonic(GTK_LABEL(label), text); |
| 418 gtk_label_set_mnemonic_widget(GTK_LABEL(label), button); |
418 gtk_label_set_mnemonic_widget(GTK_LABEL(label), button); |
| 419 gtk_box_pack_start(GTK_BOX(lbox), label, FALSE, TRUE, 0); |
419 gtk_box_pack_start(GTK_BOX(lbox), label, FALSE, TRUE, 0); |
| 420 pidgin_set_accessible_label (button, label); |
420 pidgin_set_accessible_label (button, label); |
| 890 |
890 |
| 891 return optmenu; |
891 return optmenu; |
| 892 } |
892 } |
| 893 |
893 |
| 894 gboolean |
894 gboolean |
| |
895 #if GTK_CHECK_VERSION(2,4,0) |
| |
896 pidgin_check_if_dir(const char *path, gpointer filesel) |
| |
897 #else |
| 895 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel) |
898 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel) |
| |
899 #endif |
| 896 { |
900 { |
| 897 char *dirname = NULL; |
901 char *dirname = NULL; |
| 898 |
902 |
| 899 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { |
903 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { |
| 900 /* append a / if needed */ |
904 /* append a / if needed */ |
| 901 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) { |
905 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) { |
| 902 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL); |
906 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL); |
| 903 } |
907 } |
| |
908 #if !GTK_CHECK_VERSION(2,4,0) |
| 904 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path); |
909 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path); |
| |
910 #endif |
| 905 g_free(dirname); |
911 g_free(dirname); |
| 906 return TRUE; |
912 return TRUE; |
| 907 } |
913 } |
| 908 |
914 |
| 909 return FALSE; |
915 return FALSE; |