1.1 --- a/attributedialog.cpp Tue Dec 04 12:32:56 2007 +0000
1.2 +++ b/attributedialog.cpp Wed Jan 16 15:45:19 2008 +0000
1.3 @@ -58,15 +58,47 @@
1.4 void AttributeDialog::setTable (AttributeTable *t)
1.5 {
1.6 table=t;
1.7 - updateTable();
1.8 }
1.9
1.10 void AttributeDialog::setBranch (BranchObj *bo)
1.11 {
1.12 branch=bo;
1.13 - updateTable();
1.14 }
1.15
1.16 +void AttributeDialog::setMode (const AttributeDialogMode &m)
1.17 +{
1.18 + mode=m;
1.19 +
1.20 + QString title;
1.21 + if (mode==Definition)
1.22 + title= QApplication::translate("Attribute Dialog","AttributeDialog - Edit definitions", 0, QApplication::UnicodeUTF8);
1.23 + else
1.24 + title= QApplication::translate("Attribute Dialog","AttributeDialog - Edit %1", 0, QApplication::UnicodeUTF8).arg("objname");
1.25 + setWindowTitle(title);
1.26 +}
1.27 +
1.28 +void AttributeDialog::updateTable()
1.29 +{
1.30 + if (table)
1.31 + {
1.32 + // Update list of keys and values
1.33 + QStringList keyList=table->getKeys();
1.34 + AttributeWidget *aw;
1.35 + for (int i=0; i<keyList.count();i++)
1.36 + {
1.37 + aw=new AttributeWidget (this);
1.38 + aw->setKey (keyList.at(i) );
1.39 + // FIXME aw->setValues (table->getValues (keyList.at(i) ));
1.40 + aw->show();
1.41 + tableLayout->addWidget (aw);
1.42 + }
1.43 +
1.44 + // Update attributes in dialog from data in selected branch
1.45 +
1.46 + // TODO
1.47 + }
1.48 +
1.49 +}
1.50 void AttributeDialog::addKey()
1.51 {
1.52 AttributeWidget *aw1=new AttributeWidget (this);
1.53 @@ -83,27 +115,4 @@
1.54 return;
1.55 }
1.56
1.57 -void AttributeDialog::updateTable()
1.58 -{
1.59 - if (table)
1.60 - {
1.61 - // Update list of keys and values
1.62 - QStringList keyList=table->getKeys();
1.63 - AttributeWidget *aw;
1.64 - int i;
1.65 - for (i=0; i<keyList.count();i++)
1.66 - {
1.67 - aw=new AttributeWidget (this);
1.68 - aw->setKey (keyList.at(i) );
1.69 - aw->setValues (table->getValues (keyList.at(i) ));
1.70 - aw->show();
1.71 - tableLayout->addWidget (aw);
1.72 - }
1.73
1.74 - // Update attributes in dialog from data in selected branch
1.75 -
1.76 - // TODO
1.77 - }
1.78 -
1.79 -}
1.80 -