优化wine下载器

This commit is contained in:
2023-04-05 16:09:58 +08:00
parent ba91aae7e1
commit 05c297647e
14 changed files with 66 additions and 36 deletions

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#include "buildvbox.h"
#include "vbox.h"
#include <QFile>

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#ifndef BUILDVBOX_H
#define BUILDVBOX_H
#include <QString>

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#include "command.h"
#include <QProcess>
Command::Command()

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#ifndef COMMAND_H
#define COMMAND_H
#include <QString>

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
@@ -23,11 +27,11 @@ int main(int argc, char *argv[])
trans->load("virtualmachine-en_US.qm");
a.installTranslator(trans);
// 判断是否为 !amd64
if(GetRunCommand("arch").replace(" ", "").replace("\n", "") != QString("x86_64")){
// 判断是否为 !amd64(无需判断了)
/*if(GetRunCommand("arch").replace(" ", "").replace("\n", "") != QString("x86_64")){
QMessageBox::critical(NULL, "错误", "此程序不支持非 X86 架构,立即退出");
return 0;
}
}*/
MainWindow w;
w.show();

View File

@@ -28,12 +28,12 @@ MainWindow::MainWindow(QWidget *parent) :
ui->tabWidget->setTabPosition(QTabWidget::West); // 标签靠左
// 允许输出 qDebug 信息
QLoggingCategory::defaultCategory()->setEnabled(QtDebugMsg, true);
// 判断是否安装 vbox
if(system("which VBoxManage")){
// 判断是否安装 vbox(无需判断)
/*if(system("which VBoxManage")){
if(QMessageBox::question(this, "提示", "检测到您似乎没有安装 VirtualBox立即安装") == QMessageBox::Yes){
system("xdg-open https://www.virtualbox.org/wiki/Linux_Downloads");
}
}
}*/
// QTimer
QTimer *cpuGet = new QTimer(this);
connect(cpuGet, &QTimer::timeout, this, &MainWindow::ShowCPUMessage);

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

View File

@@ -1,3 +1,6 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
*/
#include "qemu.h"
#include <QDir>
#include <QFile>
@@ -30,7 +33,7 @@ int qemu::CreateDisk(QString path, int size){
if(QFile::exists(path)){
return 0;
}
return system(("qemu-img create '" + path + "' " + QString::number(size) + "M").toLatin1());
return system(("qemu-img create -f qcow2 '" + path + "' " + QString::number(size) + "M").toLatin1());
}
int qemu::CreateDiskControl(QString controlName){
return 0;

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#ifndef QEMU_H
#define QEMU_H
#include <QString>

View File

@@ -1,3 +1,6 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
*/
#include "vbox.h"
#include "command.h"
#include <QMessageBox>

View File

@@ -1,3 +1,7 @@
/*
* gfdgd xi、为什么您不喜欢熊出没和阿布呢
* 依照 GPLV3 开源
*/
#ifndef VBOX_H
#define VBOX_H
#include <QString>