summaryrefslogtreecommitdiff
path: root/lsmainwindow.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-04 18:19:19 +0200
committerTreeki <treeki@gmail.com>2012-08-04 18:19:19 +0200
commitcee09c07899dfec32672e7e2d175972530a7dfd4 (patch)
treeb3e4b1a0960ed1b95e2b838b5bfa4b9f132ff2c8 /lsmainwindow.cpp
parent362976328ecb796d670b32af924f76e25922cb78 (diff)
downloadLayoutStudio-cee09c07899dfec32672e7e2d175972530a7dfd4.tar.gz
LayoutStudio-cee09c07899dfec32672e7e2d175972530a7dfd4.zip
this bit is nowhere near finished but I'm pushing it so I can pull on my netbook
Diffstat (limited to '')
-rw-r--r--lsmainwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lsmainwindow.cpp b/lsmainwindow.cpp
index 66c51b3..4e6af5f 100644
--- a/lsmainwindow.cpp
+++ b/lsmainwindow.cpp
@@ -22,6 +22,7 @@
#include <QInputDialog>
#include <QMessageBox>
#include "lyt/archivepackage.h"
+#include "lslayoutwindow.h"
LSMainWindow::LSMainWindow(QWidget *parent) : QMainWindow(parent) {
m_package = 0;
@@ -33,6 +34,8 @@ LSMainWindow::LSMainWindow(QWidget *parent) : QMainWindow(parent) {
m_view = new QTreeView(this);
setCentralWidget(m_view);
+ connect(m_view, SIGNAL(activated(QModelIndex)), SLOT(handleItemActivated(QModelIndex)));
+
newArchive();
}
@@ -183,6 +186,22 @@ LYTPackageBase::ItemType LSMainWindow::selectedItemType() const {
}
+void LSMainWindow::handleItemActivated(const QModelIndex &index) {
+ QString what = selectedItem();
+ LYTPackageBase::ItemType whatType = selectedItemType();
+
+ if (what.isEmpty())
+ return;
+
+ switch (whatType) {
+ case LYTPackageBase::Layout:
+ LSLayoutWindow *w = new LSLayoutWindow(m_package, what);
+ w->show();
+ break;
+ }
+}
+
+
bool LSMainWindow::ensureSaved() {
// TODO
return false;