新增虚拟机测试;测试系统支持多行文本

This commit is contained in:
gfdgd xi 2023-11-07 21:00:32 +08:00
parent 134fff9f17
commit 0c2f37c187
9 changed files with 139 additions and 5 deletions

View File

@ -19,6 +19,7 @@ package:
cp -rv VM-source/deepin-wine-runner.svg VM
cp -rv VM-source/Windows7X64Auto.iso VM
cp -rv VM-source/Windows7X86Auto.iso VM
cp -rv VM-source/test.qcow2 VM
cp -rv wine/ deb/opt/apps/deepin-wine-runner/
cp -rv Test/ deb/opt/apps/deepin-wine-runner/
cp -rv information.json package-script

View File

@ -0,0 +1,34 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128" viewBox="0 0 128 128">
<defs>
<linearGradient id="x-office-document-c" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#005CC2"/>
<stop offset="100%" stop-color="#004DA3"/>
</linearGradient>
<path id="x-office-document-b" d="M84,95 C84,99.9705627 79.9705627,104 75,104 L9,104 C4.02943725,104 6.08718376e-16,99.9705627 0,95 L0,9 C-6.08718376e-16,4.02943725 4.02943725,9.13077564e-16 9,0 L58,0 L84,26 L84,95 Z"/>
<filter id="x-office-document-a" width="127.4%" height="122.1%" x="-13.7%" y="-9.1%" filterUnits="objectBoundingBox">
<feOffset dy="2" in="SourceAlpha" result="shadowOffsetOuter1"/>
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="3.5"/>
<feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0.22745098 0 0 0 0 0.494117647 0 0 0 0 0.960784314 0 0 0 0.2 0"/>
</filter>
<linearGradient id="x-office-document-f" x1="50%" x2="10.489%" y1="50%" y2="91.194%">
<stop offset="0%" stop-color="#FFF" stop-opacity=".1"/>
<stop offset="100%" stop-color="#FFF" stop-opacity=".3"/>
</linearGradient>
<path id="x-office-document-e" d="M58,0 L84,26 L67,26 C62.0294373,26 58,21.9705627 58,17 L58,0 L58,0 Z"/>
<filter id="x-office-document-d" width="188.5%" height="188.5%" x="-44.2%" y="-36.5%" filterUnits="objectBoundingBox">
<feOffset dy="2" in="SourceAlpha" result="shadowOffsetOuter1"/>
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="3.5"/>
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/>
<feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/>
</filter>
</defs>
<g fill="none" fill-rule="evenodd">
<g transform="translate(22 14)">
<use fill="#000" filter="url(#x-office-document-a)" xlink:href="#x-office-document-b"/>
<use fill="url(#x-office-document-c)" xlink:href="#x-office-document-b"/>
<use fill="#000" filter="url(#x-office-document-d)" xlink:href="#x-office-document-e"/>
<use fill="url(#x-office-document-f)" xlink:href="#x-office-document-e"/>
</g>
<path fill="#FFF" fill-opacity=".6" d="M92,50 L92,52 L36,52 L36,50 L92,50 Z M92,60 L92,62 L36,62 L36,60 L92,60 Z M92,70 L92,72 L36,72 L36,70 L92,70 Z M92,80 L92,82 L36,82 L36,80 L92,80 Z M92,90 L92,92 L36,92 L36,90 L92,90 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -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");
}

View File

@ -50,6 +50,8 @@ private slots:
void on_actionVMRunlLog_triggered();
void on_actionVMTest_triggered();
private:
bool stopShowTime = 0;
Ui::MainWindow *ui;

View File

@ -420,8 +420,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;此组件也有非常大的缺点,就是相比于 Wine会需要占用大量的空间、安装需要大量的时间、某些情况下需要相比于 Wine 需要消耗更多的系统资源,但可以更加完美、流畅的运行 Windows 应用,会尽量减少因为缺少或未实现导致的 Windows exe 程序运行异常&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;该组件制作者gfdgd xi&lt;/p&gt;
&lt;hr /&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-family:'Droid Sans Mono','monospace','monospace'; font-size:11pt; color:#6a9955;&quot;&gt;https://juejin.cn/post/7080484519328874510&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&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;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openLinks">
<bool>false</bool>
@ -454,6 +453,8 @@ p, li { white-space: pre-wrap; }
</property>
<addaction name="actionVMInstallLog"/>
<addaction name="actionVMRunlLog"/>
<addaction name="separator"/>
<addaction name="actionVMTest"/>
</widget>
<addaction name="menuVM"/>
</widget>
@ -487,6 +488,11 @@ p, li { white-space: pre-wrap; }
<string>虚拟机运行日志</string>
</property>
</action>
<action name="actionVMTest">
<property name="text">
<string>虚拟机测试X86、Qemu</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>

View File

@ -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

Binary file not shown.

Binary file not shown.

View File

@ -4,6 +4,7 @@
<file>deepin-wine-runner.png</file>
<file>LANG/virtualmachine-en_US.qm</file>
<file>LANG/virtualmachine-en_US.ts</file>
<file>application-vnd.oasis.opendocument.text.svg</file>
</qresource>
<qresource prefix="/picture">
<file>截图_VirtualBox Machine_20220712142929.png</file>
@ -20,4 +21,7 @@
<file>截图/截图_VirtualBox_20220712223705.png</file>
<file>截图/截图_选择区域_20220712224639.png</file>
</qresource>
<qresource prefix="/TestDisk">
<file>test.qcow2</file>
</qresource>
</RCC>