summaryrefslogtreecommitdiff
path: root/lsmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lsmainwindow.cpp')
-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;