diff --git a/deps/DCD b/deps/DCD index c324ca9..cbcc6fa 160000 --- a/deps/DCD +++ b/deps/DCD @@ -1 +1 @@ -Subproject commit c324ca9700d7ed9cf2f89c140b286ae9f325b977 +Subproject commit cbcc6faac3f820bb8e06ed132d82d13036e34d58 diff --git a/dlangide_msvc.visualdproj b/dlangide_msvc.visualdproj index 339e59e..12fa97d 100644 --- a/dlangide_msvc.visualdproj +++ b/dlangide_msvc.visualdproj @@ -89,7 +89,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -172,7 +172,7 @@ 1 $(IntDir)\$(TargetName).json 0 - + DebugInfo DCD 0 EmbedStandardResources 0 @@ -191,7 +191,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -293,7 +293,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -376,7 +376,7 @@ 1 $(IntDir)\$(TargetName).json 0 - + DebugInfo DCD 0 EmbedStandardResources 0 @@ -395,7 +395,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -478,7 +478,7 @@ 1 $(IntDir)\$(TargetName).json 0 - TestParser DebugInfo DCD + DebugInfo DCD 0 USE_CONSOLE EmbedStandardResources 0 @@ -497,7 +497,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -599,7 +599,7 @@ - ole32.lib kernel32.lib user32.lib + @@ -656,29 +656,7 @@ - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/dub.json b/dub.json index af66a63..84959fe 100644 --- a/dub.json +++ b/dub.json @@ -12,8 +12,8 @@ "stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"], "dependencies": { - "dlangui": "==0.9.50", - "dcd": "~>0.9.0-alpha4" + "dlangui": "==0.9.83", + "dcd": "~>0.9.0" }, "copyFiles-windows": [ diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index fcad06c..b1939cf 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -25,7 +25,7 @@ import ddebug.common.debugger; import std.algorithm; import std.utf : toUTF32; -import std.utf : toUTF8; +import dlangui.core.types : toUTF8; interface BreakpointListChangeListener { void onBreakpointListChanged(ProjectSourceFile sourceFile, Breakpoint[] breakpoints); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 9a7fca5..63f77d8 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -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; @@ -287,7 +287,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL _logPanel.logLine("MSG_STARTING"c ~ " " ~ executableFileName); else _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); string[string] env; program.setExecutableParams(executableFileName, args, workingDirectory, env); @@ -439,7 +439,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; } } @@ -457,7 +457,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL _tabs.selectTab(index, true); } else { 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); auto _settings = new IDESettings(buildNormalizedPath(settingsDir, "settings.json")); // Auto open last project @@ -557,7 +557,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) { @@ -596,7 +596,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) { @@ -889,18 +889,18 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL Platform.instance.openURL(HELP_PAGE_URL); return true; case IDEActions.HelpAbout: - window.showMessageBox(UIString("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)); + window.showMessageBox(UIString.fromId("ABOUT"c) ~ " " ~ 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); return true; case IDEActions.FileOpen: UIString caption; - caption = UIString("HEADER_OPEN_TEXT_FILE"c); + caption = UIString.fromId("HEADER_OPEN_TEXT_FILE"c); FileDialog dlg = createFileDialog(caption); - dlg.addFilter(FileFilterEntry(UIString("SOURCE_FILES"c), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini")); - dlg.addFilter(FileFilterEntry(UIString("ALL_FILES"c), "*.*")); + dlg.addFilter(FileFilterEntry(UIString.fromId("SOURCE_FILES"c), "*.d;*.dd;*.ddoc;*.di;*.dh;*.json;*.sdl;*.xml;*.ini")); + dlg.addFilter(FileFilterEntry(UIString.fromId("ALL_FILES"c), "*.*")); dlg.path = _settings.getRecentPath("FILE_OPEN_PATH"); dlg.dialogResult = delegate(Dialog d, const Action result) { if (result.id == ACTION_OPEN.id) { @@ -976,9 +976,9 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL return true; } // 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); - 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.dialogResult = delegate(Dialog d, const Action result) { if (result.id == ACTION_OPEN.id) { @@ -1142,8 +1142,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) { @@ -1238,7 +1238,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("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) { if (result.id == ACTION_APPLY.id) { //Log.d("settings after edit:\n", s.toJSON(true)); @@ -1268,7 +1268,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)); @@ -1301,10 +1301,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL private bool loadProject(Project project) { if (!project.load()) { _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; } - 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")); return true; } @@ -1320,23 +1320,24 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL _settings.updateRecentWorkspace(filename); }); } 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; } } else if (filename.isProjectFile) { // Open non-DlangIDE project file or DlangIDE project _logPanel.clear(); - const auto msg = "MSG_TRY_OPEN_PROJECT"c; - _logPanel.logLine(msg ~ " " ~ filename); + const auto msg = UIString.fromId("MSG_TRY_OPEN_PROJECT"c).value; + _logPanel.logLine(msg ~ toUTF32(" " ~ filename)); Project project = new Project(currentWorkspace, filename); string defWsFile = project.defWorkspaceFile; if (currentWorkspace) { Project existing = currentWorkspace.findProject(project.filename); if (existing) { - _logPanel.logLine("MSG_PROJECT_ALREADY_OPENED"c); - window.showMessageBox(UIString("MSG_OPEN_PROJECT"c), UIString("MSG_PROJECT_ALREADY_OPENED"c)); + _logPanel.logLine("Project is already in workspace"d); + window.showMessageBox(UIString.fromId("MSG_OPEN_PROJECT"c), UIString.fromId("MSG_PROJECT_ALREADY_OPENED"c)); 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) { if (result.id == IDEActions.CreateNewWorkspace) { // new ws @@ -1358,7 +1359,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL } } else { _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)); } } diff --git a/src/dlangide/ui/homescreen.d b/src/dlangide/ui/homescreen.d index 5cd0803..6e185aa 100644 --- a/src/dlangide/ui/homescreen.d +++ b/src/dlangide/ui/homescreen.d @@ -32,10 +32,10 @@ class HomeScreen : ScrollWidget { _content.addChild(_column1); _content.addChild(_column2); _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("COPYRIGHT"c))).fontSize(22).textColor(linkColor)); + _column1.addChild((new TextWidget(null, UIString.fromId("DESCRIPTION"c))).fontSize(20)); + _column1.addChild((new TextWidget(null, UIString.fromId("COPYRIGHT"c))).fontSize(22).textColor(linkColor)); _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(); _recentItems = new VerticalLayout(); _startItems.addChild(new ImageTextButton(ACTION_FILE_OPEN_WORKSPACE)); @@ -45,27 +45,27 @@ class HomeScreen : ScrollWidget { _column1.addChild(new VSpacer()); // 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; 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)); } } else { - _recentItems.addChild((new TextWidget(null, UIString("NO_RECENT"c)))); + _recentItems.addChild((new TextWidget(null, UIString.fromId("NO_RECENT"c)))); } _column1.addChild(_recentItems); // Useful links _column1.addChild(new VSpacer()); - _column2.addChild((new TextWidget(null, UIString("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("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("DLANG_IDE"c).value, "https://github.com/buggins/dlangide")); + _column2.addChild((new TextWidget(null, UIString.fromId("USEFUL_LINKS"c))).fontSize(20).textColor(linkColor)); + _column2.addChild(new UrlImageTextButton(null, UIString.fromId("D_LANG"c).value, "http://dlang.org/")); + _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DUB_REP"c).value, "http://code.dlang.org/")); + _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DLANG_UI"c).value, "https://github.com/buggins/dlangui")); + _column2.addChild(new UrlImageTextButton(null, UIString.fromId("DLANG_IDE"c).value, "https://github.com/buggins/dlangide")); _column2.addChild(new VSpacer()); contentWidget = _content; } diff --git a/src/dlangide/ui/newfile.d b/src/dlangide/ui/newfile.d index 27aadff..42f41a1 100644 --- a/src/dlangide/ui/newfile.d +++ b/src/dlangide/ui/newfile.d @@ -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; diff --git a/src/dlangide/ui/newproject.d b/src/dlangide/ui/newproject.d index a84ff65..f180b35 100644 --- a/src/dlangide/ui/newproject.d +++ b/src/dlangide/ui/newproject.d @@ -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; }; diff --git a/src/dlangide/ui/settings.d b/src/dlangide/ui/settings.d index cc3de80..0cd34c1 100644 --- a/src/dlangide/ui/settings.d +++ b/src/dlangide/ui/settings.d @@ -13,27 +13,27 @@ public import dlangide.workspace.workspacesettings; /// create DlangIDE settings pages tree SettingsPage createSettingsPages() { // Root page - SettingsPage res = new SettingsPage("", UIString(""d)); + SettingsPage res = new SettingsPage("", UIString.fromRaw(""d)); // Common page - SettingsPage common = res.addChild("common", UIString("OPTION_COMMON"c)); - common.addCheckbox("common/autoOpenLastProject", UIString("OPTION_AUTO_OPEN_LAST_PROJECT"c)); + SettingsPage common = res.addChild("common", UIString.fromId("OPTION_COMMON"c)); + common.addCheckbox("common/autoOpenLastProject", UIString.fromId("OPTION_AUTO_OPEN_LAST_PROJECT"c)); // UI settings page - 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), @@ -43,7 +43,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), @@ -64,8 +64,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; @@ -96,74 +96,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; }