Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
testwindowview.cpp
1#include "testwindowview.h"
2#include <QFileDialog>
3#include "cache_manager.h"
4#include "ui_testwindowview.h"
5
6TestWindowView::TestWindowView(QWidget *parent)
7 : QMainWindow(parent), ui(new Ui::TestWindowView) {
8 ui->setupUi(this);
9}
10
11TestWindowView::~TestWindowView() {
12 delete ui;
13}
14
15void TestWindowView::on_runButton_clicked() {
16 QString curAppPath = ui->appPathInput->text();
17 if (!curAppPath.isNull()) {
18 emit startGame(curAppPath);
19 }
20}
21
22void TestWindowView::on_selectAppPathButton_clicked() {
23 QString appPath = QFileDialog::getOpenFileName(
24 this, tr("Open App"), QDir::currentPath(), tr("QML App (*.qml)"));
25 if (!appPath.isNull()) {
26 ui->appPathInput->setText(appPath);
27 }
28}
29
30void TestWindowView::on_loadZipButton_clicked() {
31 QString zipPath = QFileDialog::getOpenFileName(this, tr("Select Archive"),
32 QDir::currentPath(),
33 tr("ZIP Archive (*.zip)"));
34 if (!zipPath.isNull()) {
35 QFile archiveFile(zipPath);
36 ui->appPathInput->setText(
37 cache_manager::save_zip_to_cache(&archiveFile).fileName());
38 }
39}
40
41void TestWindowView::on_backButton_clicked() {
42 this->close();
43 emit shownStartView();
44}
45void TestWindowView::on_testHealthConnectionButton_clicked() {
46 emit testHealthConnectionButton();
47}