diff --git a/.gitignore b/.gitignore index 0420071..3e4b789 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ test*.py # Distribution / packaging .Python .idea/ +Download/ +old/ build/ develop-eggs/ dist/ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dd91385..7bc0a69 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -21,12 +21,12 @@ - + + @@ -35,8 +35,8 @@ - - + + - + - + - + - + - - - + - + + + @@ -161,6 +166,7 @@ @@ -169,57 +175,86 @@ - + + + + + + + + + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - + + + - - + + + - - + + + - + + + + + + - + - + + \ No newline at end of file diff --git a/README.md b/README.md index 2a05ade..e6c2491 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # System-assistant - 基于但行趣事网站的助手软件 + 基于但行趣事网站的助手软件,目前因为精力有限,所以暂时关停了网站。主要的功能都迁移到了微信小程序“但行趣事”当中了。大家可以扫码体验: + + + + +
但行趣事小程序
微电脑公众号
+ +# 本项目中的内容即将重构,可能有部分功能暂时无法使用 diff --git a/Sub_Thread.py b/Sub_Thread.py index 85751d8..4346e7f 100644 --- a/Sub_Thread.py +++ b/Sub_Thread.py @@ -2,7 +2,8 @@ import time import requests import json -import psutil +import os +import subprocess import soft_cfg @@ -14,6 +15,7 @@ def cache_data(name, msm=None): with open(f"{name}.json", "r") as f: return f.readline() + class Time_Thread(QThread): thread_signal = pyqtSignal(str) @@ -88,7 +90,6 @@ def __init__(self, auto): def run(self): try: - # raise FileExistsError result = json.loads(requests.get(soft_cfg.update_url, timeout=3).text) except: result = {"Version": soft_cfg.version} @@ -97,3 +98,39 @@ def run(self): else: result["auto"] = False self.display_signal.emit(result) + + +class Downloader_Thread(QThread): + display_signal = pyqtSignal(bool) + + def __init__(self): + super().__init__() + + def run(self): + if os.path.exists('Download'): + pass + else: + os.mkdir('Download') + if not os.path.exists('aria2.session'): + open('aria2.session', 'w') + req = json.loads(requests.get(soft_cfg.tracks_url).text) + tracks = req['data'] + with open("aria2.conf", "r", encoding='utf-8') as f: + conf = f.readlines() + del conf[-1] + conf.append(f"bt-tracker={tracks}") + with open("aria2.conf", "w", encoding='utf-8') as f: + for i in conf: + f.write(f"{i}") + # 隐藏命令提示行运行 + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW + startupinfo.wShowWindow = subprocess.SW_HIDE + subprocess.Popen("aria2c.exe --conf-path=aria2.conf", startupinfo=startupinfo) + + def stop(self): + # 隐藏命令提示行运行 + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW + startupinfo.wShowWindow = subprocess.SW_HIDE + subprocess.Popen("taskkill /F /IM aria2c.exe", startupinfo=startupinfo) diff --git a/aria2.conf b/aria2.conf new file mode 100644 index 0000000..c1c7205 --- /dev/null +++ b/aria2.conf @@ -0,0 +1,93 @@ +## 文件保存相关 ## + +# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置 +dir=Download +# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M +disk-cache=32M +# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc +# 预分配所需时间: none < falloc ? trunc < prealloc +# falloc和trunc则需要文件系统和内核支持 +# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 +file-allocation=falloc +# 断点续传 +continue=true + +## 下载连接相关 ## + +# 最大同时下载任务数, 运行时可修改, 默认:5 +max-concurrent-downloads=16 +# 同一服务器连接数, 添加时可指定, 默认:1 +max-connection-per-server=16 +# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M +# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 +min-split-size=10M +# 单个任务最大线程数, 添加时可指定, 默认:5 +split=8 +# 整体下载速度限制, 运行时可修改, 默认:0 +#max-overall-download-limit=0 +# 单个任务下载速度限制, 默认:0 +#max-download-limit=0 +# 整体上传速度限制, 运行时可修改, 默认:0 +#max-overall-upload-limit=0 +# 单个任务上传速度限制, 默认:0 +#max-upload-limit=0 +# 禁用IPv6, 默认:false +disable-ipv6=false + +## 进度保存相关 ## + +# 从会话文件中读取下载任务 +input-file=aria2.session +# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件 +save-session=aria2.session +# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 +save-session-interval=10 + +## RPC相关设置 ## + +# 启用RPC, 默认:false +enable-rpc=true +# 允许所有来源, 默认:false +rpc-allow-origin-all=true +# 允许非外部访问, 默认:false +rpc-listen-all=true +# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同 +#event-poll=select +# RPC监听端口, 端口被占用时可以修改, 默认:6800 +#rpc-listen-port=6800 + +## BT/PT下载相关 ## + +# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true +#follow-torrent=true +# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 +listen-port=51413 +# 单个种子最大连接数, 默认:55 +#bt-max-peers=55 +# 打开DHT功能, PT需要禁用, 默认:true +enable-dht=true +# 打开IPv6 DHT功能, PT需要禁用 +enable-dht6=true +# DHT网络监听端口, 默认:6881-6999 +#dht-listen-port=6881-6999 +# 本地节点查找, PT需要禁用, 默认:false +bt-enable-lpd=true +# 种子交换, PT需要禁用, 默认:true +enable-peer-exchange=true +# 每个种子限速, 对少种的PT很有用, 默认:50K +#bt-request-peer-speed-limit=50K +# 客户端伪装, PT需要 +peer-id-prefix=-TR2770- +user-agent=Transmission/2.77 +# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 +seed-ratio=0 +# 强制保存会话, 话即使任务已经完成, 默认:false +# 较新的版本开启后会在任务完成后依然保留.aria2文件 +#force-save=false +# BT校验相关, 默认:true +#bt-hash-check-seed=true +# 继续之前的BT任务时, 无需再次校验, 默认:false +bt-seed-unverified=true +# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false +bt-save-metadata=true +bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.opentrackr.org:1337/announce,http://tracker.opentrackr.org:1337/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.internetwarriors.net:1337/announce,http://tracker.internetwarriors.net:1337/announce,udp://p4p.arenabg.com:1337/announce,udp://9.rarbg.to:2710/announce,udp://9.rarbg.me:2710/announce,udp://exodus.desync.com:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://open.stealth.si:80/announce,udp://retracker.lanta-net.ru:2710/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker.tiny-vps.com:6969/announce,http://tracker3.itzmx.com:6961/announce,http://tracker1.itzmx.com:8080/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.moeking.me:6969/announce,udp://bt2.archive.org:6969/announce,udp://bt1.archive.org:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://explodie.org:6969/announce,http://explodie.org:6969/announce,udp://valakas.rollo.dnsabr.com:2710/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker.kamigami.org:2710/announce,udp://retracker.akado-ural.ru:80/announce,udp://opentor.org:2710/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker.kamigami.org:2710/announce,udp://tracker.uw0.xyz:6969/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.iamhansen.xyz:2000/announce,udp://tracker.ds.is:6969/announce,udp://tracker.army:6969/announce,udp://tracker-udp.gbitt.info:80/announce,udp://opentracker.i2p.rocks:6969/announce,udp://open.nyap2p.com:6969/announce,https://tracker.lelux.fi:443/announce,https://tracker.gbitt.info:443/announce,http://vps02.net.orel.ru:80/announce,http://tracker.nyap2p.com:8080/announce,http://tracker.lelux.fi:80/announce,http://tracker.gbitt.info:80/announce,http://opentracker.i2p.rocks:6969/announce,http://h4.trakx.nibba.trade:80/announce,udp://u.wwwww.wtf:1/announce,udp://tracker.jae.moe:6969/announce,udp://retracker.netbynet.ru:2710/announce,udp://chihaya.de:6969/announce,udp://aaa.army:8866/announce,https://w.wwwww.wtf:443/announce,https://tracker.jae.moe:443/announce,https://aaa.army:8866/announce,http://tracker.bt4g.com:2095/announce,http://t.overflow.biz:6969/announce,http://open.acgtracker.com:1096/announce,http://aaa.army:8866/announce,udp://zephir.monocul.us:6969/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker.yoshi210.com:6969/announce,udp://tracker.teambelgium.net:6969/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.dler.org:6969/announce,https://tracker.vectahosting.eu:2053/announce,https://tracker.tamersunion.org:443/announce,https://tracker.sloppyta.co:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.nanoha.org:443/announce,https://t3.leech.ie:443/announce,https://t2.leech.ie:443/announce,https://t1.leech.ie:443/announce,https://1337.abcvg.info:443/announce,http://trun.tom.ru:80/announce,http://tracker2.dler.org:80/announce,http://tracker.yoshi210.com:6969/announce,http://tracker.skyts.net:6969/announce,http://tracker.dler.org:6969/announce,http://t3.leech.ie:80/announce,http://t2.leech.ie:80/announce,http://t1.leech.ie:80/announce,http://t.nyaatracker.com:80/announce,http://pow7.com:80/announce,http://mail2.zelenaya.net:80/announce,udp://www.loushao.net:8080/announce,udp://tracker6.dler.org:2710/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker.filemail.com:6969/announce,udp://tr2.ysagin.top:2710/announce,udp://tr.bangumi.moe:6969/announce,udp://retracker.sevstar.net:2710/announce,udp://bt2.54new.com:8080/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.hama3.net:443/announce,https://tr.ready4.icu:443/announce,https://tk.mabo.ltd:443/announce,http://www.loushao.net:8080/announce,http://tracker4.itzmx.com:2710/announce,http://tracker2.itzmx.com:6961/announce,http://tracker.ygsub.com:6969/announce,http://t.acg.rip:6699/announce,http://retracker.sevstar.net:2710/announce,http://open.acgnxtracker.com:80/announce \ No newline at end of file diff --git a/aria2.session b/aria2.session new file mode 100644 index 0000000..2615896 --- /dev/null +++ b/aria2.session @@ -0,0 +1,30 @@ +magnet:?xt=urn:btih:063526bed8c4c052f9b4633b5d7002e43a8f9ce5 + gid=214de68371d6fad0 + split=8 + max-connection-per-server=16 + seed-ratio=0 +magnet:?xt=urn:btih:1869E41A4559DA3D8089B2265BBAE174F0B97C2C + gid=afce0f1f5e58fea7 + split=8 + max-connection-per-server=16 + seed-ratio=0 +magnet:?xt=urn:btih:716b13237cf8b670cceb00751f830d6c053d37c2&dn=[%E7%94%B5%E5%BD%B1%E5%A4%A9%E5%A0%82www.dytt89.com]%E5%A4%A7%E8%B5%A2%E5%AE%B6HD%E5%9B%BD%E8%AF%AD%E4%B8%AD%E5%AD%97.mp4 + gid=caf9fa7ede42835a + split=8 + max-connection-per-server=16 + seed-ratio=0 +magnet:?xt=urn:btih:6PAYVV5X6TZUEI6CX2J72T7DTSFGI7JH + gid=76c82d4917f0d54a + split=8 + max-connection-per-server=16 + seed-ratio=0 +Download/a3ef7c1ceb6e9d392e7824db40140bd2426ee969.torrent + gid=9ade82373b53da9d + split=8 + max-connection-per-server=16 + seed-ratio=0 +Download/f37db208c242cb0f613d1f3e7f672d5d540f53ce.torrent + gid=62c9f0c401b68b66 + split=8 + max-connection-per-server=16 + seed-ratio=0 diff --git a/aria2c.exe b/aria2c.exe new file mode 100644 index 0000000..18b2b7b Binary files /dev/null and b/aria2c.exe differ diff --git a/function.py b/function.py index 0db98b1..132417f 100644 --- a/function.py +++ b/function.py @@ -1,7 +1,6 @@ import hashlib import os import subprocess - from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt, QSize from PyQt5.QtGui import QCursor @@ -12,16 +11,13 @@ from Sub_Thread import Source_Thread from Sub_Thread import Article_Thread from Sub_Thread import Update_Thread +from Sub_Thread import Downloader_Thread import soft_cfg md5obj = hashlib.md5() file = os.path.realpath(__file__) -def window_close(code): - qApp.exit(code) - - def open_browser(url): QtGui.QDesktopServices.openUrl(QtCore.QUrl(url)) @@ -103,7 +99,6 @@ def __init__(self): self.setWindowOpacity(1) # 设置窗口透明度 self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # 主窗口透明 self.setWindowFlag(QtCore.Qt.FramelessWindowHint) # 隐藏边框 - # self.setWindowFlag(QtCore.Qt.WindowStaysOnTopHint) # 窗口始终置顶 # 初始化功能 self.signal_on_btn() @@ -115,16 +110,19 @@ def __init__(self): self.article_url = [] # 文章教程链接初始化 self.label_10.hide() self.label_sys_info.hide() + self.label_welcome.setText(soft_cfg.welcome) # 线程启动 self.time_thread() self.source_thread() self.article_thread() + self.webDownloader_Thread = Downloader_Thread() + self.webDownloader_Thread.start() self.update_thread() def signal_on_btn(self): # 基础按钮事件绑定 - self.pushButton_close.clicked.connect(lambda: window_close(0)) + self.pushButton_close.clicked.connect(lambda: self.window_close(0)) self.pushButton_min.clicked.connect(lambda: self.showMinimized()) self.pushButton_feedback.clicked.connect(lambda: open_browser(soft_cfg.feed_back)) self.pushButton_web_site.clicked.connect(lambda: open_browser(soft_cfg.web_site)) @@ -139,10 +137,12 @@ def signal_on_btn(self): # 界面转换 self.pushButton_menu_soft.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(0)) # self.pushButton_menu_api.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(1)) - self.pushButton_menu_api.clicked.connect(self.open_api_site) + self.pushButton_menu_api.clicked.connect(lambda: open_browser(soft_cfg.api_site)) self.pushButton_menu_article.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(2)) self.pushButton_menu_source.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(3)) self.pushButton_menu_about_us.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(4)) + # self.pushButton_menu_downloader.clicked.connect(lambda: self.stackedWidget.setCurrentIndex(7)) + self.pushButton_menu_downloader.clicked.connect(lambda: open_browser(soft_cfg.download_url)) def icon_on_btn(self): self.pushButton_feedback.setIcon(qtawesome.icon('fa.envelope-o', color="blank")) @@ -155,13 +155,15 @@ def icon_on_btn(self): self.pushButton_menu_article.setIcon(qtawesome.icon('fa.file-text', color='white')) self.pushButton_menu_source.setIcon(qtawesome.icon('fa.code', color='white')) self.pushButton_menu_soft.setIcon(qtawesome.icon('fa.th-large', color='white')) + self.pushButton_menu_downloader.setIcon(qtawesome.icon('fa.download', color='white')) # 自定义功能区 - def open_api_site(self): # 接口文档 --跳转到API网页 - res = QMessageBox.question(self, '提示', '即将在浏览器中打开接口文档,需登录后才可使用本站API,是否继续?', QMessageBox.Yes | QMessageBox.No, + def window_close(self, code): + res = QMessageBox.question(self, '是否关闭程序', '请确保没有下载任务', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) if res == QMessageBox.Yes: - open_browser(soft_cfg.api_site) + self.webDownloader_Thread.stop() + qApp.exit(code) else: pass @@ -171,8 +173,7 @@ def licenses(self): scrollbar = self.textEdit_licenses.verticalScrollBar() scrollbar.setSliderPosition(0) - # 界面拖动 - + # 界面拖动 def mousePressEvent(self, event): if event.button() == Qt.LeftButton: self.m_flag = True diff --git a/get_hash.py b/get_hash.py index 0734a57..b138c89 100644 --- a/get_hash.py +++ b/get_hash.py @@ -2,10 +2,10 @@ import os import json - -path = "F:\\Python\\System assistant\\dist\\但行趣事管家" # os.path.dirname(os.path.realpath(__file__)) +path = "F:\\Python\\System assistant\\dist\\toodoAssistant" # os.path.dirname(os.path.realpath(__file__)) os.chdir(path) + def get_file_md5(file_path): """ 获取文件md5值 diff --git a/main_window.py b/main_window.py index c341154..2b1be21 100644 --- a/main_window.py +++ b/main_window.py @@ -16,10 +16,9 @@ def setupUi(self, MainWindow): MainWindow.resize(1200, 741) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") - self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) - self.horizontalLayout.setContentsMargins(0, 0, 0, 0) - self.horizontalLayout.setSpacing(0) - self.horizontalLayout.setObjectName("horizontalLayout") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setContentsMargins(0, 0, 0, 0) + self.gridLayout.setObjectName("gridLayout") self.widget = QtWidgets.QWidget(self.centralwidget) self.widget.setObjectName("widget") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget) @@ -28,8 +27,9 @@ def setupUi(self, MainWindow): self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.widget_menu = QtWidgets.QWidget(self.widget) self.widget_menu.setMinimumSize(QtCore.QSize(200, 0)) - self.widget_menu.setMaximumSize(QtCore.QSize(300, 16777215)) - self.widget_menu.setStyleSheet("QWidget#widget_menu{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #4e54c8,stop:1 #8f94fb);}") + self.widget_menu.setMaximumSize(QtCore.QSize(200, 16777215)) + self.widget_menu.setStyleSheet( + "QWidget#widget_menu{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #4e54c8,stop:1 #8f94fb);}") self.widget_menu.setObjectName("widget_menu") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widget_menu) self.verticalLayout_2.setContentsMargins(0, 0, 0, 10) @@ -70,7 +70,8 @@ def setupUi(self, MainWindow): font.setBold(False) font.setWeight(50) self.pushButton_menu_soft.setFont(font) - self.pushButton_menu_soft.setStyleSheet("QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_soft.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") self.pushButton_menu_soft.setObjectName("pushButton_menu_soft") self.verticalLayout.addWidget(self.pushButton_menu_soft) self.pushButton_menu_source = QtWidgets.QPushButton(self.widget_3) @@ -81,7 +82,8 @@ def setupUi(self, MainWindow): font.setBold(False) font.setWeight(50) self.pushButton_menu_source.setFont(font) - self.pushButton_menu_source.setStyleSheet("QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_source.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") self.pushButton_menu_source.setObjectName("pushButton_menu_source") self.verticalLayout.addWidget(self.pushButton_menu_source) self.pushButton_menu_article = QtWidgets.QPushButton(self.widget_3) @@ -92,7 +94,8 @@ def setupUi(self, MainWindow): font.setBold(False) font.setWeight(50) self.pushButton_menu_article.setFont(font) - self.pushButton_menu_article.setStyleSheet("QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_article.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") self.pushButton_menu_article.setObjectName("pushButton_menu_article") self.verticalLayout.addWidget(self.pushButton_menu_article) self.pushButton_menu_api = QtWidgets.QPushButton(self.widget_3) @@ -103,10 +106,20 @@ def setupUi(self, MainWindow): font.setBold(False) font.setWeight(50) self.pushButton_menu_api.setFont(font) - self.pushButton_menu_api.setStyleSheet("QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_api.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") self.pushButton_menu_api.setObjectName("pushButton_menu_api") self.verticalLayout.addWidget(self.pushButton_menu_api) self.verticalLayout_2.addWidget(self.widget_3) + self.pushButton_menu_downloader = QtWidgets.QPushButton(self.widget_menu) + self.pushButton_menu_downloader.setMinimumSize(QtCore.QSize(0, 50)) + font = QtGui.QFont() + font.setFamily("微软雅黑") + self.pushButton_menu_downloader.setFont(font) + self.pushButton_menu_downloader.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_downloader.setObjectName("pushButton_menu_downloader") + self.verticalLayout_2.addWidget(self.pushButton_menu_downloader) self.pushButton_menu_about_us = QtWidgets.QPushButton(self.widget_menu) self.pushButton_menu_about_us.setMinimumSize(QtCore.QSize(0, 50)) font = QtGui.QFont() @@ -115,7 +128,8 @@ def setupUi(self, MainWindow): font.setBold(False) font.setWeight(50) self.pushButton_menu_about_us.setFont(font) - self.pushButton_menu_about_us.setStyleSheet("QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") + self.pushButton_menu_about_us.setStyleSheet( + "QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);}") self.pushButton_menu_about_us.setObjectName("pushButton_menu_about_us") self.verticalLayout_2.addWidget(self.pushButton_menu_about_us) spacerItem = QtWidgets.QSpacerItem(20, 460, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) @@ -157,28 +171,32 @@ def setupUi(self, MainWindow): self.pushButton_feedback = QtWidgets.QPushButton(self.widget_6) self.pushButton_feedback.setMinimumSize(QtCore.QSize(30, 30)) self.pushButton_feedback.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_feedback.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_feedback.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_feedback.setText("") self.pushButton_feedback.setObjectName("pushButton_feedback") self.horizontalLayout_4.addWidget(self.pushButton_feedback) self.pushButton_update = QtWidgets.QPushButton(self.widget_6) self.pushButton_update.setMinimumSize(QtCore.QSize(30, 30)) self.pushButton_update.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_update.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_update.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_update.setText("") self.pushButton_update.setObjectName("pushButton_update") self.horizontalLayout_4.addWidget(self.pushButton_update) self.pushButton_min = QtWidgets.QPushButton(self.widget_6) self.pushButton_min.setMinimumSize(QtCore.QSize(30, 30)) self.pushButton_min.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_min.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_min.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_min.setText("") self.pushButton_min.setObjectName("pushButton_min") self.horizontalLayout_4.addWidget(self.pushButton_min) self.pushButton_close = QtWidgets.QPushButton(self.widget_6) self.pushButton_close.setMinimumSize(QtCore.QSize(30, 30)) self.pushButton_close.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_close.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_close.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_close.setText("") self.pushButton_close.setObjectName("pushButton_close") self.horizontalLayout_4.addWidget(self.pushButton_close) @@ -264,7 +282,7 @@ def setupUi(self, MainWindow): font.setBold(True) font.setWeight(75) self.label_10.setFont(font) - self.label_10.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label_10.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.label_10.setObjectName("label_10") self.verticalLayout_9.addWidget(self.label_10) self.verticalLayout_10.addWidget(self.widget_9) @@ -433,10 +451,37 @@ def setupUi(self, MainWindow): self.verticalLayout_13.addItem(spacerItem7) self.verticalLayout_11.addWidget(self.widget_13) self.stackedWidget.addWidget(self.sta_start) + self.browser = QtWidgets.QWidget() + self.browser.setObjectName("browser") + self.verticalLayout_14 = QtWidgets.QVBoxLayout(self.browser) + self.verticalLayout_14.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_14.setSpacing(0) + self.verticalLayout_14.setObjectName("verticalLayout_14") + self.widget_browser = QtWidgets.QWidget(self.browser) + self.widget_browser.setObjectName("widget_browser") + self.verticalLayout_14.addWidget(self.widget_browser) + self.stackedWidget.addWidget(self.browser) + self.downloader = QtWidgets.QWidget() + self.downloader.setObjectName("downloader") + self.horizontalLayout_13 = QtWidgets.QHBoxLayout(self.downloader) + self.horizontalLayout_13.setContentsMargins(0, 0, 0, 0) + self.horizontalLayout_13.setSpacing(0) + self.horizontalLayout_13.setObjectName("horizontalLayout_13") + self.widget_14 = QtWidgets.QWidget(self.downloader) + self.widget_14.setObjectName("widget_14") + self.verticalLayout_15 = QtWidgets.QVBoxLayout(self.widget_14) + self.verticalLayout_15.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_15.setSpacing(0) + self.verticalLayout_15.setObjectName("verticalLayout_15") + self.widget_downloader = QtWidgets.QWidget(self.widget_14) + self.widget_downloader.setObjectName("widget_downloader") + self.verticalLayout_15.addWidget(self.widget_downloader) + self.horizontalLayout_13.addWidget(self.widget_14) + self.stackedWidget.addWidget(self.downloader) self.horizontalLayout_6.addWidget(self.stackedWidget) self.verticalLayout_3.addWidget(self.widget_5) self.horizontalLayout_2.addWidget(self.widget_main) - self.horizontalLayout.addWidget(self.widget) + self.gridLayout.addWidget(self.widget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) @@ -450,6 +495,7 @@ def retranslateUi(self, MainWindow): self.pushButton_menu_source.setText(_translate("MainWindow", " 源码仓库")) self.pushButton_menu_article.setText(_translate("MainWindow", " 文章教程")) self.pushButton_menu_api.setText(_translate("MainWindow", " 接口文档")) + self.pushButton_menu_downloader.setText(_translate("MainWindow", " 下载管理")) self.pushButton_menu_about_us.setText(_translate("MainWindow", " 关于我们")) self.label_sys_info.setText(_translate("MainWindow", "00:00:00")) self.pushButton_feedback.setToolTip(_translate("MainWindow", "

