新增QEMU设置窗口

This commit is contained in:
gfdgd xi 2023-04-15 19:14:30 +08:00
parent 125aa730c2
commit 6a44167c9a
8 changed files with 298 additions and 20 deletions

View File

@ -58,9 +58,11 @@ SOURCES = main.cpp \
vbox.cpp \
command.cpp \
infoutils.cpp \
qemu.cpp qrc_图标.cpp \
qemu.cpp \
qemusetting.cpp qrc_图标.cpp \
moc_mainwindow.cpp \
moc_infoutils.cpp
moc_infoutils.cpp \
moc_qemusetting.cpp
OBJECTS = main.o \
mainwindow.o \
buildvbox.o \
@ -68,9 +70,11 @@ OBJECTS = main.o \
command.o \
infoutils.o \
qemu.o \
qemusetting.o \
qrc_图标.o \
moc_mainwindow.o \
moc_infoutils.o
moc_infoutils.o \
moc_qemusetting.o
DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \
@ -245,13 +249,15 @@ DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
vbox.h \
command.h \
infoutils.h \
qemu.h main.cpp \
qemu.h \
qemusetting.h main.cpp \
mainwindow.cpp \
buildvbox.cpp \
vbox.cpp \
command.cpp \
infoutils.cpp \
qemu.cpp
qemu.cpp \
qemusetting.cpp
QMAKE_TARGET = VirtualMachine
DESTDIR =
TARGET = VirtualMachine
@ -260,7 +266,7 @@ TARGET = VirtualMachine
first: all
####### Build rules
VirtualMachine: ui_mainwindow.h $(OBJECTS)
VirtualMachine: ui_mainwindow.h ui_qemusetting.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
@ -622,9 +628,9 @@ distdir: FORCE
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents 图标.qrc $(DISTDIR)/
$(COPY_FILE) --parents /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainwindow.h buildvbox.h vbox.h command.h infoutils.h qemu.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp mainwindow.cpp buildvbox.cpp vbox.cpp command.cpp infoutils.cpp qemu.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainwindow.ui $(DISTDIR)/
$(COPY_FILE) --parents mainwindow.h buildvbox.h vbox.h command.h infoutils.h qemu.h qemusetting.h $(DISTDIR)/
$(COPY_FILE) --parents main.cpp mainwindow.cpp buildvbox.cpp vbox.cpp command.cpp infoutils.cpp qemu.cpp qemusetting.cpp $(DISTDIR)/
$(COPY_FILE) --parents mainwindow.ui qemusetting.ui $(DISTDIR)/
$(COPY_FILE) --parents zh_CN.ts en_US.ts $(DISTDIR)/
@ -679,9 +685,9 @@ compiler_moc_predefs_clean:
moc_predefs.h: /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp
g++ -pipe -O2 -std=gnu++11 -Wall -Wextra -dM -E -o moc_predefs.h /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp
compiler_moc_header_make_all: moc_mainwindow.cpp moc_infoutils.cpp
compiler_moc_header_make_all: moc_mainwindow.cpp moc_infoutils.cpp moc_qemusetting.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp moc_infoutils.cpp
-$(DEL_FILE) moc_mainwindow.cpp moc_infoutils.cpp moc_qemusetting.cpp
moc_mainwindow.cpp: mainwindow.h \
moc_predefs.h \
/usr/lib/qt5/bin/moc
@ -692,17 +698,26 @@ moc_infoutils.cpp: infoutils.h \
/usr/lib/qt5/bin/moc
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/8 -I/usr/include/x86_64-linux-gnu/c++/8 -I/usr/include/c++/8/backward -I/usr/lib/gcc/x86_64-linux-gnu/8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include infoutils.h -o moc_infoutils.cpp
moc_qemusetting.cpp: qemusetting.h \
moc_predefs.h \
/usr/lib/qt5/bin/moc
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/8 -I/usr/include/x86_64-linux-gnu/c++/8 -I/usr/include/c++/8/backward -I/usr/lib/gcc/x86_64-linux-gnu/8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include qemusetting.h -o moc_qemusetting.cpp
compiler_moc_objc_header_make_all:
compiler_moc_objc_header_clean:
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_make_all: ui_mainwindow.h ui_qemusetting.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
-$(DEL_FILE) ui_mainwindow.h ui_qemusetting.h
ui_mainwindow.h: mainwindow.ui \
/usr/lib/qt5/bin/uic
/usr/lib/qt5/bin/uic mainwindow.ui -o ui_mainwindow.h
ui_qemusetting.h: qemusetting.ui \
/usr/lib/qt5/bin/uic
/usr/lib/qt5/bin/uic qemusetting.ui -o ui_qemusetting.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
@ -719,7 +734,8 @@ main.o: main.cpp mainwindow.h
mainwindow.o: mainwindow.cpp mainwindow.h \
ui_mainwindow.h \
buildvbox.h \
infoutils.h
infoutils.h \
qemusetting.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
buildvbox.o: buildvbox.cpp buildvbox.h \
@ -742,6 +758,10 @@ qemu.o: qemu.cpp qemu.h \
command.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qemu.o qemu.cpp
qemusetting.o: qemusetting.cpp qemusetting.h \
ui_qemusetting.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qemusetting.o qemusetting.cpp
qrc_图标.o: qrc_图标.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_图标.o qrc_图标.cpp
@ -751,6 +771,9 @@ moc_mainwindow.o: moc_mainwindow.cpp
moc_infoutils.o: moc_infoutils.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_infoutils.o moc_infoutils.cpp
moc_qemusetting.o: moc_qemusetting.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qemusetting.o moc_qemusetting.cpp
####### Install
install_target: first FORCE

