Skip to content

Commit

Permalink
Merge pull request #125 from abgox/v2
Browse files Browse the repository at this point in the history
fix: 更新版本 2.28.1
  • Loading branch information
abgox authored Jan 1, 2025
2 parents 57f407b + eb234e2 commit 0fe3017
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 146 deletions.
10 changes: 9 additions & 1 deletion src/v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

- 没有特别说明的版本都是修复问题

## 2.28.1

- 修复黑名单机制的版本迁移
- 对于旧版本更新到新版本,还是沿用黑名单机制,白名单机制需要重新设置
-`托盘菜单` 中的 `忽略更新` 修改 `设置更新检测`
- 修复虚拟机系统环境中,获取目录路径错乱的问题
- 修复设置状态自动切换时,意外写入的一个配置项 app_add

## 2.28.0

> [!warning]
>
> `v2.28.0` 会默认使用白名单机制
>
> 由于配置迁移的问题,旧版本更新后,需要根据情况手动调整。
> 由于配置迁移的问题,旧版本更新后,需要根据情况手动调整。(在 `v2.28.1` 中已修复)
>
> - 使用新的白名单机制: `托盘菜单` => `符号显示黑/白名单` => `设置「白」名单`
> - 继续使用黑名单机制: `托盘菜单` => `符号显示黑/白名单` => `使用「黑」名单`
Expand Down
Binary file modified src/v2/InputTip.JAB.JetBrains.exe
Binary file not shown.
14 changes: 12 additions & 2 deletions src/v2/InputTip.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ if (A_IsCompiled) {
checkIni() ; 检查配置文件

; 检查更新
ignoreUpdate := readIni("ignoreUpdate", 0)
try {
ignoreUpdate := IniRead("InputTip.ini", "Config-v2", "ignoreUpdate")
if (ignoreUpdate) {
checkUpdateDelay := readIni("checkUpdateDelay", 0)
} else {
checkUpdateDelay := readIni("checkUpdateDelay", 1440)
}
IniDelete("InputTip.ini", "Config-v2", "ignoreUpdate")
}

checkUpdateDelay := readIni("checkUpdateDelay", 1440)

#Include .\utils\var.ahk

checkUpdate()
checkUpdate(1)

checkUpdateDone()

Expand Down
248 changes: 136 additions & 112 deletions src/v2/utils/check-version.ahk

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/v2/utils/options.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ InstallMouseHook
CoordMode 'Mouse', 'Screen'
SetStoreCapsLockMode 0

;@AHK2Exe-SetVersion 2.28.0
currentVersion := "2.28.0"
;@AHK2Exe-SetVersion 2.28.1
currentVersion := "2.28.1"
64 changes: 40 additions & 24 deletions src/v2/utils/tray-menu.ahk
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
makeTrayMenu() {
A_TrayMenu.Delete()
A_TrayMenu.Add("忽略更新", fn_ignore_update)
fn_ignore_update(item, *) {
global ignoreUpdate := !ignoreUpdate
writeIni("ignoreUpdate", ignoreUpdate)
A_TrayMenu.ToggleCheck(item)
checkUpdate()
}
ignoreUpdate ? A_TrayMenu.Check("忽略更新") : 0
A_TrayMenu.Add("开机自启动", fn_startup)
fn_startup(item, *) {
global isStartUp
Expand Down Expand Up @@ -80,6 +72,29 @@ makeTrayMenu() {
if (isStartUp) {
A_TrayMenu.Check("开机自启动")
}
A_TrayMenu.Add("设置更新检测", fn_check_update)
fn_check_update(item, *) {
createGui(fn).Show()
fn(x, y, w, h) {
g := Gui("AlwaysOnTop", "InputTip - 设置更新检测")
g.SetFont(fz, "微软雅黑")
g.AddText("cRed", "- 单位是分钟,默认是 1440 分钟,即一天。`n- 如果不为 0,在系统启动后,会立即检测一次。`n- 如果为 0,则表示不自动检测更新。`n")
g.AddText("xs", "每隔多少分钟检测一次更新: ")
_c := g.AddEdit("yp Number vcheckUpdateDelay")
_c.Value := readIni("checkUpdateDelay", 1440)
_c.OnEvent("Change", fn_change_delay)
fn_change_delay(item, *) {
if (item.value != "") {
writeIni("checkUpdateDelay", item.value)
global checkUpdateDelay := item.value
if (checkUpdateDelay) {
checkUpdate()
}
}
}
return g
}
}
A_TrayMenu.Add("设置输入法模式", fn_input_mode)
fn_input_mode(item, *) {
createGui(fn).Show()
Expand Down Expand Up @@ -319,7 +334,7 @@ makeTrayMenu() {
bw := w - g.MarginX * 2

g.AddText("cRed", "「白」名单机制: 只有在白名单中的应用进程窗口会显示符号。`n「黑」名单机制: 只有不在黑名单中的应用进程窗口会显示符号。")
g.AddText(, "1. 建议使用白名单机制,这样可以精确控制哪些应用进程窗口需要显示符号。`n2. 使用白名单机制,可以减少大量特殊窗口的兼容性问题。`n3. 如果选择了白名单机制,请及时添加你需要使用的应用进程到白名单中")
g.AddText(, "1. 建议使用白名单机制,这样可以精确控制哪些应用进程窗口需要显示符号。`n2. 使用白名单机制,可以减少大量特殊窗口的兼容性问题。`n3. 如果选择了白名单机制,请及时添加你需要使用的应用进程到白名单中")
g.AddText(, "-------------------------------------------------------------------------------------")

g.AddText(, "选择显示符号的名单机制: ")
Expand Down Expand Up @@ -1291,16 +1306,17 @@ makeTrayMenu() {
_handle(to) {
g_1.Destroy()
gc.%"LV_" from%.Delete(RowNumber)
config := "app_" from
value := readIni(config, "")
res := ""
for v in StrSplit(value, ":") {
if (Trim(v) && v != RowText) {
res .= ":" v
if (from != "add") {
config := "app_" from
value := readIni(config, "")
res := ""
for v in StrSplit(value, ":") {
if (Trim(v) && v != RowText) {
res .= ":" v
}
}
writeIni(config, SubStr(res, 2))
}
writeIni(config, SubStr(res, 2))

gc.%"LV_" to%.Add(, RowText)
config := "app_" to
value := readIni(config, "")
Expand Down Expand Up @@ -1917,10 +1933,10 @@ getCursorDir() {
loopDir(path) {
Loop Files path "\*", "DR" {
if (A_LoopFileAttrib ~= "D") {
loopDir A_LoopFileShortPath
if (!hasChildDir(A_LoopFileShortPath)) {
if (!InStr(dirList, ":" A_LoopFileShortPath ":") && !InStr(defaultList, ":" A_LoopFileShortPath ":")) {
dirList .= A_LoopFileShortPath ":"
loopDir A_LoopFilePath
if (!hasChildDir(A_LoopFilePath)) {
if (!InStr(dirList, ":" A_LoopFilePath ":") && !InStr(defaultList, ":" A_LoopFilePath ":")) {
dirList .= A_LoopFilePath ":"
}
}
}
Expand All @@ -1942,9 +1958,9 @@ getPicDir() {
picList := ":"
defaultList := ":InputTipSymbol\default\Caps.png:InputTipSymbol\default\EN.png:InputTipSymbol\default\CN.png:"
Loop Files "InputTipSymbol\*", "R" {
if (A_LoopFileExt = "png" && A_LoopFileShortPath != "InputTipSymbol\default\offer.png") {
if (!InStr(picList, ":" A_LoopFileShortPath ":") && !InStr(defaultList, ":" A_LoopFileShortPath ":")) {
picList .= A_LoopFileShortPath ":"
if (A_LoopFileExt = "png" && A_LoopFilePath != "InputTipSymbol\default\offer.png") {
if (!InStr(picList, ":" A_LoopFilePath ":") && !InStr(defaultList, ":" A_LoopFilePath ":")) {
picList .= A_LoopFilePath ":"
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/v2/utils/var.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ statusModeEN := readIni("statusModeEN", "", "InputMethod")
conversionModeEN := readIni("conversionModeEN", "", "InputMethod")
checkTimeout := readIni("checkTimeout", 500, "InputMethod")


; 是否使用 Shift 键切换输入法状态
useShift := readIni("useShift", 1)

; 是否启用白名单
useWhiteList := readIni("useWhiteList", 1)
; 是否使用白名单机制
useWhiteList := readIni("useWhiteList", 0)

; 是否改变鼠标样式
changeCursor := readIni("changeCursor", 0)
Expand Down
5 changes: 4 additions & 1 deletion src/v2/utils/verify-file.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ checkIni() {
writeIni("JetBrains_list", "WebStorm64.exe:DataGrip64.exe:PhpStorm64.exe:PyCharm64.exe:Rider64.exe:CLion64.exe:RubyMine64.exe:GoLand64.exe:Idea64.exe:DataSpell64.exe")
}
} else {
; 是否使用白名单机制,如果是第一次使用,就直接使用白名单机制
useWhiteList := readIni("useWhiteList", 1)

isContinue := true
createGui(fn1).Show()
fn1(x, y, w, h) {
Expand Down Expand Up @@ -125,7 +128,7 @@ checkIni() {

g.AddText("cRed", "对于符号显示,InputTip 现在默认使用白名单机制。")
g.AddText("cRed", "白名单机制: 只有在白名单中的应用进程窗口会显示符号。")
g.AddText(, "建议立即添加应用进程到白名单中")
g.AddText(, "建议立即添加应用进程到白名单中")
g.AddButton("w" bw, "【是】现在就添加应用进程").OnEvent("Click", add_white_list)
g.AddButton("w" bw, "【否】不了,等一下再添加").OnEvent("Click", no)
add_white_list(*) {
Expand Down
2 changes: 1 addition & 1 deletion src/v2/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.28.0
2.28.1

0 comments on commit 0fe3017

Please sign in to comment.