反馈与建议

")) @@ -460,13 +506,15 @@ def retranslateUi(self, MainWindow): self.label_4.setText(_translate("MainWindow", "每行代码都是用自己有限的青春换来的无限宝藏")) self.label_10.setText(_translate("MainWindow", "--致每一位程序员")) self.label_9.setText(_translate("MainWindow", "虽然不能保证每天更新一篇\n" -"但是可以保证更新的每一篇都是干货")) + "但是可以保证更新的每一篇都是干货")) self.label_7.setText(_translate("MainWindow", "更多精彩,敬请关注微电脑公众号")) self.label_8.setText(_translate("MainWindow", "http://www.toodo.fun")) self.pushButton_web_site.setText(_translate("MainWindow", "但行趣事")) self.pushButton_web_rights.setText(_translate("MainWindow", "用户协议")) self.pushButton_help_us.setText(_translate("MainWindow", "支持我们")) self.label_5.setText(_translate("MainWindow", "Copyright © 2020 Toodo.fun. All Rights Reserved.")) - self.label_welcome.setText(_translate("MainWindow", "初逢不知人如玉,再逢已是意中人")) + self.label_welcome.setText(_translate("MainWindow", "我自是年少,韶华倾负")) self.label_time.setText(_translate("MainWindow", "TextLabel")) + + import resources_rc diff --git a/main_window.ui b/main_window.ui index 1f33acd..9714d89 100644 --- a/main_window.ui +++ b/main_window.ui @@ -1,1104 +1,1424 @@ - MainWindow - - - - 0 - 0 - 1200 - 741 - - - - MainWindow - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 200 - 0 - - - - - 300 - 16777215 - - - - QWidget#widget_menu{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #4e54c8,stop:1 #8f94fb);} - - - - 0 - - - 0 - - - 0 - - - 0 - - - 10 - - - - - - - - - 150 - 49 - - - - - 150 - 49 - - - - - 微软雅黑 - 14 - 75 - true - - - - QLabel{background:Transparent;color:white} - - - - - - :/images/toodo.fun.png - - - true - - - Qt::AlignCenter - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 50 - - - - - 微软雅黑 - 9 - 50 - false - - - - QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);} - - - 软件安利 - - - - - - - - 0 - 50 - - - - - 微软雅黑 - 9 - 50 - false - - - - QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);} - - - 源码仓库 - - - - - - - - 0 - 50 - - - - - 微软雅黑 - 9 - 50 - false - - - - QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);} - - - 文章教程 - - - - - - - - 0 - 50 - - - - - 微软雅黑 - 9 - 50 - false - - - - QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);} - - - 接口文档 - - - - - - - - - - - 0 - 50 - - - - - 微软雅黑 - 9 - 50 - false - - - - QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, 0.2);} - - - 关于我们 - - - - - - - Qt::Vertical - - - - 20 - 460 - - - - - - - - - 微软雅黑 - 9 - 50 - false - - - - QLabel{background:Transparent;color:white} - - - 00:00:00 - - - Qt::AlignCenter - - - - - - - - - - QWidget#widget_main{background:#F7FAFF} - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 30 - - - - - 16777215 - 30 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 886 - 20 - - - - - - - - - 2 - + MainWindow + + + + 0 + 0 + 1200 + 741 + + + + MainWindow + + + - 0 + 0 - 0 + 0 - 0 + 0 - 0 + 0 - - - - - 30 - 30 - - - - - 30 - 30 - - - - <html><head/><body><p>反馈与建议</p></body></html> - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + QWidget#widget_menu{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 + #4e54c8,stop:1 #8f94fb);} + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 10 + + + + + + + + + 150 + 49 + + + + + 150 + 49 + + + + + 微软雅黑 + 14 + 75 + true + + + + + QLabel{background:Transparent;color:white} + + + + + + + + :/images/toodo.fun.png + + + + true + + + Qt::AlignCenter + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 50 + + + + + 微软雅黑 + 9 + 50 + false + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 软件安利 + + + + + + + + 0 + 50 + + + + + 微软雅黑 + 9 + 50 + false + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 源码仓库 + + + + + + + + 0 + 50 + + + + + 微软雅黑 + 9 + 50 + false + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 文章教程 + + + + + + + + 0 + 50 + + + + + 微软雅黑 + 9 + 50 + false + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 接口文档 + + + + + + + + + + + 0 + 50 + + + + + 微软雅黑 + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 下载管理 + + + + + + + + 0 + 50 + + + + + 微软雅黑 + 9 + 50 + false + + + + + QPushButton{background:Transparent;color:white;}QPushButton:hover{background-color:rgba(0,0,0, + 0.2);} + + + + 关于我们 + + + + + + + Qt::Vertical + + + + 20 + 460 + + + + + + + + + 微软雅黑 + 9 + 50 + false + + + + QLabel{background:Transparent;color:white} + + + + 00:00:00 + + + Qt::AlignCenter + + + + + + + + + + QWidget#widget_main{background:#F7FAFF} + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 886 + 20 + + + + + + + + + 2 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 30 + 30 + + + + + 30 + 30 + + + + <html><head/><body><p>反馈与建议</p></body></html> + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + <html><head/><body><p>检查更新</p></body></html> + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + <html><head/><body><p>最小化</p></body></html> + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + 30 + 30 + + + + + 30 + 30 + + + + <html><head/><body><p>关闭</p></body></html> + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + 5 + + + + + + + 加班加点紧急制作中 + + + Qt::AlignCenter + + + + + + + + + + + + 微软雅黑 + 9 + + + + + QTextEdit{background:Transparent;border:0px + solid grey;} + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + Qt::NoTextInteraction + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + QListWidget{background:transparent;border:0px + solid grey;margin:10px;} + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + + QAbstractItemView::NoSelection + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 16777215 + 40 + + + + + 0 + + + 10 + + + 0 + + + 10 + + + 0 + + + + + + + 微软雅黑 + + 75 + + true + + + + + + 每行代码都是用自己有限的青春换来的无限宝藏 + + + + + + + + + + 微软雅黑 + + 75 + + true + + + + + + --致每一位程序员 + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + QListWidget{background:transparent;border:0px + solid + grey;margin:10px;} + + + + + Qt::ScrollBarAlwaysOff + + + + + Qt::ScrollBarAlwaysOff + + + + + QAbstractItemView::NoEditTriggers + + + + + QAbstractItemView::NoSelection + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 200 + + + 200 + + + + + + 200 + + + 200 + + + + + + + + + :/images/wechat.jpg + + + + true + + + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + + 75 + + true + + + + + + 虽然不能保证每天更新一篇 + 但是可以保证更新的每一篇都是干货 + + + + + Qt::AlignCenter + + + + + + + + + + 微软雅黑 + + + 14 + + 75 + + true + + + + + + 更多精彩,敬请关注微电脑公众号 + + + + + Qt::AlignCenter + + + + + + + + + + + + 微软雅黑 + + + + + http://www.toodo.fun + + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 16777215 + 80 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + Qt::Horizontal + + + + + 40 + + 20 + + + + + + + + + + PointingHandCursor + + + + + QPushButton{background:Transparent;color:blank;} + + + + 但行趣事 + + + + + + + + + Qt::Vertical + + + + + + + + + PointingHandCursor + + + + + QPushButton{background:Transparent;color:blank;} + + + + 用户协议 + + + + + + + + + PointingHandCursor + + + + + Qt::Vertical + + + + + + + + + PointingHandCursor + + + + + QPushButton{background:Transparent;color:blank;} + + + + 支持我们 + + + + + + + + + Qt::Horizontal + + + + + 40 + + 20 + + + + + + + + + + + + Copyright © 2020 + Toodo.fun. All Rights + Reserved. + + + + Qt::AlignCenter + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + Qt::Vertical + + + + 20 + 309 + + + + + + + + + 华文行楷 + 16 + + 75 + true + + + + 我自是年少,韶华倾负 + + + Qt::AlignCenter + + + + + + + + + + + + + TextLabel + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 308 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + - - - - - 30 - 30 - - - - - 30 - 30 - - - - <html><head/><body><p>检查更新</p></body></html> - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - <html><head/><body><p>最小化</p></body></html> - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - - - - - - - 30 - 30 - - - - - 30 - 30 - - - - <html><head/><body><p>关闭</p></body></html> - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - 5 - - - - - - - 加班加点紧急制作中 - - - Qt::AlignCenter - - - - - - - - - - - - 微软雅黑 - 9 - - - - QTextEdit{background:Transparent;border:0px solid grey;} - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - Qt::NoTextInteraction - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QListWidget{background:transparent;border:0px solid grey;margin:10px;} - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::NoSelection - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 16777215 - 40 - - - - - 0 - - - 10 - - - 0 - - - 10 - - - 0 - - - - - - 微软雅黑 - 75 - true - - - - 每行代码都是用自己有限的青春换来的无限宝藏 - - - - - - - - 微软雅黑 - 75 - true - - - - --致每一位程序员 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QListWidget{background:transparent;border:0px solid grey;margin:10px;} - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::NoSelection - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 200 - 200 - - - - - 200 - 200 - - - - - - - :/images/wechat.jpg - - - true - - - Qt::AlignCenter - - - - - - - - - - - - - - 微软雅黑 - 75 - true - - - - 虽然不能保证每天更新一篇 -但是可以保证更新的每一篇都是干货 - - - Qt::AlignCenter - - - - - - - - 微软雅黑 - 14 - 75 - true - - - - 更多精彩,敬请关注微电脑公众号 - - - Qt::AlignCenter - - - - - - - - - - - 微软雅黑 - - - - http://www.toodo.fun - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 16777215 - 80 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PointingHandCursor - - - QPushButton{background:Transparent;color:blank;} - - - 但行趣事 - - - - - - - Qt::Vertical - - - - - - - PointingHandCursor - - - QPushButton{background:Transparent;color:blank;} - - - 用户协议 - - - - - - - PointingHandCursor - - - Qt::Vertical - - - - - - - PointingHandCursor - - - QPushButton{background:Transparent;color:blank;} - - - 支持我们 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Copyright © 2020 Toodo.fun. All Rights Reserved. - - - Qt::AlignCenter - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - Qt::Vertical - - - - 20 - 309 - - - - - - - - - 华文行楷 - 16 - 75 - true - - - - 初逢不知人如玉,再逢已是意中人 - - - Qt::AlignCenter - - - - - - - - - - - - - TextLabel - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 308 - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/resources.qrc b/resources.qrc index 7f4accc..cbfdde1 100644 --- a/resources.qrc +++ b/resources.qrc @@ -1,7 +1,7 @@ - - images/wechat.jpg - images/toodo.fun.png - images/logo.ico - + + images/wechat.jpg + images/toodo.fun.png + images/logo.ico + diff --git a/resources_rc.py b/resources_rc.py index 2bd48d9..b3ade22 100644 --- a/resources_rc.py +++ b/resources_rc.py @@ -6177,10 +6177,13 @@ rcc_version = 2 qt_resource_struct = qt_resource_struct_v2 + def qInitResources(): QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + def qCleanupResources(): QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) + qInitResources() diff --git a/soft_cfg.py b/soft_cfg.py index bc4844f..4431148 100644 --- a/soft_cfg.py +++ b/soft_cfg.py @@ -1,16 +1,19 @@ import json -version = 1.1 -name = "但行趣事管家.exe" +version = 1.3 +name = "toodoAssistant.exe" +welcome = "赠卿春绿夏黄秋红,余生卿欠我白首" # 定义网址 web_site = "https://www.toodo.fun" # 网站主页 -api_site = "https://www.toodo.fun/api" # API 主页 +api_site = "https://www.toodo.fun/api" # API 主页 feed_back = "https://www.toodo.fun" # 反馈网址 help_us = "https://toodo.fun/funs/thanks/" # 捐赠网址 source_api_url = "http://softapi.toodo.fun/get_source" # 源码仓库网址 article_api_url = "http://softapi.toodo.fun/get_article" # 文章教程网址 update_url = "https://www.toodo.fun/api/software/version.php" # 软件更新网址 +download_url = "http://aria2.toodo.fun/" # 下载器webUI +tracks_url = "http://softapi.toodo.fun/get_tracks" # 自动更新下载器tracks网址 # 线程配置 time_thread = .5 @@ -25,9 +28,9 @@ 'language': ['Python', 'Java']}) article_api = json.dumps({'url': [ 'https://toodo.fun/funs/learn/files/article.php?id=58&title=UP%E4%B8%BB%E5%B0%8F%E5%8A%A9%E6%89%8B%20%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E'], - 'title': ['UP主小助手 使用说明'], - 'info': ['《UP主小助手 使用说明》是作者 鱼鹰的酒鬼 最后更新于 2020-04-24 的一篇文章,当前阅读量为 1632'], - 'date': ['2020-04-24']}) + 'title': ['UP主小助手 使用说明'], + 'info': ['《UP主小助手 使用说明》是作者 鱼鹰的酒鬼 最后更新于 2020-04-24 的一篇文章,当前阅读量为 1632'], + 'date': ['2020-04-24']}) licenses = '''

