|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
function ProjectModuleCard::onAdd(%this)
|
|
|
{
|
|
|
+ %this.toggleLaunchGroupCount = 0;
|
|
|
%this.chain = new GuiChainCtrl()
|
|
|
{
|
|
|
HorizSizing="width";
|
|
@@ -52,7 +53,7 @@
|
|
|
ThemeManager.setProfile(%this.versionText, "codeProfile");
|
|
|
%this.chain.add(%this.versionText);
|
|
|
|
|
|
- %this.addSpacer();
|
|
|
+ %this.addSpacer(%this.chain);
|
|
|
|
|
|
%this.descriptionText = new GuiControl()
|
|
|
{
|
|
@@ -67,6 +68,28 @@
|
|
|
ThemeManager.setProfile(%this.descriptionText, "normalTextProfile");
|
|
|
%this.chain.add(%this.descriptionText);
|
|
|
|
|
|
+ %this.optionGroup = %this.addSubSection("Module Options");
|
|
|
+
|
|
|
+ %this.launchGroupCheckBox = new GuiCheckBoxCtrl()
|
|
|
+ {
|
|
|
+ Class="ProjectManagerLaunchGroupCheckBox";
|
|
|
+ HorizSizing="width";
|
|
|
+ Position = "0 0";
|
|
|
+ Extent = "286 26";
|
|
|
+ Text = "Start on Project Launch";
|
|
|
+ BoxOffset = "0 2";
|
|
|
+ TextOffset = "22 0";
|
|
|
+ TextExtent = "264 26";
|
|
|
+ vAlign = "Middle";
|
|
|
+ Tooltip = "This change will be applied after restarting.";
|
|
|
+ };
|
|
|
+ ThemeManager.setProfile(%this.launchGroupCheckBox, "checkboxProfile");
|
|
|
+ ThemeManager.setProfile(%this.launchGroupCheckBox, "tipProfile", "TooltipProfile");
|
|
|
+ %this.optionGroup.add(%this.launchGroupCheckBox);
|
|
|
+ %this.launchGroupCheckBox.addListener(%this);
|
|
|
+
|
|
|
+ %this.addEmptySpace(30, %this.optionGroup);
|
|
|
+
|
|
|
%this.addSubSection("Dependencies");
|
|
|
|
|
|
%this.dependList = new GuiChainCtrl()
|
|
@@ -99,20 +122,20 @@
|
|
|
%this.startListening(ThemeManager);
|
|
|
}
|
|
|
|
|
|
-function ProjectModuleCard::addSpacer(%this)
|
|
|
+function ProjectModuleCard::addSubSection(%this, %name)
|
|
|
{
|
|
|
- %spacer = new GuiControl()
|
|
|
+ %chain = new GuiChainCtrl()
|
|
|
{
|
|
|
HorizSizing="width";
|
|
|
+ VertSizing="height";
|
|
|
Position = "0 0";
|
|
|
- Extent = "286 6";
|
|
|
+ Extent = "286 0";
|
|
|
+ IsVertical = "1";
|
|
|
+ ChildSpacing = -4;
|
|
|
};
|
|
|
- ThemeManager.setProfile(%spacer, "spacerProfile");
|
|
|
- %this.chain.add(%spacer);
|
|
|
-}
|
|
|
+ ThemeManager.setProfile(%chain, "emptyProfile");
|
|
|
+ %this.chain.add(%chain);
|
|
|
|
|
|
-function ProjectModuleCard::addSubSection(%this, %name)
|
|
|
-{
|
|
|
%subSection = new GuiControl()
|
|
|
{
|
|
|
HorizSizing="width";
|
|
@@ -121,18 +144,40 @@ function ProjectModuleCard::addSubSection(%this, %name)
|
|
|
FontSizeAdjust = "0.8";
|
|
|
};
|
|
|
ThemeManager.setProfile(%subSection, "titleProfile");
|
|
|
- %this.chain.add(%subSection);
|
|
|
+ %chain.add(%subSection);
|
|
|
+
|
|
|
+ %this.addSpacer(%chain);
|
|
|
+ %this.addEmptySpace(8, %chain);
|
|
|
|
|
|
- %this.addSpacer();
|
|
|
+ return %chain;
|
|
|
+}
|
|
|
+
|
|
|
+function ProjectModuleCard::addSpacer(%this, %chain)
|
|
|
+{
|
|
|
+ %spacer = new GuiControl()
|
|
|
+ {
|
|
|
+ HorizSizing="width";
|
|
|
+ Position = "0 0";
|
|
|
+ Extent = "286 6";
|
|
|
+ };
|
|
|
+ ThemeManager.setProfile(%spacer, "spacerProfile");
|
|
|
+ %chain.add(%spacer);
|
|
|
|
|
|
+ return %spacer;
|
|
|
+}
|
|
|
+
|
|
|
+function ProjectModuleCard::addEmptySpace(%this, %size, %chain)
|
|
|
+{
|
|
|
%empty = new GuiControl()
|
|
|
{
|
|
|
HorizSizing="width";
|
|
|
Position = "0 0";
|
|
|
- Extent = "286 8";
|
|
|
+ Extent = "286" SPC %size;
|
|
|
};
|
|
|
ThemeManager.setProfile(%empty, "emptyProfile");
|
|
|
- %this.chain.add(%empty);
|
|
|
+ %chain.add(%empty);
|
|
|
+
|
|
|
+ return %empty;
|
|
|
}
|
|
|
|
|
|
function ProjectModuleCard::onThemeChange(%this, %theme)
|
|
@@ -145,6 +190,7 @@ function ProjectModuleCard::show(%this, %module)
|
|
|
{
|
|
|
if(isObject(%module))
|
|
|
{
|
|
|
+ %this.activeModule = %module;
|
|
|
%this.moduleID = %module.moduleID;
|
|
|
%this.versionID = %module.versionID;
|
|
|
|
|
@@ -173,6 +219,21 @@ function ProjectModuleCard::show(%this, %module)
|
|
|
|
|
|
}
|
|
|
|
|
|
+ %this.optionGroup.visible = false;
|
|
|
+ if(!%module.Synchronized)
|
|
|
+ {
|
|
|
+ %this.optionGroup.visible = true;
|
|
|
+ %this.launchGroupCheckBox.setStateOn(%module.Group $= "launch");
|
|
|
+ for(%i = 0; %i < %this.toggleLaunchGroupCount; %i++)
|
|
|
+ {
|
|
|
+ if(%this.toggleLaunchGroup[%i] $= %this.activeModule.getModulePath())
|
|
|
+ {
|
|
|
+ %this.launchGroupCheckBox.setStateOn(!%this.launchGroupCheckBox.getStateOn());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
%this.visible = true;
|
|
|
%this.dependList.show(%module);
|
|
|
}
|
|
@@ -180,6 +241,7 @@ function ProjectModuleCard::show(%this, %module)
|
|
|
|
|
|
function ProjectModuleCard::hide(%this)
|
|
|
{
|
|
|
+ %this.activeModule = 0;
|
|
|
%this.moduleID = "";
|
|
|
%this.versionID = 0;
|
|
|
%this.visible = false;
|
|
@@ -243,3 +305,59 @@ function ProjectModuleCard::onButtonClick(%this)
|
|
|
{
|
|
|
%this.postEvent(%this.button.getText() @ "Click");
|
|
|
}
|
|
|
+
|
|
|
+function ProjectManagerLaunchGroupCheckBox::onClick(%this)
|
|
|
+{
|
|
|
+ %state = %this.getStateOn();
|
|
|
+ %this.postEvent("LauchGroupClick", %state);
|
|
|
+}
|
|
|
+
|
|
|
+function ProjectModuleCard::onLauchGroupClick(%this, %state)
|
|
|
+{
|
|
|
+ %this.startListening(ProjectManager);
|
|
|
+ if(isObject(%this.activeModule))
|
|
|
+ {
|
|
|
+ if((%state && %this.activeModule.group $= "launch") || (!%state && %this.activeModule.group !$= "launch"))
|
|
|
+ {
|
|
|
+ %path = %this.activeModule.getModulePath();
|
|
|
+ for(%i = 0; %i < %this.toggleLaunchGroupCount; %i++)
|
|
|
+ {
|
|
|
+ if(%this.toggleLaunchGroup[%i] $= %path)
|
|
|
+ {
|
|
|
+ %this.toggleLaunchGroup[%i] = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ %this.toggleLaunchGroup[%this.toggleLaunchGroupCount] = %this.activeModule.getModulePath();
|
|
|
+ %this.toggleLaunchGroupCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function ProjectModuleCard::onShutDown(%this)
|
|
|
+{
|
|
|
+ for(%i = 0; %i < %this.toggleLaunchGroupCount; %i++)
|
|
|
+ {
|
|
|
+ %path = pathConcat(%this.toggleLaunchGroup[%i], "module.taml");
|
|
|
+ if(%path !$= "" && isFile(%path))
|
|
|
+ {
|
|
|
+ %this.toggleLaunchGroupForPath(%path);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function ProjectModuleCard::toggleLaunchGroupForPath(%this, %path)
|
|
|
+{
|
|
|
+ %module = TamlRead(%path);
|
|
|
+ if(%module.group $= "launch")
|
|
|
+ {
|
|
|
+ %module.group = "";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ %module.group = "launch";
|
|
|
+ }
|
|
|
+ TamlWrite(%module, %path);
|
|
|
+}
|