From cee09c07899dfec32672e7e2d175972530a7dfd4 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 4 Aug 2012 18:19:19 +0200 Subject: this bit is nowhere near finished but I'm pushing it so I can pull on my netbook --- lsmainwindow.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lsmainwindow.cpp') diff --git a/lsmainwindow.cpp b/lsmainwindow.cpp index 66c51b3..4e6af5f 100644 --- a/lsmainwindow.cpp +++ b/lsmainwindow.cpp @@ -22,6 +22,7 @@ #include #include #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; -- cgit v1.2.3