diff options
author | Treeki <treeki@gmail.com> | 2014-06-03 05:55:54 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-06-03 05:55:54 +0200 |
commit | 7a9387269e3b123b1647cf59c78cc6c998a9a330 (patch) | |
tree | 7874647c497a6b6113f660ff27f6f79b7fc7d4aa /lsmainwindow.cpp | |
parent | be8b56a7f0a8f6ba5456a099b61d032fd8aa2f61 (diff) | |
download | LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.tar.gz LayoutStudio-7a9387269e3b123b1647cf59c78cc6c998a9a330.zip |
experimental 3DS support
Diffstat (limited to '')
-rw-r--r-- | lsmainwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lsmainwindow.cpp b/lsmainwindow.cpp index 1d13a50..91bbf50 100644 --- a/lsmainwindow.cpp +++ b/lsmainwindow.cpp @@ -22,6 +22,7 @@ #include <QInputDialog> #include <QMessageBox> #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; |