Skip to content

Commit

Permalink
After settings reset, startup process re-initiated (SDK, Java prompt
Browse files Browse the repository at this point in the history
etc.) (reference #27)
  • Loading branch information
rat-moonshine committed Oct 20, 2017
1 parent 4d4def8 commit 1017b66
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ package actionScripts.plugin.settings
import actionScripts.plugin.settings.vo.PluginSetting;
import actionScripts.plugin.settings.vo.PluginSettingsWrapper;
import actionScripts.plugin.splashscreen.SplashScreenPlugin;
import actionScripts.plugin.startup.StartupHelperPlugin;
import actionScripts.plugin.syntax.AS3SyntaxPlugin;
import actionScripts.plugin.syntax.CSSSyntaxPlugin;
import actionScripts.plugin.syntax.HTMLSyntaxPlugin;
Expand Down Expand Up @@ -161,6 +162,9 @@ package actionScripts.plugin.settings

// removing plugin-storage values
clearAllSettings();

// restarting all startup process again
dispatcher.dispatchEvent(new Event(StartupHelperPlugin.EVENT_RESTART_HELPING));
}

private function getClassName(instance:*):String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ package actionScripts.plugin.startup
public static const EVENT_TYPEAHEAD_REQUIRES_SDK:String = "EVENT_TYPEAHEAD_REQUIRES_SDK";
public static const EVENT_SDK_HELPER_DOWNLOAD_REQUEST:String = "EVENT_SDK_HELPER_DOWNLOAD_REQUEST";
public static const EVENT_SDK_UNZIP_REQUEST:String = "EVENT_SDK_UNZIP_REQUEST";
public static const EVENT_RESTART_HELPING:String = "EVENT_RESTART_HELPING";

private static const SDK_XTENDED:String = "SDK_XTENDED";
private static const CC_JAVA:String = "CC_JAVA";
Expand All @@ -65,19 +66,29 @@ package actionScripts.plugin.startup
// we want this to be work in desktop version only
if (!ConstantsCoreVO.IS_AIR) return;

dispatcher.addEventListener(EVENT_RESTART_HELPING, onRestartRequest, false, 0, true);

// event listner to open up #sdk-extended from File in OSX
CONFIG::OSX
{
dispatcher.addEventListener(EVENT_SDK_HELPER_DOWNLOAD_REQUEST, onSDKhelperDownloadRequest, false, 0, true);
}

preInitHelping();
}

/**
* Pre-initialization helping process
*/
private function preInitHelping():void
{
sequences = new Array();
sequences.push(SDK_XTENDED);
sequences.push(CC_JAVA);
sequences.push(CC_SDK);

// just a little delay to see things visually right
setTimeout(startHelping, 1000);

// event listner to open up #sdk-extended from File in OSX
CONFIG::OSX
{
dispatcher.addEventListener(EVENT_SDK_HELPER_DOWNLOAD_REQUEST, onSDKhelperDownloadRequest, false, 0, true);
}
}

/**
Expand Down Expand Up @@ -224,6 +235,21 @@ package actionScripts.plugin.startup
//
//--------------------------------------------------------------------------

/**
* To restart helping process
*/
private function onRestartRequest(event:Event):void
{
sdkNotificationView = null;
ccNotificationView = null;
sequences = null;
sequenceIndex = 0;
isSDKSetupShowing = false;
ConstantsCoreVO.IS_OSX_CODECOMPLETION_PROMPT = false;

preInitHelping();
}

/**
* On SDK notification prompt close
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.core.IDataRenderer;
import mx.effects.Fade;
import mx.events.EffectEvent;
import mx.events.FlexEvent;
import mx.events.ResizeEvent;
Expand Down Expand Up @@ -465,20 +466,19 @@
private function onDefaultSDKStateChanged(event:Event):void
{
var isSDKAvailable:Boolean = IDEModel.getInstance().defaultSDK ? true : false;
var tmpMove:Move;
if (!isSDKAvailable && !isNoSDKMessageShown)
{
grpNoSDKMess.visible = true;
isNoSDKMessageShown = true;
grpNoSDKMess.y = this.height - grpNoSDKMess.height;
tmpMove = new Move(grpNoSDKMess);
tmpMove.yFrom = this.height;
tmpMove.yTo = height - grpNoSDKMess.height;
tmpMove.play();
var tmpFade:Fade = new Fade(grpNoSDKMess);
tmpFade.alphaFrom = 0;
tmpFade.alphaTo = 1;
tmpFade.play();
}
else if (isSDKAvailable && isNoSDKMessageShown)
{
tmpMove = new Move(grpNoSDKMess);
var tmpMove:Move = new Move(grpNoSDKMess);
tmpMove.yFrom = grpNoSDKMess.y;
tmpMove.yTo = height;
tmpMove.addEventListener(EffectEvent.EFFECT_END, onEffectEnds);
Expand All @@ -489,7 +489,7 @@
function onEffectEnds(effEvent:EffectEvent):void
{
effEvent.target.removeEventListener(EffectEvent.EFFECT_END, onEffectEnds);
grpNoSDKMess.visible = false;
grpNoSDKMess.alpha = 0;
}
}
Expand Down Expand Up @@ -624,7 +624,7 @@
</s:VGroup>

<s:Group id="grpNoSDKMess"
width="100%" height="24" visible="false">
width="100%" height="24" alpha="0">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffffcc"/>
Expand Down

0 comments on commit 1017b66

Please sign in to comment.