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 061f847..f8dbb5e 100644 Binary files a/test-kvm.asm.bin and b/test-kvm.asm.bin differ diff --git a/test.qcow2 b/test.qcow2 index ba44915..82675bb 100644 Binary files a/test.qcow2 and b/test.qcow2 differ diff --git a/图标.qrc b/图标.qrc index a1fd5c5..e7e57be 100755 --- a/图标.qrc +++ b/图标.qrc @@ -4,6 +4,7 @@ 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 +