2023-08-06 08:48:11 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-04-14 08:24:06 -04:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2023-09-23 15:45:38 -04:00
|
|
|
#include <KAboutApplicationDialog>
|
|
|
|
#include <KAboutData>
|
2023-07-08 10:33:12 -04:00
|
|
|
#include <QAction>
|
|
|
|
#include <QApplication>
|
2023-08-06 08:48:11 -04:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QDesktopServices>
|
2022-04-14 08:24:06 -04:00
|
|
|
#include <QHBoxLayout>
|
2023-08-06 08:48:11 -04:00
|
|
|
#include <QMenuBar>
|
2022-04-14 08:24:06 -04:00
|
|
|
#include <QTableWidget>
|
|
|
|
#include <QTreeWidget>
|
2023-08-06 08:48:11 -04:00
|
|
|
#include <QUrl>
|
2022-04-14 08:24:06 -04:00
|
|
|
|
2023-07-08 10:33:12 -04:00
|
|
|
#include "filepropertieswindow.h"
|
2023-09-23 15:45:38 -04:00
|
|
|
#include "filetreewindow.h"
|
2023-07-08 10:33:12 -04:00
|
|
|
|
2023-10-10 18:02:13 -04:00
|
|
|
MainWindow::MainWindow(GameData *data)
|
2023-10-10 18:22:38 -04:00
|
|
|
: NovusMainWindow()
|
|
|
|
, data(data)
|
2023-10-10 18:02:13 -04:00
|
|
|
{
|
2023-10-10 18:22:38 -04:00
|
|
|
setupMenubar();
|
2023-07-08 10:33:12 -04:00
|
|
|
|
2023-04-09 15:32:09 -04:00
|
|
|
mdiArea = new QMdiArea();
|
|
|
|
setCentralWidget(mdiArea);
|
2022-04-14 08:24:06 -04:00
|
|
|
|
2023-04-09 15:32:09 -04:00
|
|
|
auto tree = new FileTreeWindow(data);
|
|
|
|
connect(tree, &FileTreeWindow::openFileProperties, this, [=](QString path) {
|
|
|
|
qInfo() << "opening properties window for " << path;
|
|
|
|
auto window = mdiArea->addSubWindow(new FilePropertiesWindow(data, path));
|
|
|
|
window->show();
|
|
|
|
});
|
2022-04-14 08:24:06 -04:00
|
|
|
|
2023-04-09 15:32:09 -04:00
|
|
|
mdiArea->addSubWindow(tree);
|
2022-04-14 08:24:06 -04:00
|
|
|
}
|