This commit is contained in:
gfdgd xi 2023-11-11 19:44:28 +08:00
parent 3f6c4a47ff
commit bc0c9039fd
3 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 6.0.2, 2023-11-11T15:26:04. -->
<!-- Written by QtCreator 6.0.2, 2023-11-11T19:43:38. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -155,8 +155,9 @@
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/orangepi/Desktop/deep-wine-runner/VM-source/VirtualMachine.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/orangepi/Desktop/deep-wine-runner/VM-source/VirtualMachine.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">VirtualMachine2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/orangepi/Desktop/windows-virtual-machine-installer-for-wine-runner/VirtualMachine.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/orangepi/Desktop/windows-virtual-machine-installer-for-wine-runner/VirtualMachine.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>

View File

@ -147,6 +147,7 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){
vm.EnabledUEFI(true);
setISOAlready = 1;
break;
}
vm.CreateDiskControl();
//vm.CreateDiskControl("storage_controller_2");

View File

@ -212,6 +212,18 @@ void MainWindow::on_install_clicked()
return;
}
break;
case 8:
if(ui->vmChooser->currentIndex() == 1){
QMessageBox::warning(this, "提示", "VirtualBox 不支持该选项!");
return;
}
break;
case 9:
if(ui->vmChooser->currentIndex() == 1){
QMessageBox::warning(this, "提示", "VirtualBox 不支持该选项!");
return;
}
break;
default:
if(ui->vmChooser->currentIndex() == 0 && QFile::exists(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI")){
QFile::remove(QDir::homePath() + "/.config/deepin-wine-runner/QEMU-EFI");
@ -371,15 +383,12 @@ void MainWindow::on_actionVMTest_triggered()
// 写入 disk 文件
QFile file(":/TestDisk/test.qcow2");
// 计算随机数
//qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
//int number = qrand() % 1000;
//QFile writeFile("/tmp/indows-virtual-machine-installer-for-wine-runner-test-disk-" + QString::number(number) + ".qcow2");
QFile writeFile("/tmp/indows-virtual-machine-installer-for-wine-runner-test-disk.qcow2");
file.open(QIODevice::ReadOnly);
writeFile.open(QIODevice::WriteOnly);
writeFile.write(file.readAll());
file.close();
writeFile.close();
system("qemu-system-i386 --hda /tmp/indows-virtual-machine-installer-for-wine-runner-test-disk.qcow2 > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1");
system("qemu-system-i386 --hda /tmp/indows-virtual-machine-installer-for-wine-runner-test-disk.qcow2 -rtc base=localtime > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1");
}