# HG changeset patch # User insilmaril # Date 1199717569 0 # Node ID 0ff5fc89dc5c60438bf14b4c1e3377bc95456ca8 # Parent f83abc1f75b4f96de740e78dc9e643b98604028a Included french in vym.pro diff -r f83abc1f75b4 -r 0ff5fc89dc5c attributedialog.cpp --- a/attributedialog.cpp Mon Jan 07 14:52:49 2008 +0000 +++ b/attributedialog.cpp Mon Jan 07 14:52:49 2008 +0000 @@ -58,15 +58,47 @@ void AttributeDialog::setTable (AttributeTable *t) { table=t; - updateTable(); } void AttributeDialog::setBranch (BranchObj *bo) { branch=bo; - updateTable(); } +void AttributeDialog::setMode (const AttributeDialogMode &m) +{ + mode=m; + + QString title; + if (mode==Definition) + title= QApplication::translate("Attribute Dialog","AttributeDialog - Edit definitions", 0, QApplication::UnicodeUTF8); + else + title= QApplication::translate("Attribute Dialog","AttributeDialog - Edit %1", 0, QApplication::UnicodeUTF8).arg("objname"); + setWindowTitle(title); +} + +void AttributeDialog::updateTable() +{ + if (table) + { + // Update list of keys and values + QStringList keyList=table->getKeys(); + AttributeWidget *aw; + for (int i=0; isetKey (keyList.at(i) ); + // FIXME aw->setValues (table->getValues (keyList.at(i) )); + aw->show(); + tableLayout->addWidget (aw); + } + + // Update attributes in dialog from data in selected branch + + // TODO + } + +} void AttributeDialog::addKey() { AttributeWidget *aw1=new AttributeWidget (this); @@ -83,27 +115,4 @@ return; } -void AttributeDialog::updateTable() -{ - if (table) - { - // Update list of keys and values - QStringList keyList=table->getKeys(); - AttributeWidget *aw; - int i; - for (i=0; isetKey (keyList.at(i) ); - aw->setValues (table->getValues (keyList.at(i) )); - aw->show(); - tableLayout->addWidget (aw); - } - // Update attributes in dialog from data in selected branch - - // TODO - } - -} - diff -r f83abc1f75b4 -r 0ff5fc89dc5c attributedialog.h --- a/attributedialog.h Mon Jan 07 14:52:49 2008 +0000 +++ b/attributedialog.h Mon Jan 07 14:52:49 2008 +0000 @@ -12,6 +12,12 @@ #include +/*! \brief Set the dialog mode */ +enum AttributeDialogMode { + Definition, //!< Edit attribute definitions (AttributeDef) + Object //!< Edit attributes of OrnamentedObj +}; + class AttributeDialog:public QDialog { Q_OBJECT @@ -19,13 +25,14 @@ AttributeDialog (QWidget *parent=0 ); void setTable (AttributeTable *table=0); void setBranch (BranchObj *bo); + void setMode (const AttributeDialogMode &m); + void updateTable(); signals: void windowClosed(); private slots: void addKey(); protected: void closeEvent(QCloseEvent*); - void updateTable(); private: QVBoxLayout *vboxLayout; QVBoxLayout *tableLayout; @@ -34,6 +41,7 @@ QSpacerItem *spacerItem; QPushButton *closeButton; + AttributeDialogMode mode; AttributeTable *table; BranchObj *branch; };