Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
065a92c526 |
No files matched your search
@@ -12,6 +12,8 @@ __pycache__/
|
||||
venv/
|
||||
build/
|
||||
dist/
|
||||
release/
|
||||
|
||||
*.log
|
||||
*.tmp
|
||||
PGU-NetFileSyncWin.ini
|
||||
@@ -13,6 +13,7 @@ PGU-NetFileSyncWin 是一个面向 Windows 的 PyQt5 远程文件管理与高速
|
||||
- `assets/pgu_netfilesync_icon.png`:Qt GUI 窗口图标。
|
||||
- `README.md`:仓库概览。
|
||||
- `USER.md`:用户说明书。
|
||||
- `PGU-NetFileSyncWin.ini`:本机便携配置文件,包含连接信息;该文件被 `.gitignore` 忽略,不提交仓库。
|
||||
|
||||
## Python 环境
|
||||
|
||||
@@ -56,6 +57,29 @@ C:\Users\clear\.conda\envs\clear_conda_main\python.exe pgu4_sync.py
|
||||
dist/PGU-NetFileSyncWin.exe
|
||||
```
|
||||
|
||||
发布版配置文件位于 exe 同目录:
|
||||
|
||||
```text
|
||||
dist/PGU-NetFileSyncWin.ini
|
||||
```
|
||||
|
||||
源码运行时配置文件位于项目目录:
|
||||
|
||||
```text
|
||||
PGU-NetFileSyncWin.ini
|
||||
```
|
||||
|
||||
当前默认配置:
|
||||
|
||||
```ini
|
||||
[General]
|
||||
host=192.168.1.248
|
||||
port=22
|
||||
username=clear
|
||||
password=Bone1644
|
||||
remote_path=/home/clear/Data
|
||||
```
|
||||
|
||||
## GUI 设计要点
|
||||
|
||||
- 必须使用 PyQt5,不要升级到 PyQt6。
|
||||
@@ -83,6 +107,8 @@ dist/PGU-NetFileSyncWin.exe
|
||||
|
||||
这些连接参数会通过 `QSettings` 记忆。
|
||||
|
||||
当前项目不再使用 Windows 注册表保存配置,而是使用 `QSettings(str(config_path()), QSettings.IniFormat)`,把配置保存到 `PGU-NetFileSyncWin.ini`。密码按用户要求以明文保存。
|
||||
|
||||
“扫描”按钮会扫描本机选定网卡所在局域网中开放 `5901` 或 `5923` 的设备:
|
||||
|
||||
- 如果发现 `5923`,主界面端口自动填 `5922`。
|
||||
@@ -214,6 +240,7 @@ v1.0.0
|
||||
## 注意事项
|
||||
|
||||
- 不要把远端设备密码、Gitea 密码、服务器密码写入仓库。
|
||||
- `PGU-NetFileSyncWin.ini` 含明文密码,不要提交仓库。
|
||||
- `.idea/`、`__pycache__/`、`build/`、`dist/` 默认不提交。
|
||||
- `dist/` 中的 exe 是发布产物,不在 git 中跟踪,通过 Gitea Release 附件发布。
|
||||
- Windows 图标可能被系统缓存;测试图标时应关闭旧进程,必要时取消任务栏固定后重新固定新版 exe。
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
基于 PyQt5 的 Ubuntu 远程文件管理与高速下载工具。界面以远程文件列表为主,支持连接记忆、远程路径记忆、局域网扫描、拖拽到 Windows 资源管理器、多线程下载、暂停/继续、取消、实时速度条和极速 HTTP Range 通道。
|
||||
|
||||
连接配置保存在程序同目录的 `PGU-NetFileSyncWin.ini` 中,便于和 exe 一起复制使用。
|
||||
|
||||
## 安装
|
||||
|
||||
建议使用本机 `clear_conda_main` 环境:
|
||||
|
||||
@@ -14,6 +14,26 @@ PGU-NetFileSyncWin.exe
|
||||
|
||||
发布版是单文件程序,不需要打开命令行窗口。
|
||||
|
||||
配置文件建议和 exe 放在同一目录:
|
||||
|
||||
```text
|
||||
PGU-NetFileSyncWin.exe
|
||||
PGU-NetFileSyncWin.ini
|
||||
```
|
||||
|
||||
默认配置文件内容:
|
||||
|
||||
```ini
|
||||
[General]
|
||||
host=192.168.1.248
|
||||
port=22
|
||||
username=clear
|
||||
password=Bone1644
|
||||
remote_path=/home/clear/Data
|
||||
```
|
||||
|
||||
密码按当前版本设计为明文保存。如果要清空连接记录,删除或编辑这个 ini 文件即可。
|
||||
|
||||
如果使用源码运行:
|
||||
|
||||
```powershell
|
||||
@@ -108,6 +128,8 @@ run_pgu4_sync.bat
|
||||
|
||||
连接信息会自动记忆,下次打开软件会自动填入。
|
||||
|
||||
这些连接信息保存在程序同目录的 `PGU-NetFileSyncWin.ini`,不是写入 exe 内部,也不是保存到注册表。
|
||||
|
||||
## 5. 扫描局域网设备
|
||||
|
||||
点击 `扫描` 后会弹出扫描窗口。
|
||||
|
||||
+26
-1
@@ -72,6 +72,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
APP_ORG = "ClearCore"
|
||||
APP_NAME = "PGU4-Sync"
|
||||
CONFIG_FILE_NAME = "PGU-NetFileSyncWin.ini"
|
||||
APP_ICON_FILE = "assets/pgu_netfilesync_icon.png"
|
||||
WINDOWS_APP_ID = "ClearCore.PGU.NetFileSyncWin"
|
||||
CHUNK_SIZE = 16 * 1024 * 1024
|
||||
@@ -1402,7 +1403,7 @@ class RemoteTableView(QTableView):
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.settings = QSettings(APP_ORG, APP_NAME)
|
||||
self.settings = QSettings(str(config_path()), QSettings.IniFormat)
|
||||
self.factory = SSHClientFactory()
|
||||
self.remote_model = RemoteTableModel()
|
||||
self.current_remote_path = self.settings.value("remote_path", "/", str)
|
||||
@@ -2211,6 +2212,29 @@ def resource_path(relative_path: str) -> str:
|
||||
return str(Path(base) / relative_path)
|
||||
|
||||
|
||||
def app_dir() -> Path:
|
||||
if getattr(sys, "frozen", False):
|
||||
return Path(sys.executable).resolve().parent
|
||||
return Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def config_path() -> Path:
|
||||
return app_dir() / CONFIG_FILE_NAME
|
||||
|
||||
|
||||
def ensure_default_config() -> None:
|
||||
path = config_path()
|
||||
if path.exists():
|
||||
return
|
||||
settings = QSettings(str(path), QSettings.IniFormat)
|
||||
settings.setValue("host", "192.168.1.248")
|
||||
settings.setValue("port", 22)
|
||||
settings.setValue("username", "clear")
|
||||
settings.setValue("password", "Bone1644")
|
||||
settings.setValue("remote_path", "/home/clear/Data")
|
||||
settings.sync()
|
||||
|
||||
|
||||
def set_windows_app_id() -> None:
|
||||
if sys.platform != "win32":
|
||||
return
|
||||
@@ -2372,6 +2396,7 @@ def create_copy_drag_cursor() -> QCursor:
|
||||
|
||||
def main() -> int:
|
||||
set_windows_app_id()
|
||||
ensure_default_config()
|
||||
app = QApplication(sys.argv)
|
||||
app.setOrganizationName(APP_ORG)
|
||||
app.setApplicationName(APP_NAME)
|
||||
|
||||
Reference in new issue
Block a user