From c4b977c31c85d88905ce54e0a05804ab51682cc7 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Mon, 1 Jan 2024 22:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0Wine=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources.qrc | 23 ++++++++++ about_this_program.cpp | 79 ++++++++++++++++++++++++++++++++ about_this_program.h | 25 ++++++++++ about_this_program.ui | 78 +++++++++++++++++++++++++++++++ deep-wine-runner-cpp.pro | 6 +++ information.json | 61 +++++++++++++++++++++++++ mainwindow.cpp | 99 ++++++++++++++++++++++++++++++++++------ mainwindow.h | 17 +++++++ 8 files changed, 373 insertions(+), 15 deletions(-) create mode 100644 Resources.qrc create mode 100644 about_this_program.cpp create mode 100644 about_this_program.h create mode 100644 about_this_program.ui create mode 100644 information.json diff --git a/Resources.qrc b/Resources.qrc new file mode 100644 index 0000000..5eac88c --- /dev/null +++ b/Resources.qrc @@ -0,0 +1,23 @@ +<RCC> + <qresource prefix="/"> + <file>information.json</file> + <file>LICENSE</file> + </qresource> + <qresource prefix="/Icon"> + <file>deepin-wine-runner_512x512.png</file> + <file>deepin-wine-runner.svg</file> + <file>Icon/Program/AboutIcon0.png</file> + </qresource> + <qresource prefix="/Icon/QR"> + <file>Icon/QR/Alipay.jpg</file> + <file>Icon/QR/QQ.png</file> + <file>Icon/QR/Wechat.png</file> + </qresource> + <qresource prefix="/Icon/Function"> + <file>Icon/Function/CHROOT.png</file> + <file>Icon/Function/more-wine.png</file> + <file>Icon/Function/wine.png</file> + <file>Icon/Function/wine23A.png</file> + <file>Icon/Function/wine23P.png</file> + </qresource> +</RCC> diff --git a/about_this_program.cpp b/about_this_program.cpp new file mode 100644 index 0000000..714f53b --- /dev/null +++ b/about_this_program.cpp @@ -0,0 +1,79 @@ +#include "about_this_program.h" +#include "ui_about_this_program.h" + +#include <QDateTime> + +about_this_program::about_this_program(QWidget *parent) : + QDialog(parent), + ui(new Ui::about_this_program) +{ + ui->setupUi(this); + QString tips = tr("<h4>提示:</h4>\n"\ + "1、使用终端运行该程序,可以看到 wine 以及程序本身的提示和报错;\n"\ + "2、wine 32 位和 64 位的容器互不兼容;\n"\ + "3、所有的 wine 和 winetricks 均需要自行安装(可以从 菜单栏=>程序 里面进行安装);\n"\ + "4、本程序支持带参数运行 wine 程序(之前版本也可以),只需要按以下格式即可:\n"\ + "exe路径\' 参数 \'\n"\ + "即可(单引号需要输入);\n"\ + "5、wine 容器如果没有指定,则会默认为 ~/.wine;\n"\ + "6、如果可执行文件比较大的话,会出现点击“获取该程序运行情况”出现假死的情况,因为正在后台读取 SHA1,只需要等一下即可(读取速度依照您电脑处理速度、读写速度、可执行文件大小等有关);\n"\ + "7、如果非 X86 的用户的 UOS 专业版用户想要使用的话,只需要在应用商店安装一个 Wine 版本微信即可在本程序选择正确的 Wine 运行程序;"); + QString aboutProgram = tr("<p>Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序。原版的 Wine 只能使用命令操作,且安装过程较为繁琐,对小白不友好。于是该运行器为了解决该痛点,内置了对Wine图形化的支持、Wine 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器、运行库安装工具等。</p>\n"\ + "<p>它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具,可以做到只需下载系统镜像并点击安装即可,无需考虑虚拟机的安装、创建、分区等操作,也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。</p>\n"\ + "<p>而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。</p>\n"\ + "<p>且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式</p>\n"\ + "<pre>"); + QString goodRunSystem = tr("常见 Linux 发行版"); + QString updateThingsString = ""; + QString updateTime = "2023年12月24日"; + QString thankText = ""; + QString version = ""; + QString programUrl = "https://gitee.com/gfdgd-xi/deep-wine-runner\nhttps://github.com/gfdgd-xi/deep-wine-runner\nhttps://gfdgd-xi.github.io"; + QString about = "<style>\n"\ + "a:link, a:active {{\n"\ + " text-decoration: none;\n"\ + "}}\n"\ + "</style>\n"\ + "<h1>关于</h1>\n"\ + "" + aboutProgram + "\n"\ + "\n"\ + "版本:" + version + "\n"\ + "适用平台:" + goodRunSystem + "\n"\ + "安装包构建时间:" + __DATE__ + " " + __TIME__ + "\n"\ + "Qt 版本:" + qVersion() + "\n"\ + "程序官网:" + programUrl + "\n"\ + "<b>Wine 运行器 QQ 交流群:762985460</b>\n"\ + "<b>Wine运行器 QQ 频道:https://pd.qq.com/s/edqkgeydx</b>\n"\ + "当前程序占用体积:@programSize@MB</pre>\n"\ + "<p>本程序依照 GPLV3 协议开源</p>\n"\ + "<hr>\n"\ + "<h1>鸣谢名单</h1>\n"\ + "<pre>" + thankText + "</pre>\n"\ + "<hr>\n"\ + "<h1>更新内容</h1>\n"\ + "<pre>" + updateThingsString + "\n"\ + "<b>更新时间:" + updateTime + "</b></pre>\n"\ + "<hr>\n"\ + "<h1>提示</h1>\n"\ + "<pre>" + tips + "\n"\ + "</pre>\n"\ + "<hr>\n"\ + "<h1>友谊链接</h1>\n"\ + "<pre>星火应用商店:<a href='https://spark-app.store/'>https://spark-app.store/</a>\n"\ + "Deepin 官网:<a href='https://www.deepin.org'>https://www.deepin.org</a>\n"\ + "Deepin 论坛:<a href='https://bbs.deepin.org'>https://bbs.deepin.org</a>\n"\ + "gfdgd xi:<a href='https://gfdgd-xi.github.io'>https://gfdgd-xi.github.io</a>\n"\ + "<hr>\n"\ + "<h1>©2020~" + QDateTime(QDateTime::currentDateTime()).toString("yyyy") + " By gfdgd xi</h1>"; +} + +about_this_program::~about_this_program() +{ + delete ui; +} + +void about_this_program::on_ok_clicked() +{ + this->close(); +} + diff --git a/about_this_program.h b/about_this_program.h new file mode 100644 index 0000000..93147bf --- /dev/null +++ b/about_this_program.h @@ -0,0 +1,25 @@ +#ifndef ABOUT_THIS_PROGRAM_H +#define ABOUT_THIS_PROGRAM_H + +#include <QDialog> + +namespace Ui { +class about_this_program; +} + +class about_this_program : public QDialog +{ + Q_OBJECT + +public: + explicit about_this_program(QWidget *parent = nullptr); + ~about_this_program(); + +private slots: + void on_ok_clicked(); + +private: + Ui::about_this_program *ui; +}; + +#endif // ABOUT_THIS_PROGRAM_H diff --git a/about_this_program.ui b/about_this_program.ui new file mode 100644 index 0000000..0dcc6f7 --- /dev/null +++ b/about_this_program.ui @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>about_this_program</class> + <widget class="QDialog" name="about_this_program"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>863</width> + <height>498</height> + </rect> + </property> + <property name="windowTitle"> + <string>关于 Wine 运行器</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="QGridLayout" name="gridLayout"> + <item row="0" column="1"> + <widget class="QTextBrowser" name="aboutInfo"/> + </item> + <item row="1" column="1"> + <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> + <item row="0" column="0"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="iconShow"> + <property name="text"> + <string><a><img src=":/Icon/deepin-wine-runner.svg" width=256 ></a></string> + </property> + </widget> + </item> + <item> + <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> + </layout> + </item> + </layout> + </widget> + <resources> + <include location="Resources.qrc"/> + </resources> + <connections/> +</ui> diff --git a/deep-wine-runner-cpp.pro b/deep-wine-runner-cpp.pro index 49eff50..b5cb818 100644 --- a/deep-wine-runner-cpp.pro +++ b/deep-wine-runner-cpp.pro @@ -9,13 +9,16 @@ CONFIG += c++17 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + about_this_program.cpp \ main.cpp \ mainwindow.cpp HEADERS += \ + about_this_program.h \ mainwindow.h FORMS += \ + about_this_program.ui \ mainwindow.ui TRANSLATIONS += \ @@ -27,3 +30,6 @@ CONFIG += embed_translations qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + Resources.qrc diff --git a/information.json b/information.json new file mode 100644 index 0000000..0a3d883 --- /dev/null +++ b/information.json @@ -0,0 +1,61 @@ +{ + "Version": "3.6.1", + "Time": "未知", + "Thank": [ + "感谢 @ёжезийлёзйз 进行 Loongarch 架构的测试(旧世界,远程)", + "感谢 @run@3a4k 提供 3a4000 测试机器(远程)", + "感谢 RacoonGX 的付出与贡献", + "感谢 @Amber 编写的《使用wine运行器打包无安装包的软件》:https://bbs.deepin.org/post/247720", + "感谢 @豪 提供程序图标", + "感谢 @鹤舞白沙 对程序文案进行优化以及编写《Wine运行器和Wine打包器傻瓜式使用教程(小白专用) 》:https://bbs.deepin.org/post/246837", + "感谢 @璀璨星空 提供的彩蛋图标", + "感谢 @Bail 反馈的更新策略问题", + "感谢 @白水 反馈的安装 exagear 后无法识别和调用 box86 的问题", + "感谢 @汐光. 提供的翻译接口", + "感谢 @鹤舞白沙 专门为小白用户编写的使用 Wine 运行器非基于生态适配脚本的程序打包教程", + "感谢 @牦牛儿苗 进行了龙芯 3a5000 平台的测试与移植", + "感谢 @鹤舞白沙 优化了程序文案", + "感谢 @豪 的程序测试和制作的论坛 https://gfdgdxi.flarum.cloud/", + "感谢 @185******67 反馈的 2.4.0 无法打开 Visual Basic 组件安装工具的问题", + "感谢 @shenmo 提供的 在打包器的 postrm 脚本添加 kill.sh、追加参数改为 --uri xxxxxxx、独立生成容器 7z 文件的功能", + "感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301", + "感谢 @zhangs https://bbs.deepin.org/post/227948", + "感谢 @gtjmaster https://bbs.deepin.org/post/225509", + "感谢 @统信UCARE服务 https://mp.weixin.qq.com/s/iOdfNv6phc8F4inackFFTw", + "感谢 @星火应用商店 提供部分安装包的源以及本程序的下载地址", + "感谢 @delsin 和 @神末shenmo 在 deepin 论坛提供打包器打包的 deb 包自动删除容器的建议", + "感谢 @shenmo 反馈的 2.1.0 打包器问题和 2.1.0-1 终端调用问题", + "感谢 @GershonWang 在 https://github.com/gfdgd-xi/deep-wine-runner/issues/1 提供窗口居中的建议", + "感谢 @134******28 和 @sgb76 提供的新程序 GUI 布局和实现代码", + "感谢 @sgb76 为 Wine 打包器(非生态适配脚本)打包的 i386 deb 提供建议", + "感谢 @PossibleVing 提供的新版应用图标", + "感谢 @zhengjl 反馈的 1.7.0 中 .net framrwork 3.5 非离线版安装包的问题以及 1.8.0 重复路径一直自动重复增加的问题", + "感谢 @国川 @刘岐 提供的非 i386、amd64 运行 wine 使用 i386/amd64 可执行文件的教程和脚本", + "感谢 @王俊文 @189******09 @tfhyl 提供在非 X86 平台的国产 PC 进行测试", + "感谢 @cuisirwork 提供的提供视频教程的建议", + "感谢 @办公助手 提供的非 X86 平台 Wine 运行自定义 exe 应用教程和 deb 包", + "感谢 @季星火 反馈的无法使用该程序删除生成的 .desktop 的问题", + "感谢 @ZYH 提供的敏感词列表", + "感谢 @五行缺钱 反馈的 2.0.0 在 Deepin 23 缺失依赖 toilet 的问题", + "感谢 @云的眼泪 @zhengjl 反馈的 2.0.0 发布忘记把安装包传蓝奏云的问题", + "感谢 @虚幻的早晨 提出的添加 DXVK、VKD3D 的功能(VKD3D 暂未实现)", + "感谢 @以勒 修改 Dll 提取工具提示文本的建议", + "感谢 @历山居士 反馈的获取自动配置容器脚本工具无法正常加载数据的问题", + "感谢 @Nick @奋斗ing 反馈的 2.1.0-2 的快捷方式故障", + "感谢 @俊生鹏程 反馈的 2.1.0-2 及以前版本在鲲鹏运行 wine 错误的问题并积极测试,以及组件安装工具在 arm 架构的异常", + "感谢 @云的眼泪 反馈的 2.1.0-2 更新死循环的问题,可见:https://bbs.deepin.org/post/243241,以及感谢 @神末shenmo @忘记、过去 和 @历山居士 的讨论", + "感谢 @186******75 反馈的 2.2.0 基于生态适配脚本打包器对话框异常的问题", + "感谢微信用户 @华为 @办公助手 @白水 @北冥没有鱼 @俊生鹏程 @^♀莫離♪^ @姚洪安 @гυи @杨飞 在 arm(飞腾/鲲鹏)架构上提供提供测试与帮助", + "感谢 @办公助手 提供的 2.4.0 打包器支持生成的 arm 架构 deb 包同时支持 UOS box86+exagear 的建议", + "", + "感谢统信在 Wine 生态适配活动中提供的打包脚本", + "也感谢 Deepin Wine 团体制作的 Deepin Wine 和对应的 Deepin Wine Tools,对本程序有很大的帮助", + "也感谢 DXVK 的开发者开发了 DXVK 这个程序,项目链接:https://github.com/doitsujin/dxvk", + "也感谢 WineHQ 开发团队开发的 WineHQ,项目网址:https://dl.winehq.org/", + "也感谢来自 Vek 的灵感和 Vek 开发者的支持,项目链接:https://jihulab.com/vk", + "最后也感谢支持本程序的用户和上传相关软件运行情况数据的用户,有你们的支持和使用,使这个程序变得更好", + "", + "可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的感谢!", + "如果上面有遗漏,请向我反馈补充" + ] +} diff --git a/mainwindow.cpp b/mainwindow.cpp index 0969662..b7838a2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -41,21 +41,21 @@ MainWindow::MainWindow(){ leftUpLayout->addWidget(fastLabel, 0, 0, 1, 2); leftUpLayout->addWidget(new QLabel("<hr>"), 1, 0, 1, 2); leftUpLayout->addWidget(new QLabel(QObject::tr("请选择容器路径:")), 2, 0, 1, 1); - QComboBox *e1 = new QComboBox(); + e1 = new QComboBox(); e1->setEditable(1); leftUpLayout->addWidget(e1, 3, 0, 1, 1); - QPushButton *button1 = new QPushButton("浏览"); + button1 = new QPushButton("浏览"); //button1.clicked.connect(liulanbutton); leftUpLayout->addWidget(button1, 3, 1, 1, 1); leftUpLayout->addWidget(new QLabel(QObject::tr("请选择要执行的程序(EXE、MSI或者命令):")), 4, 0, 1, 1); - QComboBox *e2 = new QComboBox(); + e2 = new QComboBox(); e2->setEditable(1); leftUpLayout->addWidget(e2, 5, 0, 1, 1); - QPushButton *button2 = new QPushButton(QObject::tr("浏览")); + button2 = new QPushButton(QObject::tr("浏览")); //button2.clicked.connect(liulanexebutton); leftUpLayout->addWidget(button2, 5, 1, 1, 1); leftUpLayout->addWidget(new QLabel(QObject::tr("请选择WINE版本:")), 6, 0, 1, 1); - QComboBox *o1 = new QComboBox(); + o1 = new QComboBox(); leftUpLayout->addWidget(o1, 7, 0, 1, 1); // 设置空间权重 button1->setSizePolicy(size); @@ -87,18 +87,18 @@ MainWindow::MainWindow(){ QGridLayout *programManager = new QGridLayout(); leftDownLayout->addLayout(programManager); programManager->addWidget(new QLabel(QObject::tr("程序管理:")), 0, 0, 1, 1); - QPushButton *getProgramIcon = new QPushButton(QObject::tr("提取图标")); + getProgramIcon = new QPushButton(QObject::tr("提取图标")); //getProgramIcon.clicked.connect(lambda: RunWineProgram(f"{programPath}/BeCyIconGrabber.exe' '{e2.currentText()}" if e2.currentText()[:2].upper() == "C:" else f"{programPath}/BeCyIconGrabber.exe' 'z:/{e2.currentText()}")); programManager->addWidget(getProgramIcon, 1, 0, 1, 1); programManager->addWidget(new QLabel(" "), 1, 1, 1, 1); - QPushButton *trasButton = new QPushButton(QObject::tr("窗口透明工具")); + trasButton = new QPushButton(QObject::tr("窗口透明工具")); //trasButton.clicked.connect(lambda: RunWineProgram(f"{programPath}/窗体透明度设置工具.exe")); programManager->addWidget(trasButton, 1, 2, 1, 1); - QPushButton *uninstallProgram = new QPushButton(QObject::tr("卸载程序")); + uninstallProgram = new QPushButton(QObject::tr("卸载程序")); //uninstallProgram.clicked.connect(lambda: RunWineProgram(f"{programPath}/geek.exe")); programManager->addWidget(new QLabel(" "), 1, 3, 1, 1); programManager->addWidget(uninstallProgram, 1, 4, 1, 1); - QPushButton *miniAppStore = new QPushButton(QObject::tr("微型应用商店")); + miniAppStore = new QPushButton(QObject::tr("微型应用商店")); //miniAppStore.clicked.connect(lambda: threading.Thread(target=MiniAppStore).start()); programManager->addWidget(new QLabel(" "), 1, 5, 1, 1); programManager->addWidget(miniAppStore, 1, 6, 1, 1); @@ -112,13 +112,13 @@ MainWindow::MainWindow(){ programManager->addWidget(getLoseDll, 1, 10, 1, 1); programManager->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 1, 11, 1, 1); programManager->addWidget(new QLabel(QObject::tr("WINE配置:")), 2, 0, 1, 1); - QPushButton *wineConfig = new QPushButton(QObject::tr("配置容器")); + wineConfig = new QPushButton(QObject::tr("配置容器")); //wineConfig.clicked.connect(lambda: RunWineProgram("winecfg")); programManager->addWidget(wineConfig, 3, 0, 1, 1); QPushButton *fontAppStore = new QPushButton(QObject::tr("字体商店")); //fontAppStore.clicked.connect(FontAppStore); programManager->addWidget(fontAppStore, 3, 2, 1, 1); - QPushButton *button_r_6 = new QPushButton(QObject::tr("RegShot")); + button_r_6 = new QPushButton(QObject::tr("RegShot")); //button_r_6.clicked.connect(lambda: RunWineProgram(f"{programPath}/RegShot/regshot.exe")); programManager->addWidget(button_r_6, 3, 4, 1, 1); QPushButton *sparkWineSetting = new QPushButton(QObject::tr("星火wine配置")); @@ -159,7 +159,7 @@ MainWindow::MainWindow(){ // 版权 QLabel *copy = new QLabel("程序版本:{version},<b>提示:Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统</b><br/>"\ "<b>注:部分二进制兼容层会自动注册 binfmt(如原版的 Box86/64、Qemu User Static),则意味着无需在 Wine 版本那里特别指定兼容层,直接指定 Wine 即可</b><br/>"\ - "©2020~{time.strftime('%Y')} gfdgd xi"); + "©2020~" + QDateTime(QDateTime::currentDateTime()).toString("yyyy") + " gfdgd xi"); mainLayout->addWidget(copy, 2, 0, 1, 1); // 程序运行 @@ -180,16 +180,19 @@ MainWindow::MainWindow(){ // 窗口设置 window->resize(widget->frameGeometry().width() * 2, widget->frameGeometry().height()); - //window->setWindowIcon(QIcon("{programPath}/deepin-wine-runner.svg")); + window->setWindowIcon(QIcon(":/Icon/deepin-wine-runner.svg")); widget->setLayout(mainLayout); window->show(); CheckWine(); // 控件设置 - //if(setting.value("AutoWine") != 0) + e1->addItems(findExeHistory); + e2->addItems(wineBottonHistory); + combobox1->addItems(shellHistory); o1->addItems(canUseWine); + // 一个 Wine 都没有却用 Wine 的功能 // 还是要处理的,至少不会闪退 if(o1->currentText() == ""){ @@ -197,6 +200,27 @@ MainWindow::MainWindow(){ } } +void MainWindow::DisableButton(bool things){ + button_r_6->setDisabled(things); + button1->setDisabled(things); + button2->setDisabled(things); + button3->setDisabled(things); + wineConfig->setDisabled(things); + e1->setDisabled(things); + e2->setDisabled(things); + o1->setDisabled(things); + miniAppStore->setDisabled(things); + //winetricksOpen->configure(state=a[things]) + getProgramIcon->setDisabled(things); + uninstallProgram->setDisabled(things); + trasButton->setDisabled(things); +} + +void MainWindow::runexebutton(){ + DisableButton(1); + +} + MainWindow::~MainWindow() { //delete ui; @@ -385,8 +409,53 @@ void MainWindow::CheckWine(){ if(QFile::exists("/opt/exagear/bin/ubt_x32a64_al")){ nameValue.append(QStringList() << "使用 ubt_x32a64_al 运行" << "/opt/exagear/bin/ubt_x32a64_al -- "); } - for(QString g: qemuBottleList){ + /*for(QString g: qemuBottleList){ nameValue.append(QStringList() << "使用qemu-" + g[0] + "-static 调用容器" + g[1] + "运行 " << "python3 '" + programPath + "/QemuRun.py' '" + g[0] + "/" + g[1] + "' " + setting.value("QemuUnMountHome").toInt()); + }*/ + } + catch(QString msg){ + qDebug() << msg; + } + /*for(QString k: nameValue){ + qDebug() << k; + if(k.contains("qemu")){ + + } + }*/ + try{ + for(QString i: QDir(homePath + "/.deepinwine/").entryList()){ + for(QString j: wine7zUse){ + if(QFile::exists(homePath + "/.deepinwine/" + i + "/bin/" + j)){ + wine.insert(homePath + "/.deepinwine/" + i + "/bin/" + j, homePath + "/.deepinwine/" + i + "/bin/" + j); + canUseWine.append(homePath + "/.deepinwine/" + i + "/bin/" + j); + } + + } + } + } + catch(QString msg){ + qDebug() << msg; + } + try{ + QStringList canUseWineOld = canUseWine; + for(QString i: canUseWineOld){ + if(QDir(programPath + "/WineLib/usr").exists()){ + wine.insert("使用运行器的运行库运行 " + i, "bash '" + programPath + "/WineLib/run.sh' " + wine.value(i)); + canUseWine.append("使用运行器的运行库运行 " + i); + untipsWine.append("使用运行器的运行库运行 " + i); + } + } + if(QDir("/opt/exagear/images").exists()){ + for(QString k: QDir("/opt/exagear/images").entryList()){ + if(QFileInfo("/opt/exagear/images/" + k).isDir()){ + continue; + } + for(QString i: canUseWineOld){ + wine.insert("使用Exagear容器运行库运行 " + i, "bash '" + programPath + "/WineLib/run-more.sh' '/opt/exagear/images/" + k + "' " + wine.value(i)); + canUseWine.append("使用Exagear容器运行库运行 " + i); + untipsWine.append("使用Exagear容器运行库运行 " + i); + } + } } } catch(QString msg){ diff --git a/mainwindow.h b/mainwindow.h index 94efdbd..850994e 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -4,6 +4,8 @@ #include <QMap> #include <QDir> #include <QCoreApplication> +#include <QPushButton> +#include <QComboBox> class MainWindow { @@ -19,6 +21,8 @@ public: QString GetCommandResult(QString command); private: + void runexebutton(); + void DisableButton(bool things); QString homePath = QDir::homePath(); QString programPath = QCoreApplication::applicationDirPath(); QMap<QString, QString> wine; @@ -32,6 +36,19 @@ private: QStringList isoPath; QStringList isoPathFound; QMap<QString, QString> setting; + // 控件 + QPushButton *button_r_6; + QPushButton *button1; + QPushButton *button2; + QPushButton *button3; + QPushButton *wineConfig; + QPushButton *miniAppStore; + QPushButton *getProgramIcon; + QPushButton *uninstallProgram; + QPushButton *trasButton; + QComboBox *e1; + QComboBox *e2; + QComboBox *o1; };