mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-22 12:07:45 +00:00
armoury: Port to newer NovusMainWindow API
This commit is contained in:
parent
623b0ee871
commit
1d6d181007
2 changed files with 17 additions and 10 deletions
|
@ -20,6 +20,9 @@ class MainWindow : public NovusMainWindow
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(GameData* data);
|
explicit MainWindow(GameData* data);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void setupAdditionalMenus(QMenuBar *menuBar) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SingleGearView* gearView = nullptr;
|
SingleGearView* gearView = nullptr;
|
||||||
FullModelViewer* fullModelViewer = nullptr;
|
FullModelViewer* fullModelViewer = nullptr;
|
||||||
|
|
|
@ -32,15 +32,7 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
, cache(FileCache{*in_data})
|
, cache(FileCache{*in_data})
|
||||||
{
|
{
|
||||||
setMinimumSize(QSize(800, 600));
|
setMinimumSize(QSize(800, 600));
|
||||||
|
setupMenubar();
|
||||||
auto toolsMenu = menuBar()->addMenu(QStringLiteral("Tools"));
|
|
||||||
|
|
||||||
auto cmpEditorMenu = toolsMenu->addAction(QStringLiteral("CMP Editor"));
|
|
||||||
cmpEditorMenu->setIcon(QIcon::fromTheme(QStringLiteral("document-edit")));
|
|
||||||
connect(cmpEditorMenu, &QAction::triggered, [=] {
|
|
||||||
auto cmpEditor = new CmpEditor(in_data);
|
|
||||||
cmpEditor->show();
|
|
||||||
});
|
|
||||||
|
|
||||||
auto dummyWidget = new QWidget();
|
auto dummyWidget = new QWidget();
|
||||||
setCentralWidget(dummyWidget);
|
setCentralWidget(dummyWidget);
|
||||||
|
@ -69,4 +61,16 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
gearView->setFMVAvailable(!loading);
|
gearView->setFMVAvailable(!loading);
|
||||||
});
|
});
|
||||||
fullModelViewer->show();
|
fullModelViewer->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setupAdditionalMenus(QMenuBar *menuBar)
|
||||||
|
{
|
||||||
|
auto toolsMenu = menuBar->addMenu(QStringLiteral("Tools"));
|
||||||
|
|
||||||
|
auto cmpEditorMenu = toolsMenu->addAction(QStringLiteral("CMP Editor"));
|
||||||
|
cmpEditorMenu->setIcon(QIcon::fromTheme(QStringLiteral("document-edit")));
|
||||||
|
connect(cmpEditorMenu, &QAction::triggered, [this] {
|
||||||
|
auto cmpEditor = new CmpEditor(&data);
|
||||||
|
cmpEditor->show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue