mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-13 18:42:03 +08:00
虚拟机工具支持强制关闭 VirtualBox/Qemu,并增加了对 Windows 7 安装脚本的检测
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include <QIODevice>
|
||||
#include <QInputDialog>
|
||||
#include "qemusetting.h"
|
||||
#include "vbox.h"
|
||||
#include "qemu.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@@ -205,6 +207,20 @@ void MainWindow::on_install_clicked()
|
||||
archFile.write("amd64");
|
||||
archFile.close();
|
||||
switch (ui->systemVersion->currentIndex()) {
|
||||
case 0:
|
||||
if(!QFile::exists(QCoreApplication::applicationDirPath() + "/Windows7X86Auto.iso")){
|
||||
if(QMessageBox::question(this, "提示", "似乎无法找到 Windows7X86Auto.iso,是否继续创建虚拟机?\n缺少该文件可能会导致虚拟机无法正常启动,尝试重新安装 Wine 运行器再试试?") == QMessageBox::No){
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(!QFile::exists(QCoreApplication::applicationDirPath() + "/Windows7X64Auto.iso")){
|
||||
if(QMessageBox::question(this, "提示", "似乎无法找到 Windows7X64Auto.iso,是否继续创建虚拟机?\n缺少该文件可能会导致虚拟机无法正常启动,尝试重新安装 Wine 运行器再试试?") == QMessageBox::No){
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(!QFile::exists("/usr/share/qemu/OVMF.fd") && !QFile::exists(QCoreApplication::applicationDirPath() + "/OVMF.fd") && ui->vmChooser->currentIndex() == 0){
|
||||
if(QMessageBox::question(this, "提示", "似乎无法找到 UEFI 固件,是否继续创建虚拟机?\nQemu 固件可以在“安装 Qemu”处安装") == QMessageBox::No){
|
||||
@@ -419,3 +435,17 @@ void MainWindow::on_actionVMInstallLog_triggered()
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_action_StopVirtualBox_triggered()
|
||||
{
|
||||
vbox vmControl("");
|
||||
vmControl.Stop();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_action_StopQemu_triggered()
|
||||
{
|
||||
qemu vmControl("");
|
||||
vmControl.Stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user