diff --git a/application_icon.ico b/app_icon.ico similarity index 100% rename from application_icon.ico rename to app_icon.ico diff --git a/build_exe.spec b/build_exe.spec new file mode 100644 index 0000000..e1a65c8 --- /dev/null +++ b/build_exe.spec @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- + +# 本文件用于打包 Windows 程序 +# pyinstaller --clean build_exe.spec + +block_cipher = None + + +a = Analysis(['main.py'], + pathex=['.'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=['./lanzou/gui/login_assister.py', ], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) + +a.binaries = [x for x in a.binaries if 'login_assister' not in x[0]] + +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='lanzou-gui', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + version='./version_info.txt', + icon='./app_icon.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='lanzou-gui') diff --git a/lanzou/api/__init__.py b/lanzou/api/__init__.py index a0811f3..20ca31b 100644 --- a/lanzou/api/__init__.py +++ b/lanzou/api/__init__.py @@ -1,5 +1,5 @@ from lanzou.api.core import LanZouCloud -version = '2.5.0' +version = '2.5.1' __all__ = ['utils', 'types', 'models', 'LanZouCloud', 'version'] diff --git a/lanzou/gui/__init__.py b/lanzou/gui/__init__.py index d5b63fd..74898b9 100644 --- a/lanzou/gui/__init__.py +++ b/lanzou/gui/__init__.py @@ -1 +1,2 @@ -version = '0.3.0' \ No newline at end of file +version = '0.3.1' +USE_WEB_ENG = True diff --git a/lanzou/gui/dialogs/login.py b/lanzou/gui/dialogs/login.py index 4e65957..b6f838b 100644 --- a/lanzou/gui/dialogs/login.py +++ b/lanzou/gui/dialogs/login.py @@ -6,11 +6,9 @@ from lanzou.gui.others import QDoublePushButton, MyLineEdit from lanzou.gui.qss import dialog_qss_style, btn_style +from lanzou.gui import USE_WEB_ENG -HAVE_WEB_ENG = True # 是否使用 PyQtWebEngine 辅助登录 - - -if HAVE_WEB_ENG: +if USE_WEB_ENG: # 是否使用 PyQtWebEngine 辅助登录 from lanzou.gui.login_assister import LoginWindow @@ -34,6 +32,7 @@ def __init__(self, config): self.initUI() self.setStyleSheet(dialog_qss_style) self.setMinimumWidth(380) + self.name_ed.setFocus() # 信号 self.name_ed.textChanged.connect(self.set_user) self.pwd_ed.textChanged.connect(self.set_pwd) @@ -281,7 +280,7 @@ def change_ok_btn(self): self._config.set_infos(up_info) self.clicked_ok.emit() self.close() - elif HAVE_WEB_ENG: + elif USE_WEB_ENG: self.web = LoginWindow(self._user, self._pwd) self.web.cookie.connect(self.get_cookie_by_web) self.web.setWindowModality(Qt.ApplicationModal) diff --git a/lanzou/gui/gui.py b/lanzou/gui/gui.py index 3f7f65b..79dd187 100644 --- a/lanzou/gui/gui.py +++ b/lanzou/gui/gui.py @@ -734,7 +734,8 @@ def show_full_path(self): tip = f"fid:{item.id} | 描述:{item.desc}" if item.desc else f"fid:{item.id}" self._locs[index].setToolTip(tip) self._locs[index].setIcon(QIcon("./src/folder.gif")) - self._locs[index].setStyleSheet("QPushButton {border:none; background:transparent;}") + self._locs[index].setStyleSheet("QPushButton {border:none; background:transparent;\ + color: rgb(139,0,139); font-weight:bold;}") self.disk_loc_hbox.insertWidget(index, self._locs[index]) self._locs[index].clicked.connect(self.call_change_dir(item.id)) index += 1 @@ -924,7 +925,8 @@ def init_extract_share_ui(self): self.model_share = QStandardItemModel(1, 3) self.config_tableview("share") - self.get_shared_info_thread.update.connect(lambda: self.model_share.removeRows(0, self.model_share.rowCount())) # 清理旧的信息 + # 清理旧的信息 + self.get_shared_info_thread.update.connect(lambda: self.model_share.removeRows(0, self.model_share.rowCount())) self.get_shared_info_thread.msg.connect(self.show_status) # 提示信息 self.get_shared_info_thread.infos.connect(self.show_share_url_file_lists) # 内容信息 self.get_shared_info_thread.finished.connect(lambda: self.btn_extract.setEnabled(True)) @@ -932,6 +934,7 @@ def init_extract_share_ui(self): # 控件设置 self.line_share_url.setPlaceholderText("蓝奏云链接,如有提取码,放后面,空格或汉字等分割,回车键提取") self.line_share_url.returnPressed.connect(self.call_get_shared_info) + self.line_share_url.setFocus() # 光标焦点 self.btn_extract.clicked.connect(self.call_get_shared_info) self.btn_share_dl.clicked.connect(lambda: self.call_multi_manipulator("download")) self.btn_share_dl.setIcon(QIcon("./src/downloader.ico")) @@ -943,10 +946,6 @@ def init_extract_share_ui(self): self.share_set_dl_path.setText(self._config.path) self.share_set_dl_path.clicked.connect(self.set_download_path) - # QSS - self.label_share_url.setStyleSheet("#label_share_url {color: rgb(255,255,60);}") - self.label_dl_path.setStyleSheet("#label_dl_path {color: rgb(255,255,60);}") - # jobs tab def call_jobs_clean_all(self): try: diff --git a/lanzou/gui/qss.py b/lanzou/gui/qss.py index 9bfb59c..def353d 100644 --- a/lanzou/gui/qss.py +++ b/lanzou/gui/qss.py @@ -67,7 +67,7 @@ QTabWidget::pane { border: 1px; /* background:transparent; # 完全透明 */ - background-color: rgba(255, 255, 255, 100); + background-color: rgba(255, 255, 255, 90); } QTabWidget::tab-bar { background:transparent; @@ -106,6 +106,21 @@ color: white; background:transparent; } +/*提取界面文字颜色*/ +#label_share_url { + color: rgb(255,255,60); +} +#label_dl_path { + color: rgb(255,255,60); +} +/*网盘界面文字颜色*/ +#label_disk_loc { + color: rgb(0,0,0); + font-weight:bold; +} +#disk_tab { + background-color: rgba(255, 255, 255, 120); +} ''' btn_style = """ diff --git a/lanzou/gui/ui.py b/lanzou/gui/ui.py index b78bc79..bfff6cb 100644 --- a/lanzou/gui/ui.py +++ b/lanzou/gui/ui.py @@ -60,7 +60,7 @@ def setupUi(self, MainWindow): self.disk_hlayout_top = QtWidgets.QHBoxLayout() self.disk_hlayout_top.setObjectName("disk_hlayout_top") self.disk_loc_hbox = QtWidgets.QHBoxLayout() - self.disk_loc_hbox.setObjectName("disk_loc") + self.disk_loc_hbox.setObjectName("disk_loc_hbox") self.label_disk_loc = QtWidgets.QLabel(self.disk_tab) self.label_disk_loc.setObjectName("label_disk_loc") self.disk_loc_hbox.addWidget(self.label_disk_loc) diff --git a/lanzou/gui/workers/down.py b/lanzou/gui/workers/down.py index e3d3843..830aac1 100644 --- a/lanzou/gui/workers/down.py +++ b/lanzou/gui/workers/down.py @@ -72,8 +72,8 @@ def _down_failed(self, code, file): """显示下载失败的回调函数""" self.folder_file_failed.emit(code, file) - # def __del__(self): - # self.wait() + def __del__(self): + self.wait() def set_values(self, name, url, pwd, save_path): self.name = name diff --git a/pyinstaller_version_info.txt b/pyinstaller_version_info.txt deleted file mode 100644 index fd30201..0000000 --- a/pyinstaller_version_info.txt +++ /dev/null @@ -1,43 +0,0 @@ -# UTF-8 -# -# For more details about fixed file info 'ffi' see: -# http://msdn.microsoft.com/en-us/library/ms646997.aspx -VSVersionInfo( - ffi=FixedFileInfo( -# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) -# Set not needed items to zero 0. -filevers=(0, 3, 0, 0), -prodvers=(0, 3, 0, 0), -# Contains a bitmask that specifies the valid bits 'flags'r -mask=0x3f, -# Contains a bitmask that specifies the Boolean attributes of the file. -flags=0x0, -# The operating system for which this file was designed. -# 0x4 - NT and there is no need to change it. -OS=0x4, -# The general type of file. -# 0x1 - the file is an application. -fileType=0x1, -# The function of the file. -# 0x0 - the function is not defined for this fileType -subtype=0x0, -# Creation date and time stamp. -date=(0, 0) -), - kids=[ -StringFileInfo( - [ - StringTable( - u'040904B0', - [StringStruct(u'CompanyName', u'rachpt.cn'), - StringStruct(u'FileDescription', u'蓝奏云客户端'), - StringStruct(u'FileVersion', u'0.3.0'), - StringStruct(u'InternalName', u'lanzou-gui'), - StringStruct(u'LegalCopyright', u'Copyright (c) rachpt'), - StringStruct(u'OriginalFilename', u'lanzou-gui_win64_v0.3.0.exe'), - StringStruct(u'ProductName', u'lanzou-gui_Win64'), - StringStruct(u'ProductVersion', u'0.3.0 (r200617)')]) - ]), -VarFileInfo([VarStruct(u'Translation', [2052, 1033])]) - ] -) \ No newline at end of file diff --git a/version_info.txt b/version_info.txt new file mode 100644 index 0000000..7909111 --- /dev/null +++ b/version_info.txt @@ -0,0 +1,29 @@ +# version infos + +VSVersionInfo( + ffi=FixedFileInfo( + filevers=(0, 3, 1, 0), + prodvers=(0, 3, 1, 0), + mask=0x3f, + flags=0x0, + OS=0x4, + fileType=0x1, + subtype=0x0, + date=(0, 0) + ), + kids=[ + StringFileInfo([ + StringTable( + u'040904B0', + [StringStruct(u'CompanyName', u'rachpt.cn'), + StringStruct(u'FileDescription', u'蓝奏云客户端'), + StringStruct(u'FileVersion', u'0.3.1'), + StringStruct(u'InternalName', u'lanzou-gui'), + StringStruct(u'LegalCopyright', u'Copyright (c) rachpt'), + StringStruct(u'OriginalFilename', u'lanzou-gui_win64_v0.3.1.exe'), + StringStruct(u'ProductName', u'lanzou-gui_win64'), + StringStruct(u'ProductVersion', u'0.3.1 (r200621)')]) + ]), + VarFileInfo([VarStruct(u'Translation', [2052, 1033])]) + ] +)