From 7a9387269e3b123b1647cf59c78cc6c998a9a330 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 3 Jun 2014 05:55:54 +0200 Subject: experimental 3DS support --- lsmainwindow.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lsmainwindow.cpp') diff --git a/lsmainwindow.cpp b/lsmainwindow.cpp index 1d13a50..91bbf50 100644 --- a/lsmainwindow.cpp +++ b/lsmainwindow.cpp @@ -22,6 +22,7 @@ #include #include #include "lyt/archivepackage.h" +#include "lyt/directorypackage.h" #include "lslayoutwindow.h" LSMainWindow::LSMainWindow(QWidget *parent) : QMainWindow(parent) { @@ -51,6 +52,7 @@ void LSMainWindow::createActions() { m_openArchiveAction = new QAction("&Open Archive...", this); m_saveAction = new QAction("&Save", this); m_saveArchiveAsAction = new QAction("Save Archive &As...", this); + m_openDirAction = new QAction("Open Directory...", this); m_newArchiveAction->setShortcuts(QKeySequence::New); m_openArchiveAction->setShortcuts(QKeySequence::Open); @@ -61,6 +63,7 @@ void LSMainWindow::createActions() { connect(m_openArchiveAction, SIGNAL(triggered()), SLOT(openArchive())); connect(m_saveAction, SIGNAL(triggered()), SLOT(save())); connect(m_saveArchiveAsAction, SIGNAL(triggered()), SLOT(saveArchiveAs())); + connect(m_openDirAction, SIGNAL(triggered()), SLOT(openDir())); m_addLayoutAction = new QAction("New &Layout...", this); m_addAnimationAction = new QAction("New &Animation...", this); @@ -92,6 +95,7 @@ void LSMainWindow::createActions() { m->addAction(m_openArchiveAction); m->addAction(m_saveAction); m->addAction(m_saveArchiveAsAction); + m->addAction(m_openDirAction); m = bar->addMenu("&Edit"); m->addAction(m_addLayoutAction); @@ -292,6 +296,21 @@ void LSMainWindow::saveArchiveAs() { updateTitleBar(); } +void LSMainWindow::openDir() { + QString path = QFileDialog::getExistingDirectory(this, + "Choose Archive Directory"); + + if (path.isEmpty()) + return; + + LYTDirectoryPackage *pkg = new LYTDirectoryPackage(path); + setCurrentPackage(pkg); + + m_dirty = false; + m_isSaved = true; + updateTitleBar(); +} + void LSMainWindow::setCurrentPackage(LYTPackageBase *pkg) { m_package = pkg; -- cgit v1.2.3