fix UIString deprecations

This commit is contained in:
Vadim Lopatin 2017-07-24 14:38:52 +03:00
parent bae22e7d01
commit f07c7401b2
5 changed files with 88 additions and 88 deletions

View File

@ -169,7 +169,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project)
project = currentWorkspace.startupProject;
if (!project) {
window.showMessageBox(UIString("Cannot debug project"d), UIString("Startup project is not specified"d));
window.showMessageBox(UIString.fromRaw("Cannot debug project"d), UIString.fromRaw("Startup project is not specified"d));
return;
}
buildProject(BuildOperation.Build, project, delegate(int result) {
@ -208,17 +208,17 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
import std.file;
stopExecution();
if (!project) {
window.showMessageBox(UIString("Cannot debug project"d), UIString("Startup project is not specified"d));
window.showMessageBox(UIString.fromRaw("Cannot debug project"d), UIString.fromRaw("Startup project is not specified"d));
return;
}
string executableFileName = project.executableFileName;
if (!executableFileName || !exists(executableFileName) || !isFile(executableFileName)) {
window.showMessageBox(UIString("Cannot debug project"d), UIString("Cannot find executable file"d));
window.showMessageBox(UIString.fromRaw("Cannot debug project"d), UIString.fromRaw("Cannot find executable file"d));
return;
}
string debuggerExecutable = _settings.debuggerExecutable;
if (debuggerExecutable.empty) {
window.showMessageBox(UIString("Cannot debug project"d), UIString("No debugger executable specified in settings"d));
window.showMessageBox(UIString.fromRaw("Cannot debug project"d), UIString.fromRaw("No debugger executable specified in settings"d));
return;
}
@ -238,7 +238,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project)
project = currentWorkspace.startupProject;
if (!project) {
window.showMessageBox(UIString("Cannot run project"d), UIString("Startup project is not specified"d));
window.showMessageBox(UIString.fromRaw("Cannot run project"d), UIString.fromRaw("Startup project is not specified"d));
return;
}
buildProject(BuildOperation.Build, project, delegate(int result) {
@ -255,12 +255,12 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
import std.file;
stopExecution();
if (!project) {
window.showMessageBox(UIString("Cannot run project"d), UIString("Startup project is not specified"d));
window.showMessageBox(UIString.fromRaw("Cannot run project"d), UIString.fromRaw("Startup project is not specified"d));
return;
}
string executableFileName = project.executableFileName;
if (!executableFileName || !exists(executableFileName) || !isFile(executableFileName)) {
window.showMessageBox(UIString("Cannot run project"d), UIString("Cannot find executable file"d));
window.showMessageBox(UIString.fromRaw("Cannot run project"d), UIString.fromRaw("Cannot find executable file"d));
return;
}
auto program = new ProgramExecutionNoDebug;
@ -438,7 +438,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
} else {
destroy(editor);
if (window)
window.showMessageBox(UIString("File open error"d), UIString("Failed to open file "d ~ toUTF32(file.filename)));
window.showMessageBox(UIString.fromRaw("File open error"d), UIString.fromRaw("Failed to open file "d ~ toUTF32(file.filename)));
return false;
}
}
@ -547,7 +547,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
}
string tabId = ed.id;
// tab content is modified - ask for confirmation
window.showMessageBox(UIString("Close file "d ~ toUTF32(baseName(tabId))), UIString("Content of this file has been changed."d),
window.showMessageBox(UIString.fromRaw("Close file "d ~ toUTF32(baseName(tabId))), UIString.fromRaw("Content of this file has been changed."d),
[ACTION_SAVE, ACTION_SAVE_ALL, ACTION_DISCARD_CHANGES, ACTION_DISCARD_ALL, ACTION_CANCEL],
0, delegate(const Action result) {
if (result == StandardAction.Save) {
@ -586,7 +586,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
DSourceEdit d = cast(DSourceEdit)_tabs.tabBody(tabId);
if (d && d.content.modified) {
// tab content is modified - ask for confirmation
window.showMessageBox(UIString("Close tab"d), UIString("Content of "d ~ toUTF32(baseName(tabId)) ~ " file has been changed."d),
window.showMessageBox(UIString.fromRaw("Close tab"d), UIString.fromRaw("Content of "d ~ toUTF32(baseName(tabId)) ~ " file has been changed."d),
[ACTION_SAVE, ACTION_DISCARD_CHANGES, ACTION_CANCEL],
0, delegate(const Action result) {
if (result == StandardAction.Save) {
@ -879,8 +879,8 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
Platform.instance.openURL(HELP_PAGE_URL);
return true;
case IDEActions.HelpAbout:
window.showMessageBox(UIString("About DlangIDE "d ~ DLANGIDE_VERSION),
UIString("DLangIDE\n(C) Vadim Lopatin, 2014-2016\nhttp://github.com/buggins/dlangide\nIDE for D programming language written in D\nUses DlangUI library for GUI"d));
window.showMessageBox(UIString.fromRaw("About DlangIDE "d ~ DLANGIDE_VERSION),
UIString.fromRaw("DLangIDE\n(C) Vadim Lopatin, 2014-2016\nhttp://github.com/buggins/dlangide\nIDE for D programming language written in D\nUses DlangUI library for GUI"d));
return true;
case StandardAction.OpenUrl:
platform.openURL(a.stringParam);
@ -889,8 +889,8 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
UIString caption;
caption = "Open Text File"d;
FileDialog dlg = createFileDialog(caption);
dlg.addFilter(FileFilterEntry(UIString("Source files"d), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini"));
dlg.addFilter(FileFilterEntry(UIString("All files"d), "*.*"));
dlg.addFilter(FileFilterEntry(UIString.fromRaw("Source files"d), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini"));
dlg.addFilter(FileFilterEntry(UIString.fromRaw("All files"d), "*.*"));
dlg.path = _settings.getRecentPath("FILE_OPEN_PATH");
dlg.dialogResult = delegate(Dialog d, const Action result) {
if (result.id == ACTION_OPEN.id) {
@ -967,7 +967,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
UIString caption;
caption = "Open Workspace or Project"d;
FileDialog dlg = createFileDialog(caption);
dlg.addFilter(FileFilterEntry(UIString("Workspace and project files"d), "*.dlangidews;dub.json;dub.sdl;package.json"));
dlg.addFilter(FileFilterEntry(UIString.fromRaw("Workspace and project files"d), "*.dlangidews;dub.json;dub.sdl;package.json"));
dlg.path = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH");
dlg.dialogResult = delegate(Dialog d, const Action result) {
if (result.id == ACTION_OPEN.id) {
@ -1131,8 +1131,8 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
Project project = srcfile.project;
if (!project)
return;
window.showMessageBox(UIString("Remove file"d),
UIString("Do you want to remove file "d ~ srcfile.name ~ "?"),
window.showMessageBox(UIString.fromRaw("Remove file"d),
UIString.fromRaw("Do you want to remove file "d ~ srcfile.name ~ "?"),
[ACTION_YES, ACTION_NO],
1, delegate(const Action result) {
if (result == StandardAction.Yes) {
@ -1227,7 +1227,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
//Log.d("settings before copy:\n", _settings.setting.toJSON(true));
Setting s = _settings.copySettings();
//Log.d("settings after copy:\n", s.toJSON(true));
SettingsDialog dlg = new SettingsDialog(UIString("DlangIDE settings"d), window, s, createSettingsPages());
SettingsDialog dlg = new SettingsDialog(UIString.fromRaw("DlangIDE settings"d), window, s, createSettingsPages());
dlg.dialogResult = delegate(Dialog dlg, const Action result) {
if (result.id == ACTION_APPLY.id) {
//Log.d("settings after edit:\n", s.toJSON(true));
@ -1257,7 +1257,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project)
return;
Setting s = project.settings.copySettings();
SettingsDialog dlg = new SettingsDialog(UIString(project.name ~ " settings"d), window, s, createProjectSettingsPages());
SettingsDialog dlg = new SettingsDialog(UIString.fromRaw(project.name ~ " settings"d), window, s, createProjectSettingsPages());
dlg.dialogResult = delegate(Dialog dlg, const Action result) {
if (result.id == ACTION_APPLY.id) {
//Log.d("settings after edit:\n", s.toJSON(true));
@ -1290,7 +1290,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
private bool loadProject(Project project) {
if (!project.load()) {
_logPanel.logLine("Cannot read project " ~ project.filename);
window.showMessageBox(UIString("Cannot open project"d), UIString("Error occured while opening project "d ~ toUTF32(project.filename)));
window.showMessageBox(UIString.fromRaw("Cannot open project"d), UIString.fromRaw("Error occured while opening project "d ~ toUTF32(project.filename)));
return false;
}
_logPanel.logLine(toUTF32("Project file " ~ project.filename ~ " is opened ok"));
@ -1307,7 +1307,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
_settings.updateRecentWorkspace(filename);
});
} else {
window.showMessageBox(UIString("Cannot open workspace"d), UIString("Error occured while opening workspace"d));
window.showMessageBox(UIString.fromRaw("Cannot open workspace"d), UIString.fromRaw("Error occured while opening workspace"d));
return;
}
} else if (filename.isProjectFile) {
@ -1319,10 +1319,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
Project existing = currentWorkspace.findProject(project.filename);
if (existing) {
_logPanel.logLine("This project already exists in current workspace");
window.showMessageBox(UIString("Open project"d), UIString("Project is already in workspace"d));
window.showMessageBox(UIString.fromRaw("Open project"d), UIString.fromRaw("Project is already in workspace"d));
return;
}
window.showMessageBox(UIString("Open project"d), UIString("Do you want to create new workspace or use current one?"d),
window.showMessageBox(UIString.fromRaw("Open project"d), UIString.fromRaw("Do you want to create new workspace or use current one?"d),
[ACTION_ADD_TO_CURRENT_WORKSPACE, ACTION_CREATE_NEW_WORKSPACE, ACTION_CANCEL], 0, delegate(const Action result) {
if (result.id == IDEActions.CreateNewWorkspace) {
// new ws
@ -1344,7 +1344,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
}
} else {
_logPanel.logLine("File is not recognized as DlangIDE project or workspace file");
window.showMessageBox(UIString("Invalid workspace file"d), UIString("This file is not a valid workspace or project file"d));
window.showMessageBox(UIString.fromRaw("Invalid workspace file"d), UIString.fromRaw("This file is not a valid workspace or project file"d));
}
}

View File

@ -47,7 +47,7 @@ class HomeScreen : ScrollWidget {
if (recentWorkspaces.length) {
foreach(fn; recentWorkspaces) {
Action a = ACTION_FILE_OPEN_WORKSPACE.clone();
a.label = UIString(toUTF32(stripExtension(baseName(fn))));
a.label = UIString.fromRaw(toUTF32(stripExtension(baseName(fn))));
a.stringParam = fn;
_column1.addChild(new LinkButton(a));
}

View File

@ -39,7 +39,7 @@ class NewFileDlg : Dialog {
ProjectFolder _folder;
string[] _sourcePaths;
this(IDEFrame parent, Project currentProject, ProjectFolder folder) {
super(UIString("New source file"d), parent.window,
super(UIString.fromRaw("New source file"d), parent.window,
DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
_ide = parent;
_icon = "dlangui-logo1";
@ -119,7 +119,7 @@ class NewFileDlg : Dialog {
_edLocation.filetypeIcons["dub.json"] = "project-d";
_edLocation.filetypeIcons["package.json"] = "project-d";
_edLocation.filetypeIcons[".dlangidews"] = "project-development";
_edLocation.addFilter(FileFilterEntry(UIString("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini"));
_edLocation.addFilter(FileFilterEntry(UIString.fromRaw("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini"));
_edLocation.caption = "Select directory"d;
// fill templates
@ -266,11 +266,11 @@ class NewFileDlg : Dialog {
Action newaction = action.clone();
if (action.id == IDEActions.FileNew) {
if (!validate()) {
window.showMessageBox(UIString("Error"d), UIString("Invalid parameters"));
window.showMessageBox(UIString.fromRaw("Error"d), UIString.fromRaw("Invalid parameters"));
return;
}
if (!createItem()) {
window.showMessageBox(UIString("Error"d), UIString("Failed to create project item"));
window.showMessageBox(UIString.fromRaw("Error"d), UIString.fromRaw("Failed to create project item"));
return;
}
newaction.objectParam = _result;

View File

@ -38,7 +38,7 @@ class NewProjectDlg : Dialog {
IDEFrame _ide;
this(IDEFrame parent, bool newWorkspace, Workspace currentWorkspace, string dir) {
super(newWorkspace ? UIString("New Workspace"d) : UIString("New Project"d), parent.window,
super(newWorkspace ? UIString.fromRaw("New Workspace"d) : UIString.fromRaw("New Project"d), parent.window,
DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
_ide = parent;
_icon = "dlangui-logo1";
@ -130,7 +130,7 @@ class NewProjectDlg : Dialog {
_edLocation.filetypeIcons["dub.json"] = "project-d";
_edLocation.filetypeIcons["package.json"] = "project-d";
_edLocation.filetypeIcons[".dlangidews"] = "project-development";
_edLocation.addFilter(FileFilterEntry(UIString("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini"));
_edLocation.addFilter(FileFilterEntry(UIString.fromRaw("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini"));
_edLocation.caption = "Select directory"d;
if (_currentWorkspace) {
@ -273,14 +273,14 @@ class NewProjectDlg : Dialog {
if (action.id == IDEActions.FileNewWorkspace || action.id == IDEActions.FileNewProject) {
if (!exists(_location)) {
// show message box with OK and CANCEL buttons, cancel by default, and handle its result
window.showMessageBox(UIString("Cannot create project"d), UIString("The target location does not exist.\nDo you want to create the target directory?"), [ACTION_YES, ACTION_CANCEL], 1, delegate(const Action a) {
window.showMessageBox(UIString.fromRaw("Cannot create project"d), UIString.fromRaw("The target location does not exist.\nDo you want to create the target directory?"), [ACTION_YES, ACTION_CANCEL], 1, delegate(const Action a) {
if (a.id == StandardAction.Yes) {
try {
mkdirRecurse(_location);
close(action);
} catch (Exception e) {
setError("Cannot create target location");
window.showMessageBox(UIString("Cannot create project"d), UIString(getError()));
window.showMessageBox(UIString.fromRaw("Cannot create project"d), UIString.fromRaw(getError()));
}
}
return true;
@ -288,11 +288,11 @@ class NewProjectDlg : Dialog {
return;
}
if (!validate()) {
window.showMessageBox(UIString("Cannot create project"d), UIString(getError()));
window.showMessageBox(UIString.fromRaw("Cannot create project"d), UIString.fromRaw(getError()));
return;
}
if (!createProject()) {
window.showMessageBox(UIString("Cannot create project"d), UIString("Failed to create project"));
window.showMessageBox(UIString.fromRaw("Cannot create project"d), UIString.fromRaw("Failed to create project"));
return;
}
newaction.objectParam = _result;
@ -496,8 +496,8 @@ extern (C) int UIAppMain(string[] args) {
};
// show message box with content of editors
window.mainWidget.childById!Button("btnOk").click = delegate(Widget w) {
window.showMessageBox(UIString("Ok button pressed"d),
UIString("Editors content\nEdit1: "d ~ edit1.text ~ "\nEdit2: "d ~ edit2.text));
window.showMessageBox(UIString.fromRaw("Ok button pressed"d),
UIString.fromRaw("Editors content\nEdit1: "d ~ edit1.text ~ "\nEdit2: "d ~ edit2.text));
return true;
};

View File

@ -12,22 +12,22 @@ public import dlangide.workspace.workspacesettings;
/// create DlangIDE settings pages tree
SettingsPage createSettingsPages() {
SettingsPage res = new SettingsPage("", UIString(""d));
SettingsPage res = new SettingsPage("", UIString.fromRaw(""d));
SettingsPage ui = res.addChild("interface", UIString("OPTION_INTERFACE"c));
ui.addStringComboBox("interface/theme", UIString("OPTION_THEME"c), [
SettingsPage ui = res.addChild("interface", UIString.fromId("OPTION_INTERFACE"c));
ui.addStringComboBox("interface/theme", UIString.fromId("OPTION_THEME"c), [
StringListValue("ide_theme_default", "OPTION_DEFAULT"c),
StringListValue("ide_theme_dark", "OPTION_DARK"c)]);
ui.addStringComboBox("interface/language", UIString("OPTION_LANGUAGE"c), [
ui.addStringComboBox("interface/language", UIString.fromId("OPTION_LANGUAGE"c), [
StringListValue("en", "MENU_VIEW_LANGUAGE_EN"c),
StringListValue("ru", "MENU_VIEW_LANGUAGE_RU"c),
StringListValue("es", "MENU_VIEW_LANGUAGE_ES"c),
StringListValue("cs", "MENU_VIEW_LANGUAGE_CS"c)]);
ui.addIntComboBox("interface/hintingMode", UIString("OPTION_FONT_HINTING"c), [StringListValue(0, "OPTION_FONT_HINTING_NORMAL"c),
ui.addIntComboBox("interface/hintingMode", UIString.fromId("OPTION_FONT_HINTING"c), [StringListValue(0, "OPTION_FONT_HINTING_NORMAL"c),
StringListValue(1, "OPTION_FONT_HINTING_FORCE"c),
StringListValue(2, "OPTION_FONT_HINTING_DISABLED"c), StringListValue(3, "OPTION_FONT_HINTING_LIGHT"c)]);
ui.addIntComboBox("interface/minAntialiasedFontSize", UIString("OPTION_FONT_ANTIALIASING"c),
ui.addIntComboBox("interface/minAntialiasedFontSize", UIString.fromId("OPTION_FONT_ANTIALIASING"c),
[StringListValue(0, "OPTION_FONT_ANTIALIASING_ALWAYS_ON"c),
StringListValue(12, "12"d),
StringListValue(14, "14"d),
@ -37,7 +37,7 @@ SettingsPage createSettingsPages() {
StringListValue(32, "32"d),
StringListValue(48, "48"d),
StringListValue(255, "OPTION_FONT_ANTIALIASING_ALWAYS_OFF"c)]);
ui.addFloatComboBox("interface/fontGamma", UIString("OPTION_FONT_GAMMA"c),
ui.addFloatComboBox("interface/fontGamma", UIString.fromId("OPTION_FONT_GAMMA"c),
[
StringListValue(500, "0.5 "d),
StringListValue(600, "0.6 "d),
@ -58,8 +58,8 @@ SettingsPage createSettingsPages() {
StringListValue(1700, "1.7 "d),
StringListValue(2000, "2.0 "d)]);
SettingsPage ed = res.addChild("editors", UIString("OPTION_EDITORS"c));
SettingsPage texted = ed.addChild("editors/textEditor", UIString("OPTION_TEXT_EDITORS"c));
SettingsPage ed = res.addChild("editors", UIString.fromId("OPTION_EDITORS"c));
SettingsPage texted = ed.addChild("editors/textEditor", UIString.fromId("OPTION_TEXT_EDITORS"c));
// font faces
StringListValue[] faces;
@ -90,74 +90,74 @@ SettingsPage createSettingsPages() {
else
faces ~= StringListValue(face.face, toUTF32(face.face));
}
texted.addStringComboBox("editors/textEditor/fontFace", UIString("OPTION_FONT_FACE"c), faces);
texted.addStringComboBox("editors/textEditor/fontFace", UIString.fromId("OPTION_FONT_FACE"c), faces);
texted.addNumberEdit("editors/textEditor/tabSize", UIString("OPTION_TAB"c), 1, 16, 4);
texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString("OPTION_USE_SPACES"c));
texted.addCheckbox("editors/textEditor/smartIndents", UIString("OPTION_SMART_INDENTS"c));
texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString("OPTION_SMART_INDENTS_PASTE"c));
texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString("OPTION_SHOW_SPACES"c));
texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString("OPTION_SHOW_TABS"c));
texted.addNumberEdit("editors/textEditor/tabSize", UIString.fromId("OPTION_TAB"c), 1, 16, 4);
texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString.fromId("OPTION_USE_SPACES"c));
texted.addCheckbox("editors/textEditor/smartIndents", UIString.fromId("OPTION_SMART_INDENTS"c));
texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString.fromId("OPTION_SMART_INDENTS_PASTE"c));
texted.addCheckbox("editors/textEditor/showWhiteSpaceMarks", UIString.fromId("OPTION_SHOW_SPACES"c));
texted.addCheckbox("editors/textEditor/showTabPositionMarks", UIString.fromId("OPTION_SHOW_TABS"c));
SettingsPage dlang = res.addChild("dlang", UIString("D"d));
SettingsPage dub = dlang.addChild("dlang/dub", UIString("DUB"d));
dub.addExecutableFileNameEdit("dlang/dub/executable", UIString("OPTION_DUB_EXECUTABLE"c), "dub");
dub.addStringEdit("dlang/dub/additional_params", UIString("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage rdmd = dlang.addChild("dlang/rdmd", UIString("rdmd"d));
rdmd.addExecutableFileNameEdit("dlang/rdmd/executable", UIString("OPTION_RDMD_EXECUTABLE"c), "rdmd");
rdmd.addStringEdit("dlang/rdmd/additional_params", UIString("OPTION_RDMD_ADDITIONAL_PARAMS"c), "");
SettingsPage ddebug = dlang.addChild("dlang/debugger", UIString("OPTION_DEBUGGER"c));
SettingsPage dlang = res.addChild("dlang", UIString.fromRaw("D"d));
SettingsPage dub = dlang.addChild("dlang/dub", UIString.fromRaw("DUB"d));
dub.addExecutableFileNameEdit("dlang/dub/executable", UIString.fromId("OPTION_DUB_EXECUTABLE"c), "dub");
dub.addStringEdit("dlang/dub/additional_params", UIString.fromId("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage rdmd = dlang.addChild("dlang/rdmd", UIString.fromRaw("rdmd"d));
rdmd.addExecutableFileNameEdit("dlang/rdmd/executable", UIString.fromId("OPTION_RDMD_EXECUTABLE"c), "rdmd");
rdmd.addStringEdit("dlang/rdmd/additional_params", UIString.fromId("OPTION_RDMD_ADDITIONAL_PARAMS"c), "");
SettingsPage ddebug = dlang.addChild("dlang/debugger", UIString.fromId("OPTION_DEBUGGER"c));
version (Windows) {
ddebug.addExecutableFileNameEdit("dlang/debugger/executable", UIString("OPTION_DEBUGGER_EXECUTABLE"c), "gdb");
ddebug.addExecutableFileNameEdit("dlang/debugger/executable", UIString.fromId("OPTION_DEBUGGER_EXECUTABLE"c), "gdb");
} else {
ddebug.addExecutableFileNameEdit("dlang/debugger/executable", UIString("OPTION_DEBUGGER_EXECUTABLE"c), "mago-mi");
ddebug.addExecutableFileNameEdit("dlang/debugger/executable", UIString.fromId("OPTION_DEBUGGER_EXECUTABLE"c), "mago-mi");
}
SettingsPage terminal = dlang.addChild("dlang/terminal", UIString("OPTION_TERMINAL"c));
terminal.addExecutableFileNameEdit("dlang/terminal/executable", UIString("OPTION_TERMINAL_EXECUTABLE"c), "xterm");
SettingsPage terminal = dlang.addChild("dlang/terminal", UIString.fromId("OPTION_TERMINAL"c));
terminal.addExecutableFileNameEdit("dlang/terminal/executable", UIString.fromId("OPTION_TERMINAL_EXECUTABLE"c), "xterm");
SettingsPage toolchains = dlang.addChild("dlang/toolchains", UIString("OPTION_TOOLCHANS"c));
SettingsPage dmdtoolchain = toolchains.addChild("dlang/toolchains/dmd", UIString("DMD"d));
dmdtoolchain.addExecutableFileNameEdit("dlang/toolchains/dmd/executable", UIString("OPTION_DMD_EXECUTABLE"c), "dmd");
dmdtoolchain.addStringEdit("dlang/toolchains/dmd/dub_additional_params", UIString("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage ldctoolchain = toolchains.addChild("dlang/toolchains/ldc", UIString("LDC"d));
ldctoolchain.addExecutableFileNameEdit("dlang/toolchains/ldc/executable", UIString("OPTION_LDC2_EXECUTABLE"c), "ldc2");
ldctoolchain.addStringEdit("dlang/toolchains/ldc/dub_additional_params", UIString("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage ldmdtoolchain = toolchains.addChild("dlang/toolchains/ldmd", UIString("LDMD"d));
ldmdtoolchain.addExecutableFileNameEdit("dlang/toolchains/ldmd/executable", UIString("OPTION_LDMD2_EXECUTABLE"c), "ldmd2");
ldmdtoolchain.addStringEdit("dlang/toolchains/ldmd/dub_additional_params", UIString("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage gdctoolchain = toolchains.addChild("dlang/toolchains/gdc", UIString("GDC"d));
gdctoolchain.addExecutableFileNameEdit("dlang/toolchains/gdc/executable", UIString("OPTION_GDC_EXECUTABLE"c), "gdc");
gdctoolchain.addStringEdit("dlang/toolchains/gdc/dub_additional_params", UIString("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage toolchains = dlang.addChild("dlang/toolchains", UIString.fromId("OPTION_TOOLCHANS"c));
SettingsPage dmdtoolchain = toolchains.addChild("dlang/toolchains/dmd", UIString.fromRaw("DMD"d));
dmdtoolchain.addExecutableFileNameEdit("dlang/toolchains/dmd/executable", UIString.fromId("OPTION_DMD_EXECUTABLE"c), "dmd");
dmdtoolchain.addStringEdit("dlang/toolchains/dmd/dub_additional_params", UIString.fromId("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage ldctoolchain = toolchains.addChild("dlang/toolchains/ldc", UIString.fromRaw("LDC"d));
ldctoolchain.addExecutableFileNameEdit("dlang/toolchains/ldc/executable", UIString.fromId("OPTION_LDC2_EXECUTABLE"c), "ldc2");
ldctoolchain.addStringEdit("dlang/toolchains/ldc/dub_additional_params", UIString.fromId("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage ldmdtoolchain = toolchains.addChild("dlang/toolchains/ldmd", UIString.fromRaw("LDMD"d));
ldmdtoolchain.addExecutableFileNameEdit("dlang/toolchains/ldmd/executable", UIString.fromId("OPTION_LDMD2_EXECUTABLE"c), "ldmd2");
ldmdtoolchain.addStringEdit("dlang/toolchains/ldmd/dub_additional_params", UIString.fromId("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
SettingsPage gdctoolchain = toolchains.addChild("dlang/toolchains/gdc", UIString.fromRaw("GDC"d));
gdctoolchain.addExecutableFileNameEdit("dlang/toolchains/gdc/executable", UIString.fromId("OPTION_GDC_EXECUTABLE"c), "gdc");
gdctoolchain.addStringEdit("dlang/toolchains/gdc/dub_additional_params", UIString.fromId("OPTION_DUB_ADDITIONAL_PARAMS"c), "");
return res;
}
/// create DlangIDE settings pages tree
SettingsPage createProjectSettingsPages() {
SettingsPage res = new SettingsPage("", UIString(""d));
SettingsPage res = new SettingsPage("", UIString.fromRaw(""d));
SettingsPage build = res.addChild("build", UIString("Build"d));
build.addStringComboBox("build/toolchain", UIString("Toolchain"d), [
SettingsPage build = res.addChild("build", UIString.fromRaw("Build"d));
build.addStringComboBox("build/toolchain", UIString.fromRaw("Toolchain"d), [
StringListValue("default", "Default"d),
StringListValue("dmd", "DMD"d),
StringListValue("ldc", "LDC"d),
StringListValue("ldmd", "LDMD"d),
StringListValue("gdc", "GDC"d)]);
build.addStringComboBox("build/arch", UIString("Architecture"d), [
build.addStringComboBox("build/arch", UIString.fromRaw("Architecture"d), [
StringListValue("default", "Default"d),
StringListValue("x86", "x86"d),
StringListValue("x86_64", "x86_64"d),
StringListValue("arm", "arm"d),
StringListValue("arm64", "arm64"d),
]);
build.addCheckbox("build/verbose", UIString("Verbose"d), true);
build.addStringEdit("build/dub_additional_params", UIString("DUB additional params"d), "");
build.addCheckbox("build/verbose", UIString.fromRaw("Verbose"d), true);
build.addStringEdit("build/dub_additional_params", UIString.fromRaw("DUB additional params"d), "");
SettingsPage dbg = res.addChild("debug", UIString("Run and Debug"d));
dbg.addStringEdit("debug/run_args", UIString("Command line args"d), "");
dbg.addDirNameEdit("debug/working_dir", UIString("Working directory"d), "");
dbg.addCheckbox("debug/external_console", UIString("Run in external console"d), true);
SettingsPage dbg = res.addChild("debug", UIString.fromRaw("Run and Debug"d));
dbg.addStringEdit("debug/run_args", UIString.fromRaw("Command line args"d), "");
dbg.addDirNameEdit("debug/working_dir", UIString.fromRaw("Working directory"d), "");
dbg.addCheckbox("debug/external_console", UIString.fromRaw("Run in external console"d), true);
return res;
}