all repos — mgba @ 9ddf82bebc1915ce8bee833e44b0a8eaa6451bbc

mGBA Game Boy Advance Emulator

src/platform/qt/ArchiveInspector.cpp (view raw)

 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
10using namespace QGBA;
11
12ArchiveInspector::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
24VFile* ArchiveInspector::selectedVFile() const {
25	return m_ui.archiveView->selectedVFile();
26}
27
28QPair<QString, QString> ArchiveInspector::selectedPath() const {
29	return m_ui.archiveView->selectedPath();
30}