@@ -35,6 +35,7 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
3535 public const string ACTION_CHANGE_BRANCH = " change-branch" ;
3636 public const string ACTION_CLOSE_FOLDER = " close-folder" ;
3737 public const string ACTION_CLOSE_OTHER_FOLDERS = " close-other-folders" ;
38+ public const string ACTION_SET_ACTIVE_PROJECT = " set-active-project" ;
3839
3940 private const ActionEntry [] ACTION_ENTRIES = {
4041 { ACTION_LAUNCH_APP_WITH_FILE_PATH , action_launch_app_with_file_path, " as" },
@@ -46,7 +47,8 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
4647 { ACTION_NEW_FILE , add_new_file, " s" },
4748 { ACTION_NEW_FOLDER , add_new_folder, " s" },
4849 { ACTION_CLOSE_FOLDER , action_close_folder, " s" },
49- { ACTION_CLOSE_OTHER_FOLDERS , action_close_other_folders, " s" }
50+ { ACTION_CLOSE_OTHER_FOLDERS , action_close_other_folders, " s" },
51+ { ACTION_SET_ACTIVE_PROJECT , action_set_active_project, " s" }
5052 };
5153
5254 private GLib . Settings settings;
@@ -124,6 +126,23 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane
124126 write_settings ();
125127 }
126128
129+ private void action_set_active_project (SimpleAction action , GLib .Variant ? parameter ) {
130+ warning (" set active project" );
131+ var path = parameter. get_string ();
132+ if (path == null || path == " " ) {
133+ return ;
134+ }
135+
136+ var folder_root = find_path (root, path) as ProjectFolderItem ;
137+ if (folder_root == null ) {
138+ return ;
139+ }
140+
141+ git_manager. active_project_path = path;
142+
143+ write_settings ();
144+ }
145+
127146 public void restore_saved_state () {
128147 foreach (unowned string path in settings. get_strv (" opened-folders" )) {
129148 add_folder (new File (path), false );
0 commit comments