Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/sidebar.cc')
-rw-r--r--src/sidebar.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/sidebar.cc b/src/sidebar.cc
index 498a457..c541f92 100644
--- a/src/sidebar.cc
+++ b/src/sidebar.cc
@@ -76,7 +76,7 @@ SideBar::SideBar(QWidget *parent) : QWidget(parent)
setLayout(box_global);
- setEntity(0);
+ setProperties(0);
}
void SideBar::updateEntityLocationX(const QString &value)
@@ -85,7 +85,7 @@ void SideBar::updateEntityLocationX(const QString &value)
bool ok;
float x = value.toFloat(&ok);
if (ok) {
- last_selected->set_location(x, last_selected->location(1), last_selected->location(2));
+ last_selected->set_location(x, last_selected->location()[1], last_selected->location()[2]);
emit entityChanged();
}
}
@@ -97,7 +97,7 @@ void SideBar::updateEntityLocationY(const QString &value)
bool ok;
float y = value.toFloat(&ok);
if (ok) {
- last_selected->set_location(last_selected->location(0), y, last_selected->location(2));
+ last_selected->set_location(last_selected->location()[0], y, last_selected->location()[2]);
emit entityChanged();
}
}
@@ -109,19 +109,17 @@ void SideBar::updateEntityLocationZ(const QString &value)
bool ok;
float z = value.toFloat(&ok);
if (ok) {
- last_selected->set_location(last_selected->location(0), last_selected->location(1), z);
+ last_selected->set_location(last_selected->location()[0], last_selected->location()[1], z);
emit entityChanged();
}
}
}
-void SideBar::setEntity(EntityWidget *entity)
+void SideBar::setProperties(EntityProperties *properties)
{
- QString value;
+ last_selected = properties;
- last_selected = entity;
-
- if (!entity) {
+ if (!properties) {
edit_entitylabel->setEnabled(false);
edit_entitylabel->clear();
@@ -143,29 +141,31 @@ void SideBar::setEntity(EntityWidget *entity)
text_subsections->setEnabled(false);
text_subsections->clear();
} else {
+ QString value;
+
edit_entitylabel->setEnabled(true);
- edit_entitylabel->setText(entity->label());
+ edit_entitylabel->setText(properties->label());
edit_entityname->setEnabled(true);
- edit_entityname->setText(entity->name());
+ edit_entityname->setText(properties->name());
edit_entitylocation_x->setEnabled(true);
- value.setNum(entity->location(0));
+ value.setNum(properties->location()[0]);
edit_entitylocation_x->setText(value);
edit_entitylocation_y->setEnabled(true);
- value.setNum(entity->location(1));
+ value.setNum(properties->location()[1]);
edit_entitylocation_y->setText(value);
edit_entitylocation_z->setEnabled(true);
- value.setNum(entity->location(2));
+ value.setNum(properties->location()[2]);
edit_entitylocation_z->setText(value);
text_entityproperties->setEnabled(true);
- text_entityproperties->setText(entity->properties());
+ text_entityproperties->setText(properties->values());
text_subsections->setEnabled(true);
- text_subsections->setText(entity->subsections());
+ text_subsections->setText(properties->subsections());
}
}