UIString from raw strings

This commit is contained in:
Vitaly Livshic 2017-07-29 08:23:05 +03:00
parent 3faaaacda8
commit 7ae1bf8491
3 changed files with 11 additions and 10 deletions

View File

@ -267,7 +267,7 @@ class FileDialog : Dialog, CustomGridCellAdapter {
_entries = listDirectory(dir, attrFilter, selectedFilter());
} catch(Exception e) {
import dlangui.dialogs.msgbox;
auto msgBox = new MessageBox(UIString.fromRaw("MESSAGE_ERROR"c), UIString.fromRaw(e.msg.toUTF32), window());
auto msgBox = new MessageBox(UIString.fromId("MESSAGE_ERROR"c), UIString.fromRaw(e.msg.toUTF32), window());
msgBox.show();
return false;
}
@ -557,7 +557,7 @@ class FileDialog : Dialog, CustomGridCellAdapter {
rightPanel = new VerticalLayout("main");
rightPanel.layoutHeight(FILL_PARENT).layoutWidth(FILL_PARENT);
rightPanel.addChild(new TextWidget(null, "MESSAGE_PATH"c ~ ":"));
rightPanel.addChild(new TextWidget(null, UIString.fromId("MESSAGE_PATH"c) ~ ":"));
content.addChild(leftPanel);
content.addChild(rightPanel);
@ -598,9 +598,9 @@ class FileDialog : Dialog, CustomGridCellAdapter {
_fileList.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
_fileList.resize(4, 3);
_fileList.setColTitle(0, " "d);
_fileList.setColTitle(1, dtext("COL_NAME"c));
_fileList.setColTitle(2, dtext("COL_SIZE"c));
_fileList.setColTitle(3, dtext("COL_MODIFIED"c));
_fileList.setColTitle(1, UIString.fromId("COL_NAME"c).value);
_fileList.setColTitle(2, UIString.fromId("COL_SIZE"c).value);
_fileList.setColTitle(3, UIString.fromId("COL_MODIFIED"c).value);
_fileList.showRowHeaders = false;
_fileList.rowSelect = true;
_fileList.multiSelect = _allowMultipleFiles;
@ -928,7 +928,7 @@ class FileNameEditLine : HorizontalLayout {
protected EditLine _edFileName;
protected Button _btn;
protected string[string] _filetypeIcons;
protected dstring _caption = dtext("TITLE_OPEN_FILE"c);
protected dstring _caption;
protected uint _fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable | FileDialogFlag.FileMustExist | FileDialogFlag.EnableCreateDirectory;
protected FileFilterEntry[] _filters;
protected int _filterIndex;
@ -940,6 +940,7 @@ class FileNameEditLine : HorizontalLayout {
this(string ID = null) {
super(ID);
_caption = UIString.fromId("TITLE_OPEN_FILE"c).value;
_edFileName = new EditLine("FileNameEditLine_edFileName");
_edFileName.minWidth(BACKEND_CONSOLE ? 16 : 200);
_btn = new Button("FileNameEditLine_btnFile", "..."d);
@ -1032,7 +1033,7 @@ class DirEditLine : FileNameEditLine {
super(ID);
_fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable
| FileDialogFlag.FileMustExist | FileDialogFlag.SelectDirectory | FileDialogFlag.EnableCreateDirectory;
_caption = dtext("ACTION_SELECT_DIRECTORY"c);
_caption = UIString.fromId("ACTION_SELECT_DIRECTORY"c);
}
}

View File

@ -256,7 +256,7 @@ class ExecutableFileNameEditItem : SettingsItem {
import dlangui.dialogs.filedlg;
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
FileNameEditLine ed = new FileNameEditLine(_id ~ "-filename-edit");
ed.addFilter(FileFilterEntry(UIString.fromRaw("MESSAGE_EXECUTABLES"c), "*.exe", true));
ed.addFilter(FileFilterEntry(UIString.fromId("MESSAGE_EXECUTABLES"c), "*.exe", true));
ed.minWidth = 200;
Setting setting = settings.settingByPath(_id, SettingType.STRING);
string value = setting.strDef(_defaultValue);
@ -281,7 +281,7 @@ class PathNameEditItem : SettingsItem {
import dlangui.dialogs.filedlg;
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
DirEditLine ed = new DirEditLine(_id ~ "-path-edit");
ed.addFilter(FileFilterEntry(UIString.fromRaw("MESSAGE_ALL_FILES"c), "*.*"));
ed.addFilter(FileFilterEntry(UIString.fromId("MESSAGE_ALL_FILES"c), "*.*"));
ed.minWidth = 200;
Setting setting = settings.settingByPath(_id, SettingType.STRING);
string value = setting.strDef(_defaultValue);

View File

@ -53,7 +53,7 @@ class SimpleBarChart : Widget {
trackHover = false;
styleId = "SIMPLE_BAR_CHART";
_axisX.arrowSize = 1;
title = "TITLE_NEW_CHART"c;
title = UIString.fromId("TITLE_NEW_CHART"c);
measureTextToSetWidgetSize();
}