mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-05-22 16:09:52 +08:00
初步多线程
This commit is contained in:
parent
c4b977c31c
commit
42516f874a
@ -11,15 +11,18 @@ CONFIG += c++17
|
||||
SOURCES += \
|
||||
about_this_program.cpp \
|
||||
main.cpp \
|
||||
mainwindow.cpp
|
||||
mainwindow.cpp \
|
||||
qr.cpp
|
||||
|
||||
HEADERS += \
|
||||
about_this_program.h \
|
||||
mainwindow.h
|
||||
mainwindow.h \
|
||||
qr.h
|
||||
|
||||
FORMS += \
|
||||
about_this_program.ui \
|
||||
mainwindow.ui
|
||||
mainwindow.ui \
|
||||
qr.ui
|
||||
|
||||
TRANSLATIONS += \
|
||||
deep-wine-runner-cpp_zh_CN.ts
|
||||
|
@ -17,7 +17,8 @@
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
using namespace std;
|
||||
|
||||
QComboBox *MainWindow::e1;
|
||||
QMap<QString, QString> MainWindow::setting;
|
||||
MainWindow::MainWindow(){
|
||||
/*********
|
||||
* 设置变量
|
||||
@ -198,6 +199,24 @@ MainWindow::MainWindow(){
|
||||
if(o1->currentText() == ""){
|
||||
o1->addItem("没有识别到任何Wine,请在菜单栏“程序”安装Wine或安装任意Wine应用");
|
||||
}
|
||||
QObject::connect(button3, &QPushButton::clicked, [&](){
|
||||
Runexebutton_threading *thread = new Runexebutton_threading();
|
||||
thread->start();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::Runexebutton_threading::run(){
|
||||
if(e1->currentText() == ""){
|
||||
QString wineBottlePath = setting.value("DefultBotton");
|
||||
}
|
||||
else{
|
||||
QString wineBottlePath = e1->currentText();
|
||||
}
|
||||
QString option = "";
|
||||
if(setting.value("Architecture") != "Auto"){
|
||||
QString option = option + "WINEARCH=" + setting.value("Architecture") + " ";
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::DisableButton(bool things){
|
||||
|
14
mainwindow.h
14
mainwindow.h
@ -6,6 +6,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QPushButton>
|
||||
#include <QComboBox>
|
||||
#include <QThread>
|
||||
|
||||
class MainWindow
|
||||
{
|
||||
@ -21,8 +22,17 @@ public:
|
||||
QString GetCommandResult(QString command);
|
||||
|
||||
private:
|
||||
class Runexebutton_threading: public QThread{
|
||||
signals:
|
||||
void signal(QString str);
|
||||
void showHistory(QString str);
|
||||
public:
|
||||
void run();
|
||||
|
||||
};
|
||||
void runexebutton();
|
||||
void DisableButton(bool things);
|
||||
QString lastRunCommand = "";
|
||||
QString homePath = QDir::homePath();
|
||||
QString programPath = QCoreApplication::applicationDirPath();
|
||||
QMap<QString, QString> wine;
|
||||
@ -35,7 +45,7 @@ private:
|
||||
QStringList wineBottonHistory;
|
||||
QStringList isoPath;
|
||||
QStringList isoPathFound;
|
||||
QMap<QString, QString> setting;
|
||||
static QMap<QString, QString> setting;
|
||||
// 控件
|
||||
QPushButton *button_r_6;
|
||||
QPushButton *button1;
|
||||
@ -46,7 +56,7 @@ private:
|
||||
QPushButton *getProgramIcon;
|
||||
QPushButton *uninstallProgram;
|
||||
QPushButton *trasButton;
|
||||
QComboBox *e1;
|
||||
static QComboBox *e1;
|
||||
QComboBox *e2;
|
||||
QComboBox *o1;
|
||||
|
||||
|
14
qr.cpp
Normal file
14
qr.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "qr.h"
|
||||
#include "ui_qr.h"
|
||||
|
||||
QR::QR(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::QR)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
QR::~QR()
|
||||
{
|
||||
delete ui;
|
||||
}
|
22
qr.h
Normal file
22
qr.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef QR_H
|
||||
#define QR_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QR;
|
||||
}
|
||||
|
||||
class QR : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QR(QWidget *parent = nullptr);
|
||||
~QR();
|
||||
|
||||
private:
|
||||
Ui::QR *ui;
|
||||
};
|
||||
|
||||
#endif // QR_H
|
70
qr.ui
Normal file
70
qr.ui
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QR</class>
|
||||
<widget class="QDialog" name="QR">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>656</width>
|
||||
<height>410</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="Resources.qrc">
|
||||
<normaloff>:/Icon/deepin-wine-runner.svg</normaloff>:/Icon/deepin-wine-runner.svg</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="qRShow">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10.5pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果您觉得 Wine 运行器对您有帮助,可以请作者吃点零食</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(本来想说喝一杯咖啡的,但我不喝啊)</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;"><img src=":/Icon/QR/Icon/QR/Wechat.png" width="256" /></p>
|
||||
<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;"><img src=":/Icon/QR/Icon/QR/Alipay.jpg" width="256" /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">QQ:</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><img src=":/Icon/QR/Icon/QR/QQ.png" width="256" /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="ok">
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="Resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
x
Reference in New Issue
Block a user