Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-03-11 10:25:06 +0000
committerStijn Buys <ingar@osirion.org>2012-03-11 10:25:06 +0000
commitf46146993b50ca5afc802288deeb5bd72a176d9a (patch)
tree6b1cde69c854c18ec885562bd97f6c5908cdc0ad
parent7c17b396474fc3783664dbd4da86548389825ea3 (diff)
Added zone properties button.
-rw-r--r--src/editorwindow.cc6
-rw-r--r--src/editorwindow.h5
-rw-r--r--src/sidebar.cc18
-rw-r--r--src/sidebar.h9
4 files changed, 35 insertions, 3 deletions
diff --git a/src/editorwindow.cc b/src/editorwindow.cc
index 37d4f69..fc183c6 100644
--- a/src/editorwindow.cc
+++ b/src/editorwindow.cc
@@ -32,6 +32,7 @@ EditorWindow::EditorWindow(QWidget *parent) : QWidget(parent)
connect(editorwindow_mapwidget, SIGNAL(propertiesChanged(EntityProperties *)), editorwindow_sidebar, SLOT(setProperties(EntityProperties *)));
connect(editorwindow_sidebar, SIGNAL(entityChanged()), editorwindow_mapwidget, SLOT(resizeChildren()));
+ connect(editorwindow_sidebar, SIGNAL(zonePropertiesClicked()), this, SLOT(showZoneProperties()));
}
QSize EditorWindow::sizeHint () const
@@ -251,4 +252,9 @@ void EditorWindow::deleteSelected()
editorwindow_mapwidget->deleteSelected();
}
+void EditorWindow::showZoneProperties()
+{
+ QMessageBox::information(this, tr("Zone properties"), tr("Not yet iplemented"));
+}
+
}
diff --git a/src/editorwindow.h b/src/editorwindow.h
index 12aec59..3916292 100644
--- a/src/editorwindow.h
+++ b/src/editorwindow.h
@@ -59,6 +59,11 @@ public slots:
* */
void duplicateSelected();
+ /**
+ * @brief open the zone properties window
+ * */
+ void showZoneProperties();
+
protected:
virtual void resizeEvent (QResizeEvent *event);
diff --git a/src/sidebar.cc b/src/sidebar.cc
index 9299f40..3093fc1 100644
--- a/src/sidebar.cc
+++ b/src/sidebar.cc
@@ -8,6 +8,7 @@
#include <QComboBox>
#include <QLabel>
#include <QLineEdit>
+#include <QPushButton>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QSplitter>
@@ -23,13 +24,22 @@ SideBar::SideBar(QWidget *parent) : QWidget(parent)
// global vertical layout
QVBoxLayout *box_global = new QVBoxLayout();
- // zone name
+ // zone name and properties button
+ QHBoxLayout *box_zone = new QHBoxLayout();
+
label_zone = new QLabel(tr("Zone Name"));
label_zone->setAlignment(Qt::AlignHCenter);
- box_global->addWidget(label_zone);
+ button_zone = new QPushButton(tr("..."));
+
+ box_zone->addWidget(label_zone, 1);
+ box_zone->addWidget(button_zone);
+
+ box_global->addLayout(box_zone);
box_global->addSpacing(16);
+ connect(button_zone, SIGNAL(clicked()), this, SLOT(zonePropertiesButtonClicked()));
+
// entity type
QHBoxLayout *box_entitytype = new QHBoxLayout();
QLabel *label_entitytype = new QLabel(tr("type"));
@@ -194,6 +204,10 @@ SideBar::SideBar(QWidget *parent) : QWidget(parent)
setProperties(0);
}
+void SideBar::zonePropertiesButtonClicked()
+{
+ emit(zonePropertiesClicked());
+}
void SideBar::updateEntityType(const QString &value)
{
diff --git a/src/sidebar.h b/src/sidebar.h
index 5448482..34a4d78 100644
--- a/src/sidebar.h
+++ b/src/sidebar.h
@@ -12,10 +12,11 @@
#include <QWidget>
+class QComboBox;
class QLabel;
class QLineEdit;
+class QPushButton;
class QTextEdit;
-class QComboBox;
namespace editor
{
@@ -77,12 +78,18 @@ private slots:
void updateEntitySubSections();
void updateEntityInfo();
+
+ void zonePropertiesButtonClicked();
signals:
void entityChanged();
+ void zonePropertiesClicked();
+
private:
QLabel *label_zone;
+ QPushButton *button_zone;
+
QComboBox *combo_entitytype;
QLineEdit *edit_entitylabel;
QLineEdit *edit_entityname;