deep-wine-runner/VM-source/mainwindow.cpp

49 lines
1.3 KiB
C++
Raw Normal View History

2023-02-07 22:12:05 +08:00
/*
* RacoonGX gfdgd xi
*/
2022-07-12 20:37:59 +08:00
#include "mainwindow.h"
#include "ui_mainwindow.h"
2023-02-07 22:12:05 +08:00
#include "buildvbox.h"
2022-07-12 20:37:59 +08:00
#include <QFileDialog>
#include <QDebug>
#include <QNetworkInterface>
#include <QProcess>
2023-02-07 22:12:05 +08:00
#include <QLoggingCategory>
2022-07-12 20:37:59 +08:00
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->tabWidget->setTabPosition(QTabWidget::West); // 标签靠左
2023-02-07 22:12:05 +08:00
// 允许输出 qDebug 信息
QLoggingCategory::defaultCategory()->setEnabled(QtDebugMsg, true);
2022-07-12 20:37:59 +08:00
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_browser_clicked()
{
// 浏览镜像文件
2022-07-14 14:31:36 +08:00
QString filePath = QFileDialog::getOpenFileName(this, "选择 ISO 文件", QDir::homePath(), "ISO 镜像文件(*.iso);;所有文件(*.*)");
2022-07-12 20:37:59 +08:00
if(filePath != ""){
ui->isoPath->setText(filePath);
}
}
void MainWindow::on_install_clicked()
{
2023-02-07 22:12:05 +08:00
buildvbox();
return;
//
2022-07-12 20:37:59 +08:00
QProcess progress;
QStringList list;
list << ui->isoPath->text() << QString::number(ui->systemVersion->currentIndex());
qDebug() << QCoreApplication::applicationDirPath() + QString("/run.py");
progress.startDetached(QCoreApplication::applicationDirPath() + QString("/run.py"), list);
ui->tabWidget->setCurrentIndex(1);
}