git-svn-id: svn://db.shs.com.ru/libs@112 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -200,29 +200,29 @@ QString CD_Pult::typeName(const QString & n) const {
|
||||
case 'F': return trUtf8("file"); break;
|
||||
case 'D': return trUtf8("dir"); break;
|
||||
}
|
||||
return "";
|
||||
return trUtf8("double");
|
||||
}
|
||||
|
||||
|
||||
void CD_Pult::makeTreeSection(KSection & ks, QTreeWidgetItem * pi) {
|
||||
PIMap<int, KType>::iterator ki;
|
||||
void CD_Pult::makeTreeSection(CDSection & ks, QTreeWidgetItem * pi) {
|
||||
PIMap<int, CDType>::iterator ki;
|
||||
for (ki = ks.k.begin(); ki != ks.k.end(); ++ki) {
|
||||
QTreeWidgetItem * ti = new QTreeWidgetItem(pi);
|
||||
const KType & ck(ki.value());
|
||||
const CDType & ck(ki.value());
|
||||
ti->setText(0, QString::number(ck.index()));
|
||||
ti->setText(1, PI2QString(ck.name()));
|
||||
ti->setText(2, typeName(PI2QString(ck.type())));
|
||||
ti->setText(3, PI2QString(ck.formula()));
|
||||
ti->setText(5, PI2QString(ck.comment()));
|
||||
}
|
||||
PIMap<int, KSection>::iterator si;
|
||||
PIMap<int, CDSection>::iterator si;
|
||||
for (si = ks.s.begin(); si != ks.s.end(); ++si) {
|
||||
QTreeWidgetItem * ti = new QTreeWidgetItem(pi);
|
||||
const KSection & cs(si.value());
|
||||
const CDSection & cs(si.value());
|
||||
ti->setText(0, QString("[%1]").arg(si.key()));
|
||||
ti->setText(1, PI2QString(cs.alias));
|
||||
ti->setText(2, PI2QString(cs.name));
|
||||
makeTreeSection(const_cast<KSection&>(cs), ti);
|
||||
makeTreeSection(const_cast<CDSection&>(cs), ti);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ void CD_Pult::on_buttonSetKDesc_clicked() {
|
||||
kdesc_file = Q2PIString(QDir::current().relativeFilePath(ret));
|
||||
PIFile f(kdesc_file, PIIODevice::ReadOnly);
|
||||
piCout << "open description:" << Q2PIString(ret);
|
||||
K.update(&f);
|
||||
//K.update(&f);
|
||||
updateKDesc(true);
|
||||
}
|
||||
|
||||
@@ -393,6 +393,7 @@ void CD_Pult::updateDiag() {
|
||||
void CD_Pult::updateKDesc(bool ask_move) {
|
||||
addToList(trUtf8("Update K description file \"%1\"").arg(PI2QString(kdesc_file)), Qt::darkMagenta);
|
||||
PIFile f(kdesc_file, PIIODevice::ReadOnly);
|
||||
//piCout << "call K.update():";
|
||||
K.update(&f);
|
||||
updateTree(ask_move);
|
||||
}
|
||||
@@ -418,7 +419,7 @@ void CD_Pult::updateTree(bool move) {
|
||||
ui->treeK->clear();
|
||||
ui->treeK->setUpdatesEnabled(false);
|
||||
eval.clearCustomVariables();
|
||||
makeTreeSection(const_cast<KSection&>(K.root()), ui->treeK->invisibleRootItem());
|
||||
makeTreeSection(const_cast<CDSection&>(K.root()), ui->treeK->invisibleRootItem());
|
||||
/*for (int i = 0; i < K.size_s(); ++i) {
|
||||
QTreeWidgetItem * ti = new QTreeWidgetItem();
|
||||
KDesc kd = kdesc[i];
|
||||
|
||||
Reference in New Issue
Block a user