mirror of
https://github.com/Minidoracat/mcp-feedback-enhanced.git
synced 2025-07-27 02:22:26 +08:00
✨ 新增關於分頁,顯示應用程式資訊及聯繫方式,並更新相關翻譯。
This commit is contained in:
parent
d9702ceaf0
commit
3ad7f1d31f
@ -11,10 +11,12 @@ from .feedback_tab import FeedbackTab
|
||||
from .summary_tab import SummaryTab
|
||||
from .command_tab import CommandTab
|
||||
from .settings_tab import SettingsTab
|
||||
from .about_tab import AboutTab
|
||||
|
||||
__all__ = [
|
||||
'FeedbackTab',
|
||||
'SummaryTab',
|
||||
'CommandTab',
|
||||
'SettingsTab'
|
||||
'SettingsTab',
|
||||
'AboutTab'
|
||||
]
|
260
src/mcp_feedback_enhanced/gui/tabs/about_tab.py
Normal file
260
src/mcp_feedback_enhanced/gui/tabs/about_tab.py
Normal file
@ -0,0 +1,260 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
關於分頁組件
|
||||
============
|
||||
|
||||
顯示應用程式資訊和聯繫方式的分頁組件。
|
||||
"""
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
QWidget, QVBoxLayout, QHBoxLayout, QLabel,
|
||||
QGroupBox, QPushButton, QTextEdit, QScrollArea
|
||||
)
|
||||
from PySide6.QtCore import Qt, QUrl
|
||||
from PySide6.QtGui import QFont, QDesktopServices
|
||||
|
||||
from ...i18n import t
|
||||
|
||||
|
||||
class AboutTab(QWidget):
|
||||
"""關於分頁組件"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self._setup_ui()
|
||||
|
||||
def _setup_ui(self) -> None:
|
||||
"""設置用戶介面"""
|
||||
# 主布局
|
||||
main_layout = QVBoxLayout(self)
|
||||
main_layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
# 創建滾動區域
|
||||
scroll_area = QScrollArea()
|
||||
scroll_area.setWidgetResizable(True)
|
||||
scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||
scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||
scroll_area.setStyleSheet("""
|
||||
QScrollArea {
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
QScrollBar:vertical {
|
||||
background-color: #2d2d30;
|
||||
width: 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
QScrollBar::handle:vertical {
|
||||
background-color: #464647;
|
||||
border-radius: 6px;
|
||||
min-height: 20px;
|
||||
}
|
||||
QScrollBar::handle:vertical:hover {
|
||||
background-color: #555555;
|
||||
}
|
||||
""")
|
||||
|
||||
# 創建內容容器
|
||||
content_widget = QWidget()
|
||||
content_layout = QVBoxLayout(content_widget)
|
||||
content_layout.setSpacing(16)
|
||||
content_layout.setContentsMargins(16, 16, 16, 16)
|
||||
|
||||
# === 主要資訊區域(合併應用程式資訊、專案連結、聯繫與支援) ===
|
||||
self.main_info_group = QGroupBox(t('about.appInfo'))
|
||||
self.main_info_group.setObjectName('main_info_group')
|
||||
main_info_layout = QVBoxLayout(self.main_info_group)
|
||||
main_info_layout.setSpacing(16)
|
||||
main_info_layout.setContentsMargins(20, 20, 20, 20)
|
||||
|
||||
# 應用程式標題和版本
|
||||
title_layout = QHBoxLayout()
|
||||
self.app_title_label = QLabel("MCP Feedback Enhanced")
|
||||
self.app_title_label.setStyleSheet("font-size: 20px; font-weight: bold; color: #e0e0e0;")
|
||||
title_layout.addWidget(self.app_title_label)
|
||||
|
||||
title_layout.addStretch()
|
||||
|
||||
self.version_label = QLabel("v2.1.0")
|
||||
self.version_label.setStyleSheet("font-size: 16px; color: #007acc; font-weight: bold;")
|
||||
title_layout.addWidget(self.version_label)
|
||||
|
||||
main_info_layout.addLayout(title_layout)
|
||||
|
||||
# 應用程式描述
|
||||
self.app_description = QLabel(t('about.description'))
|
||||
self.app_description.setStyleSheet("color: #9e9e9e; font-size: 13px; line-height: 1.4; margin-bottom: 16px;")
|
||||
self.app_description.setWordWrap(True)
|
||||
main_info_layout.addWidget(self.app_description)
|
||||
|
||||
# 分隔線
|
||||
separator1 = QLabel()
|
||||
separator1.setFixedHeight(1)
|
||||
separator1.setStyleSheet("background-color: #464647; margin: 8px 0;")
|
||||
main_info_layout.addWidget(separator1)
|
||||
|
||||
# GitHub 專案區域
|
||||
github_layout = QHBoxLayout()
|
||||
self.github_label = QLabel("📂 " + t('about.githubProject'))
|
||||
self.github_label.setStyleSheet("font-weight: bold; color: #e0e0e0; font-size: 14px;")
|
||||
github_layout.addWidget(self.github_label)
|
||||
|
||||
github_layout.addStretch()
|
||||
|
||||
self.github_button = QPushButton(t('about.visitGithub'))
|
||||
self.github_button.setFixedSize(120, 32)
|
||||
self.github_button.setStyleSheet("""
|
||||
QPushButton {
|
||||
background-color: #0078d4;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: #106ebe;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #005a9e;
|
||||
}
|
||||
""")
|
||||
self.github_button.clicked.connect(self._open_github)
|
||||
github_layout.addWidget(self.github_button)
|
||||
|
||||
main_info_layout.addLayout(github_layout)
|
||||
|
||||
# GitHub URL
|
||||
self.github_url_label = QLabel("https://github.com/Minidoracat/mcp-feedback-enhanced")
|
||||
self.github_url_label.setStyleSheet("color: #9e9e9e; font-size: 11px; margin-left: 24px; margin-bottom: 12px;")
|
||||
main_info_layout.addWidget(self.github_url_label)
|
||||
|
||||
# 分隔線
|
||||
separator2 = QLabel()
|
||||
separator2.setFixedHeight(1)
|
||||
separator2.setStyleSheet("background-color: #464647; margin: 8px 0;")
|
||||
main_info_layout.addWidget(separator2)
|
||||
|
||||
# Discord 支援區域
|
||||
discord_layout = QHBoxLayout()
|
||||
self.discord_label = QLabel("💬 " + t('about.discordSupport'))
|
||||
self.discord_label.setStyleSheet("font-weight: bold; color: #e0e0e0; font-size: 14px;")
|
||||
discord_layout.addWidget(self.discord_label)
|
||||
|
||||
discord_layout.addStretch()
|
||||
|
||||
self.discord_button = QPushButton(t('about.joinDiscord'))
|
||||
self.discord_button.setFixedSize(120, 32)
|
||||
self.discord_button.setStyleSheet("""
|
||||
QPushButton {
|
||||
background-color: #5865F2;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: #4752C4;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #3C45A5;
|
||||
}
|
||||
""")
|
||||
self.discord_button.clicked.connect(self._open_discord)
|
||||
discord_layout.addWidget(self.discord_button)
|
||||
|
||||
main_info_layout.addLayout(discord_layout)
|
||||
|
||||
# Discord URL 和說明
|
||||
self.discord_url_label = QLabel("https://discord.gg/ACjf9Q58")
|
||||
self.discord_url_label.setStyleSheet("color: #9e9e9e; font-size: 11px; margin-left: 24px;")
|
||||
main_info_layout.addWidget(self.discord_url_label)
|
||||
|
||||
self.contact_description = QLabel(t('about.contactDescription'))
|
||||
self.contact_description.setStyleSheet("color: #9e9e9e; font-size: 12px; margin-left: 24px; margin-top: 8px;")
|
||||
self.contact_description.setWordWrap(True)
|
||||
main_info_layout.addWidget(self.contact_description)
|
||||
|
||||
content_layout.addWidget(self.main_info_group)
|
||||
|
||||
# === 致謝區域 ===
|
||||
self.thanks_group = QGroupBox(t('about.thanks'))
|
||||
self.thanks_group.setObjectName('thanks_group')
|
||||
thanks_layout = QVBoxLayout(self.thanks_group)
|
||||
thanks_layout.setSpacing(12)
|
||||
thanks_layout.setContentsMargins(20, 20, 20, 20)
|
||||
|
||||
# 致謝文字
|
||||
self.thanks_text = QTextEdit()
|
||||
self.thanks_text.setReadOnly(True)
|
||||
self.thanks_text.setMinimumHeight(160)
|
||||
self.thanks_text.setMaximumHeight(220)
|
||||
self.thanks_text.setStyleSheet("""
|
||||
QTextEdit {
|
||||
background-color: #2d2d30;
|
||||
border: 1px solid #464647;
|
||||
border-radius: 4px;
|
||||
padding: 12px;
|
||||
color: #e0e0e0;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
QScrollBar:vertical {
|
||||
background-color: #2d2d30;
|
||||
width: 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
QScrollBar::handle:vertical {
|
||||
background-color: #464647;
|
||||
border-radius: 6px;
|
||||
min-height: 20px;
|
||||
}
|
||||
QScrollBar::handle:vertical:hover {
|
||||
background-color: #555555;
|
||||
}
|
||||
""")
|
||||
self.thanks_text.setPlainText(t('about.thanksText'))
|
||||
thanks_layout.addWidget(self.thanks_text)
|
||||
|
||||
content_layout.addWidget(self.thanks_group)
|
||||
|
||||
# 添加彈性空間
|
||||
content_layout.addStretch()
|
||||
|
||||
# 設置滾動區域的內容
|
||||
scroll_area.setWidget(content_widget)
|
||||
main_layout.addWidget(scroll_area)
|
||||
|
||||
def _open_github(self) -> None:
|
||||
"""開啟 GitHub 專案連結"""
|
||||
QDesktopServices.openUrl(QUrl("https://github.com/Minidoracat/mcp-feedback-enhanced"))
|
||||
|
||||
def _open_discord(self) -> None:
|
||||
"""開啟 Discord 邀請連結"""
|
||||
QDesktopServices.openUrl(QUrl("https://discord.gg/ACjf9Q58"))
|
||||
|
||||
def update_texts(self) -> None:
|
||||
"""更新界面文字(用於語言切換)"""
|
||||
# 更新GroupBox標題
|
||||
self.main_info_group.setTitle(t('about.appInfo'))
|
||||
self.thanks_group.setTitle(t('about.thanks'))
|
||||
|
||||
# 更新版本資訊
|
||||
self.version_label.setText("v2.1.0")
|
||||
|
||||
# 更新描述文字
|
||||
self.app_description.setText(t('about.description'))
|
||||
self.contact_description.setText(t('about.contactDescription'))
|
||||
|
||||
# 更新標籤文字
|
||||
self.github_label.setText("📂 " + t('about.githubProject'))
|
||||
self.discord_label.setText("💬 " + t('about.discordSupport'))
|
||||
|
||||
# 更新按鈕文字
|
||||
self.github_button.setText(t('about.visitGithub'))
|
||||
self.discord_button.setText(t('about.joinDiscord'))
|
||||
|
||||
# 更新致謝文字
|
||||
self.thanks_text.setPlainText(t('about.thanksText'))
|
@ -11,7 +11,7 @@ from typing import Dict, Any
|
||||
from PySide6.QtWidgets import QTabWidget, QSplitter, QWidget, QVBoxLayout, QScrollArea, QSizePolicy
|
||||
from PySide6.QtCore import Signal, Qt
|
||||
|
||||
from ..tabs import FeedbackTab, SummaryTab, CommandTab, SettingsTab
|
||||
from ..tabs import FeedbackTab, SummaryTab, CommandTab, SettingsTab, AboutTab
|
||||
from ..widgets import SmartTextEdit, ImageUploadWidget
|
||||
from ...i18n import t
|
||||
from ...debug import gui_debug_log as debug_log
|
||||
@ -35,6 +35,7 @@ class TabManager:
|
||||
self.summary_tab = None
|
||||
self.command_tab = None
|
||||
self.settings_tab = None
|
||||
self.about_tab = None
|
||||
self.combined_feedback_tab = None
|
||||
|
||||
def create_tabs(self) -> None:
|
||||
@ -62,6 +63,10 @@ class TabManager:
|
||||
self.settings_tab = SettingsTab(self.combined_mode)
|
||||
self.tab_widget.addTab(self.settings_tab, t('tabs.language'))
|
||||
|
||||
# 關於分頁
|
||||
self.about_tab = AboutTab()
|
||||
self.tab_widget.addTab(self.about_tab, t('tabs.about'))
|
||||
|
||||
debug_log(f"分頁創建完成,模式: {'合併' if self.combined_mode else '分離'}")
|
||||
|
||||
def _create_combined_feedback_tab(self) -> None:
|
||||
@ -168,16 +173,18 @@ class TabManager:
|
||||
def update_tab_texts(self) -> None:
|
||||
"""更新分頁標籤文字"""
|
||||
if self.combined_mode:
|
||||
# 合併模式:只有回饋、命令、設置
|
||||
# 合併模式:回饋、命令、設置、關於
|
||||
self.tab_widget.setTabText(0, t('tabs.feedback'))
|
||||
self.tab_widget.setTabText(1, t('tabs.command'))
|
||||
self.tab_widget.setTabText(2, t('tabs.language'))
|
||||
self.tab_widget.setTabText(3, t('tabs.about'))
|
||||
else:
|
||||
# 分離模式:回饋、摘要、命令、設置
|
||||
# 分離模式:回饋、摘要、命令、設置、關於
|
||||
self.tab_widget.setTabText(0, t('tabs.feedback'))
|
||||
self.tab_widget.setTabText(1, t('tabs.summary'))
|
||||
self.tab_widget.setTabText(2, t('tabs.command'))
|
||||
self.tab_widget.setTabText(3, t('tabs.language'))
|
||||
self.tab_widget.setTabText(4, t('tabs.about'))
|
||||
|
||||
# 更新各分頁的內部文字
|
||||
if self.feedback_tab:
|
||||
@ -188,6 +195,8 @@ class TabManager:
|
||||
self.command_tab.update_texts()
|
||||
if self.settings_tab:
|
||||
self.settings_tab.update_texts()
|
||||
if self.about_tab:
|
||||
self.about_tab.update_texts()
|
||||
|
||||
def get_feedback_data(self) -> Dict[str, Any]:
|
||||
"""獲取回饋數據"""
|
||||
|
@ -21,7 +21,22 @@
|
||||
"feedback": "💬 Feedback",
|
||||
"command": "⚡ Command",
|
||||
"language": "⚙️ Settings",
|
||||
"images": "🖼️ Images"
|
||||
"images": "🖼️ Images",
|
||||
"about": "ℹ️ About"
|
||||
},
|
||||
"about": {
|
||||
"appInfo": "Application Information",
|
||||
"version": "Version",
|
||||
"description": "A powerful MCP server that provides human-in-the-loop interactive feedback functionality for AI-assisted development tools. Supports dual interfaces (Qt GUI and Web UI) with rich features including image upload, command execution, and multi-language support.",
|
||||
"projectLinks": "Project Links",
|
||||
"githubProject": "GitHub Project",
|
||||
"visitGithub": "Visit GitHub",
|
||||
"contact": "Contact & Support",
|
||||
"discordSupport": "Discord Support",
|
||||
"joinDiscord": "Join Discord",
|
||||
"contactDescription": "For technical support, issue reports, or feature suggestions, feel free to contact us through Discord community or GitHub Issues.",
|
||||
"thanks": "Thanks & Contributions",
|
||||
"thanksText": "Special thanks to the original author Fábio Ferreira (@fabiomlferreira) for creating the original interactive-feedback-mcp project.\n\nThis enhanced version is developed and maintained by Minidoracat, who has significantly expanded the project with GUI interface, image support, multi-language capabilities, and many other improvements.\n\nAlso thanks to sanshao85's mcp-feedback-collector project for UI design inspiration.\n\nOpen source collaboration makes technology better!"
|
||||
},
|
||||
"feedback": {
|
||||
"title": "Your Feedback",
|
||||
|
@ -21,7 +21,8 @@
|
||||
"feedback": "💬 反馈",
|
||||
"command": "⚡ 命令",
|
||||
"language": "⚙️ 设置",
|
||||
"images": "🖼️ 图片"
|
||||
"images": "🖼️ 图片",
|
||||
"about": "ℹ️ 关于"
|
||||
},
|
||||
"feedback": {
|
||||
"title": "您的反馈",
|
||||
@ -130,5 +131,19 @@
|
||||
"test": {
|
||||
"qtGuiSummary": "🎯 图片预览和窗口调整测试\n\n这是一个测试会话,用于验证以下功能:\n\n✅ 功能测试项目:\n1. 图片上传和预览功能\n2. 图片右上角X删除按钮\n3. 窗口自由调整大小\n4. 分割器的灵活调整\n5. 各区域的动态布局\n6. 智能 Ctrl+V 图片粘贴功能\n\n📋 测试步骤:\n1. 尝试上传一些图片(拖拽、文件选择、剪贴板)\n2. 检查图片预览是否正常显示\n3. 点击图片右上角的X按钮删除图片\n4. 尝试调整窗口大小,检查是否可以自由调整\n5. 拖动分割器调整各区域大小\n6. 在文本框内按 Ctrl+V 测试智能粘贴功能\n7. 提供任何回馈或发现的问题\n\n请测试这些功能并提供回馈!",
|
||||
"webUiSummary": "测试 Web UI 功能\n\n🎯 **功能测试项目:**\n- Web UI 服务器启动和运行\n- WebSocket 即时通讯\n- 回馈提交功能\n- 图片上传和预览\n- 命令执行功能\n- 智能 Ctrl+V 图片粘贴\n- 多语言界面切换\n\n📋 **测试步骤:**\n1. 测试图片上传(拖拽、选择文件、剪贴板)\n2. 在文本框内按 Ctrl+V 测试智能粘贴\n3. 尝试切换语言(繁中/简中/英文)\n4. 测试命令执行功能\n5. 提交回馈和图片\n\n请测试这些功能并提供回馈!"
|
||||
},
|
||||
"about": {
|
||||
"appInfo": "应用程序信息",
|
||||
"version": "版本",
|
||||
"description": "一个强大的 MCP 服务器,为 AI 辅助开发工具提供人在回路的交互反馈功能。支持 Qt GUI 和 Web UI 双界面,并具备图片上传、命令执行、多语言等丰富功能。",
|
||||
"projectLinks": "项目链接",
|
||||
"githubProject": "GitHub 项目",
|
||||
"visitGithub": "访问 GitHub",
|
||||
"contact": "联系与支持",
|
||||
"discordSupport": "Discord 支持",
|
||||
"joinDiscord": "加入 Discord",
|
||||
"contactDescription": "如需技术支持、问题反馈或功能建议,欢迎通过 Discord 社群或 GitHub Issues 与我们联系。",
|
||||
"thanks": "致谢与贡献",
|
||||
"thanksText": "感谢原作者 Fábio Ferreira (@fabiomlferreira) 创建了原始的 interactive-feedback-mcp 项目。\n\n本增强版本由 Minidoracat 开发和维护,大幅扩展了项目功能,新增了 GUI 界面、图片支持、多语言能力以及许多其他改进功能。\n\n同时感谢 sanshao85 的 mcp-feedback-collector 项目提供的 UI 设计灵感。\n\n开源协作让技术变得更美好!"
|
||||
}
|
||||
}
|
@ -21,7 +21,22 @@
|
||||
"feedback": "💬 回饋",
|
||||
"command": "⚡ 命令",
|
||||
"language": "⚙️ 設置",
|
||||
"images": "🖼️ 圖片"
|
||||
"images": "🖼️ 圖片",
|
||||
"about": "ℹ️ 關於"
|
||||
},
|
||||
"about": {
|
||||
"appInfo": "應用程式資訊",
|
||||
"version": "版本",
|
||||
"description": "一個強大的 MCP 伺服器,為 AI 輔助開發工具提供人在回路的互動回饋功能。支援 Qt GUI 和 Web UI 雙介面,並具備圖片上傳、命令執行、多語言等豐富功能。",
|
||||
"projectLinks": "專案連結",
|
||||
"githubProject": "GitHub 專案",
|
||||
"visitGithub": "訪問 GitHub",
|
||||
"contact": "聯繫與支援",
|
||||
"discordSupport": "Discord 支援",
|
||||
"joinDiscord": "加入 Discord",
|
||||
"contactDescription": "如需技術支援、問題回報或功能建議,歡迎透過 Discord 社群或 GitHub Issues 與我們聯繫。",
|
||||
"thanks": "致謝與貢獻",
|
||||
"thanksText": "感謝原作者 Fábio Ferreira (@fabiomlferreira) 創建了原始的 interactive-feedback-mcp 專案。\n\n本增強版本由 Minidoracat 開發和維護,大幅擴展了專案功能,新增了 GUI 介面、圖片支援、多語言能力以及許多其他改進功能。\n\n同時感謝 sanshao85 的 mcp-feedback-collector 專案提供的 UI 設計靈感。\n\n開源協作讓技術變得更美好!"
|
||||
},
|
||||
"feedback": {
|
||||
"title": "您的回饋",
|
||||
|
Loading…
x
Reference in New Issue
Block a user