Skip to content

Commit d780a30

Browse files
committed
bump version
1 parent 4576aa2 commit d780a30

8 files changed

Lines changed: 59 additions & 858 deletions

File tree

Cargo.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "SC_Starter"
3-
version = "2.10.2"
3+
version = "2.10.3"
44
# 记得更新 types.rs 中 res的版本
5-
edition = "2021"
5+
edition = "2024"
66
build = "build.rs"
77

88
[profile.release]
@@ -17,15 +17,16 @@ codegen-units = 1
1717
vergen = { version = "9.1.0", features = ["build"] }
1818

1919
[target.'cfg(windows)'.build-dependencies]
20-
tauri-winres = "0.3.5"
20+
tauri-winres = "0.3.6"
2121

2222

2323
[dependencies]
24-
directories = "6.0.0"
25-
single-instance = "0.3.3"
26-
windows-hotkeys = "0.2.1"
27-
toml = "1.1.0"
28-
toml_edit = "0.25.8"
29-
tray-icon = "0.21.3"
30-
tao = "0.35.0"
31-
mslnk = "0.1.8"
24+
win_msgbox_timeout = "1.2.1"
25+
directories = "6.0.0"
26+
single-instance = "0.3.3"
27+
windows-hotkeys = "0.2.1"
28+
toml = "1.1.2"
29+
toml_edit = "0.25.11"
30+
tray-icon = "0.24.0"
31+
tao = "0.35.2"
32+
mslnk = "0.1.8"

src/config.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
//! - 验证配置有效性
77
//! - 转换配置格式
88
9-
use crate::{
10-
msgbox::{self, error_msgbox},
11-
types::*,
12-
};
9+
use crate::types::*;
1310
use std::{collections::HashMap, fs, path::PathBuf};
1411
use toml::Value;
12+
use win_msgbox_timeout::error_msgbox;
1513

1614
/// 读取并解析TOML配置文件
1715
///
@@ -154,7 +152,7 @@ fn get_kvs_from_config(
154152
// 在配置处理后通知用户错误
155153
if !errors.is_empty() {
156154
let error_message = format!("配置文件中存在以下问题:\n{}", errors.join("\n"));
157-
msgbox::error_msgbox(error_message, "Configuration Error", 0);
155+
error_msgbox(error_message, "Configuration Error", 0);
158156
}
159157
user_settings
160158
}

src/file_ops.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66
//! - 执行外部程序
77
//! - 监控文件状态并自动恢复
88
9-
use crate::{
10-
msgbox::*,
11-
types::{FileExist, PathInfos, RES_HASH_SHA1},
12-
};
9+
use crate::types::{FileExist, PathInfos, RES_HASH_SHA1};
1310
use std::{
1411
collections::HashMap,
1512
fs,
1613
os::windows::process::CommandExt,
1714
path::Path,
1815
process::Command,
1916
sync::{
17+
Arc,
2018
atomic::{AtomicBool, Ordering},
21-
mpsc, Arc,
19+
mpsc,
2220
},
2321
thread,
2422
};
23+
use win_msgbox_timeout::{error_msgbox, info_msgbox, notify_msgbox_standalone, wait_notifications};
2524

2625
/// 检查所需文件是否存在及其状态
2726
///

src/hotkeys.rs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
//! - 管理快捷键线程
77
//! - 管理启动应用程序的进程状态
88
9+
use crate::file_ops::{execute_process, open_config};
910
use crate::types::*;
1011
use crate::window_handle::{is_process_running, set_window_topmost_by_pid};
11-
use crate::{file_ops::{execute_process, open_config}, msgbox::error_msgbox};
1212
use std::{
1313
sync::{
14+
Arc, Mutex,
1415
atomic::{AtomicBool, Ordering},
15-
mpsc, Arc, Mutex,
16+
mpsc,
1617
},
1718
thread,
1819
{path::PathBuf, thread::JoinHandle},
1920
};
2021
use tao::event_loop::EventLoopProxy;
21-
use windows_hotkeys::{singlethreaded::HotkeyManager, HotkeyManagerImpl};
22+
use win_msgbox_timeout::error_msgbox;
23+
use windows_hotkeys::{HotkeyManagerImpl, singlethreaded::HotkeyManager};
2224

2325
/// 设置全局快捷键并返回事件发送器
2426
///
@@ -65,7 +67,12 @@ pub fn set_hotkeys(
6567
key_groups.get("screen_capture").unwrap().vkey,
6668
&key_groups.get("screen_capture").unwrap().mod_keys,
6769
move || {
68-
let args = crate::file_ops::build_capture_args(comp_val, scale_val, &save_path_clone, false);
70+
let args = crate::file_ops::build_capture_args(
71+
comp_val,
72+
scale_val,
73+
&save_path_clone,
74+
false,
75+
);
6976
execute_process(&exe_path_clone, args, gui_clone.clone(), notification, lang);
7077
},
7178
);
@@ -175,8 +182,19 @@ pub fn set_hotkeys(
175182
key_groups.get("screen_capture_long").unwrap().vkey,
176183
&key_groups.get("screen_capture_long").unwrap().mod_keys,
177184
move || {
178-
let args = crate::file_ops::build_capture_args(comp_val2, scale_val2, &save_path_clone, true);
179-
execute_process(&exe_path_clone, args, gui_clone.clone(), notification2, lang);
185+
let args = crate::file_ops::build_capture_args(
186+
comp_val2,
187+
scale_val2,
188+
&save_path_clone,
189+
true,
190+
);
191+
execute_process(
192+
&exe_path_clone,
193+
args,
194+
gui_clone.clone(),
195+
notification2,
196+
lang,
197+
);
180198
},
181199
);
182200
if hotkey_scl.is_err() {

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
mod config;
1313
mod file_ops;
1414
mod hotkeys;
15-
mod msgbox;
1615
mod tray;
1716
mod types;
1817
mod window_handle;
@@ -27,12 +26,13 @@ use single_instance::SingleInstance;
2726
use std::{
2827
path::PathBuf,
2928
sync::{
30-
atomic::{AtomicBool, Ordering},
3129
Arc, Mutex,
30+
atomic::{AtomicBool, Ordering},
3231
},
3332
};
3433
use tao::event_loop::EventLoop;
3534
use tray_icon::MouseButton;
35+
use win_msgbox_timeout::error_msgbox;
3636

3737
/// 随机生成的GUID,用于程序单例检测
3838
/// 防止程序多开造成快捷键冲突
@@ -52,7 +52,7 @@ fn main() {
5252
let instance = match SingleInstance::new(PROCESS_ID) {
5353
Ok(inst) => Box::new(inst),
5454
Err(e) => {
55-
msgbox::error_msgbox(
55+
error_msgbox(
5656
format!("Failed to create single instance lock: {}", e),
5757
"Fatal Error",
5858
0,
@@ -62,7 +62,7 @@ fn main() {
6262
};
6363
if !instance.is_single() {
6464
// 检测到已有实例在运行时,显示提示并退出
65-
msgbox::error_msgbox("Avoid Multiple.", "", 2);
65+
error_msgbox("Avoid Multiple.", "", 2);
6666
panic!("Multiple!")
6767
};
6868

@@ -81,7 +81,7 @@ fn main() {
8181
let binding = match directories::BaseDirs::new() {
8282
Some(bd) => bd,
8383
None => {
84-
msgbox::error_msgbox(
84+
error_msgbox(
8585
"Failed to determine base directories (LOCALAPPDATA missing?).",
8686
"Fatal Error",
8787
0,

0 commit comments

Comments
 (0)