View File

@ -34,7 +34,8 @@ SOURCES += \
vbox.cpp \
command.cpp \
infoutils.cpp \
qemu.cpp
qemu.cpp \
qemusetting.cpp
HEADERS += \
mainwindow.h \
@ -42,10 +43,12 @@ HEADERS += \
vbox.h \
command.h \
infoutils.h \
qemu.h
qemu.h \
qemusetting.h
FORMS += \
mainwindow.ui
mainwindow.ui \
qemusetting.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin

View File

@ -20,6 +20,7 @@
#include <QJsonArray>
#include <QDesktopServices>
#include <QMessageBox>
#include "qemusetting.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
@ -188,3 +189,15 @@ void MainWindow::on_getQemu_clicked()
{
system(("python3 '" + QCoreApplication::applicationDirPath() + "/../RunCommandWithTerminal.py' '" + QCoreApplication::applicationDirPath() + "/../QemuSystemInstall.sh'").toLatin1());
}
void MainWindow::on_vmChooser_currentIndexChanged(int index)
{
ui->qemuSetting->setDisabled(index);
}
void MainWindow::on_qemuSetting_clicked()
{
QemuSetting show;
show.show();
show.exec();
}

View File

@ -30,6 +30,10 @@ private slots:
void on_getQemu_clicked();
void on_vmChooser_currentIndexChanged(int index);
void on_qemuSetting_clicked();
private:
Ui::MainWindow *ui;
long m_cpuAll;

View File

@ -74,9 +74,6 @@
<property name="currentText">
<string>Windows 7 32 位(支持自动安装)</string>
</property>
<property name="placeholderText">
<string/>
</property>
<item>
<property name="text">
<string>Windows 7 32 位(支持自动安装)</string>
@ -145,6 +142,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="qemuSetting">
<property name="text">
<string>Qemu虚拟机设置</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="getQemu">
<property name="text">
@ -209,6 +213,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;其实本质上跑完安装程序就没有然后了,顶多如果想要运行舒服一点点,可以安装加强功能,直接拉到最底下看就可以了,&lt;span style=&quot; font-weight:600; font-style:italic; text-decoration: underline;&quot;&gt;只限使用 VirtualBox&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; font-style:italic; text-decoration: underline;&quot;&gt;如果你是用非 X86 PC那暂时只能使用 qemu没 kvm且跨架构的性能损失很大推荐使用 Windows XP 而非 Windows 7&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;如果爱折腾的话,下面的都看看也无所谓的,想看往下翻就可以了&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline;&quot;&gt;(这里的帮助更新可能不会那么及时,更详细/新的帮助可以看https://gitee.com/gfdgd-xi/deep-wine-runner/wikis 或 https://gitee.com/gfdgd-xi/wine-runner-wiki&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;如果鼠标被锁定到里面了按下键盘右边的“Ctrl”键就可以了&lt;span style=&quot; font-weight:600; font-style:italic; text-decoration: underline;&quot;&gt;qemu则是 Ctrl+Alt+G&lt;/span&gt; &lt;/p&gt;
&lt;hr /&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;

38
VM-source/qemusetting.cpp Normal file
View File

@ -0,0 +1,38 @@
#include "qemusetting.h"
#include "ui_qemusetting.h"
#include <QMessageBox>
#include <QDesktopServices>
#include <QUrl>
QemuSetting::QemuSetting(QWidget *parent) :
QDialog(parent),
ui(new Ui::QemuSetting)
{
ui->setupUi(this);
}
QemuSetting::~QemuSetting()
{
delete ui;
}
void QemuSetting::on_buttonBox_accepted()
{
QMessageBox::information(NULL, "", "");
acceptDrops();
}
void QemuSetting::on_save_clicked()
{
}
void QemuSetting::on_cancel_clicked()
{
accept();
}
void QemuSetting::on_getrunner_clicked()
{
QDesktopServices::openUrl(QUrl("https://gitee.com/gfdgd-xi/deep-wine-runner/"));
}

31
VM-source/qemusetting.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef QEMUSETTING_H
#define QEMUSETTING_H
#include <QDialog>
namespace Ui {
class QemuSetting;
}
class QemuSetting : public QDialog
{
Q_OBJECT
public:
explicit QemuSetting(QWidget *parent = nullptr);
~QemuSetting();
private slots:
void on_buttonBox_accepted();
void on_save_clicked();
void on_cancel_clicked();
void on_getrunner_clicked();
private:
Ui::QemuSetting *ui;
};
#endif // QEMUSETTING_H

161
VM-source/qemusetting.ui Normal file
View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QemuSetting</class>
<widget class="QDialog" name="QemuSetting">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="8" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>VNC服务端口</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;h3&gt;远程服务&lt;/h3&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>内存大小MB</string>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox"/>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>开启 rdp 服务映射</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>开启VNC服务</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBox_2"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;h3&gt;基础设置&lt;/h3&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>开启 kvm 加速</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QPushButton" name="save">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>保存</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="getrunner">
<property name="text">
<string>获取
Wine
运行器</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>