From 3c202b5ef1fbe3a3c7463f72b7fb2c0eb93c6711 Mon Sep 17 00:00:00 2001 From: Hatanezumi <13630961608@163.com> Date: Wed, 22 Mar 2023 22:39:37 +0800 Subject: [PATCH] first commit --- README.md | 3 + run.py | 10 + src/AutoProcess.py | 49 +++ src/__pycache__/AutoProcess.cpython-310.pyc | Bin 0 -> 2414 bytes src/__pycache__/main.cpython-310.pyc | Bin 0 -> 15531 bytes src/main.py | 341 +++++++++++++++++ ui/MainWindow.py | 375 ++++++++++++++++++ ui/MainWindow.ui | 404 ++++++++++++++++++++ ui/__pycache__/MainWindow.cpython-310.pyc | Bin 0 -> 6983 bytes ui/自动格式转换.py | 5 + 10 files changed, 1187 insertions(+) create mode 100644 README.md create mode 100644 run.py create mode 100644 src/AutoProcess.py create mode 100644 src/__pycache__/AutoProcess.cpython-310.pyc create mode 100644 src/__pycache__/main.cpython-310.pyc create mode 100644 src/main.py create mode 100644 ui/MainWindow.py create mode 100644 ui/MainWindow.ui create mode 100644 ui/__pycache__/MainWindow.cpython-310.pyc create mode 100644 ui/自动格式转换.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..c08c767 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# RA3附属mod下载管理器 +## 介绍 +本程序能快速配置skudef文件或是下载附属mod \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..5690dfa --- /dev/null +++ b/run.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +''' +@Author : Hatanezumi +@Contact : Hatanezumi@chunshengserver.cn +''' +from src import main + +if __name__ == '__main__': + main.init() \ No newline at end of file diff --git a/src/AutoProcess.py b/src/AutoProcess.py new file mode 100644 index 0000000..37a359f --- /dev/null +++ b/src/AutoProcess.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +''' +@Author : Hatanezumi +@Contact : Hatanezumi@chunshengserver.cn +''' +import os +import json +import requests + +def get_mods(base_path:str) -> tuple[bool,str|list[str]]: + if os.path.exists(base_path) is False: + return (False,'未找到{}'.format(base_path)) + mod_dirs = [os.path.join(base_path,i) for i in os.listdir(base_path) if os.path.isdir(os.path.join(base_path,i))] + mods = [os.path.join(base_path,i) for i in os.listdir(base_path) if os.path.splitext(i)[-1].lower() == '.skudef'] + if len(mod_dirs) == 0 and len(mods) == 0: + return (False,'mod文件夹下无mod') + for mod_dir in mod_dirs: + mod = [os.path.join(mod_dir,i) for i in os.listdir(mod_dir) if os.path.splitext(i)[-1].lower() == '.skudef'] + mods += mod + if len(mods) == 0: + return (False,'mod文件夹下无mod') + else: + return (True,mods) +def save_skudef(skufile_path:str,mods:list) -> tuple[bool,str|None]: + try: + with open(skufile_path,'r',encoding='utf-8') as file: + texts = file.readlines() + texts = [text for text in texts if not text.startswith('add-big')] + mods = ['add-big {}\n'.format(mod) for mod in mods] + first_text = texts.pop(0) + texts = mods + texts + texts.insert(0,first_text) + texts[-1] = texts[-1].removesuffix('\n') + with open(skufile_path,'w',encoding='utf-8') as file: + file.writelines(texts) + return (True,None) + except Exception as err: + return (False,err) +def get_cloud(path:str, target, arg): + try: + req = requests.get(path) + if req.status_code != 200: + target(arg,False,"返回值为:{}".format(req.status_code)) + return + res = json.loads(req.content) + target(arg,True,res) + except Exception as err: + target(arg,False,err) \ No newline at end of file diff --git a/src/__pycache__/AutoProcess.cpython-310.pyc b/src/__pycache__/AutoProcess.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..118e38ab745e331b94f89e91d6f6fefa960413be GIT binary patch literal 2414 zcma)7-D_M$6rY*CiyJ;1i%bb}xcjnCb_?z+wWrl0Z0_A)Innr86`i*$m4^W5(cyFu5r#VGC0@!WZauNjXS%a3_L=G*Sy9npZ+z5^^kvye-h2OzFa0S&34uoGfTt ziX@d$K=DtfnJ`+=4e07yAPHHdO?I8Mz|@q;K{T{!;JN~eT_Y9B4Q{Tv32Bc38*Yp9}qI=;{cNd6JRyyBf4@Wlq7ijJ8;d zO4hsng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Bw5h>ZHOe7)rD8gw^$&LbM>1njJH>) zF?%?FjMNw&zEmCtC5P9C7l)(aP?-L@!rlB1Ez=Vr{Oe&YtS9<#em1Aq5WdZ`^DIwVCP!Vp+wi0( z%tW)pwxYBoeU@)^@sAW`7qy8u+dNXrN|GRwWTYfsG2^A|NR!!QH_F@yV)D3VK^LjW zOapRc#tX6COZ_;ob|0l4BJeo?GmKyL>^bo0j(ze&DtnN?F9{40SVMsJj#1HqH6{ None: + #基础设置 + super().__init__(parent) + self.setupUi(self) + self.version = '1.0.0' + #-------------------------- + #连接信号 + self.comboBox_mods.currentIndexChanged.connect(self.__comboBox_mods_changed)#下拉框内容改变 + self.pushButton_R.clicked.connect(self.__on_pushButton_R_clicked)#右移按钮被按下 + self.pushButton_L.clicked.connect(self.__on_pushButton_L_clicked)#左移按钮被按下 + self.pushButton_up.clicked.connect(self.__on_pushButton_up_clicked)#上移按钮被按下 + self.pushButton_down.clicked.connect(self.__on_pushButton_down_clicked)#下移按钮被按下 + self.pushButton_save.clicked.connect(self.__on_pushButton_save_clicked)#保存按钮被按下 + self.pushButton_nowpath.clicked.connect(self.__on_pushButton_nowpath_clicked)#选择当前目录按钮被按下 + self.pushButton_add.clicked.connect(self.__on_pushButton_add_clicked)#添加文件按钮被按下 + self.pushButton_savedir.clicked.connect(self.__on_pushButton_savedir_clicked)#保存到按钮被按下 + self.listView_Network.clicked.connect(self.__on_listView_Network_clicked)#网络列表被按下 + self.pushButton_refresh.clicked.connect(self.__on_pushButton_refresh_clicked)#刷新按钮被按下 + self.pushButton_Download.clicked.connect(self.__on_pushButton_Download_clicked)#下载按钮被按下 + self.pushButton_release.clicked.connect(self.__on_pushButton_release_clicked)#发布页按钮被按下 + #-------------------------- + #变量注册(全局变量) + self.select_mod = '' + self.listView_loaded_qsl = QStringListModel() + self.listView_local_qsl = QStringListModel() + self.listView_Network_qsl = QStringListModel() + self.fileDialog = QFileDialog(self) + self.base_mod_path = os.path.join(os.path.splitdrive(os.environ['systemroot'])[0],os.environ['homepath'],'Documents','Red Alert 3','Mods') + self.cloud_mods = {} + self.cloud_mod_source = (None,{}) + self.isdownloading = False + #-------------------------- + #初始化内容 + self.mods = AutoProcess.get_mods(self.base_mod_path) + if self.mods[0] is False: + QMessageBox.warning(self,'获取mod列表失败',self.mods[1],QMessageBox.Ok,QMessageBox.Ok) + else: + Process.set_comboBox(self.comboBox_mods,[os.path.splitext(os.path.split(mod_name)[1])[0] for mod_name in self.mods[1]]) + self.label_about_verison.setText('当前版本:{}'.format(self.version)) + #绑定模型 + self.listView_loacl.setModel(self.listView_local_qsl) + self.listView_loaded.setModel(self.listView_loaded_qsl) + self.listView_Network.setModel(self.listView_Network_qsl) + #显示当前目录 + self.lineEdit_nowpath.setText(self.base_mod_path) + #获取云信息 + t = Thread(target=AutoProcess.get_cloud,args=('https://cloud.armorrush.com/Hatanezumi/RA3_affiliated_mods/raw/branch/master/mods.json',Process.get_cloud_data,(self,INIT,GETMODS)),daemon=True) + t.start() + #获取更新信息 + t = Thread(target=AutoProcess.get_cloud,args=('https://www.chunshengserver.cn/files/RA3mods/RA3_affiliated_mod_downloader.json',Process.get_cloud_data,(self,INIT,GETNEWVERSION)),daemon=True) + t.start() + def __comboBox_mods_changed(self): + if self.mods[0] is False: + return + # currentText = self.comboBox_mods.currentText()#为了保证数据安全采用字符串匹配的方式 + # find = False + # for mod_path in self.mods[1]: + # if os.path.split(mod_path)[1].removesuffix('.skudef') == currentText: + # self.select_mod = mod_path + # find = True + # break + # if find is False: + # return + #显示本地列表内容 + currentIndex = self.comboBox_mods.currentIndex()#因为有重复的名称,所以采用索引匹配 + mod_path = self.mods[1][currentIndex] + files = os.listdir(os.path.split(mod_path)[0]) + files_big = [file for file in files if os.path.splitext(file)[1] == '.big' or os.path.splitext(file)[1] == '.lyi'] + self.listView_local_qsl.setStringList(files_big) + #显示skudef文件内容 + with open(mod_path,'r',encoding='utf-8') as file: + file_text = file.readlines() + file_loads = [] + for text in file_text: + if text.startswith('add-big'): + file_loads.append(text.split(' ',1)[1].removesuffix('\n')) + self.listView_loaded_qsl.setStringList(file_loads) + #显示当前文件夹 + self.label_nowdir.setText('当前文件夹:{}'.format(os.path.split(os.path.split(mod_path)[0])[1])) + #显示保存到文件夹 + self.lineEdit_savedir.setText(os.path.split(mod_path)[0]) + def __on_pushButton_R_clicked(self): + currentIndex = self.listView_loacl.currentIndex().row() + if currentIndex == -1: + return + select_mod_name = self.listView_local_qsl.stringList()[currentIndex] + if select_mod_name in self.listView_loaded_qsl.stringList(): + return + new_listView_loaded_qsl = self.listView_loaded_qsl.stringList() + new_listView_loaded_qsl.insert(0,select_mod_name) + self.listView_loaded_qsl.setStringList(new_listView_loaded_qsl) + def __on_pushButton_L_clicked(self): + currentIndex = self.listView_loaded.currentIndex().row() + if currentIndex == -1: + return + new_listView_loaded_qsl = self.listView_loaded_qsl.stringList() + new_listView_loaded_qsl.pop(currentIndex) + self.listView_loaded_qsl.setStringList(new_listView_loaded_qsl) + def __on_pushButton_up_clicked(self): + currentIndex = self.listView_loaded.currentIndex().row() + if currentIndex == -1 or currentIndex == 0: + return + new_listView_loaded_qsl = self.listView_loaded_qsl.stringList() + mod_name = new_listView_loaded_qsl.pop(currentIndex) + new_listView_loaded_qsl.insert(currentIndex - 1,mod_name) + self.listView_loaded_qsl.setStringList(new_listView_loaded_qsl) + def __on_pushButton_down_clicked(self): + currentIndex = self.listView_loaded.currentIndex().row() + if currentIndex == -1 or currentIndex == len(self.listView_loaded_qsl.stringList()) - 1: + return + new_listView_loaded_qsl = self.listView_loaded_qsl.stringList() + mod_name = new_listView_loaded_qsl.pop(currentIndex) + new_listView_loaded_qsl.insert(currentIndex + 1,mod_name) + self.listView_loaded_qsl.setStringList(new_listView_loaded_qsl) + def __on_pushButton_save_clicked(self): + mods = self.listView_loaded_qsl.stringList() + currentIndex = self.comboBox_mods.currentIndex() + skudef_path = self.mods[1][currentIndex] + res = AutoProcess.save_skudef(skudef_path,mods) + if res[0]: + QMessageBox.information(self,'保存成功','保存成功',QMessageBox.Ok,QMessageBox.Ok) + else: + select = QMessageBox.critical(self,'保存失败','保存失败:{}'.format(res[1]),QMessageBox.Ok|QMessageBox.Retry,QMessageBox.Ok) + if select == QMessageBox.Retry: + self.__on_pushButton_save_clicked() + def __on_pushButton_nowpath_clicked(self): + currentIndex = self.comboBox_mods.currentIndex() + mod_path = self.mods[1][currentIndex] + select_path = self.fileDialog.getExistingDirectory(self,dir=os.path.split(os.path.split(mod_path)[0])[0]) + if select_path == '': + return + mods = AutoProcess.get_mods(select_path) + if mods[0] is False: + QMessageBox.warning(self,'获取mod列表失败',mods[1],QMessageBox.Ok,QMessageBox.Ok) + else: + self.base_mod_path = select_path + self.mods = mods + Process.set_comboBox(self.comboBox_mods,[os.path.splitext(os.path.split(mod_name)[1])[0] for mod_name in mods[1]]) + #显示当前目录 + self.lineEdit_nowpath.setText(select_path) + def __on_pushButton_add_clicked(self): + add_file_name, select = QInputDialog.getText(self,'请输入要添加的big文件名','请输入要添加的big文件名,要带".big"后缀\n如果不了解请勿随意添加') + if not select: + return + if add_file_name == '': + QMessageBox.warning(self,'错误的输入','输入内容不能为空!',QMessageBox.Ok,QMessageBox.Ok) + return + self.listView_loaded_qsl.setStringList([add_file_name]+self.listView_loaded_qsl.stringList()) + def __on_pushButton_savedir_clicked(self): + now_path = self.lineEdit_savedir.text() + if not os.path.exists(now_path): + now_path = self.base_mod_path + select_path = self.fileDialog.getExistingDirectory(self,dir=now_path) + if select_path == '': + return + self.lineEdit_savedir.setText(select_path) + def __on_listView_Network_clicked(self): + currentIndex = self.listView_Network.currentIndex().row() + select_mod_name = self.listView_Network_qsl.stringList()[currentIndex] + if select_mod_name not in self.cloud_mods.keys(): + return + t = Thread(target=AutoProcess.get_cloud,args=(self.cloud_mods[select_mod_name],Process.get_cloud_data,(self,REFRESH,GETMODINFO)),daemon=True) + t.start() + def message_box(self,arg): + mode, title, text, Button, defaultButton = arg + self.__message_box(mode,title,text,Button,defaultButton) + def __message_box(self,mode:int,title:str,text:str,Button:QMessageBox.StandardButton,defaultButton:QMessageBox.StandardButton): + if mode == INFO: + QMessageBox.information(self,title,text,Button,defaultButton) + elif mode == WARNING: + QMessageBox.warning(self,title,text,Button,defaultButton) + elif mode == CRITICAL: + QMessageBox.Critical(self,title,text,Button,defaultButton) + def set_network_page(self,res:dict): + self.label_name.setText('名称:'+res['name']) + self.label_author.setText('作者:'+res['author']) + self.label_version.setText('版本:'+res['version']) + self.plainTextEdit_introduce.setPlainText(res['introduce']) + self.cloud_mod_source = (res['name'],res['source']) + Process.set_comboBox(self.comboBox_download,[i['name'] for i in res['source']]) + def set_listView_Network(self,res:dict): + self.listView_Network_qsl.setStringList(res.keys()) + self.cloud_mods = res + def set_Status_Tip(self,text:str): + self.setStatusTip(text) + def __on_pushButton_refresh_clicked(self): + t = Thread(target=AutoProcess.get_cloud,args=('https://cloud.armorrush.com/Hatanezumi/RA3_affiliated_mods/raw/branch/master/mods.json',Process.get_cloud_data,(self,REFRESH,GETMODS)),daemon=True) + t.start() + def __on_pushButton_Download_clicked(self): + if self.isdownloading: + QMessageBox.information(self,'无法下载','当前有下载任务在进行',QMessageBox.Ok,QMessageBox.Ok) + return + currentText = self.comboBox_download.currentText() + if self.cloud_mod_source[0] != self.listView_Network_qsl.stringList()[self.listView_Network.currentIndex().row()]: + return + link = '' + for source in self.cloud_mod_source[1]: + if source['name'] == currentText: + link = source['link'] + if link == '': + return + file_name = link.split('/')[-1] + save_path = self.lineEdit_savedir.text() + self.isdownloading = True + t = Thread(target=Process.download,args=(self,link,os.path.join(save_path,file_name)),daemon=True) + t.start() + def set_progressBar_Download(self,value:int): + self.progressBar_Download.setValue(value) + def download_finished(self,path:str): + self.isdownloading = False + self.progressBar_Download.value(0) + select = QMessageBox.information(self,'下载成功','下载成功,是否自动解压?',QMessageBox.Ok|QMessageBox.Cancel,QMessageBox.Cancel) + if select == QMessageBox.Ok: + try: + with py7zr.SevenZipFile(file=path,mode='r') as file: + file.extractall(path=os.path.split(path)[0]) + except Exception as err: + QMessageBox.warning(self,'解压失败','解压失败,原因:{}'.format(err),QMessageBox.Ok,QMessageBox.Ok) + return + else: + QMessageBox.warning(self,'解压成功','解压成功',QMessageBox.Ok,QMessageBox.Ok) + def download_err(self,err:Exception): + self.isdownloading = False + QMessageBox.warning(self,'下载失败','下载失败,原因:{}'.format(err),QMessageBox.Ok,QMessageBox.Ok) + def set_new_version(self,version:str): + self.label_about_newverison.setText("最新版本:"+version) + version_int = int(version.replace('.','')) + self_version = int(self.version.replace('.','')) + if version_int > self_version: + self.label_about_newverison.setText("最新版本:"+version+"(有更新!请点击发布页下载)") + def get_new_version_err(self,err:str): + self.label_about_newverison.setText("最新版本:连接到纯世蜉生失败,原因:{}".format(err)) + def __on_pushButton_release_clicked(self): + webbrowser.open('https://cloud.armorrush.com/Hatanezumi') +def init(): + app = QApplication(sys.argv) + main_window = MainWindow() + main_window.show() + sys.exit(app.exec_()) \ No newline at end of file diff --git a/ui/MainWindow.py b/ui/MainWindow.py new file mode 100644 index 0000000..2dc9b76 --- /dev/null +++ b/ui/MainWindow.py @@ -0,0 +1,375 @@ +# -*- coding: utf-8 -*- + +################################################################################ +## Form generated from reading UI file 'MainWindow.ui' +## +## Created by: Qt User Interface Compiler version 5.15.2 +## +## WARNING! All changes made in this file will be lost when recompiling UI file! +################################################################################ + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + if not MainWindow.objectName(): + MainWindow.setObjectName(u"MainWindow") + MainWindow.resize(819, 576) + self.centralwidget = QWidget(MainWindow) + self.centralwidget.setObjectName(u"centralwidget") + self.verticalLayout = QVBoxLayout(self.centralwidget) + self.verticalLayout.setObjectName(u"verticalLayout") + self.tabWidget_Main = QTabWidget(self.centralwidget) + self.tabWidget_Main.setObjectName(u"tabWidget_Main") + self.tab_local = QWidget() + self.tab_local.setObjectName(u"tab_local") + self.horizontalLayout = QHBoxLayout(self.tab_local) + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.verticalLayout_3 = QVBoxLayout() + self.verticalLayout_3.setObjectName(u"verticalLayout_3") + self.label_local = QLabel(self.tab_local) + self.label_local.setObjectName(u"label_local") + + self.verticalLayout_3.addWidget(self.label_local) + + self.listView_loacl = QListView(self.tab_local) + self.listView_loacl.setObjectName(u"listView_loacl") + self.listView_loacl.setEditTriggers(QAbstractItemView.NoEditTriggers) + + self.verticalLayout_3.addWidget(self.listView_loacl) + + + self.horizontalLayout.addLayout(self.verticalLayout_3) + + self.verticalLayout_2 = QVBoxLayout() + self.verticalLayout_2.setObjectName(u"verticalLayout_2") + self.pushButton_R = QPushButton(self.tab_local) + self.pushButton_R.setObjectName(u"pushButton_R") + + self.verticalLayout_2.addWidget(self.pushButton_R) + + + self.horizontalLayout.addLayout(self.verticalLayout_2) + + self.verticalLayout_11 = QVBoxLayout() + self.verticalLayout_11.setObjectName(u"verticalLayout_11") + self.label_loaded = QLabel(self.tab_local) + self.label_loaded.setObjectName(u"label_loaded") + + self.verticalLayout_11.addWidget(self.label_loaded) + + self.listView_loaded = QListView(self.tab_local) + self.listView_loaded.setObjectName(u"listView_loaded") + self.listView_loaded.setEditTriggers(QAbstractItemView.NoEditTriggers) + + self.verticalLayout_11.addWidget(self.listView_loaded) + + + self.horizontalLayout.addLayout(self.verticalLayout_11) + + self.verticalLayout_12 = QVBoxLayout() + self.verticalLayout_12.setObjectName(u"verticalLayout_12") + self.pushButton_up = QPushButton(self.tab_local) + self.pushButton_up.setObjectName(u"pushButton_up") + + self.verticalLayout_12.addWidget(self.pushButton_up) + + self.pushButton_down = QPushButton(self.tab_local) + self.pushButton_down.setObjectName(u"pushButton_down") + + self.verticalLayout_12.addWidget(self.pushButton_down) + + self.pushButton_add = QPushButton(self.tab_local) + self.pushButton_add.setObjectName(u"pushButton_add") + + self.verticalLayout_12.addWidget(self.pushButton_add) + + self.pushButton_L = QPushButton(self.tab_local) + self.pushButton_L.setObjectName(u"pushButton_L") + + self.verticalLayout_12.addWidget(self.pushButton_L) + + + self.horizontalLayout.addLayout(self.verticalLayout_12) + + self.verticalLayout_4 = QVBoxLayout() + self.verticalLayout_4.setObjectName(u"verticalLayout_4") + self.horizontalLayout_6 = QHBoxLayout() + self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") + self.label_nowpath = QLabel(self.tab_local) + self.label_nowpath.setObjectName(u"label_nowpath") + + self.horizontalLayout_6.addWidget(self.label_nowpath) + + self.lineEdit_nowpath = QLineEdit(self.tab_local) + self.lineEdit_nowpath.setObjectName(u"lineEdit_nowpath") + self.lineEdit_nowpath.setReadOnly(True) + + self.horizontalLayout_6.addWidget(self.lineEdit_nowpath) + + self.pushButton_nowpath = QPushButton(self.tab_local) + self.pushButton_nowpath.setObjectName(u"pushButton_nowpath") + + self.horizontalLayout_6.addWidget(self.pushButton_nowpath) + + + self.verticalLayout_4.addLayout(self.horizontalLayout_6) + + self.comboBox_mods = QComboBox(self.tab_local) + self.comboBox_mods.setObjectName(u"comboBox_mods") + + self.verticalLayout_4.addWidget(self.comboBox_mods) + + self.label_nowdir = QLabel(self.tab_local) + self.label_nowdir.setObjectName(u"label_nowdir") + + self.verticalLayout_4.addWidget(self.label_nowdir) + + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_4.addItem(self.verticalSpacer) + + self.pushButton_save = QPushButton(self.tab_local) + self.pushButton_save.setObjectName(u"pushButton_save") + + self.verticalLayout_4.addWidget(self.pushButton_save) + + + self.horizontalLayout.addLayout(self.verticalLayout_4) + + self.tabWidget_Main.addTab(self.tab_local, "") + self.tab_Network = QWidget() + self.tab_Network.setObjectName(u"tab_Network") + self.horizontalLayout_2 = QHBoxLayout(self.tab_Network) + self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") + self.listView_Network = QListView(self.tab_Network) + self.listView_Network.setObjectName(u"listView_Network") + self.listView_Network.setEditTriggers(QAbstractItemView.NoEditTriggers) + + self.horizontalLayout_2.addWidget(self.listView_Network) + + self.verticalLayout_7 = QVBoxLayout() + self.verticalLayout_7.setObjectName(u"verticalLayout_7") + self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_7.addItem(self.verticalSpacer_2) + + self.pushButton_refresh = QPushButton(self.tab_Network) + self.pushButton_refresh.setObjectName(u"pushButton_refresh") + + self.verticalLayout_7.addWidget(self.pushButton_refresh) + + + self.horizontalLayout_2.addLayout(self.verticalLayout_7) + + self.verticalLayout_6 = QVBoxLayout() + self.verticalLayout_6.setObjectName(u"verticalLayout_6") + self.label_name = QLabel(self.tab_Network) + self.label_name.setObjectName(u"label_name") + + self.verticalLayout_6.addWidget(self.label_name) + + self.label_author = QLabel(self.tab_Network) + self.label_author.setObjectName(u"label_author") + + self.verticalLayout_6.addWidget(self.label_author) + + self.label_version = QLabel(self.tab_Network) + self.label_version.setObjectName(u"label_version") + + self.verticalLayout_6.addWidget(self.label_version) + + self.horizontalLayout_3 = QHBoxLayout() + self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") + self.label_introduce = QLabel(self.tab_Network) + self.label_introduce.setObjectName(u"label_introduce") + + self.horizontalLayout_3.addWidget(self.label_introduce) + + self.plainTextEdit_introduce = QPlainTextEdit(self.tab_Network) + self.plainTextEdit_introduce.setObjectName(u"plainTextEdit_introduce") + self.plainTextEdit_introduce.setLineWrapMode(QPlainTextEdit.NoWrap) + + self.horizontalLayout_3.addWidget(self.plainTextEdit_introduce) + + + self.verticalLayout_6.addLayout(self.horizontalLayout_3) + + + self.horizontalLayout_2.addLayout(self.verticalLayout_6) + + self.line = QFrame(self.tab_Network) + self.line.setObjectName(u"line") + self.line.setFrameShape(QFrame.VLine) + self.line.setFrameShadow(QFrame.Sunken) + + self.horizontalLayout_2.addWidget(self.line) + + self.verticalLayout_8 = QVBoxLayout() + self.verticalLayout_8.setObjectName(u"verticalLayout_8") + self.horizontalLayout_4 = QHBoxLayout() + self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") + self.label_savedir = QLabel(self.tab_Network) + self.label_savedir.setObjectName(u"label_savedir") + + self.horizontalLayout_4.addWidget(self.label_savedir) + + self.lineEdit_savedir = QLineEdit(self.tab_Network) + self.lineEdit_savedir.setObjectName(u"lineEdit_savedir") + self.lineEdit_savedir.setReadOnly(False) + + self.horizontalLayout_4.addWidget(self.lineEdit_savedir) + + self.pushButton_savedir = QPushButton(self.tab_Network) + self.pushButton_savedir.setObjectName(u"pushButton_savedir") + + self.horizontalLayout_4.addWidget(self.pushButton_savedir) + + + self.verticalLayout_8.addLayout(self.horizontalLayout_4) + + self.horizontalLayout_7 = QHBoxLayout() + self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") + self.label_source = QLabel(self.tab_Network) + self.label_source.setObjectName(u"label_source") + + self.horizontalLayout_7.addWidget(self.label_source) + + self.comboBox_download = QComboBox(self.tab_Network) + self.comboBox_download.setObjectName(u"comboBox_download") + + self.horizontalLayout_7.addWidget(self.comboBox_download) + + self.horizontalLayout_7.setStretch(1, 10) + + self.verticalLayout_8.addLayout(self.horizontalLayout_7) + + self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.verticalLayout_8.addItem(self.verticalSpacer_3) + + self.progressBar_Download = QProgressBar(self.tab_Network) + self.progressBar_Download.setObjectName(u"progressBar_Download") + self.progressBar_Download.setValue(0) + + self.verticalLayout_8.addWidget(self.progressBar_Download) + + self.pushButton_Download = QPushButton(self.tab_Network) + self.pushButton_Download.setObjectName(u"pushButton_Download") + + self.verticalLayout_8.addWidget(self.pushButton_Download) + + + self.horizontalLayout_2.addLayout(self.verticalLayout_8) + + self.tabWidget_Main.addTab(self.tab_Network, "") + self.tab_about = QWidget() + self.tab_about.setObjectName(u"tab_about") + self.horizontalLayout_5 = QHBoxLayout(self.tab_about) + self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") + self.verticalLayout_9 = QVBoxLayout() + self.verticalLayout_9.setObjectName(u"verticalLayout_9") + self.label_about_author = QLabel(self.tab_about) + self.label_about_author.setObjectName(u"label_about_author") + + self.verticalLayout_9.addWidget(self.label_about_author) + + self.label_about_contact = QLabel(self.tab_about) + self.label_about_contact.setObjectName(u"label_about_contact") + + self.verticalLayout_9.addWidget(self.label_about_contact) + + + self.horizontalLayout_5.addLayout(self.verticalLayout_9) + + self.line_2 = QFrame(self.tab_about) + self.line_2.setObjectName(u"line_2") + self.line_2.setFrameShape(QFrame.VLine) + self.line_2.setFrameShadow(QFrame.Sunken) + + self.horizontalLayout_5.addWidget(self.line_2) + + self.verticalLayout_10 = QVBoxLayout() + self.verticalLayout_10.setObjectName(u"verticalLayout_10") + self.label_about_verison = QLabel(self.tab_about) + self.label_about_verison.setObjectName(u"label_about_verison") + + self.verticalLayout_10.addWidget(self.label_about_verison) + + self.label_about_newverison = QLabel(self.tab_about) + self.label_about_newverison.setObjectName(u"label_about_newverison") + + self.verticalLayout_10.addWidget(self.label_about_newverison) + + self.pushButton_release = QPushButton(self.tab_about) + self.pushButton_release.setObjectName(u"pushButton_release") + + self.verticalLayout_10.addWidget(self.pushButton_release) + + + self.horizontalLayout_5.addLayout(self.verticalLayout_10) + + self.tabWidget_Main.addTab(self.tab_about, "") + + self.verticalLayout.addWidget(self.tabWidget_Main) + + MainWindow.setCentralWidget(self.centralwidget) + self.statusBar = QStatusBar(MainWindow) + self.statusBar.setObjectName(u"statusBar") + MainWindow.setStatusBar(self.statusBar) + + self.retranslateUi(MainWindow) + + self.tabWidget_Main.setCurrentIndex(0) + + + QMetaObject.connectSlotsByName(MainWindow) + # setupUi + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"RA3\u9644\u5c5emod\u4e0b\u8f7d\u5668", None)) +#if QT_CONFIG(statustip) + MainWindow.setStatusTip("") +#endif // QT_CONFIG(statustip) + self.label_local.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u6587\u4ef6\u5939\u4e0b\u7684big\u6587\u4ef6", None)) + self.pushButton_R.setText(QCoreApplication.translate("MainWindow", u"\u2192", None)) + self.label_loaded.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u52a0\u8f7d\u7684\u6587\u4ef6", None)) + self.pushButton_up.setText(QCoreApplication.translate("MainWindow", u"\u2191", None)) + self.pushButton_down.setText(QCoreApplication.translate("MainWindow", u"\u2193", None)) + self.pushButton_add.setText(QCoreApplication.translate("MainWindow", u"+", None)) + self.pushButton_L.setText(QCoreApplication.translate("MainWindow", u"-", None)) + self.label_nowpath.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u76ee\u5f55:", None)) + self.pushButton_nowpath.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.label_nowdir.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u6587\u4ef6\u5939:", None)) + self.pushButton_save.setText(QCoreApplication.translate("MainWindow", u"\u4fdd\u5b58", None)) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_local), QCoreApplication.translate("MainWindow", u"\u672c\u5730", None)) + self.pushButton_refresh.setText(QCoreApplication.translate("MainWindow", u"\u5237\u65b0", None)) + self.label_name.setText(QCoreApplication.translate("MainWindow", u"\u540d\u79f0:", None)) + self.label_author.setText(QCoreApplication.translate("MainWindow", u"\u4f5c\u8005:", None)) + self.label_version.setText(QCoreApplication.translate("MainWindow", u"\u7248\u672c:", None)) + self.label_introduce.setText(QCoreApplication.translate("MainWindow", u"\u4ecb\u7ecd:", None)) + self.label_savedir.setText(QCoreApplication.translate("MainWindow", u"\u4fdd\u5b58\u5230:", None)) + self.pushButton_savedir.setText(QCoreApplication.translate("MainWindow", u"...", None)) + self.label_source.setText(QCoreApplication.translate("MainWindow", u"\u4e0b\u8f7d\u6e90:", None)) + self.pushButton_Download.setText(QCoreApplication.translate("MainWindow", u"\u4e0b\u8f7d", None)) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_Network), QCoreApplication.translate("MainWindow", u"\u7f51\u7edc", None)) + self.label_about_author.setText(QCoreApplication.translate("MainWindow", u"\u4f5c\u8005:\u7530\u9f20-Hatanezumi", None)) + self.label_about_contact.setText(QCoreApplication.translate("MainWindow", u"\u8054\u7cfb:Hatanezumi@chunshengserver.cn", None)) + self.label_about_verison.setText(QCoreApplication.translate("MainWindow", u"\u5f53\u524d\u7248\u672c:", None)) + self.label_about_newverison.setText(QCoreApplication.translate("MainWindow", u"\u6700\u65b0\u7248\u672c:", None)) + self.pushButton_release.setText(QCoreApplication.translate("MainWindow", u"\u53d1\u5e03\u9875", None)) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_about), QCoreApplication.translate("MainWindow", u"\u5173\u4e8e", None)) +#if QT_CONFIG(statustip) + self.statusBar.setStatusTip("") +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(accessibility) + self.statusBar.setAccessibleName("") +#endif // QT_CONFIG(accessibility) +#if QT_CONFIG(accessibility) + self.statusBar.setAccessibleDescription("") +#endif // QT_CONFIG(accessibility) + # retranslateUi + diff --git a/ui/MainWindow.ui b/ui/MainWindow.ui new file mode 100644 index 0000000..4074d97 --- /dev/null +++ b/ui/MainWindow.ui @@ -0,0 +1,404 @@ + + + MainWindow + + + + 0 + 0 + 819 + 576 + + + + RA3附属mod下载器 + + + + + + + + + + 0 + + + + 本地 + + + + + + + + 当前文件夹下的big文件 + + + + + + + QAbstractItemView::NoEditTriggers + + + + + + + + + + + + + + + + + + + + + + 当前加载的文件 + + + + + + + QAbstractItemView::NoEditTriggers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + 当前目录: + + + + + + + true + + + + + + + ... + + + + + + + + + + + + 当前文件夹: + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 保存 + + + + + + + + + + 网络 + + + + + + QAbstractItemView::NoEditTriggers + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 刷新 + + + + + + + + + + + 名称: + + + + + + + 作者: + + + + + + + 版本: + + + + + + + + + 介绍: + + + + + + + QPlainTextEdit::NoWrap + + + + + + + + + + + Qt::Vertical + + + + + + + + + + + 保存到: + + + + + + + false + + + + + + + ... + + + + + + + + + + + 下载源: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 0 + + + + + + + 下载 + + + + + + + + + + 关于 + + + + + + + + 作者:田鼠-Hatanezumi + + + + + + + 联系:Hatanezumi@chunshengserver.cn + + + + + + + + + Qt::Vertical + + + + + + + + + 当前版本: + + + + + + + 最新版本: + + + + + + + 发布页 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/__pycache__/MainWindow.cpython-310.pyc b/ui/__pycache__/MainWindow.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc3ae7f3b20db947429d4e72156ec3e72a93867b GIT binary patch literal 6983 zcmai3>r)%o6<r1O#zR6-9W zC8UNPgyt)hifO52eX zC9H()_*E@6A#2$=Evw{ir%BcQP`eV}5qyn5S4-0UKtXye8P)g=D1pa;03ktg?r|_6 znW6iE2Z8%is^Y$Ms{)J)VwjcGV?2yj7>IZ0^7#C zVkCD1-woW|gHB$}Zf5Pln8>faXzc}ylJJ6!;#;=FyUD?Bm&w(wHfBu^;??@I_=duIw0()5?yq7OhOobR4bY(A?+D z)X%n$JH0-ReZOy}0q_UF=iM?BycPaf+evqXlT0(uIJgJqhhfu9EcGU3c2`=^<81})+15L!cE9dcMhg<j?iQ!JhnqHdMoY{wgVqe@;0)yURfY2m?J52HyiTFb=%v`Q$P*2G~D%kp>Q%|LVq+$C!>jw%7^@Xj1dSBFGR6*SoIbtpqmIbOv zDDf^#+RahXD!pr zWm8w|`m*sON9>quPgYdLuJs!vV1q`F9ru~E@^-DSi%K_ZCwzdcC?zh8Z*Z~CZYW=M zs^5+aud=z@dD&dH>oQtaJ*Q}9%0XuA2Hz|$EuPM;EauMU?xa?7is3E|ql%`lH=^2J ze+i<*V?%yhwI#cTHepgVZ|C$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C_10-|={8-6|9 z9Zsk544^G$R4$8~OQ2EJNb6djR<7r0HoA!mp;IdZF^>DNK~ps1CeRdY3T*uA{6AP{ z05_IUUFcqG>FuMW0-5Zpv?Hlh7NtchWk*x=jA>=49ZRL&vgC{y(GAxzpR?>Xdraqv z_Qjy2jG%y!-jUvkoze-X84^=>r!__G=}wxo^>)12KW}MveX%R5D8mlt_$h)dY&NAG WIVn6njX+5T-TETY2yWhuq5lDba+_-a literal 0 HcmV?d00001 diff --git a/ui/自动格式转换.py b/ui/自动格式转换.py new file mode 100644 index 0000000..b4b8450 --- /dev/null +++ b/ui/自动格式转换.py @@ -0,0 +1,5 @@ +import os + +files = [file for file in os.listdir() if os.path.splitext(file)[1] == '.ui'] +for file in files: + os.system('pyside2-uic {} > {}'.format(file,os.path.splitext(file)[0] + '.py')) \ No newline at end of file