Mozilla Public License Version 2.0

1. Definitions

@@ -318,4 +321,4 @@

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice

This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0.

''' \ No newline at end of file + defined by the Mozilla Public License, v. 2.0.

''' diff --git a/source_api.py b/source_api.py index c5c3341..1a34947 100644 --- a/source_api.py +++ b/source_api.py @@ -49,4 +49,4 @@ def get_info(): if __name__ == '__main__': result = get_info() - print(result) \ No newline at end of file + print(result) diff --git "a/\344\275\206\350\241\214\350\266\243\344\272\213\347\256\241\345\256\266.py" b/toodoAssistant.py similarity index 99% rename from "\344\275\206\350\241\214\350\266\243\344\272\213\347\256\241\345\256\266.py" rename to toodoAssistant.py index cb091bd..ad4d389 100644 --- "a/\344\275\206\350\241\214\350\266\243\344\272\213\347\256\241\345\256\266.py" +++ b/toodoAssistant.py @@ -2,7 +2,6 @@ import function from PyQt5 import QtWidgets - if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) ui = function.fun_main() diff --git a/update_function.py b/update_function.py index 1937f88..6adf014 100644 --- a/update_function.py +++ b/update_function.py @@ -98,14 +98,14 @@ def Com_UI(self, msm): if "jindu" in msm: num = int(msm.replace('jindu', '')) self.progressBar.setValue(num) - if "更新失败" in msm: + if "更新失败" in msm and "jindu" not in msm: self.com_flag = True self.show_message(msm) - elif msm == "更新完成" and self.com_flag == False: + elif msm == "更新完成" and self.com_flag == False and "jindu" not in msm: self.show_message("更新完成,更新程序即将退出") subprocess.Popen(f"{self.argv[2]}") qApp.exit(0) - elif not self.com_flag != False: + elif not self.com_flag != False and "jindu" not in msm: self.show_message(msm) @@ -170,7 +170,7 @@ def run(self): except: if j == 3: self.thread_signal.emit(f"{i}更新失败") - self.thread_signal.emit(f'jindu{25+int((up_files.index(i)+1)/len(up_files)*75)}') + self.thread_signal.emit(f'jindu{25 + int((up_files.index(i) + 1) / len(up_files) * 75)}') self.thread_signal.emit(f"更新完成") def get_file_md5(self, file_path): @@ -183,4 +183,4 @@ def get_file_md5(self, file_path): md5obj = hashlib.md5() md5obj.update(f.read()) _hash = md5obj.hexdigest() - return str(_hash).upper() \ No newline at end of file + return str(_hash).upper() diff --git a/update_main.py b/update_main.py index 2c6331d..59909ab 100644 --- a/update_main.py +++ b/update_main.py @@ -2,7 +2,6 @@ import update_function from PyQt5 import QtWidgets - if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) ui = update_function.fun_main(sys.argv) diff --git a/update_ui.py b/update_ui.py index 163477d..d08830e 100644 --- a/update_ui.py +++ b/update_ui.py @@ -46,13 +46,15 @@ def setupUi(self, MainWindow): self.horizontalLayout.addItem(spacerItem) self.pushButton_min = QtWidgets.QPushButton(self.widget) self.pushButton_min.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_min.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_min.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_min.setText("") self.pushButton_min.setObjectName("pushButton_min") self.horizontalLayout.addWidget(self.pushButton_min) self.pushButton_close = QtWidgets.QPushButton(self.widget) self.pushButton_close.setMaximumSize(QtCore.QSize(30, 30)) - self.pushButton_close.setStyleSheet("QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") + self.pushButton_close.setStyleSheet( + "QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);}") self.pushButton_close.setText("") self.pushButton_close.setObjectName("pushButton_close") self.horizontalLayout.addWidget(self.pushButton_close) @@ -93,7 +95,8 @@ def setupUi(self, MainWindow): self.progressBar.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) self.progressBar.setAcceptDrops(False) self.progressBar.setLayoutDirection(QtCore.Qt.LeftToRight) - self.progressBar.setStyleSheet("QProgressBar::chunk{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #36d1dc,stop:1 #5b86e5);}") + self.progressBar.setStyleSheet( + "QProgressBar::chunk{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #36d1dc,stop:1 #5b86e5);}") self.progressBar.setProperty("value", 66) self.progressBar.setAlignment(QtCore.Qt.AlignCenter) self.progressBar.setTextVisible(True) diff --git a/update_ui.ui b/update_ui.ui index 1c7be6f..64de3d2 100644 --- a/update_ui.ui +++ b/update_ui.ui @@ -1,228 +1,237 @@ - MainWindow - - - - 0 - 0 - 800 - 300 - - - - - 0 - 0 - - - - MainWindow - - - - QWidget#centralwidget{background:#F7FAFF} - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 16777215 - 40 - - - - - 0 - - - 10 - - - 0 - - - 10 - - - 0 - - - - - - 微软雅黑 - 11 - 75 - true - - - - 升级程序 - + MainWindow + + + + 0 + 0 + 800 + 300 + + + + + 0 + 0 + + + + MainWindow + + + + QWidget#centralwidget{background:#F7FAFF} + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 16777215 + 40 + + + + + 0 + + + 10 + + + 0 + + + 10 + + + 0 + + + + + + 微软雅黑 + 11 + 75 + true + + + + 升级程序 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 30 + 30 + + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + 30 + 30 + + + + + QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, + 0.1);} + + + + + + + + + + + + + + QTextEdit{background:Transparent;border:0px solid grey;} + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + true + + + + + + + + + + + 微软雅黑 + + + + 更新进度: + + + + + + + + 0 + 0 + + + + + 16777215 + 20 + + + + + 微软雅黑 + 50 + false + false + false + false + true + + + + Qt::DefaultContextMenu + + + false + + + Qt::LeftToRight + + + + QProgressBar::chunk{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 + #36d1dc,stop:1 #5b86e5);} + + + + 66 + + + Qt::AlignCenter + + + true + + + Qt::Horizontal + + + false + + + QProgressBar::TopToBottom + + + %p% + + + + + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 30 - 30 - - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - - - - - - - 30 - 30 - - - - QPushButton{background:Transparent;color:blank;}QPushButton:hover{background-color:rgba(0,0,0, 0.1);} - - - - - - - - - - - - - QTextEdit{background:Transparent;border:0px solid grey;} - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - true - - - - - - - - - - - 微软雅黑 - - - - 更新进度: - - - - - - - - 0 - 0 - - - - - 16777215 - 20 - - - - - 微软雅黑 - 50 - false - false - false - false - true - - - - Qt::DefaultContextMenu - - - false - - - Qt::LeftToRight - - - QProgressBar::chunk{background:qlineargradient(spread:pad,x1:0,y1:0,x2:1,y2:0,stop:0 #36d1dc,stop:1 #5b86e5);} - - - 66 - - - Qt::AlignCenter - - - true - - - Qt::Horizontal - - - false - - - QProgressBar::TopToBottom - - - %p% - - - - - - - - - - - + + +