UIString deprecated constructor replaced by fromId method

This commit is contained in:
Vitaly Livshic 2017-08-06 16:13:50 +03:00
commit 10d52a7410
9 changed files with 123 additions and 144 deletions

2
deps/DCD vendored

@ -1 +1 @@
Subproject commit c324ca9700d7ed9cf2f89c140b286ae9f325b977 Subproject commit cbcc6faac3f820bb8e06ed132d82d13036e34d58

View File

@ -89,7 +89,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -172,7 +172,7 @@
<doXGeneration>1</doXGeneration> <doXGeneration>1</doXGeneration>
<xfilename>$(IntDir)\$(TargetName).json</xfilename> <xfilename>$(IntDir)\$(TargetName).json</xfilename>
<debuglevel>0</debuglevel> <debuglevel>0</debuglevel>
<debugids /> <debugids>DebugInfo DCD</debugids>
<versionlevel>0</versionlevel> <versionlevel>0</versionlevel>
<versionids>EmbedStandardResources</versionids> <versionids>EmbedStandardResources</versionids>
<dump_source>0</dump_source> <dump_source>0</dump_source>
@ -191,7 +191,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -293,7 +293,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -376,7 +376,7 @@
<doXGeneration>1</doXGeneration> <doXGeneration>1</doXGeneration>
<xfilename>$(IntDir)\$(TargetName).json</xfilename> <xfilename>$(IntDir)\$(TargetName).json</xfilename>
<debuglevel>0</debuglevel> <debuglevel>0</debuglevel>
<debugids /> <debugids>DebugInfo DCD</debugids>
<versionlevel>0</versionlevel> <versionlevel>0</versionlevel>
<versionids>EmbedStandardResources</versionids> <versionids>EmbedStandardResources</versionids>
<dump_source>0</dump_source> <dump_source>0</dump_source>
@ -395,7 +395,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -478,7 +478,7 @@
<doXGeneration>1</doXGeneration> <doXGeneration>1</doXGeneration>
<xfilename>$(IntDir)\$(TargetName).json</xfilename> <xfilename>$(IntDir)\$(TargetName).json</xfilename>
<debuglevel>0</debuglevel> <debuglevel>0</debuglevel>
<debugids>TestParser DebugInfo DCD</debugids> <debugids>DebugInfo DCD</debugids>
<versionlevel>0</versionlevel> <versionlevel>0</versionlevel>
<versionids>USE_CONSOLE EmbedStandardResources</versionids> <versionids>USE_CONSOLE EmbedStandardResources</versionids>
<dump_source>0</dump_source> <dump_source>0</dump_source>
@ -497,7 +497,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -599,7 +599,7 @@
<cv2pdbOptions /> <cv2pdbOptions />
<objfiles /> <objfiles />
<linkswitches /> <linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib</libfiles> <libfiles />
<libpaths /> <libpaths />
<deffile /> <deffile />
<resfile /> <resfile />
@ -656,29 +656,7 @@
<File path="deps\DCD\dsymbol\src\dsymbol\builtin\symbols.d" /> <File path="deps\DCD\dsymbol\src\dsymbol\builtin\symbols.d" />
<File path="deps\DCD\dsymbol\src\dsymbol\type_lookup.d" /> <File path="deps\DCD\dsymbol\src\dsymbol\type_lookup.d" />
</Folder> </Folder>
<Folder name="experimental_allocator"> <Folder name="experimental_allocator" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\allocator_list.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\bitmapped_block.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\bucketizer.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\common.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\fallback_allocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\free_list.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\free_tree.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\gc_allocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\kernighan_ritchie.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\mallocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\mmap_allocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\null_allocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\package.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\package.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\quantizer.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\region.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\scoped_allocator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\segregator.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\showcase.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\building_blocks\stats_collector.d" />
<File path="deps\DCD\libdparse\experimental_allocator\src\std\experimental\allocator\typed.d" />
</Folder>
<Folder name="libdparse"> <Folder name="libdparse">
<File path="deps\DCD\libdparse\src\dparse\ast.d" /> <File path="deps\DCD\libdparse\src\dparse\ast.d" />
<File path="deps\DCD\libdparse\src\dparse\entities.d" /> <File path="deps\DCD\libdparse\src\dparse\entities.d" />

