Skip to content

Commit d6a7a3c

Browse files
committed
·subs_list 更新
[ * ] 把字幕文件尽可能改成 utf-8 编码 ·sub_db 更新 [Fix] 修正「打开本地文件夹」的 bug [ ! ] 修改一些类名 [ * ] 支持简繁字自动转换进行查找
1 parent dbf6a9f commit d6a7a3c

File tree

14,615 files changed

+118907
-118930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

14,615 files changed

+118907
-118930
lines changed
29.1 KB
Binary file not shown.

Subtitles DataBase/Files/changelog.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
v0.17 (svn367) - 2022.1.8
1+
v0.18 (svn378) - 2022.6.6
2+
[Fix] 修正「打开本地文件夹」的 bug
3+
[ ! ] 修改一些类名
4+
[ * ] 支持简繁字自动转换进行查找
5+
6+
v0.17 (svn367) - 2022.1.8
27
[ ! ] vs2019 -> vs2022
38

49
v0.16 (svn352) - 2021.8.29

Subtitles DataBase/sub_db.exe

512 Bytes
Binary file not shown.
Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using Microsoft.WindowsAPICodePack.Taskbar;
7-
using System.Runtime.InteropServices;
8-
using System.Windows.Forms;
9-
10-
namespace sub_db
11-
{
12-
internal class c_Common_
13-
{
14-
internal const string m_k_PROGRAM_NAME = "Subtitles Database";
15-
internal const string m_k_VERSION = "v0.17";
16-
17-
internal const int m_k_MAX_PROGRESS_VALUE = 10000;
18-
19-
// 热键 ID
20-
internal enum e_HotKeyID
21-
{
22-
OpenDir = 1, // 打开本地文件夹
23-
OpenURL, // 打开远程链接
24-
Search, // 查找
25-
UpdateDB, // 更新数据库
26-
27-
MAX,
28-
};
29-
30-
[Flags()]
31-
public enum e_KeyModifiers
32-
{
33-
None = 0,
34-
Alt = 1,
35-
Ctrl = 2,
36-
Shift = 4,
37-
WindowsKey = 8
38-
};
39-
40-
[DllImport("user32.dll", SetLastError = true)]
41-
public static extern bool RegisterHotKey(IntPtr hWnd, int id, e_KeyModifiers fsModifiers, Keys vk);
42-
43-
[DllImport("user32.dll", SetLastError = true)]
44-
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
45-
46-
/*==============================================================
47-
* 设置任务栏进度
48-
*==============================================================*/
49-
internal static void SetProgressValue(int currentValue)
50-
{
51-
frm_Mainform.m_s_mainform.m_UpdateDatabase.progressBar_Update.Value = currentValue;
52-
53-
if(Environment.OSVersion.Version.Major >= 6)
54-
{
55-
if(TaskbarManager.IsPlatformSupported)
56-
TaskbarManager.Instance.SetProgressValue(currentValue, m_k_MAX_PROGRESS_VALUE);
57-
}
58-
}
59-
60-
/*==============================================================
61-
* 注册热键
62-
*==============================================================*/
63-
internal static void RegHotKey(IntPtr hwnd, int hotKeyId, e_KeyModifiers keyModifiers, Keys key)
64-
{
65-
if(!RegisterHotKey(hwnd, hotKeyId, keyModifiers, key))
66-
{
67-
int errorCode = Marshal.GetLastWin32Error();
68-
69-
string err_txt = (errorCode == 1409) ? "热键被占用!" : $"注册热键失败!({errorCode})";
70-
71-
frm_Mainform.m_s_mainform.toolStripStatusLabel_ErrorMsg.Text = err_txt;
72-
frm_Mainform.m_s_mainform.toolStripStatusLabel_ErrorMsg.Visible = true;
73-
}
74-
}
75-
76-
/*==============================================================
77-
* 注销热键
78-
*==============================================================*/
79-
internal static void UnRegHotKey(IntPtr hwnd, int hotKeyId)
80-
{
81-
UnregisterHotKey(hwnd, hotKeyId);
82-
}
83-
};
84-
} // namespace sub_db
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Microsoft.WindowsAPICodePack.Taskbar;
7+
using System.Runtime.InteropServices;
8+
using System.Windows.Forms;
9+
10+
namespace sub_db
11+
{
12+
internal class COMMON
13+
{
14+
internal const string m_k_PROGRAM_NAME = "Subtitles Database";
15+
internal const string m_k_VERSION = "v0.18";
16+
17+
internal const int m_k_MAX_PROGRESS_VALUE = 10000;
18+
19+
// 热键 ID
20+
internal enum e_HotKeyID
21+
{
22+
OpenDir = 1, // 打开本地文件夹
23+
OpenURL, // 打开远程链接
24+
Search, // 查找
25+
UpdateDB, // 更新数据库
26+
27+
MAX,
28+
};
29+
30+
[Flags()]
31+
public enum e_KeyModifiers
32+
{
33+
None = 0,
34+
Alt = 1,
35+
Ctrl = 2,
36+
Shift = 4,
37+
WindowsKey = 8
38+
};
39+
40+
[DllImport("user32.dll", SetLastError = true)]
41+
public static extern bool RegisterHotKey(IntPtr hWnd, int id, e_KeyModifiers fsModifiers, Keys vk);
42+
43+
[DllImport("user32.dll", SetLastError = true)]
44+
public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
45+
46+
/*==============================================================
47+
* 设置任务栏进度
48+
*==============================================================*/
49+
internal static void SetProgressValue(int currentValue)
50+
{
51+
frm_Mainform.m_s_mainform.m_UpdateDatabase.progressBar_Update.Value = currentValue;
52+
53+
if(Environment.OSVersion.Version.Major >= 6)
54+
{
55+
if(TaskbarManager.IsPlatformSupported)
56+
TaskbarManager.Instance.SetProgressValue(currentValue, m_k_MAX_PROGRESS_VALUE);
57+
}
58+
}
59+
60+
/*==============================================================
61+
* 注册热键
62+
*==============================================================*/
63+
internal static void RegHotKey(IntPtr hwnd, int hotKeyId, e_KeyModifiers keyModifiers, Keys key)
64+
{
65+
if(!RegisterHotKey(hwnd, hotKeyId, keyModifiers, key))
66+
{
67+
int errorCode = Marshal.GetLastWin32Error();
68+
69+
string err_txt = (errorCode == 1409) ? "热键被占用!" : $"注册热键失败!({errorCode})";
70+
71+
frm_Mainform.m_s_mainform.toolStripStatusLabel_ErrorMsg.Text = err_txt;
72+
frm_Mainform.m_s_mainform.toolStripStatusLabel_ErrorMsg.Visible = true;
73+
}
74+
}
75+
76+
/*==============================================================
77+
* 注销热键
78+
*==============================================================*/
79+
internal static void UnRegHotKey(IntPtr hwnd, int hotKeyId)
80+
{
81+
UnregisterHotKey(hwnd, hotKeyId);
82+
}
83+
};
84+
} // namespace sub_db

0 commit comments

Comments
 (0)