Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,6 @@ build
*test*
*.log
*.c
*.pyd
*.pyd
__pycache__/
*.pyc
Binary file added app/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file added app/__pycache__/config.cpython-313.pyc
Binary file not shown.
Binary file added app/log/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file added app/log/__pycache__/logger.cpython-313.pyc
Binary file not shown.
Binary file added app/model/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file added app/model/__pycache__/file_model.cpython-313.pyc
Binary file not shown.
Binary file added app/ui/__pycache__/Icon.cpython-313.pyc
Binary file not shown.
Binary file added app/ui/__pycache__/__init__.cpython-313.pyc
Binary file not shown.
Binary file added app/ui/__pycache__/global_signal.cpython-313.pyc
Binary file not shown.
Binary file added app/ui/__pycache__/mainview.cpython-313.pyc
Binary file not shown.
Binary file added app/ui/__pycache__/mainwindow.cpython-313.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions app/ui/pdf_tools/merge/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ def open_file_dialog(self):
elided_text = font_metrics.elidedText(self.output_dir, Qt.ElideRight, self.label_output_dir.width() - 10)
self.label_output_dir.setText(elided_text)
self.label_output_dir.setToolTip(self.output_dir)

# 输出文件名格式:使用第一个文件的名称作为基础
if files:
first_file = files[0]
filename = os.path.basename(first_file)
filename_without_ext = os.path.splitext(filename)[0]
new_filename = f"{filename_without_ext}_合并文件"
self.output_filename = new_filename
self.lineEdit_filename.setText(new_filename)

def merge(self):
input_files = self.list_view.get_data()
Expand Down
51 changes: 48 additions & 3 deletions app/ui/pdf_tools/pdf_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def __init__(self, router: Router, parent=None):
self.setCursorTimeout(100)

self.commandLinkButton_merge_pdf.clicked.connect(self.merge_pdf)
self.commandLinkButton_split_pdf.clicked.connect(globalSignals.not_support)
self.commandLinkButton_encrypt.clicked.connect(globalSignals.not_support)
self.commandLinkButton_decrypt.clicked.connect(globalSignals.not_support)
self.commandLinkButton_split_pdf.clicked.connect(self.split_pdf)
self.commandLinkButton_encrypt.clicked.connect(self.encrypt_pdf)
self.commandLinkButton_decrypt.clicked.connect(self.decrypt_pdf)
self.commandLinkButton_delete_blank_pages.clicked.connect(globalSignals.not_support)
self.commandLinkButton_add_watermark.clicked.connect(globalSignals.not_support)

Expand Down Expand Up @@ -62,6 +62,51 @@ def merge_pdf(self):
else:
self.router.navigate(self.merge_view.router_path)

def split_pdf(self):
from app.ui.pdf_tools.split.split import SplitControl
if not hasattr(self, 'split_view') or not self.split_view:
self.split_view = SplitControl(router=self.router, parent=self if self.parent() else None)
self.split_view.okSignal.connect(self.split_finish)
self.router.add_route(self.split_view.router_path, self.split_view)
self.child_routes[self.split_view.router_path] = 0
self.childRouterSignal.emit(self.split_view.router_path)
self.router.navigate(self.split_view.router_path)
else:
self.router.navigate(self.split_view.router_path)

def encrypt_pdf(self):
from app.ui.pdf_tools.security.encrypt import EncryptControl
if not hasattr(self, 'encrypt_view') or not self.encrypt_view:
self.encrypt_view = EncryptControl(router=self.router, parent=self if self.parent() else None)
self.encrypt_view.okSignal.connect(self.encrypt_finish)
self.router.add_route(self.encrypt_view.router_path, self.encrypt_view)
self.child_routes[self.encrypt_view.router_path] = 0
self.childRouterSignal.emit(self.encrypt_view.router_path)
self.router.navigate(self.encrypt_view.router_path)
else:
self.router.navigate(self.encrypt_view.router_path)

def decrypt_pdf(self):
from app.ui.pdf_tools.security.decrypt import DecryptControl
if not hasattr(self, 'decrypt_view') or not self.decrypt_view:
self.decrypt_view = DecryptControl(router=self.router, parent=self if self.parent() else None)
self.decrypt_view.okSignal.connect(self.decrypt_finish)
self.router.add_route(self.decrypt_view.router_path, self.decrypt_view)
self.child_routes[self.decrypt_view.router_path] = 0
self.childRouterSignal.emit(self.decrypt_view.router_path)
self.router.navigate(self.decrypt_view.router_path)
else:
self.router.navigate(self.decrypt_view.router_path)

def encrypt_finish(self):
self.encrypt_view = None

def decrypt_finish(self):
self.decrypt_view = None

def split_finish(self):
self.split_view = None

def merge_finish(self):
self.merge_view = None

Expand Down
4 changes: 4 additions & 0 deletions app/ui/pdf_tools/security/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# PDF加密解密功能模块
"""
包含PDF加密和解密相关功能
"""
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading