Skip to content

Commit

Permalink
关于选项卡与日志中显示测试版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Jun 7, 2024
1 parent 96b93e9 commit e0fc862
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Config(QConfig):


YEAR = 2023
AUTHOR = "Zaphkiel"
AUTHOR = "Zzaphkiel"
VERSION = "0.12.2"
BETA = "0.13.0-beta2"
FEEDBACK_URL = "https://github.com/Zzaphkiel/Seraphine/issues?q=is%3Aissue"
Expand Down
4 changes: 2 additions & 2 deletions app/components/message_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
CheckBox, setCustomStyleSheet, ProgressBar,
PrimaryPushButton, ComboBox)

from app.common.config import VERSION, cfg, LOCAL_PATH
from app.common.config import VERSION, cfg, LOCAL_PATH, BETA
from app.common.util import (github, getLolClientPidSlowly, getPortTokenServerByPid,
getTasklistPath, getLolClientPids, getLolClientPidsSlowly)
from app.common.signals import signalBus
Expand Down Expand Up @@ -50,7 +50,7 @@ def __initWidget(self):
self.titleLabel.setText(self.tr('Update detected'))
self.titleLabel.setContentsMargins(5, 0, 5, 0)

self.content.setText(self.tr("current: v") + VERSION + self.tr(", ")
self.content.setText(self.tr("current: v") + BETA or VERSION + self.tr(", ")
+ self.tr("new: v") + self.info.get("tag_name")[1:])
self.content.setContentsMargins(8, 0, 5, 0)

Expand Down
4 changes: 2 additions & 2 deletions app/view/auxiliary_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ def setConfigFileReadOnlyEnabled(self, enable):
mode = 0o444 if enable else 0o666
os.chmod(path, mode)

current_mode = stat.S_IMODE(os.lstat(path).st_mode)
if current_mode != mode:
currentMode = stat.S_IMODE(os.lstat(path).st_mode)
if currentMode != mode:
return False

return True
Expand Down
2 changes: 1 addition & 1 deletion app/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MainWindow(FluentWindow):
def __init__(self):
super().__init__()

logger.critical(f"Seraphine started, version: {VERSION}", TAG)
logger.critical(f"Seraphine started, version: {BETA or VERSION}", TAG)
self.__initConfig()

self.__initWindow()
Expand Down
29 changes: 13 additions & 16 deletions app/view/setting_interface.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# coding:utf-8
import os

from ..common.qfluentwidgets import (
SettingCardGroup, SwitchSettingCard, ComboBoxSettingCard, PushSettingCard,
ExpandLayout, CustomColorSettingCard, InfoBar, setTheme, setThemeColor,
SmoothScrollArea, PrimaryPushSettingCard,
HyperlinkCard, TeachingTip, TeachingTipTailPosition, TeachingTipView,
ExpandGroupSettingCard, ConfigItem, setCustomStyleSheet, SwitchButton,
qconfig, LineEdit, PushButton, IndicatorPosition, FluentIcon)
from app.common.qfluentwidgets import (SettingCardGroup, SwitchSettingCard, ComboBoxSettingCard,
PushSettingCard, ExpandLayout, CustomColorSettingCard, InfoBar,
setTheme, setThemeColor, PrimaryPushSettingCard, HyperlinkCard,
TeachingTip, TeachingTipTailPosition, TeachingTipView, PushButton)
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QWidget, QLabel, QFileDialog, QHBoxLayout
from PyQt5.QtWidgets import QWidget, QLabel, QFileDialog

from ..common.icons import Icon
from ..common.config import (
cfg, YEAR, AUTHOR, VERSION, FEEDBACK_URL, GITHUB_URL, isWin11)
from ..common.style_sheet import StyleSheet
from ..components.seraphine_interface import SeraphineInterface
from ..components.setting_cards import (LineEditSettingCard, GameTabColorSettingCard,
LooseSwitchSettingCard, ProxySettingCard)
from app.common.icons import Icon
from app.common.config import (cfg, YEAR, AUTHOR, VERSION, FEEDBACK_URL, GITHUB_URL, isWin11,
BETA)
from app.common.style_sheet import StyleSheet
from app.components.seraphine_interface import SeraphineInterface
from app.components.setting_cards import (LineEditSettingCard, GameTabColorSettingCard,
LooseSwitchSettingCard, ProxySettingCard)


class SettingInterface(SeraphineInterface):
Expand Down Expand Up @@ -200,7 +197,7 @@ def __init__(self, parent=None):
self.aboutCard = HyperlinkCard(
GITHUB_URL, self.tr("View GitHub"), Icon.INFO, self.tr('About'),
self.tr('Copyright') + ' © ' + f"{YEAR}, {AUTHOR}. " +
self.tr('Version') + f" {VERSION}", self.aboutGroup)
self.tr('Version') + f" {BETA or VERSION}", self.aboutGroup)
self.aboutCard.linkButton.setIcon(Icon.GITHUB)

self.__initWidget()
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding:utf-8
from app.view.main_window import MainWindow
from app.common.config import cfg, VERSION
from app.common.config import cfg, VERSION, BETA
import sys
import os

Expand All @@ -16,7 +16,7 @@
def main():
args = sys.argv
if len(args) == 2 and args[1] in ['--version', '-v']:
print(VERSION)
print(BETA or VERSION)
return

if cfg.get(cfg.dpiScale) == "Auto":
Expand Down

0 comments on commit e0fc862

Please sign in to comment.