minClientSize = { 560, 542 };
nativeDecorations = true;
- IDESettings ideSettings;
- IDESettingsContainer settingsContainer;
String workspaceActiveCompiler;
TabControl tabControl { this, background = formColor, anchor = { left = 8, top = 8, right = 8, bottom = 40 } };
bool editorSettingsChanged = false;
bool compilerSettingsChanged = false;
bool projectOptionsChanged = false;
+ AVLTree<String> cfgsToWrite = null;
if(editorTab.modifiedDocument)
{
if(editorTab.useFreeCaret.checked != ideSettings.useFreeCaret ||
{
if(strcmp(compilersTab.compilerConfigsDir.path, ideSettings.compilerConfigsDir))
ideSettings.compilerConfigsDir = compilersTab.compilerConfigsDir.path;
- ideSettings.compilerConfigs.Free();
- for(compiler : compilersTab.compilerConfigs)
+ if(compilersTab.compilerConfigs.OnCompare(ideConfig.compilers))
{
- ideSettings.compilerConfigs.Add(compiler.Copy());
+ cfgsToWrite = compilersTab.compilerConfigs.getWriteRequiredList(ideConfig.compilers);
+ ideConfig.compilers.Free();
+ for(compiler : compilersTab.compilerConfigs)
+ {
+ ideConfig.compilers.Add(compiler.Copy());
+ }
+ compilerSettingsChanged = true;
}
- compilerSettingsChanged = true;
}
if(projectOptionsTab.modifiedDocument)
}
}
- settingsContainer.Save();
+ if(editorSettingsChanged || projectOptionsChanged)
+ settingsContainer.Save();
if(compilerSettingsChanged)
+ {
+ ideConfig.compilers.write(settingsContainer, cfgsToWrite);
OnGlobalSettingChange(GlobalSettingsChange::compilerSettings);
+ cfgsToWrite.Free();
+ delete cfgsToWrite;
+ }
if(editorSettingsChanged)
OnGlobalSettingChange(GlobalSettingsChange::editorSettings);
if(projectOptionsChanged)
// CompilersTab
if(workspaceActiveCompiler)
{
- for(compiler : ideSettings.compilerConfigs)
+ for(compiler : ideConfig.compilers)
{
if(!activateCompiler && !strcmp(workspaceActiveCompiler, compiler.name))
activateCompiler = compiler;
}
if(!activateCompiler && readonlyCompiler)
activateCompiler = readonlyCompiler;
- if(!activateCompiler && ideSettings.compilerConfigs.count)
- activateCompiler = ideSettings.compilerConfigs[0];
+ if(!activateCompiler && ideConfig.compilers.count)
+ activateCompiler = ideConfig.compilers[0];
- for(compiler : ideSettings.compilerConfigs)
+ for(compiler : ideConfig.compilers)
compilersTab.AddCompiler(compiler.Copy(), compiler == activateCompiler);
compilersTab.compilerConfigsDir.path = ideSettings.compilerConfigsDir;
CompilerEnvironmentTab environmentTab { this, tabControl = tabControl };
CompilerOptionsTab optionsTab { this, tabControl = tabControl };
- List<CompilerConfig> compilerConfigs { };
+ CompilerConfigs compilerConfigs { };
CompilerConfig activeCompiler;
Label labelCompilers
cppLabel.disabled = cpp.disabled = isVC || disabled;
cxxLabel.disabled = cxx.disabled = isVC || disabled;
ccLabel.disabled = cc.disabled = isVC || disabled;
- ldLabel.disabled = cxx.disabled = isVC || disabled;
+ ldLabel.disabled = ld.disabled = isVC || disabled;
+ arLabel.disabled = ar.disabled = isVC || disabled;
makeLabel.disabled = make.disabled = disabled;
executableLauncherLabel.disabled = executableLauncher.disabled = disabled;
gnuToolchainPrefixLabel.disabled = gnuToolchainPrefix.disabled = disabled;
Button distccEnabled
{
- this, text = $"Use distcc", hotKey = altD, position = { 158, 68 };
+ this, text = $"Use distcc", position = { 158, 68 };
isCheckbox = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
CompilerConfig compiler = loadedCompiler;
if(compiler)
{
- distccHosts.disabled = !button.checked;
+ distccHostsLabel.disabled = distccHosts.disabled = !button.checked;
compiler.distccEnabled = button.checked;
modifiedDocument = true;
compilersTab.modifiedDocument = true;
}
};
- Label distccHostsLabel { this, position = { 8, 96 }, labeledWindow = distccHosts };
+ Label distccHostsLabel { this, position = { 240, 68 }, labeledWindow = distccHosts };
EditBox distccHosts
{
this, text = $"distcc hosts", hotKey = altH;
- position = { 88, 92 }, size = { 300, 22 };
+ position = { 320, 64 }, size = { 160, 22 };
bool NotifyModified(EditBox editBox)
{
}
};
- Label lblPrepDefs { this, position = { 8, 126 }, labeledWindow = prepDefs };
+ Label lblPrepDefs { this, position = { 8, 96 }, labeledWindow = prepDefs };
StringListBox prepDefs
{
this, text = $"Preprocessor directives", hotKey = altP;
- position = { 168, 124 }, size = { 280, 22 }, anchor = { left = 168, top = 124, right = 8 };
+ position = { 168, 94 }, size = { 280, 22 }, anchor = { left = 168, top = 94, right = 8 };
bool NotifyModified(EditBox editBox)
{
}
};
- Label leCcompilerFlags { this, position = { 8, 156 }, labeledWindow = eCcompilerFlags };
+ Label leCcompilerFlags { this, position = { 8, 126 }, labeledWindow = eCcompilerFlags };
StringListBox eCcompilerFlags
{
this, text = $"Additional eC compiler flags", hotKey = altG;
- position = { 168, 154 }, size = { 280, 22 }, anchor = { left = 168, top = 154, right = 8 };
+ position = { 168, 124 }, size = { 280, 22 }, anchor = { left = 168, top = 124, right = 8 };
bool NotifyModified(EditBox editBox)
{
}
};
- Label lblCompilerFlags { this, position = { 8, 186 }, labeledWindow = compilerFlags };
+ Label lblCompilerFlags { this, position = { 8, 156 }, labeledWindow = compilerFlags };
StringListBox compilerFlags
{
- this, text = $"Additional compiler flags", hotKey = altR;
- position = { 168, 184 }, size = { 280, 22 }, anchor = { left = 168, top = 184, right = 8 };
+ this, text = $"Additional C compiler flags", hotKey = altR;
+ position = { 168, 154 }, size = { 280, 22 }, anchor = { left = 168, top = 154, right = 8 };
bool NotifyModified(EditBox editBox)
{
}
};
+ Label lblcxxFlags { this, position = { 8, 186 }, labeledWindow = cxxFlags };
+ StringListBox cxxFlags
+ {
+ this, text = $"Additional C++ compiler flags", hotKey = altD;
+ position = { 168, 184 }, size = { 280, 22 }, anchor = { left = 168, top = 184, right = 8 };
+
+ bool NotifyModified(EditBox editBox)
+ {
+ if(loadedCompiler)
+ {
+ CompilerConfig compiler = loadedCompiler;
+ compiler.cxxFlags = ((StringListBox)editBox).strings;
+ modifiedDocument = true;
+ compilersTab.modifiedDocument = true;
+ }
+ return true;
+ }
+ };
+
Label lblLinkerFlags { this, position = { 8, 216 }, labeledWindow = linkerFlags };
StringListBox linkerFlags
{
}
};
- Label outputFileExtLabel { this, position = { 8, 306 }, labeledWindow = outputFileExt };
- EditBox outputFileExt
+ Label staticLibFileExtLabel { this, position = { 8, 306 }, labeledWindow = staticLibFileExt };
+ EditBox staticLibFileExt
{
- this, text = $"Output file extension";//, hotKey = altH;
+ this, text = $"Target extensions (a, so, exe)";//, hotKey = altH;
position = { 168, 304 }, size = { 80, 22 };
bool NotifyModified(EditBox editBox)
CompilerConfig compiler = loadedCompiler;
if(compiler)
{
- compiler.outputFileExt = editBox.contents;
+ compiler.staticLibFileExt = editBox.contents;
+ modifiedDocument = true;
+ compilersTab.modifiedDocument = true;
+ }
+ return true;
+ }
+ };
+ EditBox sharedLibFileExt
+ {
+ this;
+ position = { 256, 304 }, size = { 80, 22 };
+
+ bool NotifyModified(EditBox editBox)
+ {
+ CompilerConfig compiler = loadedCompiler;
+ if(compiler)
+ {
+ compiler.sharedLibFileExt = editBox.contents;
+ modifiedDocument = true;
+ compilersTab.modifiedDocument = true;
+ }
+ return true;
+ }
+ };
+ EditBox executableFileExt
+ {
+ this;
+ position = { 344, 304 }, size = { 80, 22 };
+
+ bool NotifyModified(EditBox editBox)
+ {
+ CompilerConfig compiler = loadedCompiler;
+ if(compiler)
+ {
+ compiler.executableFileExt = editBox.contents;
+ modifiedDocument = true;
+ compilersTab.modifiedDocument = true;
+ }
+ return true;
+ }
+ };
+
+ Button stripTarget
+ {
+ this, text = $"Strip target", hotKey = altC, position = { 168, 332 };
+ isCheckbox = true;
+
+ bool NotifyClicked(Button button, int x, int y, Modifiers mods)
+ {
+ CompilerConfig compiler = loadedCompiler;
+ if(compiler)
+ {
+ compiler.noStripTarget = !button.checked;
modifiedDocument = true;
compilersTab.modifiedDocument = true;
}
Button resourcesDotEar
{
- this, text = $"Use resources.ear", position = { 300, 308 };
+ this, text = $"Use resources.ear", position = { 308, 332 };
isCheckbox = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
numJobsBox.Refresh();
ccacheEnabled.checked = compiler.ccacheEnabled;
distccEnabled.checked = compiler.distccEnabled;
- distccHosts.disabled = !compiler.distccEnabled;
+ distccHostsLabel.disabled = distccHosts.disabled = !compiler.distccEnabled;
distccHosts.contents = compiler.distccHosts;
prepDefs.strings = compiler.prepDirectives;
excludedLibraries.strings = compiler.excludeLibs;
eCcompilerFlags.strings = compiler.eCcompilerFlags;
compilerFlags.strings = compiler.compilerFlags;
+ cxxFlags.strings = compiler.cxxFlags;
linkerFlags.strings = compiler.linkerFlags;
objectFileExt.contents = compiler.objectFileExt;
- outputFileExt.contents = compiler.outputFileExt;
+ staticLibFileExt.contents = compiler.staticLibFileExt;
+ sharedLibFileExt.contents = compiler.sharedLibFileExt;
+ executableFileExt.contents = compiler.executableFileExt;
+ stripTarget.checked = !compiler.noStripTarget;
resourcesDotEar.checked = compiler.resourcesDotEar;
labelTargetPlatform.disabled = disabled;
bool OnCreate()
{
GlobalSettingsDialog dialog = this.dialog;
- if(dialog && dialog.compilersTab.compilerConfigs && dialog.ideSettings)
+ if(dialog && dialog.compilersTab.compilerConfigs && ideSettings)
{
DataRow row;
- for(compiler : dialog.ideSettings.compilerConfigs)
+ for(compiler : ideConfig.compilers)
{
row = defaultCompilerDropBox.AddString(compiler.name);
- if(dialog.ideSettings.defaultCompiler && dialog.ideSettings.defaultCompiler[0] &&
- !strcmp(compiler.name, dialog.ideSettings.defaultCompiler))
+ if(ideSettings.defaultCompiler && ideSettings.defaultCompiler[0] &&
+ !strcmp(compiler.name, ideSettings.defaultCompiler))
defaultCompilerDropBox.currentRow = row;
}
if(!defaultCompilerDropBox.currentRow && defaultCompilerDropBox)