Skip to content

Commit

Permalink
将日志文件的设置放在单独的分组中
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Jul 3, 2024
1 parent 458e9c9 commit a6cb3da
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 51 deletions.
2 changes: 1 addition & 1 deletion app/components/tool_tip.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self, view: QWidget, parent: QWidget = None):
super().__init__(Icon.QUESTION_CIRCLE, parent=parent)

self.setFixedSize(QSize(26, 26))
self.setFixedSize(QSize(16, 16))
self.setIconSize(QSize(16, 16))

self.view = view
self.mToolTip = None
Expand Down
Binary file modified app/resource/i18n/Seraphine.zh_CN.qm
Binary file not shown.
97 changes: 51 additions & 46 deletions app/resource/i18n/Seraphine.zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2001,82 +2001,82 @@ If champions set by lane are not available, default settings will be used.</sour
<translation>客户端路径</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="98"/>
<location filename="../../view/setting_interface.py" line="100"/>
<source>Auto-start LOL</source>
<translation>自动启动游戏</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="98"/>
<location filename="../../view/setting_interface.py" line="100"/>
<source>Launch LOL client upon opening Seraphine automatically</source>
<translation>启动 Seraphine 时自动启动 LOL 客户端</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="121"/>
<location filename="../../view/setting_interface.py" line="123"/>
<source>Personalization</source>
<translation>个性化</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="132"/>
<location filename="../../view/setting_interface.py" line="134"/>
<source>Application theme</source>
<translation>应用主题</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="132"/>
<location filename="../../view/setting_interface.py" line="134"/>
<source>Change the appearance of Seraphine</source>
<translation>调整 Seraphine 的外观主题</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="132"/>
<location filename="../../view/setting_interface.py" line="134"/>
<source>Light</source>
<translation>浅色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="132"/>
<location filename="../../view/setting_interface.py" line="134"/>
<source>Dark</source>
<translation>深色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="163"/>
<location filename="../../view/setting_interface.py" line="165"/>
<source>Use system setting</source>
<translation>跟随系统设置</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="143"/>
<location filename="../../view/setting_interface.py" line="145"/>
<source>Theme color</source>
<translation>主题色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="143"/>
<location filename="../../view/setting_interface.py" line="145"/>
<source>Change the theme color of Seraphine</source>
<translation>调整 Seraphine 的主题色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="153"/>
<location filename="../../view/setting_interface.py" line="155"/>
<source>Interface zoom</source>
<translation>界面缩放</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="153"/>
<location filename="../../view/setting_interface.py" line="155"/>
<source>Change the size of widgets and fonts</source>
<translation>调整部件和字体的大小</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="293"/>
<location filename="../../view/setting_interface.py" line="296"/>
<source>Updated successfully</source>
<translation>更新成功</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="287"/>
<location filename="../../view/setting_interface.py" line="290"/>
<source>Configuration takes effect after restart</source>
<translation>设置在重启软件后生效</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="163"/>
<location filename="../../view/setting_interface.py" line="165"/>
<source>Language</source>
<translation>语言</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="163"/>
<location filename="../../view/setting_interface.py" line="165"/>
<source>Set your preferred language for Seraphine</source>
<translation>选择 Seraphine 所使用的语言</translation>
</message>
Expand Down Expand Up @@ -2107,52 +2107,52 @@ If champions set by lane are not available, default settings will be used.</sour
<translation type="obsolete">在对局详情界面中显示段位图标,启动该选项将影响加载该界面的速度</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="196"/>
<location filename="../../view/setting_interface.py" line="198"/>
<source>About</source>
<translation>关于</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="187"/>
<location filename="../../view/setting_interface.py" line="189"/>
<source>Provide feedback</source>
<translation>提供反馈</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="187"/>
<location filename="../../view/setting_interface.py" line="189"/>
<source>Help us improve Seraphine by providing feedback</source>
<translation>通过提供反馈帮助我们改善 Seraphine</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="196"/>
<location filename="../../view/setting_interface.py" line="198"/>
<source>Copyright</source>
<translation>版权所有</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="196"/>
<location filename="../../view/setting_interface.py" line="198"/>
<source>Version</source>
<translation>当前版本</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="104"/>
<location filename="../../view/setting_interface.py" line="106"/>
<source>Delete</source>
<translation>删除</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="104"/>
<location filename="../../view/setting_interface.py" line="106"/>
<source>Delete cache</source>
<translation>清除缓存</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="104"/>
<location filename="../../view/setting_interface.py" line="106"/>
<source>Delete all game resources (Apply it when game resources update)</source>
<translation>删除所有游戏资源的缓存(建议在游戏资源有更新时使用)</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="196"/>
<location filename="../../view/setting_interface.py" line="198"/>
<source>View GitHub</source>
<translation>查看 GitHub</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="311"/>
<location filename="../../view/setting_interface.py" line="314"/>
<source>Really?</source>
<translation>真的要删除吗?</translation>
</message>
Expand All @@ -2164,32 +2164,32 @@ If champions set by lane are not available, default settings will be used.</sour
这有可能会消耗更多的时间</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="319"/>
<location filename="../../view/setting_interface.py" line="322"/>
<source>Confirm delete</source>
<translation>确定删除</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="124"/>
<location filename="../../view/setting_interface.py" line="126"/>
<source>Mica effect</source>
<translation>云母效果</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="124"/>
<location filename="../../view/setting_interface.py" line="126"/>
<source>Apply semi transparent to windows and surfaces (only available on Win11)</source>
<translation>窗口和表面显示半透明(仅在 Win11 上可用)</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="114"/>
<location filename="../../view/setting_interface.py" line="116"/>
<source>Minimize to tray on close</source>
<translation>最小化到任务栏托盘</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="114"/>
<location filename="../../view/setting_interface.py" line="116"/>
<source>Minimize to system tray when clicking close</source>
<translation>点击右上角关闭时将程序最小化到托盘</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="293"/>
<location filename="../../view/setting_interface.py" line="296"/>
<source>Settings have been applied</source>
<translation>设置已应用</translation>
</message>
Expand All @@ -2204,12 +2204,12 @@ If champions set by lane are not available, default settings will be used.</sour
<translation>打开此选项后,当你在排位时,对局信息界面将只显示排位模式对局战绩</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="174"/>
<location filename="../../view/setting_interface.py" line="176"/>
<source>Check for updates</source>
<translation>检查更新</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="174"/>
<location filename="../../view/setting_interface.py" line="176"/>
<source>Automatically check for updates when software starts</source>
<translation>在 Seraphine 启动时自动检查更新</translation>
</message>
Expand All @@ -2229,12 +2229,12 @@ If champions set by lane are not available, default settings will be used.</sour
<translation type="obsolete">在游戏时通过避免渲染窗口以减少 CPU 使用</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="80"/>
<location filename="../../view/setting_interface.py" line="82"/>
<source>Log Level</source>
<translation>日志等级</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="80"/>
<location filename="../../view/setting_interface.py" line="82"/>
<source>The level of logging for Seraphine (take effect after restart)</source>
<translation>修改 Seraphine 记录日志的等级(重启后生效)</translation>
</message>
Expand All @@ -2244,12 +2244,12 @@ If champions set by lane are not available, default settings will be used.</sour
<translation type="obsolete">HTTP 代理</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="180"/>
<location filename="../../view/setting_interface.py" line="182"/>
<source>Using a proxy when connecting to GitHub</source>
<translation>连接 GitHub 时启用 HTTP 代理</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="172"/>
<location filename="../../view/setting_interface.py" line="174"/>
<source>Update</source>
<translation>软件更新</translation>
</message>
Expand All @@ -2269,17 +2269,17 @@ If champions set by lane are not available, default settings will be used.</sour
<translation>该值越大数据加载速度越快,但越可能引起客户端闪退</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="147"/>
<location filename="../../view/setting_interface.py" line="149"/>
<source>Game tabs color</source>
<translation>对局卡片颜色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="147"/>
<location filename="../../view/setting_interface.py" line="149"/>
<source>Change the color of game tabs</source>
<translation>改变对局卡片提示胜利 / 失败的颜色</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="180"/>
<location filename="../../view/setting_interface.py" line="182"/>
<source>HTTP proxy</source>
<translation>HTTP 代理</translation>
</message>
Expand All @@ -2289,25 +2289,25 @@ If champions set by lane are not available, default settings will be used.</sour
<translation>在对局详情界面中显示段位图标,启动该选项将影响加载该界面的速度</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="87"/>
<location filename="../../view/setting_interface.py" line="89"/>
<source>Open</source>
<translation>打开文件夹</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="87"/>
<location filename="../../view/setting_interface.py" line="89"/>
<source>Log file</source>
<translation>日志文件</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="87"/>
<location filename="../../view/setting_interface.py" line="89"/>
<source>Open log directory</source>
<translation>打开日志文件夹</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="311"/>
<location filename="../../view/setting_interface.py" line="314"/>
<source>Game resources will be downloaded again
when they are used by Seraphine, which will cost more time</source>
<translation>游戏资源将会在它们要被 Seraphine 使用时重新下载
<translation>游戏资源将会在它们要被 Seraphine 使用时重新下载
这有可能会消耗更多的时间</translation>
</message>
<message>
Expand All @@ -2320,6 +2320,11 @@ when they are used by Seraphine, which will cost more time</source>
<source>Set client path and order</source>
<translation>设置客户端路径以及顺序</translation>
</message>
<message>
<location filename="../../view/setting_interface.py" line="80"/>
<source>Log</source>
<translation>日志</translation>
</message>
</context>
<context>
<name>SpectateCard</name>
Expand Down
11 changes: 7 additions & 4 deletions app/view/setting_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,20 @@ def __init__(self, parent=None):
self.lolFolderCard.button.setStyleSheet(
"QPushButton {padding-left: 0; padding-right: 0;}")

