~noskcaj/ubuntu/vivid/gthumb/flickr-https

« back to all changes in this revision

Viewing changes to gthumb/gth-file-source-vfs.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2014-04-08 06:31:09 UTC
  • mfrom: (1.3.20)
  • Revision ID: package-import@ubuntu.com-20140408063109-tk845map8ji6uxvd
Tags: 3:3.3.1.is.3.2.7-0ubuntu1
* Revert to newest upstream stable release. LP: #1290691
  - Refresh patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
 
63
63
static GList *
64
 
gth_file_source_vfs_add_special_dir (GList         *list,
 
64
gth_file_source_vfs_add_special_dir (GList         *list, 
65
65
                                     GthFileSource *file_source,
66
66
                                     GUserDirectory special_dir)
67
67
{
89
89
static GList *
90
90
gth_file_source_vfs_add_uri (GList         *list,
91
91
                             GthFileSource *file_source,
92
 
                             const char    *uri)
 
92
                             const char    *uri,
 
93
                             char          *display_name)
93
94
{
94
95
        GFile *file;
95
96
 
98
99
                GFileInfo *info;
99
100
 
100
101
                info = gth_file_source_get_file_info (file_source, file, GFILE_BASIC_ATTRIBUTES ",access::*");
 
102
                g_file_info_set_display_name (info, display_name);
101
103
                list = g_list_append (list, gth_file_data_new (file, info));
102
 
 
103
104
                g_object_unref (info);
104
105
        }
105
106
        g_object_unref (file);
111
112
static GList *
112
113
gth_file_source_vfs_get_entry_points (GthFileSource *file_source)
113
114
{
114
 
        GList *list;
115
 
        GList *mounts;
116
 
        GList *scan;
 
115
        GList       *list;
 
116
        GList       *mounts;
 
117
        GList       *scan;
117
118
 
118
119
        list = NULL;
119
120
 
120
 
        list = gth_file_source_vfs_add_uri (list, file_source, get_home_uri ());
 
121
        list = gth_file_source_vfs_add_uri (list, file_source, get_home_uri (), _("Home Folder"));
121
122
        list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_PICTURES);
122
123
        list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_VIDEOS);
123
124
        list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_DESKTOP);
124
 
        /*list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_DOCUMENTS);*/
125
 
        list = gth_file_source_vfs_add_uri (list, file_source, "file:///");
 
125
        list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_DOCUMENTS);
 
126
        list = gth_file_source_vfs_add_uri (list, file_source, "file:///", _("File System"));
126
127
 
127
128
        mounts = g_volume_monitor_get_mounts (g_volume_monitor_get ());
128
129
        for (scan = mounts; scan; scan = scan->next) {
145
146
 
146
147
                info = g_file_query_info (file, GFILE_BASIC_ATTRIBUTES ",access::*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
147
148
 
148
 
                icon = g_mount_get_symbolic_icon (mount);
 
149
                icon = g_mount_get_icon (mount);
149
150
                name = g_mount_get_name (mount);
150
151
 
151
152
                drive = g_mount_get_drive (mount);
162
163
                        g_free (drive_name);
163
164
                }
164
165
 
165
 
                g_file_info_set_symbolic_icon (info, icon);
 
166
                g_file_info_set_icon (info, icon);
166
167
                g_file_info_set_display_name (info, name);
167
168
 
168
169
                list = g_list_append (list, gth_file_data_new (file, info));
198
199
{
199
200
        GFile     *gio_file;
200
201
        GFileInfo *file_info;
201
 
        char      *uri;
202
202
 
203
203
        gio_file = gth_file_source_to_gio_file (file_source, file);
204
204
        file_info = g_file_query_info (gio_file,
207
207
                                       NULL,
208
208
                                       NULL);
209
209
 
210
 
        uri = g_file_get_uri (gio_file);
211
 
        if (g_strcmp0 (uri, "file:///") == 0) {
212
 
                GIcon *icon;
213
 
 
214
 
                g_file_info_set_display_name (file_info, _("Computer"));
215
 
                icon = g_themed_icon_new ("drive-harddisk-symbolic");
216
 
                g_file_info_set_symbolic_icon (file_info, icon);
217
 
 
218
 
                g_object_unref (icon);
219
 
        }
220
 
        else if (g_strcmp0 (uri, get_home_uri ()) == 0)
221
 
                g_file_info_set_display_name (file_info, _("Home Folder"));
222
 
 
223
210
        g_object_unref (gio_file);
224
211
 
225
212
        return file_info;
750
737
                                d = _gtk_yesno_dialog_new (window,
751
738
                                                           GTK_DIALOG_MODAL,
752
739
                                                           _("The files cannot be moved to the Trash. Do you want to delete them permanently?"),
753
 
                                                           _GTK_LABEL_CANCEL,
754
 
                                                           _GTK_LABEL_DELETE);
 
740
                                                           GTK_STOCK_CANCEL,
 
741
                                                           GTK_STOCK_DELETE);
755
742
                                g_signal_connect (d,
756
743
                                                  "response",
757
744
                                                  G_CALLBACK (delete_permanently_response_cb),
819
806
 
820
807
                d = _gtk_message_dialog_new (window,
821
808
                                             GTK_DIALOG_MODAL,
822
 
                                             _GTK_ICON_NAME_DIALOG_QUESTION,
 
809
                                             GTK_STOCK_DIALOG_QUESTION,
823
810
                                             prompt,
824
811
                                             NULL,
825
 
                                             _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
 
812
                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
826
813
                                             _("Mo_ve to Trash"), GTK_RESPONSE_YES,
827
814
                                             NULL);
828
815
                g_signal_connect (d, "response",
862
849
 
863
850
        d = _gtk_message_dialog_new (window,
864
851
                                     GTK_DIALOG_MODAL,
865
 
                                     _GTK_ICON_NAME_DIALOG_QUESTION,
 
852
                                     GTK_STOCK_DIALOG_QUESTION,
866
853
                                     prompt,
867
854
                                     _("If you delete a file, it will be permanently lost."),
868
 
                                     _GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
869
 
                                     _GTK_LABEL_DELETE, GTK_RESPONSE_YES,
 
855
                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
856
                                     GTK_STOCK_DELETE, GTK_RESPONSE_YES,
870
857
                                     NULL);
871
858
        g_signal_connect (d, "response", G_CALLBACK (delete_permanently_response_cb), file_list);
872
859
        gtk_widget_show (d);