Skip to content

Commit 16fd71c

Browse files
committed
- 修复编译错误
- 采用全新的界面 - Image Converter全新改版
1 parent 62ac718 commit 16fd71c

File tree

74 files changed

+3352
-2677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3352
-2677
lines changed

.DS_Store

-4 KB
Binary file not shown.

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
if: github.event_name == 'push'
3030
uses: softprops/action-gh-release@v2
3131
with:
32-
tag_name: 2.0.0B3
33-
name: 2.0.0 Beta 2
32+
tag_name: 2.0.0B4
33+
name: 2.0.0 Beta 4
3434
body: ${{ github.event.head_commit.message }}
3535
prerelease: true
3636
files: |
@@ -57,8 +57,8 @@ jobs:
5757
if: github.event_name == 'push'
5858
uses: softprops/action-gh-release@v2
5959
with:
60-
tag_name: 2.0.0B3
61-
name: 2.0.0 Beta 2
60+
tag_name: 2.0.0B4
61+
name: 2.0.0 Beta 4
6262
body: ${{ github.event.head_commit.message }}
6363
prerelease: true
6464
files: |

.gitignore

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[codz]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
#poetry.toml
110+
111+
# pdm
112+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115+
#pdm.lock
116+
#pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# pixi
121+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122+
#pixi.lock
123+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124+
# in the .venv directory. It is recommended not to include this directory in version control.
125+
.pixi
126+
127+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128+
__pypackages__/
129+
130+
# Celery stuff
131+
celerybeat-schedule
132+
celerybeat.pid
133+
134+
# SageMath parsed files
135+
*.sage.py
136+
137+
# Environments
138+
.env
139+
.envrc
140+
.venv
141+
env/
142+
venv/
143+
ENV/
144+
env.bak/
145+
venv.bak/
146+
147+
# Spyder project settings
148+
.spyderproject
149+
.spyproject
150+
151+
# Rope project settings
152+
.ropeproject
153+
154+
# mkdocs documentation
155+
/site
156+
157+
# mypy
158+
.mypy_cache/
159+
.dmypy.json
160+
dmypy.json
161+
162+
# Pyre type checker
163+
.pyre/
164+
165+
# pytype static type analyzer
166+
.pytype/
167+
168+
# Cython debug symbols
169+
cython_debug/
170+
171+
# PyCharm
172+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174+
# and can be added to the global gitignore or merged into this file. For a more nuclear
175+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
176+
#.idea/
177+
178+
# Abstra
179+
# Abstra is an AI-powered process automation framework.
180+
# Ignore directories containing user credentials, local state, and settings.
181+
# Learn more at https://abstra.io/docs
182+
.abstra/
183+
184+
# Visual Studio Code
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188+
# you could uncomment the following to ignore the entire vscode folder
189+
# .vscode/
190+
191+
# Ruff stuff:
192+
.ruff_cache/
193+
194+
# PyPI configuration file
195+
.pypirc
196+
197+
# Cursor
198+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200+
# refer to https://docs.cursor.com/context/ignore-files
201+
.cursorignore
202+
.cursorindexingignore
203+
204+
# Marimo
205+
marimo/_static/
206+
marimo/_lsp/
207+
__marimo__/

.trae/rules/project_rules.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
使用python版本:3.13
2+
依赖:requirements.txt中,用 pip3.13 install -r requirements.txt
3+
测试文件:放入test文件夹中