self.logGroup = SettingCardGroup(self.tr("Log"), self.scrollWidget)

self.logLevelCard = ComboBoxSettingCard(
cfg.logLevel,
Icon.LOG,
self.tr('Log Level'),
self.tr('The level of logging for Seraphine (take effect after restart)'),
texts=["Debug", "Info", "Warning", "Error"],
parent=self.generalGroup)
parent=self.logGroup)
self.viewLogCard = PushSettingCard(
self.tr("Open"), Icon.DOCUMENT, self.tr("Log file"),
self.
tr("Open log directory"),
self.generalGroup)
self.logGroup)
self.viewLogCard.button.setFixedWidth(100)

# 这玩意左右 padding 大的离谱,手动给它改了
Expand Down Expand Up @@ -235,8 +237,8 @@ def __initLayout(self):
self.generalGroup.addSettingCard(self.deleteResourceCard)
self.generalGroup.addSettingCard(self.enableCloseToTray)
# self.generalGroup.addSettingCard(self.gameStartMinimizeCard) # 该功能不再支持, 隐藏它 -- By Hpero4
self.generalGroup.addSettingCard(self.logLevelCard)
self.generalGroup.addSettingCard(self.viewLogCard)
self.logGroup.addSettingCard(self.logLevelCard)
self.logGroup.addSettingCard(self.viewLogCard)

self.personalizationGroup.addSettingCard(self.micaCard)
self.personalizationGroup.addSettingCard(self.themeCard)
Expand All @@ -256,6 +258,7 @@ def __initLayout(self):
self.expandLayout.setContentsMargins(36, 0, 36, 0)
self.expandLayout.addWidget(self.functionGroup)
self.expandLayout.addWidget(self.generalGroup)
self.expandLayout.addWidget(self.logGroup)
self.expandLayout.addWidget(self.personalizationGroup)
self.expandLayout.addWidget(self.updateGroup)
self.expandLayout.addWidget(self.aboutGroup)
Expand Down

0 comments on commit a6cb3da

Please sign in to comment.