-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathloaderwindow.cpp
More file actions
40 lines (38 loc) · 1.13 KB
/
Copy pathloaderwindow.cpp
File metadata and controls
40 lines (38 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "loaderwindow.h"
#include "ui_loaderwindow.h"
LoaderWindow::LoaderWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::LoaderWindow)
{
ui->setupUi(this);
ui->launchButton->setEnabled(false);
filename = "";
visualizer = NULL;
}
LoaderWindow::~LoaderWindow()
{
delete ui;
}
void LoaderWindow::on_launchButton_clicked()
{
ui->launchButton->setEnabled(false);
visualizer = new VisualizerWindow(this, filename);
connect(visualizer, SIGNAL(destroyed()), this, SLOT(visualizerClosed()));
}
void LoaderWindow::on_objectButton_clicked()
{
filename = QFileDialog::getOpenFileName(this, tr("Load Object"), "", tr("Object File (*.obj)"));
if(filename != NULL){
QFile file(filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
ui->launchButton->setEnabled(false);
else
ui->launchButton->setEnabled(true);
}
else
ui->launchButton->setEnabled(false);
}
void LoaderWindow::visualizerClosed()
{
ui->launchButton->setEnabled(true);
disconnect(visualizer, SIGNAL(destroyed()), this, SLOT(visualizerClosed()));
visualizer = NULL;
}