From 8202f8ef8ac730e9dfad33788e6ee30b0e3f5e51 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 7 Nov 2023 21:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=99=9A=E6=8B=9F=E6=9C=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9B=E6=B5=8B=E8=AF=95=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E8=A1=8C=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application-vnd.oasis.opendocument.text.svg | 34 ++++++++++ mainwindow.cpp | 24 ++++++- mainwindow.h | 2 + mainwindow.ui | 10 ++- test-kvm.asm | 69 +++++++++++++++++++- test-kvm.asm.bin | Bin 512 -> 512 bytes test.qcow2 | Bin 1024 -> 1024 bytes 图标.qrc | 4 ++ 8 files changed, 138 insertions(+), 5 deletions(-) create mode 100644 application-vnd.oasis.opendocument.text.svg diff --git a/application-vnd.oasis.opendocument.text.svg b/application-vnd.oasis.opendocument.text.svg new file mode 100644 index 0000000..1196821 --- /dev/null +++ b/application-vnd.oasis.opendocument.text.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index cbfa737..b735e47 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -96,7 +96,10 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->textBrowser_3, &QTextBrowser::anchorClicked, this, [=](const QUrl &link){ QDesktopServices::openUrl(link); }); - + // 设置标签栏图标 + ui->tabWidget->setTabIcon(1, QIcon::fromTheme(":/application-vnd.oasis.opendocument.text.svg")); + // 设置窗口图标 + this->setWindowIcon(QIcon(":/deepin-wine-runner.svg")); } void MainWindow::ShowCPUMessage(){ @@ -361,3 +364,22 @@ void MainWindow::on_actionVMRunlLog_triggered() file.close(); } + +void MainWindow::on_actionVMTest_triggered() +{ + // 运行 Demo + // 写入 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"); +} + diff --git a/mainwindow.h b/mainwindow.h index 7198e90..6dbf138 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -50,6 +50,8 @@ private slots: void on_actionVMRunlLog_triggered(); + void on_actionVMTest_triggered(); + private: bool stopShowTime = 0; Ui::MainWindow *ui; diff --git a/mainwindow.ui b/mainwindow.ui index bf92d85..870610e 100755 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -420,8 +420,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">此组件也有非常大的缺点,就是相比于 Wine,会需要占用大量的空间、安装需要大量的时间、某些情况下需要相比于 Wine 需要消耗更多的系统资源,但可以更加完美、流畅的运行 Windows 应用,会尽量减少因为缺少或未实现导致的 Windows exe 程序运行异常</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">该组件制作者:gfdgd xi</p> <hr /> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">参考文献:</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Droid Sans Mono','monospace','monospace'; font-size:11pt; color:#6a9955;">https://juejin.cn/post/7080484519328874510</span></p></body></html> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> false @@ -454,6 +453,8 @@ p, li { white-space: pre-wrap; } + + @@ -487,6 +488,11 @@ p, li { white-space: pre-wrap; } 虚拟机运行日志 + + + 虚拟机测试(X86、Qemu) + + diff --git a/test-kvm.asm b/test-kvm.asm index 345ddd9..f21c8ef 100644 --- a/test-kvm.asm +++ b/test-kvm.asm @@ -39,7 +39,7 @@ tailtitle: loop tailtitle ; 在第一行写入文本 Hello World! jmp near showHeadText -headText: db 'Hello World!' +headText: db 'Hello World!' ;'Wine Runner Qemu Test' showHeadText: ; 虽然可以简单粗暴的用 movsw,但是会出现问题 mov cx,showHeadText-headText @@ -74,7 +74,72 @@ showTailText: mov al,[ds:si] mov byte [es:di],al loop showTailTextLoop - + +; 显示中部提示文本 +jmp near showCenterText +centerTextScreenSize: + ; 第一位是行数 + ; 第二位是单行偏移量 + db 1, -1 +centerText: + db 'Hello', 0x0A + db 'It is test text', 0x0A + db 'a', 0x0A + db 'b', 0x0A + db 0x03 ; 结束符 +showCenterText: + centerTextLong equ showCenterText-centerText + mov cx,centerTextLong + xor ax,ax + loopShowCenterText: + jmp near addScreenLineFinish + addScreenLine: + ; 如果检测到换行符 + mov dx, [centerTextScreenSize] + add dx,1 + mov [centerTextScreenSize], dx + dec cx + mov al,-1 + mov [centerTextScreenSize+1],al + ; 行数+1,偏移量设为 -1(从头开始) + ;ret + addScreenLineFinish: + ; 偏移量 + 1 + mov al,[centerTextScreenSize+1] + add al,1 + mov [centerTextScreenSize+1],al + mov di,centerText + add di,centerTextLong + sub di,cx + mov bl,[di] + + ; 判断是不是结束符 + cmp bl,0x03 + je showCenterTextEnd + + ; 判断是不是换行符 + cmp bl,0x0A + je addScreenLine ; 换行符检测 + + xor ah,ah ; 清空高位 + add al,al + mov di,ax + + ; 计算显示位置 + xor dx,dx + mov dl,[centerTextScreenSize] + mov ax,80 + mul dx + mov dx,2 + mul dx + add ax,2 + add di,ax + + ; 显示 + mov byte [es:di], bl + loop loopShowCenterText + +showCenterTextEnd: get_data: mov di,80*2*25-2 diff --git a/test-kvm.asm.bin b/test-kvm.asm.bin index 061f84791c6aec2688d68354d1df207f4b6d7364..f8dbb5e1bf0738f7c5de204f17d8d76f4acadb89 100644 GIT binary patch delta 165 zcmZo*X<(VKrT(QX1LJ>>)SR4rF3%E$%wmO-)Z!8#QBlH`$d$y!yi=ON@W4w!hHkO# z49$laJAstvhX0FpFf7=?z`_Wm_wQtAJ}#|!zDu^@H*<+un3XAX6#yw5 B9EAV? diff --git a/test.qcow2 b/test.qcow2 index ba44915d00e0d4d5ffacca75d194cbdfbfcfbc6b..82675bb4593026ced004fc804edfbfef7175db14 100644 GIT binary patch delta 167 zcmZqRXyBNzrT(QX1LJ>>)SR4rF3%E$%wmO-)Z!8#QBlH`$d$y!yi=ON@W4w!hHkO# z49$laJAstvhX0FpFf7=?z`_Wm_wQtAJ}#|!zDu^@H*<+deepin-wine-runner.png LANG/virtualmachine-en_US.qm LANG/virtualmachine-en_US.ts + application-vnd.oasis.opendocument.text.svg 截图_VirtualBox Machine_20220712142929.png @@ -20,4 +21,7 @@ 截图/截图_VirtualBox_20220712223705.png 截图/截图_选择区域_20220712224639.png + + test.qcow2 +