~mitya57/ubuntu/precise/nautilus/desktop-window-fixes

« back to all changes in this revision

Viewing changes to libnautilus-private/nautilus-autorun.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2009-09-23 20:11:11 UTC
  • mto: (1.2.5 upstream) (2.4.1 sid)
  • mto: This revision was merged to the branch mainline in revision 138.
  • Revision ID: james.westby@ubuntu.com-20090923201111-r4e2b6x5biik0ldh
Tags: upstream-2.28.0
ImportĀ upstreamĀ versionĀ 2.28.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
869
869
        ret = FALSE;
870
870
        mount_name = NULL;
871
871
 
 
872
        if (g_content_type_is_a (x_content_type, "x-content/win32-software")) {
 
873
                /* don't pop up the dialog anyway if the content type says
 
874
                 * windows software.
 
875
                 */
 
876
                goto out;
 
877
        }
 
878
 
872
879
        user_forced_dialog = is_shift_pressed ();
873
880
 
874
881
        nautilus_autorun_get_preferences (x_content_type, &pref_start_app, &pref_ignore, &pref_open_folder);
904
911
 
905
912
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
906
913
        hbox = gtk_hbox_new (FALSE, 12);
907
 
        gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox);
 
914
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
908
915
        gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
909
916
 
910
917
        icon = g_mount_get_icon (mount);
915
922
        g_object_unref (icon);
916
923
        image = gtk_image_new_from_pixbuf (pixbuf);
917
924
        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
918
 
        gtk_box_pack_start_defaults (GTK_BOX (hbox), image);
 
925
        gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 0);
919
926
        /* also use the icon on the dialog */
920
927
        gtk_window_set_title (GTK_WINDOW (dialog), mount_name);
921
928
        gtk_window_set_icon (GTK_WINDOW (dialog), pixbuf);
923
930
        g_object_unref (pixbuf);
924
931
 
925
932
        vbox = gtk_vbox_new (FALSE, 12);
926
 
        gtk_box_pack_start_defaults (GTK_BOX (hbox), vbox);
 
933
        gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
927
934
 
928
935
        label = gtk_label_new (NULL);
929
936
 
955
962
                media_greeting = _("You have just inserted a medium with digital photos.");
956
963
        } else if (strcmp (x_content_type, "x-content/audio-player") == 0) {
957
964
                media_greeting = _("You have just inserted a digital audio player.");
958
 
        } else if (strcmp (x_content_type, "x-content/software") == 0) {
 
965
        } else if (g_content_type_is_a (x_content_type, "x-content/software")) {
959
966
                media_greeting = _("You have just inserted a medium with software intended to be automatically started.");
960
967
        } else {
961
968
                /* fallback to generic greeting */
966
973
        g_free (markup);
967
974
        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
968
975
        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
969
 
        gtk_box_pack_start_defaults (GTK_BOX (vbox), label);
 
976
        gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
970
977
 
971
978
        label = gtk_label_new (NULL);
972
979
        content_description = g_content_type_get_description (x_content_type);
976
983
        g_free (markup);
977
984
        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
978
985
        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
979
 
        gtk_box_pack_start_defaults (GTK_BOX (vbox), label);
 
986
        gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
980
987
        
981
988
        data = g_new0 (AutorunDialogData, 1);
982
989
        data->dialog = dialog;
990
997
 
991
998
        combo_box = gtk_combo_box_new ();
992
999
        nautilus_autorun_prepare_combo_box (combo_box, x_content_type, FALSE, TRUE, FALSE, autorun_combo_changed, data);
993
 
        gtk_box_pack_start_defaults (GTK_BOX (vbox), combo_box);
 
1000
        gtk_box_pack_start (GTK_BOX (vbox), combo_box, TRUE, TRUE, 0);
994
1001
 
995
1002
        always_check_button = gtk_check_button_new_with_mnemonic (_("_Always perform this action"));
996
1003
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (always_check_button), data->remember);
998
1005
                          "toggled",
999
1006
                          G_CALLBACK (autorun_always_toggled),
1000
1007
                          data);
1001
 
        gtk_box_pack_start_defaults (GTK_BOX (vbox), always_check_button);
 
1008
        gtk_box_pack_start (GTK_BOX (vbox), always_check_button, TRUE, TRUE, 0);
1002
1009
 
1003
1010
        gtk_dialog_add_buttons (GTK_DIALOG (dialog), 
1004
1011
                                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,