@@ -71,14 +71,8 @@ public class Files.View.Window : Hdy.ApplicationWindow {
7171 {" go-to" , action_go_to, " s" },
7272 {" zoom" , action_zoom, " s" },
7373 {" view-mode" , action_view_mode, " u" , " 0" },
74- {" show-hidden" , null , null , " false" , change_state_show_hidden},
75- {" singleclick-select" , null , null , " false" , change_state_single_click_select},
76- {" show-remote-thumbnails" , null , null , " true" , change_state_show_remote_thumbnails},
77- {" show-local-thumbnails" , null , null , " false" , change_state_show_local_thumbnails},
78- {" show-file-preview" , null , null , " false" , change_state_show_file_preview},
7974 {" tabhistory-restore" , action_tabhistory_restore, " s" },
8075 {" folders-before-files" , null , null , " true" , change_state_folders_before_files},
81- {" restore-tabs-on-startup" , null , null , " true" , change_state_restore_tabs_on_startup},
8276 {" forward" , action_forward, " i" },
8377 {" back" , action_back, " i" },
8478 {" focus-sidebar" , action_focus_sidebar}
@@ -122,6 +116,14 @@ public class Files.View.Window : Hdy.ApplicationWindow {
122116 icon_name = " system-file-manager" ;
123117 title = _(APP_TITLE );
124118
119+ var app_settings = new Settings (" io.elementary.files.preferences" );
120+ add_action (app_settings. create_action (" restore-tabs" ));
121+ add_action (app_settings. create_action (" show-file-preview" ));
122+ add_action (app_settings. create_action (" show-local-thumbnails" ));
123+ add_action (app_settings. create_action (" show-remote-thumbnails" ));
124+ add_action (app_settings. create_action (" show-hiddenfiles" ));
125+ add_action (app_settings. create_action (" singleclick-select" ));
126+
125127 add_action_entries (WIN_ENTRIES , this );
126128 undo_actions_set_insensitive ();
127129
@@ -152,7 +154,7 @@ public class Files.View.Window : Hdy.ApplicationWindow {
152154 marlin_app. set_accels_for_action (" win.zoom::ZOOM_IN" , {" <Ctrl>plus" , " <Ctrl>equal" });
153155 marlin_app. set_accels_for_action (" win.zoom::ZOOM_OUT" , {" <Ctrl>minus" });
154156 marlin_app. set_accels_for_action (" win.zoom::ZOOM_NORMAL" , {" <Ctrl>0" });
155- marlin_app. set_accels_for_action (" win.show-hidden " , {" <Ctrl>H" });
157+ marlin_app. set_accels_for_action (" win.show-hiddenfiles " , {" <Ctrl>H" });
156158 marlin_app. set_accels_for_action (" win.refresh" , {" <Ctrl>R" , " F5" });
157159 marlin_app. set_accels_for_action (" win.go-to::HOME" , {" <Alt>Home" });
158160 marlin_app. set_accels_for_action (" win.go-to::RECENT" , {" <Alt>R" });
@@ -278,13 +280,7 @@ public class Files.View.Window : Hdy.ApplicationWindow {
278280
279281 /* * Apply preferences */
280282 var prefs = Files.Preferences.get_default (); // Bound to settings schema by Application
281- get_action ("show -hidden ").set_state (prefs .show_hidden_files );
282- get_action ("show -local -thumbnails ").set_state (prefs .show_local_thumbnails );
283- get_action ("show -remote -thumbnails ").set_state (prefs .show_remote_thumbnails );
284- get_action ("show -file -preview ").set_state (prefs .show_file_preview );
285- get_action ("singleclick -select ").set_state (prefs .singleclick_select );
286283 get_action ("folders -before -files ").set_state (prefs .sort_directories_first );
287- get_action ("restore -tabs -on -startup ").set_state (app_settings .get_boolean ("restore -tabs "));
288284
289285 button_forward.slow_press.connect (() => {
290286 get_action_group (" win" ). activate_action (" forward" , new Variant .int32 (1 ));
@@ -1041,48 +1037,12 @@ public class Files.View.Window : Hdy.ApplicationWindow {
10411037 doing_undo_redo = false ;
10421038 }
10431039
1044- public void change_state_show_hidden (GLib .SimpleAction action ) {
1045- bool state = ! action. state. get_boolean ();
1046- action. set_state (new GLib .Variant .boolean (state));
1047- Files . app_settings. set_boolean (" show-hiddenfiles" , state);
1048- }
1049-
1050- public void change_state_single_click_select (GLib .SimpleAction action ) {
1051- bool state = ! action. state. get_boolean ();
1052- action. set_state (new GLib .Variant .boolean (state));
1053- Files . Preferences . get_default (). singleclick_select = state;
1054- }
1055-
1056- public void change_state_show_remote_thumbnails (GLib .SimpleAction action ) {
1057- bool state = ! action. state. get_boolean ();
1058- action. set_state (new GLib .Variant .boolean (state));
1059- Files . app_settings. set_boolean (" show-remote-thumbnails" , state);
1060- }
1061-
1062- public void change_state_show_local_thumbnails (GLib .SimpleAction action ) {
1063- bool state = ! action. state. get_boolean ();
1064- action. set_state (new GLib .Variant .boolean (state));
1065- Files . app_settings. set_boolean (" show-local-thumbnails" , state);
1066- }
1067-
1068- public void change_state_show_file_preview (GLib .SimpleAction action ) {
1069- var state = ! action. state. get_boolean ();
1070- action. set_state (new GLib .Variant .boolean (state));
1071- Files . app_settings. set_boolean (" show-file-preview" , state);
1072- }
1073-
10741040 public void change_state_folders_before_files (GLib .SimpleAction action ) {
10751041 bool state = ! action. state. get_boolean ();
10761042 action. set_state (new GLib .Variant .boolean (state));
10771043 Files . Preferences . get_default (). sort_directories_first = state;
10781044 }
10791045
1080- public void change_state_restore_tabs_on_startup (GLib .SimpleAction action ) {
1081- bool state = ! action. state. get_boolean ();
1082- action. set_state (new GLib .Variant .boolean (state));
1083- Files . app_settings. set_boolean (" restore-tabs" , state);
1084- }
1085-
10861046 private void connect_to_server () {
10871047 var dialog = new PF .ConnectServerDialog ((Gtk . Window ) this );
10881048 string server_uri = " " ;
0 commit comments