Skip to content

Commit

Permalink
Updated procedure against clear all Moonshine settings (those can be set
Browse files Browse the repository at this point in the history
through Moonshine > File > Settings (reference #27)
  • Loading branch information
rat-moonshine committed Oct 18, 2017
1 parent 2f980e0 commit 4274718
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,18 @@ package actionScripts.plugins.ant

}

override public function resetSettings():void
{
model.antScriptFile = null;
antHomePath = "";
}

private function reset():void
{
isASuccessBuild = false;
nativeProcess = null;
selectedProject = null;
IDEModel.getInstance().antScriptFile = null;
model.antScriptFile = null;
}

private function onAntURLSet(event:NewFileEvent):void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ package actionScripts.plugins.as3project.mxmlc
import mx.managers.PopUpManager;
import mx.resources.ResourceManager;

import actionScripts.events.GeneralEvent;
import actionScripts.events.GlobalEventDispatcher;
import actionScripts.events.ProjectEvent;
import actionScripts.events.RefreshTreeEvent;
Expand Down Expand Up @@ -249,6 +250,13 @@ package actionScripts.plugins.as3project.mxmlc
cmdLine = null;
}

override public function resetSettings():void
{
model.userSavedSDKs = new ArrayCollection();
defaultFlexSDK = "";
currentSDK = null;
}

public function getSettingsList():Vector.<ISetting>
{
return Vector.<ISetting>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ package actionScripts.plugins.away3d
dispatcher.removeEventListener(ProjectEvent.ADD_PROJECT_AWAY3D, onAway3DProjectCreated);
}

override public function resetSettings():void
{
awdFileObject = null;
}

public function getSettingsList():Vector.<ISetting>
{
return Vector.<ISetting>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ package actionScripts.plugins.svn
dispatcher.removeEventListener(CHECKOUT_REQUEST, handleCheckoutRequest);
}

override public function resetSettings():void
{
svnBinaryPath = null;
}

public function getSettingsList():Vector.<ISetting>
{
return Vector.<ISetting>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package actionScripts.plugin
function get description():String;
function activate():void
function deactivate():void
function resetSettings():void
function get activated():Boolean
function get activatedByDefault():Boolean

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ package actionScripts.plugin
{
_activated = false;
}
public function resetSettings():void
{

}


public function PluginBase() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ package actionScripts.plugin.actionscript.as3project.save
public function set workspacePath(value:String):void
{
_workspacePath = value;
OSXBookmarkerNotifiers.workspaceLocation = new FileLocation(_workspacePath);
OSXBookmarkerNotifiers.workspaceLocation = value ? new FileLocation(_workspacePath) : null;
}

public function get isResetCalled():Boolean { return false; }
Expand All @@ -102,6 +102,14 @@ package actionScripts.plugin.actionscript.as3project.save
dispatcher.removeEventListener(ProjectEvent.ACCESS_MANAGER, openAccessManager);
}

override public function resetSettings():void
{
workspacePath = null;
isSaveFiles = false;
OSXBookmarkerNotifiers.isWorkspaceAcknowledged = false;
model.saveFilesBeforeBuild = false;
}

public function getSettingsList():Vector.<ISetting>
{
// update local path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ package actionScripts.plugin.console
return (consoleView != null);
}

override public function resetSettings():void
{
consoleTriggerKey = null;
consolePopsOver = false;
showDebugMessages = true;
}

private var isOverTheExpandCollapseButton:Boolean;
private function onDividerMouseOver(event:MouseEvent):void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,31 +194,21 @@ package actionScripts.plugin.recentlyOpened
// fields those limited to Settings

delete cookie.data["javaPathForTypeahead"];
model.javaPathForTypeAhead = null;
model.isCodeCompletionJavaPresent = false;

delete cookie.data["userSDKs"];
model.userSavedSDKs = new ArrayCollection();

delete cookie.data["moonshineWorkspace"];
OSXBookmarkerNotifiers.workspaceLocation = null;

delete cookie.data["isWorkspaceAcknowledged"];
OSXBookmarkerNotifiers.isWorkspaceAcknowledged = false;

delete cookie.data["isBundledSDKpromptDNS"];
ConstantsCoreVO.IS_BUNDLED_SDK_PROMPT_DNS = false;

delete cookie.data["isSDKhelperPromptDNS"];
ConstantsCoreVO.IS_SDK_HELPER_PROMPT_DNS = false;

delete cookie.data["devicesAndroid"];
delete cookie.data["devicesIOS"];

model.javaPathForTypeAhead = null;
model.isCodeCompletionJavaPresent = false;
ConstantsCoreVO.IS_BUNDLED_SDK_PROMPT_DNS = false;
ConstantsCoreVO.IS_SDK_HELPER_PROMPT_DNS = false;
ConstantsCoreVO.generateDevices();

model.defaultSDK = null;
model.antHomePath = null;
model.saveFilesBeforeBuild = false;
cookie.flush();
}

private function handleAddProject(event:ProjectEvent):void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ package actionScripts.plugin.settings
import flash.utils.getQualifiedClassName;

import actionScripts.events.AddTabEvent;
import actionScripts.events.GeneralEvent;
import actionScripts.events.SettingsEvent;
import actionScripts.factory.FileLocation;
import actionScripts.plugin.IPlugin;
Expand All @@ -95,7 +96,7 @@ package actionScripts.plugin.settings
import actionScripts.ui.tabview.CloseTabEvent;
import actionScripts.utils.SDKUtils;
import actionScripts.utils.moonshine_internal;
import actionScripts.valueObjects.ConstantsCoreVO;
import actionScripts.valueObjects.ConstantsCoreVO;

use namespace moonshine_internal;

Expand Down Expand Up @@ -131,6 +132,7 @@ package actionScripts.plugin.settings
dispatcher.addEventListener(SetSettingsEvent.SET_SETTING, handleSetSettings);
dispatcher.addEventListener(RequestSettingEvent.REQUEST_SETTING, handleRequestSetting);
dispatcher.addEventListener(SetSettingsEvent.SAVE_SPECIFIC_PLUGIN_SETTING, handleSpecificPluginSave);
dispatcher.addEventListener(GeneralEvent.RESET_ALL_SETTINGS, onResetApplicationSettings, false, 0, true);

if (ConstantsCoreVO.IS_AIR)
{
Expand All @@ -148,7 +150,19 @@ package actionScripts.plugin.settings
registerCommand("debug-clear-app-settings",tempObj);
}


private function onResetApplicationSettings(event:GeneralEvent):void
{
// removing plugin-local values
var plugins:Vector.<IPlugin> = pluginManager.moonshine_internal::getPlugins();
for each (var plug:IPlugin in plugins)
{
plug.resetSettings();
}

// removing plugin-storage values
clearAllSettings();
}

private function getClassName(instance:*):String
{
return getQualifiedClassName(instance).split("::").pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ package actionScripts.plugin.templating
}
}

override public function resetSettings():void
{

}

protected function readTemplates():void
{
// Find default templates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,12 @@
var tmpMove:Move;
if (!isSDKAvailable && !isNoSDKMessageShown)
{
grpNoSDKMess.visible = true;
isNoSDKMessageShown = true;
tmpMove = new Move(grpNoSDKMess);
tmpMove.yFrom = this.height;
tmpMove.yTo = height - grpNoSDKMess.height;
grpNoSDKMess.visible = true;
isNoSDKMessageShown = true;
tmpMove.play();
}
else if (isSDKAvailable && isNoSDKMessageShown)
Expand Down

0 comments on commit 4274718

Please sign in to comment.