View File

@ -12,8 +12,8 @@
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"], "stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
"dependencies": { "dependencies": {
"dlangui": "==0.9.50", "dlangui": "==0.9.83",
"dcd": "~>0.9.0-alpha4" "dcd": "~>0.9.0"
}, },
"copyFiles-windows": [ "copyFiles-windows": [

View File

@ -25,7 +25,7 @@ import ddebug.common.debugger;
import std.algorithm; import std.algorithm;
import std.utf : toUTF32; import std.utf : toUTF32;
import std.utf : toUTF8; import dlangui.core.types : toUTF8;
interface BreakpointListChangeListener { interface BreakpointListChangeListener {
void onBreakpointListChanged(ProjectSourceFile sourceFile, Breakpoint[] breakpoints); void onBreakpointListChanged(ProjectSourceFile sourceFile, Breakpoint[] breakpoints);

View File

@ -169,7 +169,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project) if (!project)
project = currentWorkspace.startupProject; project = currentWorkspace.startupProject;
if (!project) { 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; return;
} }
buildProject(BuildOperation.Build, project, delegate(int result) { buildProject(BuildOperation.Build, project, delegate(int result) {
@ -208,17 +208,17 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
import std.file; import std.file;
stopExecution(); stopExecution();
if (!project) { 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; return;
} }
string executableFileName = project.executableFileName; string executableFileName = project.executableFileName;
if (!executableFileName || !exists(executableFileName) || !isFile(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; return;
} }
string debuggerExecutable = _settings.debuggerExecutable; string debuggerExecutable = _settings.debuggerExecutable;
if (debuggerExecutable.empty) { 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; return;
} }
@ -238,7 +238,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project) if (!project)
project = currentWorkspace.startupProject; project = currentWorkspace.startupProject;
if (!project) { 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; return;
} }
buildProject(BuildOperation.Build, project, delegate(int result) { buildProject(BuildOperation.Build, project, delegate(int result) {
@ -255,12 +255,12 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
import std.file; import std.file;
stopExecution(); stopExecution();
if (!project) { 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; return;
} }
string executableFileName = project.executableFileName; string executableFileName = project.executableFileName;
if (!executableFileName || !exists(executableFileName) || !isFile(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; return;
} }
auto program = new ProgramExecutionNoDebug; auto program = new ProgramExecutionNoDebug;
@ -287,7 +287,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
_logPanel.logLine("MSG_STARTING"c ~ " " ~ executableFileName); _logPanel.logLine("MSG_STARTING"c ~ " " ~ executableFileName);
else else
_logPanel.logLine("MSG_STARTING_DEBUGGER"c ~ " " ~ executableFileName); _logPanel.logLine("MSG_STARTING_DEBUGGER"c ~ " " ~ executableFileName);
const auto status = program.isDebugger ? UIString("DEBUGGING"c).value : UIString("RUNNING"c).value; const auto status = program.isDebugger ? UIString.fromId("DEBUGGING"c).value : UIString.fromId("RUNNING"c).value;
_statusLine.setBackgroundOperationStatus("debug-run", status); _statusLine.setBackgroundOperationStatus("debug-run", status);
string[string] env; string[string] env;
program.setExecutableParams(executableFileName, args, workingDirectory, env); program.setExecutableParams(executableFileName, args, workingDirectory, env);
@ -439,7 +439,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
} else { } else {
destroy(editor); destroy(editor);
if (window) 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; return false;
} }
} }
@ -457,7 +457,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
_tabs.selectTab(index, true); _tabs.selectTab(index, true);
} else { } else {
HomeScreen home = new HomeScreen(HOME_SCREEN_ID, this); HomeScreen home = new HomeScreen(HOME_SCREEN_ID, this);
_tabs.addTab(home, UIString("HOME"c), null, true); _tabs.addTab(home, UIString.fromId("HOME"c), null, true);
_tabs.selectTab(HOME_SCREEN_ID, true); _tabs.selectTab(HOME_SCREEN_ID, true);
auto _settings = new IDESettings(buildNormalizedPath(settingsDir, "settings.json")); auto _settings = new IDESettings(buildNormalizedPath(settingsDir, "settings.json"));
// Auto open last project // Auto open last project
@ -557,7 +557,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
} }
string tabId = ed.id; string tabId = ed.id;
// tab content is modified - ask for confirmation // 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], [ACTION_SAVE, ACTION_SAVE_ALL, ACTION_DISCARD_CHANGES, ACTION_DISCARD_ALL, ACTION_CANCEL],
0, delegate(const Action result) { 0, delegate(const Action result) {
if (result == StandardAction.Save) { if (result == StandardAction.Save) {
@ -596,7 +596,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
DSourceEdit d = cast(DSourceEdit)_tabs.tabBody(tabId); DSourceEdit d = cast(DSourceEdit)_tabs.tabBody(tabId);
if (d && d.content.modified) { if (d && d.content.modified) {
// tab content is modified - ask for confirmation // 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], [ACTION_SAVE, ACTION_DISCARD_CHANGES, ACTION_CANCEL],
0, delegate(const Action result) { 0, delegate(const Action result) {
if (result == StandardAction.Save) { if (result == StandardAction.Save) {
@ -889,18 +889,18 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
Platform.instance.openURL(HELP_PAGE_URL); Platform.instance.openURL(HELP_PAGE_URL);
return true; return true;
case IDEActions.HelpAbout: case IDEActions.HelpAbout:
window.showMessageBox(UIString("ABOUT"c) ~ " " ~ DLANGIDE_VERSION, window.showMessageBox(UIString.fromId("ABOUT"c) ~ " " ~ 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)); 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; return true;
case StandardAction.OpenUrl: case StandardAction.OpenUrl:
platform.openURL(a.stringParam); platform.openURL(a.stringParam);
return true; return true;
case IDEActions.FileOpen: case IDEActions.FileOpen:
UIString caption; UIString caption;
caption = UIString("HEADER_OPEN_TEXT_FILE"c); caption = UIString.fromId("HEADER_OPEN_TEXT_FILE"c);
FileDialog dlg = createFileDialog(caption); FileDialog dlg = createFileDialog(caption);
dlg.addFilter(FileFilterEntry(UIString("SOURCE_FILES"c), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini")); dlg.addFilter(FileFilterEntry(UIString.fromId("SOURCE_FILES"c), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini"));
dlg.addFilter(FileFilterEntry(UIString("ALL_FILES"c), "*.*")); dlg.addFilter(FileFilterEntry(UIString.fromId("ALL_FILES"c), "*.*"));
dlg.path = _settings.getRecentPath("FILE_OPEN_PATH"); dlg.path = _settings.getRecentPath("FILE_OPEN_PATH");
dlg.dialogResult = delegate(Dialog d, const Action result) { dlg.dialogResult = delegate(Dialog d, const Action result) {
if (result.id == ACTION_OPEN.id) { if (result.id == ACTION_OPEN.id) {
@ -976,9 +976,9 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
return true; return true;
} }
// Ask user for workspace to open // Ask user for workspace to open
UIString caption = "HEADER_OPEN_WORKSPACE_OR_PROJECT"c; UIString caption = UIString.fromId("HEADER_OPEN_WORKSPACE_OR_PROJECT"c);
FileDialog dlg = createFileDialog(caption); FileDialog dlg = createFileDialog(caption);
dlg.addFilter(FileFilterEntry(UIString("WORKSPACE_AND_PROJECT_FILES"c), "*.dlangidews;dub.json;dub.sdl;package.json")); dlg.addFilter(FileFilterEntry(UIString.fromId("WORKSPACE_AND_PROJECT_FILES"c), "*.dlangidews;dub.json;dub.sdl;package.json"));
dlg.path = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH"); dlg.path = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH");
dlg.dialogResult = delegate(Dialog d, const Action result) { dlg.dialogResult = delegate(Dialog d, const Action result) {
if (result.id == ACTION_OPEN.id) { if (result.id == ACTION_OPEN.id) {
@ -1142,8 +1142,8 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
Project project = srcfile.project; Project project = srcfile.project;
if (!project) if (!project)
return; return;
window.showMessageBox(UIString("Remove file"d), window.showMessageBox(UIString.fromRaw("Remove file"d),
UIString("Do you want to remove file "d ~ srcfile.name ~ "?"), UIString.fromRaw("Do you want to remove file "d ~ srcfile.name ~ "?"),
[ACTION_YES, ACTION_NO], [ACTION_YES, ACTION_NO],
1, delegate(const Action result) { 1, delegate(const Action result) {
if (result == StandardAction.Yes) { if (result == StandardAction.Yes) {
@ -1238,7 +1238,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
//Log.d("settings before copy:\n", _settings.setting.toJSON(true)); //Log.d("settings before copy:\n", _settings.setting.toJSON(true));
Setting s = _settings.copySettings(); Setting s = _settings.copySettings();
//Log.d("settings after copy:\n", s.toJSON(true)); //Log.d("settings after copy:\n", s.toJSON(true));
SettingsDialog dlg = new SettingsDialog(UIString("HEADER_SETTINGS"c), window, s, createSettingsPages()); SettingsDialog dlg = new SettingsDialog(UIString.fromId("HEADER_SETTINGS"c), window, s, createSettingsPages());
dlg.dialogResult = delegate(Dialog dlg, const Action result) { dlg.dialogResult = delegate(Dialog dlg, const Action result) {
if (result.id == ACTION_APPLY.id) { if (result.id == ACTION_APPLY.id) {
//Log.d("settings after edit:\n", s.toJSON(true)); //Log.d("settings after edit:\n", s.toJSON(true));
@ -1268,7 +1268,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
if (!project) if (!project)
return; return;
Setting s = project.settings.copySettings(); 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) { dlg.dialogResult = delegate(Dialog dlg, const Action result) {
if (result.id == ACTION_APPLY.id) { if (result.id == ACTION_APPLY.id) {
//Log.d("settings after edit:\n", s.toJSON(true)); //Log.d("settings after edit:\n", s.toJSON(true));
@ -1301,10 +1301,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
private bool loadProject(Project project) { private bool loadProject(Project project) {
if (!project.load()) { if (!project.load()) {
_logPanel.logLine("Cannot read project " ~ project.filename); _logPanel.logLine("Cannot read project " ~ project.filename);
window.showMessageBox(UIString("ERROR_OPEN_PROJECT"c).value, UIString("ERROR_OPENING_PROJECT"c).value ~ toUTF32(project.filename)); window.showMessageBox(UIString.fromId("ERROR_OPEN_PROJECT"c).value, UIString.fromId("ERROR_OPENING_PROJECT"c).value ~ toUTF32(project.filename));
return false; return false;
} }
const auto msg = UIString("MSG_OPENED_PROJECT"c); const auto msg = UIString.fromId("MSG_OPENED_PROJECT"c);
_logPanel.logLine(toUTF32("Project file " ~ project.filename ~ " is opened ok")); _logPanel.logLine(toUTF32("Project file " ~ project.filename ~ " is opened ok"));
return true; return true;
} }
@ -1320,23 +1320,24 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
_settings.updateRecentWorkspace(filename); _settings.updateRecentWorkspace(filename);
}); });
} else { } else {
window.showMessageBox(UIString("ERROR_OPEN_WORKSPACE"c).value, UIString("ERROR_OPENING_WORKSPACE"c).value); window.showMessageBox(UIString.fromId("ERROR_OPEN_WORKSPACE"c).value, UIString.fromId("ERROR_OPENING_WORKSPACE"c).value);
return; return;
} }
} else if (filename.isProjectFile) { // Open non-DlangIDE project file or DlangIDE project } else if (filename.isProjectFile) { // Open non-DlangIDE project file or DlangIDE project
_logPanel.clear(); _logPanel.clear();
const auto msg = "MSG_TRY_OPEN_PROJECT"c; const auto msg = UIString.fromId("MSG_TRY_OPEN_PROJECT"c).value;
_logPanel.logLine(msg ~ " " ~ filename); _logPanel.logLine(msg ~ toUTF32(" " ~ filename));
Project project = new Project(currentWorkspace, filename); Project project = new Project(currentWorkspace, filename);
string defWsFile = project.defWorkspaceFile; string defWsFile = project.defWorkspaceFile;
if (currentWorkspace) { if (currentWorkspace) {
Project existing = currentWorkspace.findProject(project.filename); Project existing = currentWorkspace.findProject(project.filename);
if (existing) { if (existing) {
_logPanel.logLine("MSG_PROJECT_ALREADY_OPENED"c); _logPanel.logLine("Project is already in workspace"d);
window.showMessageBox(UIString("MSG_OPEN_PROJECT"c), UIString("MSG_PROJECT_ALREADY_OPENED"c)); window.showMessageBox(UIString.fromId("MSG_OPEN_PROJECT"c), UIString.fromId("MSG_PROJECT_ALREADY_OPENED"c));
return; return;
} }
window.showMessageBox(UIString("MSG_OPEN_PROJECT"c), UIString("QUESTION_NEW_WORKSPACE"c), window.showMessageBox(UIString.fromId("MSG_OPEN_PROJECT"c), UIString.fromId("QUESTION_NEW_WORKSPACE"c),
[ACTION_ADD_TO_CURRENT_WORKSPACE, ACTION_CREATE_NEW_WORKSPACE, ACTION_CANCEL], 0, delegate(const Action result) { [ACTION_ADD_TO_CURRENT_WORKSPACE, ACTION_CREATE_NEW_WORKSPACE, ACTION_CANCEL], 0, delegate(const Action result) {
if (result.id == IDEActions.CreateNewWorkspace) { if (result.id == IDEActions.CreateNewWorkspace) {
// new ws // new ws
@ -1358,7 +1359,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
} }
} else { } else {
_logPanel.logLine("File is not recognized as DlangIDE project or workspace file"); _logPanel.logLine("File is not recognized as DlangIDE project or workspace file");
window.showMessageBox(UIString("ERROR_INVALID_WORKSPACE_FILE"c), UIString("ERROR_INVALID_WS_OR_PROJECT_FILE"c)); window.showMessageBox(UIString.fromId("ERROR_INVALID_WORKSPACE_FILE"c), UIString.fromId("ERROR_INVALID_WS_OR_PROJECT_FILE"c));
} }
} }

View File

@ -32,10 +32,10 @@ class HomeScreen : ScrollWidget {
_content.addChild(_column1); _content.addChild(_column1);
_content.addChild(_column2); _content.addChild(_column2);
_column1.addChild((new TextWidget(null, "Dlang IDE "d ~ DLANGIDE_VERSION)).fontSize(32).textColor(linkColor)); _column1.addChild((new TextWidget(null, "Dlang IDE "d ~ DLANGIDE_VERSION)).fontSize(32).textColor(linkColor));
_column1.addChild((new TextWidget(null, UIString("DESCRIPTION"c))).fontSize(20)); _column1.addChild((new TextWidget(null, UIString.fromId("DESCRIPTION"c))).fontSize(20));
_column1.addChild((new TextWidget(null, UIString("COPYRIGHT"c))).fontSize(22).textColor(linkColor)); _column1.addChild((new TextWidget(null, UIString.fromId("COPYRIGHT"c))).fontSize(22).textColor(linkColor));
_column1.addChild(new VSpacer()); _column1.addChild(new VSpacer());
_column1.addChild((new TextWidget(null, UIString("START_WITH"c))).fontSize(20).textColor(linkColor)); _column1.addChild((new TextWidget(null, UIString.fromId("START_WITH"c))).fontSize(20).textColor(linkColor));
_startItems = new VerticalLayout(); _startItems = new VerticalLayout();
_recentItems = new VerticalLayout(); _recentItems = new VerticalLayout();
_startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE)); _startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE));
@ -45,27 +45,27 @@ class HomeScreen : ScrollWidget {
_column1.addChild(new VSpacer()); _column1.addChild(new VSpacer());
// Recent workspaces // Recent workspaces
_column1.addChild((new TextWidget(null, UIString("RECENT"c))).fontSize(20).textColor(linkColor)); _column1.addChild((new TextWidget(null, UIString.fromId("RECENT"c))).fontSize(20).textColor(linkColor));
string[] recentWorkspaces = _frame.settings.recentWorkspaces; string[] recentWorkspaces = _frame.settings.recentWorkspaces;
if (recentWorkspaces.length) { if (recentWorkspaces.length) {
foreach(fn; recentWorkspaces) { foreach(fn; recentWorkspaces) {
Action a = ACTION_FILE_OPEN_WORKSPACE.clone(); 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; a.stringParam = fn;
_column1.addChild(new LinkButton(a)); _column1.addChild(new LinkButton(a));
} }
} else { } else {
_recentItems.addChild((new TextWidget(null, UIString("NO_RECENT"c)))); _recentItems.addChild((new TextWidget(null, UIString.fromId("NO_RECENT"c))));
} }
_column1.addChild(_recentItems); _column1.addChild(_recentItems);
// Useful links // Useful links
_column1.addChild(new VSpacer()); _column1.addChild(new VSpacer());
_column2.addChild((new TextWidget(null, UIString("USEFUL_LINKS"c))).fontSize(20).textColor(linkColor)); _column2.addChild((new TextWidget(null, UIString.fromId("USEFUL_LINKS"c))).fontSize(20).textColor(linkColor));
_column2.addChild(new UrlImageTextButton(null, UIString("D_LANG"c).value, "http://dlang.org/")); _column2.addChild(new UrlImageTextButton(null, UIString.fromId("D_LANG"c).value, "http://dlang.org/"));
_column2.addChild(new UrlImageTextButton(null, UIString("DUB_REP"c).value, "http://code.dlang.org/")); _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DUB_REP"c).value, "http://code.dlang.org/"));
_column2.addChild(new UrlImageTextButton(null, UIString("DLANG_UI"c).value, "https://github.com/buggins/dlangui")); _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DLANG_UI"c).value, "https://github.com/buggins/dlangui"));
_column2.addChild(new UrlImageTextButton(null, UIString("DLANG_IDE"c).value, "https://github.com/buggins/dlangide")); _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DLANG_IDE"c).value, "https://github.com/buggins/dlangide"));
_column2.addChild(new VSpacer()); _column2.addChild(new VSpacer());
contentWidget = _content; contentWidget = _content;
} }

View File

@ -39,7 +39,7 @@ class NewFileDlg : Dialog {
ProjectFolder _folder; ProjectFolder _folder;
string[] _sourcePaths; string[] _sourcePaths;
this(IDEFrame parent, Project currentProject, ProjectFolder folder) { 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); DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
_ide = parent; _ide = parent;
_icon = "dlangui-logo1"; _icon = "dlangui-logo1";
@ -119,7 +119,7 @@ class NewFileDlg : Dialog {
_edLocation.filetypeIcons["dub.json"] = "project-d"; _edLocation.filetypeIcons["dub.json"] = "project-d";
_edLocation.filetypeIcons["package.json"] = "project-d"; _edLocation.filetypeIcons["package.json"] = "project-d";
_edLocation.filetypeIcons[".dlangidews"] = "project-development"; _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; _edLocation.caption = "Select directory"d;
// fill templates // fill templates
@ -266,11 +266,11 @@ class NewFileDlg : Dialog {
Action newaction = action.clone(); Action newaction = action.clone();
if (action.id == IDEActions.FileNew) { if (action.id == IDEActions.FileNew) {
if (!validate()) { if (!validate()) {
window.showMessageBox(UIString("Error"d), UIString("Invalid parameters")); window.showMessageBox(UIString.fromRaw("Error"d), UIString.fromRaw("Invalid parameters"));
return; return;
} }
if (!createItem()) { 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; return;
} }
newaction.objectParam = _result; newaction.objectParam = _result;

View File

@ -38,7 +38,7 @@ class NewProjectDlg : Dialog {
IDEFrame _ide; IDEFrame _ide;
this(IDEFrame parent, bool newWorkspace, Workspace currentWorkspace, string dir) { 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); DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
_ide = parent; _ide = parent;
_icon = "dlangui-logo1"; _icon = "dlangui-logo1";
@ -130,7 +130,7 @@ class NewProjectDlg : Dialog {
_edLocation.filetypeIcons["dub.json"] = "project-d"; _edLocation.filetypeIcons["dub.json"] = "project-d";
_edLocation.filetypeIcons["package.json"] = "project-d"; _edLocation.filetypeIcons["package.json"] = "project-d";
_edLocation.filetypeIcons[".dlangidews"] = "project-development"; _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; _edLocation.caption = "Select directory"d;
if (_currentWorkspace) { if (_currentWorkspace) {
@ -273,14 +273,14 @@ class NewProjectDlg : Dialog {
if (action.id == IDEActions.FileNewWorkspace || action.id == IDEActions.FileNewProject) { if (action.id == IDEActions.FileNewWorkspace || action.id == IDEActions.FileNewProject) {
if (!exists(_location)) { if (!exists(_location)) {
// show message box with OK and CANCEL buttons, cancel by default, and handle its result // 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) { if (a.id == StandardAction.Yes) {
try { try {
mkdirRecurse(_location); mkdirRecurse(_location);
close(action); close(action);
} catch (Exception e) { } catch (Exception e) {
setError("Cannot create target location"); 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; return true;
@ -288,11 +288,11 @@ class NewProjectDlg : Dialog {
return; return;
} }
if (!validate()) { if (!validate()) {
window.showMessageBox(UIString("Cannot create project"d), UIString(getError())); window.showMessageBox(UIString.fromRaw("Cannot create project"d), UIString.fromRaw(getError()));
return; return;
} }
if (!createProject()) { 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; return;
} }
newaction.objectParam = _result; newaction.objectParam = _result;
@ -496,8 +496,8 @@ extern (C) int UIAppMain(string[] args) {
}; };
// show message box with content of editors // show message box with content of editors
window.mainWidget.childById!Button("btnOk").click = delegate(Widget w) { window.mainWidget.childById!Button("btnOk").click = delegate(Widget w) {
window.showMessageBox(UIString("Ok button pressed"d), window.showMessageBox(UIString.fromRaw("Ok button pressed"d),
UIString("Editors content\nEdit1: "d ~ edit1.text ~ "\nEdit2: "d ~ edit2.text)); UIString.fromRaw("Editors content\nEdit1: "d ~ edit1.text ~ "\nEdit2: "d ~ edit2.text));
return true; return true;
}; };

View File

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