pidgin/gtkutils.c

branch
cpw.qulogic.gtk3
changeset 32372
6080fb3a2967
parent 32371
1762d0df9a12
child 32373
71a01df1ac09
equal deleted inserted replaced
32371:1762d0df9a12 32372:6080fb3a2967
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(GTK_BOX(bbox), ibox, TRUE, TRUE, 0); 409 gtk_box_pack_start_defaults(GTK_BOX(bbox), ibox);
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(GTK_BOX(bbox), lbox, TRUE, TRUE, 0); 415 gtk_box_pack_start_defaults(GTK_BOX(bbox), lbox);
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
898 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel) 895 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel)
899 #endif
900 { 896 {
901 char *dirname = NULL; 897 char *dirname = NULL;
902 898
903 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { 899 if (g_file_test(path, G_FILE_TEST_IS_DIR)) {
904 /* append a / if needed */ 900 /* append a / if needed */
905 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) { 901 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) {
906 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL); 902 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL);
907 } 903 }
908 #if !GTK_CHECK_VERSION(2,4,0)
909 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path); 904 gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path);
910 #endif
911 g_free(dirname); 905 g_free(dirname);
912 return TRUE; 906 return TRUE;
913 } 907 }
914 908
915 return FALSE; 909 return FALSE;

mercurial