From f30841cf55218e75d48ee8ff8b211178d893113b Mon Sep 17 00:00:00 2001 From: rat-moonshine Date: Wed, 27 Dec 2023 18:12:23 +0530 Subject: [PATCH] Added recent files/project list clear on Reset to Default #1232 --- .../recentlyOpened/RecentlyOpenedPlugin.as | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ide/MoonshineSharedCore/src/actionScripts/plugin/recentlyOpened/RecentlyOpenedPlugin.as b/ide/MoonshineSharedCore/src/actionScripts/plugin/recentlyOpened/RecentlyOpenedPlugin.as index d1bda37f2..e275dc64d 100644 --- a/ide/MoonshineSharedCore/src/actionScripts/plugin/recentlyOpened/RecentlyOpenedPlugin.as +++ b/ide/MoonshineSharedCore/src/actionScripts/plugin/recentlyOpened/RecentlyOpenedPlugin.as @@ -123,6 +123,27 @@ package actionScripts.plugin.recentlyOpened return UtilsCore.getRecentFilesMenu(); } + override public function resetSettings():void + { + if (cookie.data.hasOwnProperty('recentFiles')) + delete cookie.data['recentFiles']; + if (cookie.data.hasOwnProperty('recentProjects')) + delete cookie.data['recentProjects']; + if (cookie.data.hasOwnProperty('recentProjectsOpenedOption')) + delete cookie.data['recentProjectsOpenedOption']; + if (cookie.data.hasOwnProperty('lastBrowsedLocation')) + delete cookie.data['lastBrowsedLocation']; + cookie.flush(); + + model.recentlyOpenedFiles = new ArrayCollection(); + model.recentlyOpenedProjects = new ArrayCollection(); + model.recentlyOpenedProjectOpenedOption = new ArrayCollection(); + model.recentSaveProjectPath = new ArrayCollection(); + + dispatcher.dispatchEvent(new Event(RECENT_PROJECT_LIST_UPDATED)); + dispatcher.dispatchEvent(new Event(RECENT_FILES_LIST_UPDATED)); + } + private function restoreFromCookie():void { // Uncomment & run to delete cookie