mirror of https://github.com/buggins/dlangui.git
UIString from raw strings
This commit is contained in:
parent
3faaaacda8
commit
7ae1bf8491
|
@ -267,7 +267,7 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
_entries = listDirectory(dir, attrFilter, selectedFilter());
|
_entries = listDirectory(dir, attrFilter, selectedFilter());
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
import dlangui.dialogs.msgbox;
|
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();
|
msgBox.show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
|
|
||||||
rightPanel = new VerticalLayout("main");
|
rightPanel = new VerticalLayout("main");
|
||||||
rightPanel.layoutHeight(FILL_PARENT).layoutWidth(FILL_PARENT);
|
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(leftPanel);
|
||||||
content.addChild(rightPanel);
|
content.addChild(rightPanel);
|
||||||
|
@ -598,9 +598,9 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
_fileList.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
|
_fileList.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT);
|
||||||
_fileList.resize(4, 3);
|
_fileList.resize(4, 3);
|
||||||
_fileList.setColTitle(0, " "d);
|
_fileList.setColTitle(0, " "d);
|
||||||
_fileList.setColTitle(1, dtext("COL_NAME"c));
|
_fileList.setColTitle(1, UIString.fromId("COL_NAME"c).value);
|
||||||
_fileList.setColTitle(2, dtext("COL_SIZE"c));
|
_fileList.setColTitle(2, UIString.fromId("COL_SIZE"c).value);
|
||||||
_fileList.setColTitle(3, dtext("COL_MODIFIED"c));
|
_fileList.setColTitle(3, UIString.fromId("COL_MODIFIED"c).value);
|
||||||
_fileList.showRowHeaders = false;
|
_fileList.showRowHeaders = false;
|
||||||
_fileList.rowSelect = true;
|
_fileList.rowSelect = true;
|
||||||
_fileList.multiSelect = _allowMultipleFiles;
|
_fileList.multiSelect = _allowMultipleFiles;
|
||||||
|
@ -928,7 +928,7 @@ class FileNameEditLine : HorizontalLayout {
|
||||||
protected EditLine _edFileName;
|
protected EditLine _edFileName;
|
||||||
protected Button _btn;
|
protected Button _btn;
|
||||||
protected string[string] _filetypeIcons;
|
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 uint _fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable | FileDialogFlag.FileMustExist | FileDialogFlag.EnableCreateDirectory;
|
||||||
protected FileFilterEntry[] _filters;
|
protected FileFilterEntry[] _filters;
|
||||||
protected int _filterIndex;
|
protected int _filterIndex;
|
||||||
|
@ -940,6 +940,7 @@ class FileNameEditLine : HorizontalLayout {
|
||||||
|
|
||||||
this(string ID = null) {
|
this(string ID = null) {
|
||||||
super(ID);
|
super(ID);
|
||||||
|
_caption = UIString.fromId("TITLE_OPEN_FILE"c).value;
|
||||||
_edFileName = new EditLine("FileNameEditLine_edFileName");
|
_edFileName = new EditLine("FileNameEditLine_edFileName");
|
||||||
_edFileName.minWidth(BACKEND_CONSOLE ? 16 : 200);
|
_edFileName.minWidth(BACKEND_CONSOLE ? 16 : 200);
|
||||||
_btn = new Button("FileNameEditLine_btnFile", "..."d);
|
_btn = new Button("FileNameEditLine_btnFile", "..."d);
|
||||||
|
@ -1032,7 +1033,7 @@ class DirEditLine : FileNameEditLine {
|
||||||
super(ID);
|
super(ID);
|
||||||
_fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable
|
_fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable
|
||||||
| FileDialogFlag.FileMustExist | FileDialogFlag.SelectDirectory | FileDialogFlag.EnableCreateDirectory;
|
| FileDialogFlag.FileMustExist | FileDialogFlag.SelectDirectory | FileDialogFlag.EnableCreateDirectory;
|
||||||
_caption = dtext("ACTION_SELECT_DIRECTORY"c);
|
_caption = UIString.fromId("ACTION_SELECT_DIRECTORY"c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ class ExecutableFileNameEditItem : SettingsItem {
|
||||||
import dlangui.dialogs.filedlg;
|
import dlangui.dialogs.filedlg;
|
||||||
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
||||||
FileNameEditLine ed = new FileNameEditLine(_id ~ "-filename-edit");
|
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;
|
ed.minWidth = 200;
|
||||||
Setting setting = settings.settingByPath(_id, SettingType.STRING);
|
Setting setting = settings.settingByPath(_id, SettingType.STRING);
|
||||||
string value = setting.strDef(_defaultValue);
|
string value = setting.strDef(_defaultValue);
|
||||||
|
@ -281,7 +281,7 @@ class PathNameEditItem : SettingsItem {
|
||||||
import dlangui.dialogs.filedlg;
|
import dlangui.dialogs.filedlg;
|
||||||
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
TextWidget lbl = new TextWidget(_id ~ "-label", _label);
|
||||||
DirEditLine ed = new DirEditLine(_id ~ "-path-edit");
|
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;
|
ed.minWidth = 200;
|
||||||
Setting setting = settings.settingByPath(_id, SettingType.STRING);
|
Setting setting = settings.settingByPath(_id, SettingType.STRING);
|
||||||
string value = setting.strDef(_defaultValue);
|
string value = setting.strDef(_defaultValue);
|
||||||
|
|
|
@ -53,7 +53,7 @@ class SimpleBarChart : Widget {
|
||||||
trackHover = false;
|
trackHover = false;
|
||||||
styleId = "SIMPLE_BAR_CHART";
|
styleId = "SIMPLE_BAR_CHART";
|
||||||
_axisX.arrowSize = 1;
|
_axisX.arrowSize = 1;
|
||||||
title = "TITLE_NEW_CHART"c;
|
title = UIString.fromId("TITLE_NEW_CHART"c);
|
||||||
measureTextToSetWidgetSize();
|
measureTextToSetWidgetSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue