Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ixlang committed Nov 29, 2020
1 parent 5b0a224 commit 87b1eb4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 25 deletions.
33 changes: 19 additions & 14 deletions XStringMapView.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class XStringMapView : DocumentView{
QPushButton btnfirst, btnlast, btnprev, btnnext, btndel, btnimport;
QComboBox pagecmb;

bool bloaded = false;
bool bloaded = false, bUpdating = false;

static String unescape(String text){
return text.replace("\t", "\\t").replace("\b", "\\b").replace("\r", "\\r").replace("\n", "\\n");
Expand Down Expand Up @@ -420,6 +420,21 @@ class XStringMapView : DocumentView{

}
});

_container.setOnTableWidgetEventListener(new TableWidgetEventListener(){
public void onCellChange(QTableWidget object, int row,int column) {
if (bUpdating){
return ;
}
int n = currentPage * 1024 + row;
if (n >= 0 && n < langvect.size()){
if (langvect[n].setLangText(curlang, _container.getText(row, 1))){
setModified(true);
}
}
}
});

_container.show();
return true;
}
Expand All @@ -443,22 +458,11 @@ class XStringMapView : DocumentView{
}

void updatecontent(){
int begin = currentPage * 1024;
bool modified = isModified();
for (int i = 0; i < 1024; i++){
int n = i + begin;
if (n < langvect.size()){
if (langvect[n].setLangText(curlang, _container.getText(i, 1))){
modified = true;
}
}else{
break;
}
}
setModified(modified);

}

void updateDisplay(){
bUpdating = true;
int begin = currentPage * 1024;
if (begin < langvect.size()){

Expand Down Expand Up @@ -487,6 +491,7 @@ class XStringMapView : DocumentView{
}
}
pagecmb.setText("" + (currentPage + 1));
bUpdating = false;
}


Expand Down
20 changes: 10 additions & 10 deletions XStudio.xprj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"libs": ["QXLibrary.lix"],
"links": [],
"depends": [],
"wtype": "",
"ostype": "",
"sstype": "",
"outname": "$(ProjectName)$(Ext)",
"outpath": "D:\\Programs\\windows_x64",
"command": "-ce",
"uaclevel": "默认",
"ignorewarning": "",
"warexcp": "-we",
"compdest": "-z",
Expand All @@ -31,14 +38,7 @@
"warnilptr": "-wn",
"strlistfile": "",
"languagefile": "",
"stringoutput": "",
"wtype": "",
"ostype": "",
"sstype": "",
"outname": "$(ProjectName)$(Ext)",
"outpath": "D:\\Programs\\windows_x64",
"command": "-ce",
"uaclevel": "默认"
"stringoutput": ""
},
"release": {
"path": {
Expand Down Expand Up @@ -73,7 +73,7 @@
}
},
"comment": "\r此项目为 XStudio 的源代码\r\r使用了QT 界面库作为XNL的底层调用,\r\rQTdll的代码在example文件夹中可以找到, \r\r该项目约有25000行代码.\r\r可以使用编译好的xide打开此项目进行修改编辑以及调试等.\r\r因为有部分第三方XNL调用以及资源文件依赖,所以编译生成\r\r的可执行文件需要放在与此ide相同目录下才可以正常运行.\r\r版本控制系统暂未处理\r\remail:3.vc@163.com 你也可以向此邮件发送你的建议.",
"versioninc": "0",
"icofile": "xide.ico"
"icofile": "xide.ico",
"versioninc": "0"
}
}
21 changes: 20 additions & 1 deletion XVersionEditor.x
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class XVersionEditor : DocumentView{
QTableWidget _container;
XWorkspace _workspace;
JsonObject versionObj = nilptr;

bool updating = false;
static String [] HVComulns = {" 公司名称 ", " 版权描述 ", " 产品版本 "," 产品名称 ", " 文件名称 ", " 文件版本 ", " 文件描述 "};
static String [] HHComulns = {""};

Expand Down Expand Up @@ -35,6 +35,23 @@ class XVersionEditor : DocumentView{
_container.setVHColumns(HVComulns);
_container.setHHColumns(HHComulns);

_container.setOnTableWidgetEventListener(new TableWidgetEventListener(){
public void onCellChange(QTableWidget object, int row,int column) {
if (updating){
return;
}
String [] keys = {"CompanyName", "LegalCopyright", "ProductVersion", "ProductName", "InternalName", "FileVersion", "FileDescription" };
if (versionObj != nilptr && row >= 0 && row < keys.length){
while (versionObj.has(keys[row])){
versionObj.remove(keys[row]);
}
String text = object.getText(row,column);
versionObj.put(keys[row],text);
setModified(true);
}
}
});

_container.show();
return true;
}
Expand Down Expand Up @@ -67,10 +84,12 @@ class XVersionEditor : DocumentView{
}

void loadVersion(){
updating = true;
String [] keys = {"CompanyName", "LegalCopyright", "ProductVersion", "ProductName", "InternalName", "FileVersion", "FileDescription" };
for (int i =0; i < keys.length; i++){
setToTable(keys[i], i);
}
updating = false;
}


Expand Down

0 comments on commit 87b1eb4

Please sign in to comment.