1 /* Copyright (c) 2013-2017 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "ArchiveInspector.h"
7
8 #include <mgba-util/vfs.h>
9
10 using namespace QGBA;
11
ArchiveInspector(const QString & filename,QWidget * parent)12 ArchiveInspector::ArchiveInspector(const QString& filename, QWidget* parent)
13 : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
14 {
15 m_ui.setupUi(this);
16 connect(m_ui.archiveView, &LibraryController::doneLoading, [this]() {
17 m_ui.loading->hide();
18 });
19 connect(m_ui.archiveView, &LibraryController::startGame, this, &ArchiveInspector::accepted);
20 m_ui.archiveView->setViewStyle(LibraryStyle::STYLE_LIST);
21 m_ui.archiveView->addDirectory(filename);
22 }
23
selectedVFile() const24 VFile* ArchiveInspector::selectedVFile() const {
25 return m_ui.archiveView->selectedVFile();
26 }
27
selectedPath() const28 QPair<QString, QString> ArchiveInspector::selectedPath() const {
29 return m_ui.archiveView->selectedPath();
30 }
31