/
thunar-standard-view.c
4665 lines (3773 loc) · 190 KB
/
thunar-standard-view.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
* Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
* Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <gdk/gdkkeysyms.h>
#include <thunar/thunar-application.h>
#include <thunar/thunar-create-dialog.h>
#include <thunar/thunar-dialogs.h>
#include <thunar/thunar-dnd.h>
#include <thunar/thunar-enum-types.h>
#include <thunar/thunar-gio-extensions.h>
#include <thunar/thunar-gobject-extensions.h>
#include <thunar/thunar-gtk-extensions.h>
#include <thunar/thunar-history.h>
#include <thunar/thunar-icon-renderer.h>
#include <thunar/thunar-marshal.h>
#include <thunar/thunar-menu-util.h>
#include <thunar/thunar-pango-extensions.h>
#include <thunar/thunar-private.h>
#include <thunar/thunar-properties-dialog.h>
#include <thunar/thunar-renamer-dialog.h>
#include <thunar/thunar-simple-job.h>
#include <thunar/thunar-standard-view.h>
#include <thunar/thunar-standard-view-ui.h>
#include <thunar/thunar-templates-action.h>
#include <thunar/thunar-thumbnailer.h>
#include <thunar/thunar-util.h>
#if defined(GDK_WINDOWING_X11)
#include <gdk/gdkx.h>
#endif
/* Property identifiers */
enum
{
PROP_0,
PROP_CURRENT_DIRECTORY,
PROP_LOADING,
PROP_DISPLAY_NAME,
PROP_TOOLTIP_TEXT,
PROP_SELECTED_FILES,
PROP_SHOW_HIDDEN,
PROP_STATUSBAR_TEXT,
PROP_UI_MANAGER,
PROP_ZOOM_LEVEL,
PROP_THUMBNAIL_DRAW_FRAMES,
N_PROPERTIES
};
/* Signal identifiers */
enum
{
DELETE_SELECTED_FILES,
START_OPEN_LOCATION,
LAST_SIGNAL,
};
/* Identifiers for DnD target types */
enum
{
TARGET_TEXT_URI_LIST,
TARGET_XDND_DIRECT_SAVE0,
TARGET_NETSCAPE_URL,
};
static void thunar_standard_view_component_init (ThunarComponentIface *iface);
static void thunar_standard_view_navigator_init (ThunarNavigatorIface *iface);
static void thunar_standard_view_view_init (ThunarViewIface *iface);
static GObject *thunar_standard_view_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties);
static void thunar_standard_view_dispose (GObject *object);
static void thunar_standard_view_finalize (GObject *object);
static void thunar_standard_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void thunar_standard_view_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void thunar_standard_view_realize (GtkWidget *widget);
static void thunar_standard_view_unrealize (GtkWidget *widget);
static void thunar_standard_view_grab_focus (GtkWidget *widget);
static gboolean thunar_standard_view_draw (GtkWidget *widget,
cairo_t *cr);
static GList *thunar_standard_view_get_selected_files (ThunarComponent *component);
static void thunar_standard_view_set_selected_files (ThunarComponent *component,
GList *selected_files);
static GtkUIManager *thunar_standard_view_get_ui_manager (ThunarComponent *component);
static void thunar_standard_view_set_ui_manager (ThunarComponent *component,
GtkUIManager *ui_manager);
static ThunarFile *thunar_standard_view_get_current_directory (ThunarNavigator *navigator);
static void thunar_standard_view_set_current_directory (ThunarNavigator *navigator,
ThunarFile *current_directory);
static gboolean thunar_standard_view_get_loading (ThunarView *view);
static void thunar_standard_view_set_loading (ThunarStandardView *standard_view,
gboolean loading);
static const gchar *thunar_standard_view_get_statusbar_text (ThunarView *view);
static gboolean thunar_standard_view_get_show_hidden (ThunarView *view);
static void thunar_standard_view_set_show_hidden (ThunarView *view,
gboolean show_hidden);
static ThunarZoomLevel thunar_standard_view_get_zoom_level (ThunarView *view);
static void thunar_standard_view_set_zoom_level (ThunarView *view,
ThunarZoomLevel zoom_level);
static void thunar_standard_view_reset_zoom_level (ThunarView *view);
static void thunar_standard_view_reload (ThunarView *view,
gboolean reload_info);
static gboolean thunar_standard_view_get_visible_range (ThunarView *view,
ThunarFile **start_file,
ThunarFile **end_file);
static void thunar_standard_view_scroll_to_file (ThunarView *view,
ThunarFile *file,
gboolean select_file,
gboolean use_align,
gfloat row_align,
gfloat col_align);
static gboolean thunar_standard_view_delete_selected_files (ThunarStandardView *standard_view);
static GdkDragAction thunar_standard_view_get_dest_actions (ThunarStandardView *standard_view,
GdkDragContext *context,
gint x,
gint y,
guint timestamp,
ThunarFile **file_return);
static ThunarFile *thunar_standard_view_get_drop_file (ThunarStandardView *standard_view,
gint x,
gint y,
GtkTreePath **path_return);
static void thunar_standard_view_merge_custom_actions (ThunarStandardView *standard_view,
GList *selected_items);
static void thunar_standard_view_update_statusbar_text (ThunarStandardView *standard_view);
static void thunar_standard_view_current_directory_destroy (ThunarFile *current_directory,
ThunarStandardView *standard_view);
static void thunar_standard_view_current_directory_changed (ThunarFile *current_directory,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_create_empty_file (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_create_folder (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_create_template (GtkAction *action,
const ThunarFile *file,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_properties (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_cut (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_copy (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_paste (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_move_to_trash (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_delete (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_paste_into_folder (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_select_all_files (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_select_by_pattern (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_selection_invert (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_duplicate (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_make_link (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_rename (GtkAction *action,
ThunarStandardView *standard_view);
static void thunar_standard_view_action_restore (GtkAction *action,
ThunarStandardView *standard_view);
static GClosure *thunar_standard_view_new_files_closure (ThunarStandardView *standard_view,
GtkWidget *source_view);
static void thunar_standard_view_new_files (ThunarStandardView *standard_view,
GList *path_list);
static gboolean thunar_standard_view_button_release_event (GtkWidget *view,
GdkEventButton *event,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_motion_notify_event (GtkWidget *view,
GdkEventMotion *event,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_key_press_event (GtkWidget *view,
GdkEventKey *event,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_scroll_event (GtkWidget *view,
GdkEventScroll *event,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_button_press_event (GtkWidget *view,
GdkEventButton *event,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_drag_drop (GtkWidget *view,
GdkDragContext *context,
gint x,
gint y,
guint timestamp,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_data_received (GtkWidget *view,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *selection_data,
guint info,
guint timestamp,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_leave (GtkWidget *view,
GdkDragContext *context,
guint timestamp,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_drag_motion (GtkWidget *view,
GdkDragContext *context,
gint x,
gint y,
guint timestamp,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_begin (GtkWidget *view,
GdkDragContext *context,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_data_get (GtkWidget *view,
GdkDragContext *context,
GtkSelectionData *selection_data,
guint info,
guint timestamp,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_data_delete (GtkWidget *view,
GdkDragContext *context,
ThunarStandardView *standard_view);
static void thunar_standard_view_drag_end (GtkWidget *view,
GdkDragContext *context,
ThunarStandardView *standard_view);
static void thunar_standard_view_row_deleted (ThunarListModel *model,
GtkTreePath *path,
ThunarStandardView *standard_view);
static void thunar_standard_view_select_after_row_deleted (ThunarListModel *model,
GtkTreePath *path,
ThunarStandardView *standard_view);
static gboolean thunar_standard_view_restore_selection_idle (ThunarStandardView *standard_view);
static void thunar_standard_view_row_changed (ThunarListModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
ThunarStandardView *standard_view);
static void thunar_standard_view_rows_reordered (ThunarListModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer new_order,
ThunarStandardView *standard_view);
static void thunar_standard_view_error (ThunarListModel *model,
const GError *error,
ThunarStandardView *standard_view);
static void thunar_standard_view_sort_column_changed (GtkTreeSortable *tree_sortable,
ThunarStandardView *standard_view);
static void thunar_standard_view_loading_unbound (gpointer user_data);
static gboolean thunar_standard_view_drag_scroll_timer (gpointer user_data);
static void thunar_standard_view_drag_scroll_timer_destroy (gpointer user_data);
static gboolean thunar_standard_view_drag_timer (gpointer user_data);
static void thunar_standard_view_drag_timer_destroy (gpointer user_data);
static void thunar_standard_view_finished_thumbnailing (ThunarThumbnailer *thumbnailer,
guint request,
ThunarStandardView *standard_view);
static void thunar_standard_view_thumbnailing_destroyed (gpointer data);
static void thunar_standard_view_cancel_thumbnailing (ThunarStandardView *standard_view);
static void thunar_standard_view_schedule_thumbnail_timeout (ThunarStandardView *standard_view);
static void thunar_standard_view_schedule_thumbnail_idle (ThunarStandardView *standard_view);
static gboolean thunar_standard_view_request_thumbnails (gpointer data);
static gboolean thunar_standard_view_request_thumbnails_lazy (gpointer data);
static void thunar_standard_view_thumbnail_mode_toggled (ThunarStandardView *standard_view,
GParamSpec *pspec,
ThunarIconFactory *icon_factory);
static void thunar_standard_view_scrolled (GtkAdjustment *adjustment,
ThunarStandardView *standard_view);
static void thunar_standard_view_size_allocate (ThunarStandardView *standard_view,
GtkAllocation *allocation);
struct _ThunarStandardViewPrivate
{
/* current directory of the view */
ThunarFile *current_directory;
GtkAction *action_create_folder;
GtkAction *action_create_document;
GtkAction *action_properties;
GtkAction *action_cut;
GtkAction *action_copy;
GtkAction *action_paste;
GtkAction *action_move_to_trash;
GtkAction *action_delete;
GtkAction *action_paste_into_folder;
GtkAction *action_duplicate;
GtkAction *action_make_link;
GtkAction *action_rename;
GtkAction *action_restore;
/* history of the current view */
ThunarHistory *history;
/* support for file manager extensions */
ThunarxProviderFactory *provider_factory;
/* zoom-level support */
ThunarZoomLevel zoom_level;
/* scroll_to_file support */
GHashTable *scroll_to_files;
/* statusbar */
gchar *statusbar_text;
guint statusbar_text_idle_id;
/* custom menu actions support */
GtkActionGroup *custom_actions;
gint custom_merge_id;
/* right-click drag/popup support */
GList *drag_g_file_list;
guint drag_scroll_timer_id;
guint drag_timer_id;
GdkEvent *drag_timer_event;
gint drag_x;
gint drag_y;
/* drop site support */
guint drop_data_ready : 1; /* whether the drop data was received already */
guint drop_highlight : 1;
guint drop_occurred : 1; /* whether the data was dropped */
GList *drop_file_list; /* the list of URIs that are contained in the drop data */
/* the "new-files" closure, which is used to select files whenever
* new files are created by a ThunarJob associated with this view
*/
GClosure *new_files_closure;
/* the "new-files" path list that was remembered in the closure callback
* if the view is currently being loaded and as such the folder may
* not have all "new-files" at hand. This list is used when the
* folder tells that it's ready loading and the view will try again
* to select exactly these files.
*/
GList *new_files_path_list;
/* scroll-to-file support */
ThunarFile *scroll_to_file;
guint scroll_to_select : 1;
guint scroll_to_use_align : 1;
gfloat scroll_to_row_align;
gfloat scroll_to_col_align;
/* selected_files support */
GList *selected_files;
guint restore_selection_idle_id;
/* support for generating thumbnails */
ThunarThumbnailer *thumbnailer;
guint thumbnail_request;
guint thumbnail_source_id;
gboolean thumbnailing_scheduled;
/* file insert signal */
gulong row_changed_id;
/* Tree path for restoring the selection after selecting and
* deleting an item */
GtkTreePath *selection_before_delete;
};
static const GtkActionEntry action_entries[] =
{
{ "file-context-menu", NULL, N_ ("File Context Menu"), NULL, NULL, NULL, },
{ "folder-context-menu", NULL, N_ ("Folder Context Menu"), NULL, NULL, NULL, },
{ "create-folder", "folder-new", N_ ("Create _Folder..."), "<control><shift>N", N_ ("Create an empty folder within the current folder"), G_CALLBACK (thunar_standard_view_action_create_folder), },
{ "properties", "document-properties", N_ ("_Properties..."), "<alt>Return", N_ ("View the properties of the selected file"), G_CALLBACK (thunar_standard_view_action_properties), },
{ "cut", "edit-cut", N_ ("Cu_t"), "<control>X", NULL, G_CALLBACK (thunar_standard_view_action_cut), },
{ "copy", "edit-copy", N_ ("_Copy"), "<control>C", NULL, G_CALLBACK (thunar_standard_view_action_copy), },
{ "paste", "edit-paste", N_ ("_Paste"), "<control>V", N_ ("Move or copy files previously selected by a Cut or Copy command"), G_CALLBACK (thunar_standard_view_action_paste), },
{ "move-to-trash", "user-trash", N_ ("Mo_ve to Trash"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_move_to_trash), },
{ "delete", "edit-delete", N_ ("_Delete"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_delete), },
{ "paste-into-folder", "edit-paste", N_ ("Paste Into Folder"), NULL, N_ ("Move or copy files previously selected by a Cut or Copy command into the selected folder"), G_CALLBACK (thunar_standard_view_action_paste_into_folder), },
{ "select-all-files", NULL, N_ ("Select _all Files"), NULL, N_ ("Select all files in this window"), G_CALLBACK (thunar_standard_view_action_select_all_files), },
{ "select-by-pattern", NULL, N_ ("Select _by Pattern..."), "<control>S", N_ ("Select all files that match a certain pattern"), G_CALLBACK (thunar_standard_view_action_select_by_pattern), },
{ "invert-selection", NULL, N_ ("_Invert Selection"), NULL, N_ ("Select all files but not those currently selected"), G_CALLBACK (thunar_standard_view_action_selection_invert), },
{ "duplicate", NULL, N_ ("Du_plicate"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_duplicate), },
{ "make-link", NULL, N_ ("Ma_ke Link"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_make_link), },
{ "rename", NULL, N_ ("_Rename..."), "F2", NULL, G_CALLBACK (thunar_standard_view_action_rename), },
{ "restore", NULL, N_ ("_Restore"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_restore), },
};
/* Target types for dragging from the view */
static const GtkTargetEntry drag_targets[] =
{
{ "text/uri-list", 0, TARGET_TEXT_URI_LIST, },
};
/* Target types for dropping to the view */
static const GtkTargetEntry drop_targets[] =
{
{ "text/uri-list", 0, TARGET_TEXT_URI_LIST, },
{ "XdndDirectSave0", 0, TARGET_XDND_DIRECT_SAVE0, },
{ "_NETSCAPE_URL", 0, TARGET_NETSCAPE_URL, },
};
static guint standard_view_signals[LAST_SIGNAL];
static GParamSpec *standard_view_props[N_PROPERTIES] = { NULL, };
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ThunarStandardView, thunar_standard_view, GTK_TYPE_SCROLLED_WINDOW,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_standard_view_navigator_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_standard_view_component_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_VIEW, thunar_standard_view_view_init)
G_ADD_PRIVATE (ThunarStandardView))
static void
thunar_standard_view_class_init (ThunarStandardViewClass *klass)
{
GtkWidgetClass *gtkwidget_class;
GtkBindingSet *binding_set;
GObjectClass *gobject_class;
gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructor = thunar_standard_view_constructor;
gobject_class->dispose = thunar_standard_view_dispose;
gobject_class->finalize = thunar_standard_view_finalize;
gobject_class->get_property = thunar_standard_view_get_property;
gobject_class->set_property = thunar_standard_view_set_property;
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->realize = thunar_standard_view_realize;
gtkwidget_class->unrealize = thunar_standard_view_unrealize;
gtkwidget_class->grab_focus = thunar_standard_view_grab_focus;
gtkwidget_class->draw = thunar_standard_view_draw;
klass->delete_selected_files = thunar_standard_view_delete_selected_files;
klass->connect_ui_manager = (gpointer) exo_noop;
klass->disconnect_ui_manager = (gpointer) exo_noop;
/**
* ThunarStandardView:loading:
*
* Whether the folder associated with this view is
* currently being loaded from the underlying media.
*
* Override property to set the property as writable
* for the binding.
**/
standard_view_props[PROP_LOADING] =
g_param_spec_override ("loading",
g_param_spec_boolean ("loading",
"loading",
"loading",
FALSE,
EXO_PARAM_READWRITE));
/**
* ThunarStandardView:display-name:
*
* Display name of the current directory, for label text
**/
standard_view_props[PROP_DISPLAY_NAME] =
g_param_spec_string ("display-name",
"display-name",
"display-name",
NULL,
EXO_PARAM_READABLE);
/**
* ThunarStandardView:parse-name:
*
* Full parsed name of the current directory, for label tooltip
**/
standard_view_props[PROP_TOOLTIP_TEXT] =
g_param_spec_string ("tooltip-text",
"tooltip-text",
"tooltip-text",
NULL,
EXO_PARAM_READABLE);
/**
* ThunarStandardView:thumbnail-draw-frames:
*
* Whether to draw black frames around thumbnails.
* This looks neat, but will delay the first draw a bit.
* May have an impact on older systems, on folders with many pictures.
**/
standard_view_props[PROP_THUMBNAIL_DRAW_FRAMES] =
g_param_spec_boolean ("thumbnail-draw-frames",
"thumbnail-draw-frames",
"thumbnail-draw-frames",
FALSE,
EXO_PARAM_READWRITE);
/* override ThunarComponent's properties */
g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
standard_view_props[PROP_SELECTED_FILES] =
g_param_spec_override ("selected-files",
g_object_interface_find_property (g_iface, "selected-files"));
standard_view_props[PROP_UI_MANAGER] =
g_param_spec_override ("ui-manager",
g_object_interface_find_property (g_iface, "ui-manager"));
/* override ThunarNavigator's properties */
g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
standard_view_props[PROP_CURRENT_DIRECTORY] =
g_param_spec_override ("current-directory",
g_object_interface_find_property (g_iface, "current-directory"));
/* override ThunarView's properties */
g_iface = g_type_default_interface_peek (THUNAR_TYPE_VIEW);
standard_view_props[PROP_STATUSBAR_TEXT] =
g_param_spec_override ("statusbar-text",
g_object_interface_find_property (g_iface, "statusbar-text"));
standard_view_props[PROP_SHOW_HIDDEN] =
g_param_spec_override ("show-hidden",
g_object_interface_find_property (g_iface, "show-hidden"));
standard_view_props[PROP_ZOOM_LEVEL] =
g_param_spec_override ("zoom-level",
g_object_interface_find_property (g_iface, "zoom-level"));
/* install all properties */
g_object_class_install_properties (gobject_class, N_PROPERTIES, standard_view_props);
/**
* ThunarStandardView::start-opn-location:
* @standard_view : a #ThunarStandardView.
* @initial_text : the inital location text.
*
* Emitted by @standard_view, whenever the user requests to
* select a custom location (using either the "Open Location"
* dialog or the location entry widget) by specifying an
* @initial_text (i.e. if the user types "/" into the
* view).
**/
standard_view_signals[START_OPEN_LOCATION] =
g_signal_new (I_("start-open-location"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ThunarStandardViewClass, start_open_location),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
/**
* ThunarStandardView::delete-selected-files:
* @standard_view : a #ThunarStandardView.
*
* Emitted whenever the user presses the Delete key. This
* is an internal signal used to bind the action to keys.
**/
standard_view_signals[DELETE_SELECTED_FILES] =
g_signal_new (I_("delete-selected-files"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (ThunarStandardViewClass, delete_selected_files),
g_signal_accumulator_true_handled, NULL,
_thunar_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN, 0);
/* setup the key bindings for the standard views */
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_CONTROL_MASK, "delete-selected-files", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, 0, "delete-selected-files", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK, "delete-selected-files", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, 0, "delete-selected-files", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK, "delete-selected-files", 0);
}
static void
thunar_standard_view_component_init (ThunarComponentIface *iface)
{
iface->get_selected_files = thunar_standard_view_get_selected_files;
iface->set_selected_files = thunar_standard_view_set_selected_files;
iface->get_ui_manager = thunar_standard_view_get_ui_manager;
iface->set_ui_manager = thunar_standard_view_set_ui_manager;
}
static void
thunar_standard_view_navigator_init (ThunarNavigatorIface *iface)
{
iface->get_current_directory = thunar_standard_view_get_current_directory;
iface->set_current_directory = thunar_standard_view_set_current_directory;
}
static void
thunar_standard_view_view_init (ThunarViewIface *iface)
{
iface->get_loading = thunar_standard_view_get_loading;
iface->get_statusbar_text = thunar_standard_view_get_statusbar_text;
iface->get_show_hidden = thunar_standard_view_get_show_hidden;
iface->set_show_hidden = thunar_standard_view_set_show_hidden;
iface->get_zoom_level = thunar_standard_view_get_zoom_level;
iface->set_zoom_level = thunar_standard_view_set_zoom_level;
iface->reset_zoom_level = thunar_standard_view_reset_zoom_level;
iface->reload = thunar_standard_view_reload;
iface->get_visible_range = thunar_standard_view_get_visible_range;
iface->scroll_to_file = thunar_standard_view_scroll_to_file;
}
static void
thunar_standard_view_init (ThunarStandardView *standard_view)
{
standard_view->priv = thunar_standard_view_get_instance_private (standard_view);
/* allocate the scroll_to_files mapping (directory GFile -> first visible child GFile) */
standard_view->priv->scroll_to_files = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, g_object_unref);
/* grab a reference on the preferences */
standard_view->preferences = thunar_preferences_get ();
/* grab a reference on the provider factory */
standard_view->priv->provider_factory = thunarx_provider_factory_get_default ();
/* create a thumbnailer */
standard_view->priv->thumbnailer = thunar_thumbnailer_get ();
g_signal_connect (G_OBJECT (standard_view->priv->thumbnailer), "request-finished", G_CALLBACK (thunar_standard_view_finished_thumbnailing), standard_view);
standard_view->priv->thumbnailing_scheduled = FALSE;
/* initialize the scrolled window */
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (standard_view),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (standard_view), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (standard_view), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (standard_view), GTK_SHADOW_IN);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the action group for this view */
standard_view->action_group = gtk_action_group_new ("ThunarStandardView");
gtk_action_group_set_translation_domain (standard_view->action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions (standard_view->action_group, action_entries,
G_N_ELEMENTS (action_entries),
GTK_WIDGET (standard_view));
/* lookup all actions to speed up access later */
standard_view->priv->action_create_folder = gtk_action_group_get_action (standard_view->action_group, "create-folder");
standard_view->priv->action_properties = gtk_action_group_get_action (standard_view->action_group, "properties");
standard_view->priv->action_cut = gtk_action_group_get_action (standard_view->action_group, "cut");
standard_view->priv->action_copy = gtk_action_group_get_action (standard_view->action_group, "copy");
standard_view->priv->action_paste = gtk_action_group_get_action (standard_view->action_group, "paste");
standard_view->priv->action_move_to_trash = gtk_action_group_get_action (standard_view->action_group, "move-to-trash");
standard_view->priv->action_delete = gtk_action_group_get_action (standard_view->action_group, "delete");
standard_view->priv->action_paste_into_folder = gtk_action_group_get_action (standard_view->action_group, "paste-into-folder");
standard_view->priv->action_duplicate = gtk_action_group_get_action (standard_view->action_group, "duplicate");
standard_view->priv->action_make_link = gtk_action_group_get_action (standard_view->action_group, "make-link");
standard_view->priv->action_rename = gtk_action_group_get_action (standard_view->action_group, "rename");
standard_view->priv->action_restore = gtk_action_group_get_action (standard_view->action_group, "restore");
G_GNUC_END_IGNORE_DEPRECATIONS
/* add the "Create Document" sub menu action */
standard_view->priv->action_create_document = thunar_templates_action_new ("create-document", _("Create _Document"));
g_signal_connect (G_OBJECT (standard_view->priv->action_create_document), "create-empty-file",
G_CALLBACK (thunar_standard_view_action_create_empty_file), standard_view);
g_signal_connect (G_OBJECT (standard_view->priv->action_create_document), "create-template",
G_CALLBACK (thunar_standard_view_action_create_template), standard_view);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_action_group_add_action (standard_view->action_group, standard_view->priv->action_create_document);
G_GNUC_END_IGNORE_DEPRECATIONS
g_object_unref (G_OBJECT (standard_view->priv->action_create_document));
/* setup the history support */
standard_view->priv->history = g_object_new (THUNAR_TYPE_HISTORY, "action-group", standard_view->action_group, NULL);
g_signal_connect_swapped (G_OBJECT (standard_view->priv->history), "change-directory", G_CALLBACK (thunar_navigator_change_directory), standard_view);
/* setup the list model */
standard_view->model = thunar_list_model_new ();
g_signal_connect (G_OBJECT (standard_view->model), "row-deleted", G_CALLBACK (thunar_standard_view_row_deleted), standard_view);
g_signal_connect_after (G_OBJECT (standard_view->model), "row-deleted", G_CALLBACK (thunar_standard_view_select_after_row_deleted), standard_view);
standard_view->priv->row_changed_id = g_signal_connect (G_OBJECT (standard_view->model), "row-changed", G_CALLBACK (thunar_standard_view_row_changed), standard_view);
g_signal_connect (G_OBJECT (standard_view->model), "rows-reordered", G_CALLBACK (thunar_standard_view_rows_reordered), standard_view);
g_signal_connect (G_OBJECT (standard_view->model), "error", G_CALLBACK (thunar_standard_view_error), standard_view);
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-case-sensitive", G_OBJECT (standard_view->model), "case-sensitive");
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-date-style", G_OBJECT (standard_view->model), "date-style");
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-date-custom-style", G_OBJECT (standard_view->model), "date-custom-style");
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-folders-first", G_OBJECT (standard_view->model), "folders-first");
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-file-size-binary", G_OBJECT (standard_view->model), "file-size-binary");
/* setup the icon renderer */
standard_view->icon_renderer = thunar_icon_renderer_new ();
g_object_ref_sink (G_OBJECT (standard_view->icon_renderer));
exo_binding_new (G_OBJECT (standard_view), "zoom-level", G_OBJECT (standard_view->icon_renderer), "size");
exo_binding_new (G_OBJECT (standard_view->icon_renderer), "size", G_OBJECT (standard_view->priv->thumbnailer), "thumbnail-size");
/* setup the name renderer */
standard_view->name_renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
"attributes", thunar_pango_attr_disable_hyphens (),
"alignment", PANGO_ALIGN_CENTER,
"xalign", 0.5,
FALSE);
g_object_ref_sink (G_OBJECT (standard_view->name_renderer));
/* TODO: prelit underline
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click", G_OBJECT (standard_view->name_renderer), "follow-prelit");*/
/* be sure to update the selection whenever the folder changes */
g_signal_connect_swapped (G_OBJECT (standard_view->model), "notify::folder", G_CALLBACK (thunar_standard_view_selection_changed), standard_view);
/* be sure to update the statusbar text whenever the number of
* files in our model changes.
*/
g_signal_connect_swapped (G_OBJECT (standard_view->model), "notify::num-files", G_CALLBACK (thunar_standard_view_update_statusbar_text), standard_view);
/* be sure to update the statusbar text whenever the file-size-binary property changes */
g_signal_connect_swapped (G_OBJECT (standard_view->model), "notify::file-size-binary", G_CALLBACK (thunar_standard_view_update_statusbar_text), standard_view);
/* connect to size allocation signals for generating thumbnail requests */
g_signal_connect_after (G_OBJECT (standard_view), "size-allocate",
G_CALLBACK (thunar_standard_view_size_allocate), NULL);
/* add widget to css class */
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (standard_view)), "standard-view");
}
static GObject*
thunar_standard_view_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
ThunarStandardView *standard_view;
ThunarZoomLevel zoom_level;
GtkAdjustment *adjustment;
ThunarColumn sort_column;
GtkSortType sort_order;
GtkWidget *view;
GObject *object;
/* let the GObject constructor create the instance */
object = G_OBJECT_CLASS (thunar_standard_view_parent_class)->constructor (type,
n_construct_properties,
construct_properties);
/* cast to standard_view for convenience */
standard_view = THUNAR_STANDARD_VIEW (object);
/* setup the default zoom-level, determined from the "last-<view>-zoom-level" preference */
g_object_get (G_OBJECT (standard_view->preferences), THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->zoom_level_property_name, &zoom_level, NULL);
thunar_view_set_zoom_level (THUNAR_VIEW (standard_view), zoom_level);
/* save the "zoom-level" as "last-<view>-zoom-level" whenever the user changes the zoom level */
g_object_bind_property (object, "zoom-level", G_OBJECT (standard_view->preferences), THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->zoom_level_property_name, G_BINDING_DEFAULT);
/* determine the real view widget (treeview or iconview) */
view = gtk_bin_get_child (GTK_BIN (object));
/* apply our list model to the real view (the child of the scrolled window),
* we therefore assume that all real views have the "model" property.
*/
g_object_set (G_OBJECT (view), "model", standard_view->model, NULL);
/* apply the single-click settings to the view */
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click", G_OBJECT (view), "single-click");
exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click-timeout", G_OBJECT (view), "single-click-timeout");
/* apply the default sort column and sort order */
g_object_get (G_OBJECT (standard_view->preferences), "last-sort-column", &sort_column, "last-sort-order", &sort_order, NULL);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (standard_view->model), sort_column, sort_order);
/* stay informed about changes to the sort column/order */
g_signal_connect (G_OBJECT (standard_view->model), "sort-column-changed", G_CALLBACK (thunar_standard_view_sort_column_changed), standard_view);
/* setup support to navigate using a horizontal mouse wheel and the back and forward buttons */
g_signal_connect (G_OBJECT (view), "scroll-event", G_CALLBACK (thunar_standard_view_scroll_event), object);
g_signal_connect (G_OBJECT (view), "button-press-event", G_CALLBACK (thunar_standard_view_button_press_event), object);
/* need to catch certain keys for the internal view widget */
g_signal_connect (G_OBJECT (view), "key-press-event", G_CALLBACK (thunar_standard_view_key_press_event), object);
/* setup the real view as drop site */
gtk_drag_dest_set (view, 0, drop_targets, G_N_ELEMENTS (drop_targets), GDK_ACTION_ASK | GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_MOVE);
g_signal_connect (G_OBJECT (view), "drag-drop", G_CALLBACK (thunar_standard_view_drag_drop), object);
g_signal_connect (G_OBJECT (view), "drag-data-received", G_CALLBACK (thunar_standard_view_drag_data_received), object);
g_signal_connect (G_OBJECT (view), "drag-leave", G_CALLBACK (thunar_standard_view_drag_leave), object);
g_signal_connect (G_OBJECT (view), "drag-motion", G_CALLBACK (thunar_standard_view_drag_motion), object);
/* setup the real view as drag source */
gtk_drag_source_set (view, GDK_BUTTON1_MASK, drag_targets, G_N_ELEMENTS (drag_targets), GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
g_signal_connect (G_OBJECT (view), "drag-begin", G_CALLBACK (thunar_standard_view_drag_begin), object);
g_signal_connect (G_OBJECT (view), "drag-data-get", G_CALLBACK (thunar_standard_view_drag_data_get), object);
g_signal_connect (G_OBJECT (view), "drag-data-delete", G_CALLBACK (thunar_standard_view_drag_data_delete), object);
g_signal_connect (G_OBJECT (view), "drag-end", G_CALLBACK (thunar_standard_view_drag_end), object);
/* connect to scroll events for generating thumbnail requests */
adjustment = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (standard_view));
g_signal_connect (adjustment, "value-changed",
G_CALLBACK (thunar_standard_view_scrolled), object);
adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (standard_view));
g_signal_connect (adjustment, "value-changed",
G_CALLBACK (thunar_standard_view_scrolled), object);
/* done, we have a working object */
return object;
}
static void
thunar_standard_view_dispose (GObject *object)
{
ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (object);
/* cancel pending thumbnail sources and requests */
thunar_standard_view_cancel_thumbnailing (standard_view);
/* unregister the "loading" binding */
if (G_UNLIKELY (standard_view->loading_binding != NULL))
exo_binding_unbind (standard_view->loading_binding);
/* be sure to cancel any pending drag autoscroll timer */
if (G_UNLIKELY (standard_view->priv->drag_scroll_timer_id != 0))
g_source_remove (standard_view->priv->drag_scroll_timer_id);
/* be sure to cancel any pending drag timer */
if (G_UNLIKELY (standard_view->priv->drag_timer_id != 0))
g_source_remove (standard_view->priv->drag_timer_id);
/* be sure to free any pending drag timer event */
if (G_UNLIKELY (standard_view->priv->drag_timer_event != NULL))
{
gdk_event_free (standard_view->priv->drag_timer_event);
standard_view->priv->drag_timer_event = NULL;
}
/* reset the UI manager property */
thunar_component_set_ui_manager (THUNAR_COMPONENT (standard_view), NULL);
/* disconnect from file */
if (standard_view->priv->current_directory != NULL)
{
g_signal_handlers_disconnect_matched (standard_view->priv->current_directory,
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, standard_view);
g_object_unref (standard_view->priv->current_directory);
standard_view->priv->current_directory = NULL;
}
(*G_OBJECT_CLASS (thunar_standard_view_parent_class)->dispose) (object);
}
static void
thunar_standard_view_finalize (GObject *object)
{
ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (object);
/* some safety checks */
_thunar_assert (standard_view->loading_binding == NULL);
_thunar_assert (standard_view->icon_factory == NULL);
_thunar_assert (standard_view->ui_manager == NULL);
_thunar_assert (standard_view->clipboard == NULL);
/* release the thumbnailer */
g_signal_handlers_disconnect_by_func (standard_view->priv->thumbnailer, thunar_standard_view_finished_thumbnailing, standard_view);
g_object_unref (standard_view->priv->thumbnailer);
/* release the scroll_to_file reference (if any) */
if (G_UNLIKELY (standard_view->priv->scroll_to_file != NULL))
g_object_unref (G_OBJECT (standard_view->priv->scroll_to_file));
/* release the selected_files list (if any) */
thunar_g_file_list_free (standard_view->priv->selected_files);
/* release our reference on the provider factory */
g_object_unref (G_OBJECT (standard_view->priv->provider_factory));
/* release the drag path list (just in case the drag-end wasn't fired before) */
thunar_g_file_list_free (standard_view->priv->drag_g_file_list);
/* release the drop path list (just in case the drag-leave wasn't fired before) */
thunar_g_file_list_free (standard_view->priv->drop_file_list);
/* release the history */
g_object_unref (standard_view->priv->history);
/* release the reference on the name renderer */
g_object_unref (G_OBJECT (standard_view->name_renderer));
/* release the reference on the icon renderer */
g_object_unref (G_OBJECT (standard_view->icon_renderer));
/* release the reference on the action group */
g_object_unref (G_OBJECT (standard_view->action_group));
/* drop any existing "new-files" closure */
if (G_UNLIKELY (standard_view->priv->new_files_closure != NULL))
{
g_closure_invalidate (standard_view->priv->new_files_closure);
g_closure_unref (standard_view->priv->new_files_closure);
standard_view->priv->new_files_closure = NULL;
}
/* drop any remaining "new-files" paths */
thunar_g_file_list_free (standard_view->priv->new_files_path_list);
/* release our reference on the preferences */
g_object_unref (G_OBJECT (standard_view->preferences));
/* disconnect from the list model */
g_signal_handlers_disconnect_matched (G_OBJECT (standard_view->model), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, standard_view);
g_object_unref (G_OBJECT (standard_view->model));
/* remove selection restore timeout */
if (standard_view->priv->restore_selection_idle_id != 0)
g_source_remove (standard_view->priv->restore_selection_idle_id);
/* free the statusbar text (if any) */
if (standard_view->priv->statusbar_text_idle_id != 0)
g_source_remove (standard_view->priv->statusbar_text_idle_id);
g_free (standard_view->priv->statusbar_text);
/* release the scroll_to_files hash table */
g_hash_table_destroy (standard_view->priv->scroll_to_files);
(*G_OBJECT_CLASS (thunar_standard_view_parent_class)->finalize) (object);
}
static void
thunar_standard_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ThunarFile *current_directory;
gboolean thumbnail_draw_frames;
switch (prop_id)
{
case PROP_CURRENT_DIRECTORY:
g_value_set_object (value, thunar_navigator_get_current_directory (THUNAR_NAVIGATOR (object)));
break;
case PROP_LOADING:
g_value_set_boolean (value, thunar_view_get_loading (THUNAR_VIEW (object)));
break;
case PROP_DISPLAY_NAME:
current_directory = thunar_navigator_get_current_directory (THUNAR_NAVIGATOR (object));
if (current_directory != NULL)
g_value_set_static_string (value, thunar_file_get_display_name (current_directory));
break;
case PROP_TOOLTIP_TEXT:
current_directory = thunar_navigator_get_current_directory (THUNAR_NAVIGATOR (object));
if (current_directory != NULL)
g_value_take_string (value, g_file_get_parse_name (thunar_file_get_file (current_directory)));
break;
case PROP_SELECTED_FILES:
g_value_set_boxed (value, thunar_component_get_selected_files (THUNAR_COMPONENT (object)));
break;