@@ -39,14 +39,14 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
3939 public const string ACTION_SET_ACTIVE_PROJECT = " set-active-project" ;
4040
4141 private const ActionEntry [] PRIMARY_ONLY_ACTION_ENTRIES = {
42- { ACTION_SHOW_APP_CHOOSER , action_show_app_chooser, " s" },
4342 { ACTION_SET_ACTIVE_PROJECT , action_set_active_project, " s" },
4443 { ACTION_RENAME_FILE , action_rename_file, " s" },
4544 { ACTION_RENAME_FOLDER , action_rename_folder, " s" }
4645 };
4746
4847 private const ActionEntry [] ACTION_ENTRIES = {
4948 { ACTION_LAUNCH_APP_WITH_FILE_PATH , action_launch_app_with_file_path, " as" },
49+ { ACTION_SHOW_APP_CHOOSER , action_show_app_chooser, " s" },
5050 { ACTION_EXECUTE_CONTRACT_WITH_FILE_PATH , action_execute_contract_with_file_path, " as" },
5151 { ACTION_DELETE , action_delete, " s" },
5252 { ACTION_NEW_FILE , add_new_file, " s" },
@@ -57,6 +57,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
5757
5858 private GLib . Settings settings;
5959 private Scratch . Services . GitManager git_manager;
60+ private unowned Scratch . MainWindow window;
6061
6162 public Scratch . Services . PluginsManager plugins { get ; construct; }
6263 public bool is_primary { get ; construct; }
@@ -100,6 +101,10 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
100101 });
101102
102103 show_all ();
104+
105+ realize. connect (() = > {
106+ window = (Scratch . MainWindow ) (this . get_toplevel ());
107+ });
103108 }
104109
105110 private void action_close_folder (SimpleAction action , GLib .Variant ? parameter ) {
@@ -137,7 +142,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
137142 }
138143
139144 // Make remaining project the active one
140- git_manager . active_project_path = path;
145+ window . active_project_path = path; // Temporary fix
141146
142147 write_settings ();
143148 }
@@ -153,7 +158,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
153158 return ;
154159 }
155160
156- git_manager . active_project_path = path;
161+ window . active_project_path = path;
157162
158163 write_settings ();
159164 }
@@ -210,7 +215,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
210215
211216 public void collapse_other_projects () {
212217 unowned string path;
213- path = git_manager . active_project_path;
218+ path = window . active_project_path;
214219
215220 foreach (var child in root. children) {
216221 var project_folder = ((ProjectFolderItem ) child);
0 commit comments