Maraiah/source/tycho-qt/winmenu.cc

57 lines
831 B
C++
Raw Normal View History

2019-05-30 00:09:58 -07:00
#include "tycho.h"
2019-05-15 21:28:33 -07:00
#include "winmenu.h"
#include "ui_winmenu.h"
2019-05-30 00:09:58 -07:00
#include "ui_winabout.h"
2019-05-15 21:28:33 -07:00
2019-05-30 00:09:58 -07:00
#include <QFileDialog>
#include <iostream>
extern "C" void test_fn(char const *fname);
2019-05-16 14:50:59 -07:00
2019-05-15 21:28:33 -07:00
WinMenu::WinMenu(QWidget *parent) :
QMainWindow(parent),
2019-05-16 14:50:59 -07:00
ui(new Ui::WinMenu),
2019-05-30 00:09:58 -07:00
props(new WinMapProps(this))
2019-05-15 21:28:33 -07:00
{
ui->setupUi(this);
}
WinMenu::~WinMenu()
{
2019-05-30 00:09:58 -07:00
dbgPrintFunc();
}
void WinMenu::mapNew()
{
// TODO
}
void WinMenu::mapOpen()
{
auto fname =
QFileDialog::getOpenFileName(
this,
tr("Open Map File"),
QString(),
tr("Marathon Map files (*.scen *.sceA Map)"));
test_fn(qUtf8Printable(fname));
}
void WinMenu::openAbout()
{
QDialog dlg{this};
Ui::WinAbout about{};
about.setupUi(&dlg);
dlg.exec();
2019-05-16 14:50:59 -07:00
}
void WinMenu::openMapProperties()
{
props->show();
2019-05-15 21:28:33 -07:00
}
// EOF