deep-wine-runner/VM-source/mainwindow.cpp
2023-02-07 22:12:05 +08:00

49 lines
1.3 KiB
C++
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 归属 RacoonGX 团队开发者gfdgd xi、为什么您不喜欢熊出没和阿布呢
*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "buildvbox.h"
#include <QFileDialog>
#include <QDebug>
#include <QNetworkInterface>
#include <QProcess>
#include <QLoggingCategory>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->tabWidget->setTabPosition(QTabWidget::West); // 标签靠左
// 允许输出 qDebug 信息
QLoggingCategory::defaultCategory()->setEnabled(QtDebugMsg, true);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_browser_clicked()
{
// 浏览镜像文件
QString filePath = QFileDialog::getOpenFileName(this, "选择 ISO 文件", QDir::homePath(), "ISO 镜像文件(*.iso);;所有文件(*.*)");
if(filePath != ""){
ui->isoPath->setText(filePath);
}
}
void MainWindow::on_install_clicked()
{
buildvbox();
return;
//
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);
}