FEATURE_IMPLEMENTATION_SUMMARY.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# GUI Converter Interface Behavior Features Implementation
2+
3+
## Overview
4+
5+
I have successfully implemented three key interface behavior features for the GUI converter based on the settings shown in the provided image:
6+
7+
## Implemented Features
8+
9+
### 1. Auto-show preview after selecting file (自动预览文件选择后显示)
10+
11+
**Functionality:**
12+
- When enabled: Automatically displays image preview immediately after selecting an input file
13+
- When disabled: Requires manual action to show preview
14+
15+
**Implementation:**
16+
- Modified `on_browse_input()` method in `gui_converter.py` to check `self.auto_preview` setting
17+
- Calls `self.show_preview()` automatically when the setting is enabled
18+
- In success view, when `auto_preview` is enabled, the "Open Converted File" button is hidden and the file is automatically opened
19+
20+
**Code Location:** Lines ~860-880 in `gui_converter.py`
21+
22+
### 2. Remember last selected input/output paths (记录历史路径)
23+
24+
**Functionality:**
25+
- When enabled: Saves and restores the last used directories for input/output file selection
26+
- When enabled: Shows a "History" tab with conversion history (up to 50 entries)
27+
- When disabled: Always opens file dialogs in default location and hides the History tab
28+
29+
**Implementation:**
30+
- Added `last_input_dir` and `last_output_dir` variables
31+
- Modified file dialog methods to save/restore directory paths
32+
- Created `create_history_tab()` method that shows/hides based on setting
33+
- Added history tracking with `add_to_history()`, `load_conversion_history()`, and `save_conversion_history()` methods
34+
- Modified `show_main_view()` to preserve conversion data when remember_path is enabled
35+
36+
**Code Location:** Lines ~300-400 in `gui_converter.py`
37+
38+
### 3. Show success notification after conversion (显示转换成功通知)
39+
40+
**Functionality:**
41+
- When enabled: Shows the full success overlay with completion notification
42+
- When disabled: Only shows a simple status bar message
43+
44+
**Implementation:**
45+
- Modified `on_conversion_finished()` method to check `self.completion_notify` setting
46+
- When disabled, shows minimal notification in status bar instead of full overlay
47+
- Success view is conditionally displayed based on this setting
48+
49+
**Code Location:** Lines ~1080-1100 in `gui_converter.py`
50+
51+
## Technical Details
52+
53+
### Settings Integration
54+
55+
All three settings are:
56+
- **Automatically saved** to QSettings when changed
57+
- **Loaded on application startup** from persistent storage
58+
- **Integrated with the Settings Dialog** in the launcher (accessible via Settings → Image Converter)
59+
- **Applied immediately** when changed
60+
61+
### UI Structure Changes
62+
63+
**Tab Widget Integration:**
64+
- Main converter interface now uses a QTabWidget
65+
- "Converter" tab contains the main interface
66+
- "History" tab is dynamically shown/hidden based on `remember_path` setting
67+
68+
**History Management:**
69+
- Conversion history is stored in QSettings using array format
70+
- Limited to 50 most recent conversions
71+
- Shows timestamp, input file, output format with tooltips for full paths
72+
- Clear history button available
73+
74+
### File Path Preservation
75+
76+
When `remember_path` is enabled:
77+
- Input/output paths are preserved between conversions
78+
- File dialogs remember last used directories
79+
- Conversion data isn't cleared when returning from success view
80+
- History tab is visible and populated
81+
82+
When `remember_path` is disabled:
83+
- Paths are cleared after each conversion
84+
- File dialogs open in default locations
85+
- History tab is hidden
86+
- Fresh state for each conversion
87+
88+
## Settings Storage
89+
90+
All settings are stored using QSettings with keys:
91+
- `image_converter/auto_preview` (bool)
92+
- `image_converter/remember_path` (bool)
93+
- `image_converter/completion_notify` (bool)
94+
- `image_converter/last_input_dir` (string)
95+
- `image_converter/last_output_dir` (string)
96+
- `conversion_history` (array of history items)
97+
98+
## Testing Results
99+
100+
**Auto-preview**: File preview shows immediately when selecting input file (when enabled)
101+
**Remember paths**: File dialogs remember last used directories and History tab appears
102+
**Success notification**: Full overlay shown when enabled, minimal notification when disabled
103+
**Settings persistence**: All settings are saved and restored correctly
104+
**Settings integration**: Changes in Settings Dialog apply immediately to converter
105+
106+
## Files Modified
107+
108+
1. **gui_converter.py** - Main implementation of all three features
109+
2. **settings/image_converter_settings.py** - Settings widget with auto-save
110+
3. **launcher.py** - Integration of settings dialog with notification system
111+
112+
The implementation follows the existing code architecture and maintains backward compatibility while adding the requested functionality.

TODO.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# TODO.md
2+
3+
## New Features:
4+
1. 添加了Image Converter设置页面到SettingsDialog
5+
2. 实现了完整的Image Converter设置功能,包含5个设置组:
6+
- 默认输出格式设置
7+
- 默认尺寸范围设置
8+
- 图像处理选项
9+
- 界面行为设置
10+
- 高级选项
11+
3. 在gui_converter.py中集成了QSettings设置管理
12+
4. 实现了load_settings()方法用于加载设置
13+
5. 实现了save_settings()方法用于保存设置
14+
15+
## Bug Fixes:
16+
1. 修复了gui_converter.py中缺少QSettings导入的问题
17+
18+
## Improvements:
19+
1. 扩展了SettingsDialog的自动保存机制以支持Image Converter设置
20+
2. 添加了settings_changed信号用于实时设置保存
21+
3. 实现了完整的设置加载和保存功能
22+
4. 在尺寸变更和格式变更时自动调用save_settings()
23+
5. 应用程序启动时自动加载保存的设置
24+
25+
## Image Converter Settings Details:
26+
27+
### 1. 默认输出格式设置
28+
- 下拉菜单选择默认输出格式(icns、png、jpg、webp、bmp、gif、tiff、ico)
29+
- 默认值:icns
30+
31+
### 2. 默认尺寸范围设置
32+
- 最小尺寸:数字输入框(16-512px)
33+
- 最大尺寸:数字输入框(32-1024px)
34+
- 自动检测:复选框,是否启用自动检测最大尺寸功能
35+
36+
### 3. 图像处理选项
37+
- 保持宽高比:复选框,转换时是否保持原始宽高比
38+
- 自动裁剪为正方形:复选框,对于非正方形图像是否自动裁剪
39+
- 图像质量设置:滑块(1-100),设置JPG/WebP等格式的输出质量
40+
41+
### 4. 界面行为设置
42+
- 自动预览:复选框,选择文件后是否自动显示预览
43+
- 记住上次路径:复选框,是否记住上次选择的输入/输出路径
44+
- 转换完成提示:复选框,转换完成后是否显示成功提示
45+
46+
### 5. 高级选项
47+
- ICNS生成方式:下拉菜单选择使用iconutil(推荐)或Pillow备用方案
48+
- 覆盖确认:复选框,覆盖现有文件前是否提示确认
49+
- 批量处理线程数:数字输入,设置批量转换时的最大线程数(1-8)
69 Bytes
Binary file not shown.
15 Bytes
Binary file not shown.

__pycache__/clean.cpython-313.pyc

15 Bytes
Binary file not shown.

__pycache__/con.cpython-313.pyc

3.84 KB
Binary file not shown.

0 commit comments

Comments
 (0)