Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions TeXmacs/misc/themes/liii-night.css
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,68 @@ QWidget#auxiliary_container {
background-color: rgba(255, 255, 255, 0.2);
}

/****************************************************************************
* 版本更新提示条样式
****************************************************************************/
#updateNotificationBar {
background-color: #0d2b4a;
border: 1px solid #1a4a7a;
border-left: none;
border-right: none;
border-top: none;
}

#updateNotificationMessage {
color: #64b5f6;
font-size: 13px;
font-weight: 500;
}

#updateNotificationUpdateButton {
background-color: #1976d2;
color: white;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 12px;
font-weight: 500;
}

#updateNotificationUpdateButton:hover {
background-color: #1565c0;
}

#updateNotificationSnoozeButton {
background-color: transparent;
border: 1px solid #4a7a9a;
color: #64b5f6;
padding: 4px 12px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
}

#updateNotificationSnoozeButton:hover {
background-color: #1a3a5a;
}

#updateNotificationCloseButton {
background-color: transparent;
color: #64b5f6;
border: none;
font-size: 16px;
font-weight: bold;
border-radius: 4px;
padding: 0;
margin: 0;
min-width: 24px;
min-height: 24px;
}

#updateNotificationCloseButton:hover {
background-color: rgba(100, 181, 246, 0.1);
}

/****************************************************************************
* 文档编辑区域样式
****************************************************************************/
Expand Down
62 changes: 62 additions & 0 deletions TeXmacs/misc/themes/liii.css
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,68 @@ QWidget#auxiliary_container {
background-color: rgba(0, 0, 0, 0.2);
}

/****************************************************************************
* 版本更新提示条样式
****************************************************************************/
#updateNotificationBar {
background-color: #e3f2fd;
border: 1px solid #bbdefb;
border-left: none;
border-right: none;
border-top: none;
}

#updateNotificationMessage {
color: #1565c0;
font-size: 13px;
font-weight: 500;
}

#updateNotificationUpdateButton {
background-color: #1976d2;
color: white;
border: none;
border-radius: 4px;
padding: 4px 12px;
font-size: 12px;
font-weight: 500;
}

#updateNotificationUpdateButton:hover {
background-color: #1565c0;
}

#updateNotificationSnoozeButton {
background-color: transparent;
border: 1px solid #90caf9;
color: #1976d2;
padding: 4px 12px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
}

#updateNotificationSnoozeButton:hover {
background-color: #e3f2fd;
}

#updateNotificationCloseButton {
background-color: transparent;
color: #1565c0;
border: none;
font-size: 16px;
font-weight: bold;
border-radius: 4px;
padding: 0;
margin: 0;
min-width: 24px;
min-height: 24px;
}

#updateNotificationCloseButton:hover {
background-color: rgba(21, 101, 192, 0.1);
}

/*文本工具栏窗口样式*/
QWidget#text_toolbar {
background: #ffffff;
Expand Down
6 changes: 5 additions & 1 deletion TeXmacs/plugins/lang/dic/en_US/zh_CN.scm
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@
("current graphical mode" "当前绘图模式")
("current user version" "当前用户版本")
("current version" "当前版本")
("current" "当前")
("cursor" "光标")
("cursors" "游标")
("curve intersections" "曲线交点")
Expand Down Expand Up @@ -1493,6 +1494,7 @@
("new row" "")
("new table" "")
("new version" "新版")
("New version available" "发现新版本")
("new window" "新窗口")
("new" "新建")
("newer version" "新版")
Expand Down Expand Up @@ -1887,6 +1889,7 @@
("Renew" "续费")
("Renew Early" "提前续费")
("Renew Now" "续费会员")
("Remind later" "稍后提醒")
("rendering" "渲染")
("renumber this page" "修改当前页码")
("repeat object" "")
Expand Down Expand Up @@ -2397,6 +2400,7 @@
("up" "")
("up" "上")
("Update buffer" "更新缓冲区")
("Update now" "立即更新")
("update from web" "")
("update image links" "")
("update this buffer" "更新此文档")
Expand Down Expand Up @@ -2559,4 +2563,4 @@
("zoom/unzoom" "放大/缩小")
("You are currently in guest mode, login to enable AI, MathOCR,and other features" "您当前处于访客状态,登录激活AI和公式识别等功能")
("Login Now" "立即登录")
("Use extensible brackets" "使用可伸缩括号")
("Use extensible brackets" "使用可伸缩括号")
85 changes: 85 additions & 0 deletions TeXmacs/progs/utils/misc/version-update.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : version-update.scm
;; DESCRIPTION : 版本更新检查(开发者配置)
;; COPYRIGHT : (C) 2026 Mogan STEM authors
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(texmacs-module (utils misc version-update))

;; ============================================
;; 开发者配置区(修改此处调整行为)
;; ============================================
(define SNOOZE-DAYS 3) ; 稍后提醒间隔,单位:天

;; Mock 远程版本号(用于测试,设为 #f 则使用真实网络请求)
;; 示例:(define MOCK-REMOTE-VERSION "2026.3.0")
(define MOCK-REMOTE-VERSION #f)

;; ============================================
;; 内部实现
;; ============================================

;; 获取 Mock 远程版本号(优先从持久化存储读取)
(tm-define (get-mock-remote-version)
(:secure #t)
(let ((stored (persistent-get (get-texmacs-home-path) MOCK-VERSION-KEY)))
(if (and stored (!= stored ""))
stored
MOCK-REMOTE-VERSION)))

;; 设置 Mock 远程版本号(同时保存到持久化存储)
(tm-define (set-mock-remote-version! version)
(:secure #t)
(set! MOCK-REMOTE-VERSION version)
(persistent-set (get-texmacs-home-path) MOCK-VERSION-KEY version))

;; 清除 Mock 远程版本号(恢复默认 #f)
(tm-define (clear-mock-remote-version)
(:secure #t)
(set! MOCK-REMOTE-VERSION #f)
(persistent-remove (get-texmacs-home-path) MOCK-VERSION-KEY))

(define LAST-CHECK-KEY "version_last_check")
(define SNOOZE-UNTIL-KEY "version_snooze_until")
(define MOCK-VERSION-KEY "version_mock_remote")

(define (current-timestamp)
(current-time))

;; 检查是否应该检查更新(考虑稍后提醒时间)
(tm-define (should-check-version-update?)
(:secure #t)
(let* ((now (current-timestamp))
(snooze-until (or (persistent-get (get-texmacs-home-path) SNOOZE-UNTIL-KEY) "0"))
(snooze-time (if (== snooze-until "") 0 (string->number snooze-until))))
(>= now snooze-time)))

;; 强制清除所有记录(用于测试)
(tm-define (clear-version-update-history)
(:secure #t)
(persistent-remove (get-texmacs-home-path) SNOOZE-UNTIL-KEY)
(clear-mock-remote-version))

;; 稍后提醒(使用默认间隔)
(tm-define (snooze-version-update)
(:secure #t)
(let* ((now (current-timestamp))
(future (+ now (* SNOOZE-DAYS 24 3600))))
(persistent-set (get-texmacs-home-path) SNOOZE-UNTIL-KEY
(number->string future))))

;; 获取下载页URL
;; 社区版跳转到 mogan.app,商业版跳转到 liiistem.cn/com
(tm-define (get-update-download-url)
(:secure #t)
(if (community-stem?)
;; 社区版官网
(if (== (get-output-language) "chinese")
"https://mogan.app/zh/"
"https://mogan.app/en/")
;; 商业版官网
(if (== (get-output-language) "chinese")
"https://liiistem.cn/install.html"
"https://liiistem.com/install.html")))
Loading
Loading