2025-08-30 17:22:52 +08:00
|
|
|
use anyhow::Result;
|
2025-08-29 23:51:09 +08:00
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
|
config::Config,
|
2025-09-17 22:59:02 +08:00
|
|
|
core::{
|
2025-10-11 21:21:01 +08:00
|
|
|
CoreManager, Timer, handle, hotkey::Hotkey, service::SERVICE_MANAGER, sysopt, tray::Tray,
|
2025-09-17 22:59:02 +08:00
|
|
|
},
|
2025-08-29 23:51:09 +08:00
|
|
|
logging, logging_error,
|
2025-09-18 10:22:43 +08:00
|
|
|
module::lightweight::{auto_lightweight_mode_init, run_once_auto_lightweight},
|
2025-08-29 23:51:09 +08:00
|
|
|
process::AsyncHandler,
|
2025-09-18 10:22:43 +08:00
|
|
|
utils::{init, logging::Type, server, window_manager::WindowManager},
|
2025-08-29 23:51:09 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pub mod dns;
|
|
|
|
|
pub mod scheme;
|
|
|
|
|
pub mod ui;
|
|
|
|
|
pub mod window;
|
|
|
|
|
pub mod window_script;
|
|
|
|
|
|
2025-10-08 12:32:40 +08:00
|
|
|
pub fn resolve_setup_handle() {
|
|
|
|
|
init_handle();
|
2025-09-02 23:10:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn resolve_setup_sync() {
|
|
|
|
|
AsyncHandler::spawn(|| async {
|
2025-09-02 23:48:27 +08:00
|
|
|
AsyncHandler::spawn_blocking(init_scheme);
|
|
|
|
|
AsyncHandler::spawn_blocking(init_embed_server);
|
2025-09-02 23:10:02 +08:00
|
|
|
});
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn resolve_setup_async() {
|
|
|
|
|
let start_time = std::time::Instant::now();
|
|
|
|
|
logging!(
|
|
|
|
|
info,
|
|
|
|
|
Type::Setup,
|
|
|
|
|
"开始执行异步设置任务... 线程ID: {:?}",
|
|
|
|
|
std::thread::current().id()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
AsyncHandler::spawn(|| async {
|
2025-09-20 00:04:46 +08:00
|
|
|
#[cfg(not(feature = "tauri-dev"))]
|
|
|
|
|
resolve_setup_logger().await;
|
2025-09-20 23:24:43 +08:00
|
|
|
logging!(
|
|
|
|
|
info,
|
|
|
|
|
Type::ClashVergeRev,
|
|
|
|
|
"Version: {}",
|
|
|
|
|
env!("CARGO_PKG_VERSION")
|
|
|
|
|
);
|
2025-10-11 21:21:01 +08:00
|
|
|
init_service_manager().await;
|
2025-09-17 22:59:02 +08:00
|
|
|
|
2025-09-02 23:10:02 +08:00
|
|
|
futures::join!(
|
|
|
|
|
init_work_config(),
|
|
|
|
|
init_resources(),
|
|
|
|
|
init_startup_script(),
|
|
|
|
|
init_hotkey(),
|
|
|
|
|
);
|
2025-08-29 23:51:09 +08:00
|
|
|
|
|
|
|
|
init_timer().await;
|
2025-09-18 10:22:43 +08:00
|
|
|
init_once_auto_lightweight().await;
|
2025-08-29 23:51:09 +08:00
|
|
|
init_auto_lightweight_mode().await;
|
|
|
|
|
|
2025-10-06 16:51:47 +08:00
|
|
|
// 确保配置完全初始化后再启动核心管理器
|
2025-08-29 23:51:09 +08:00
|
|
|
init_verge_config().await;
|
2025-10-06 16:51:47 +08:00
|
|
|
|
|
|
|
|
// 添加配置验证,确保运行时配置已正确生成
|
2025-10-07 07:31:35 +08:00
|
|
|
Config::verify_config_initialization().await;
|
2025-10-06 16:51:47 +08:00
|
|
|
|
2025-08-29 23:51:09 +08:00
|
|
|
init_core_manager().await;
|
|
|
|
|
|
2025-09-02 23:10:02 +08:00
|
|
|
init_system_proxy().await;
|
2025-08-29 23:51:09 +08:00
|
|
|
AsyncHandler::spawn_blocking(|| {
|
|
|
|
|
init_system_proxy_guard();
|
|
|
|
|
});
|
|
|
|
|
|
2025-09-02 23:10:02 +08:00
|
|
|
let tray_and_refresh = async {
|
|
|
|
|
init_tray().await;
|
|
|
|
|
refresh_tray_menu().await;
|
|
|
|
|
};
|
|
|
|
|
futures::join!(init_window(), tray_and_refresh,);
|
2025-08-29 23:51:09 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let elapsed = start_time.elapsed();
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "异步设置任务完成,耗时: {:?}", elapsed);
|
2025-08-29 23:51:09 +08:00
|
|
|
|
|
|
|
|
if elapsed.as_secs() > 10 {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(warn, Type::Setup, "异步设置任务耗时较长({:?})", elapsed);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 其它辅助函数不变
|
2025-10-07 07:32:01 +08:00
|
|
|
pub async fn resolve_reset_async() -> Result<(), anyhow::Error> {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Tray, "Resetting system proxy");
|
2025-10-07 07:32:01 +08:00
|
|
|
sysopt::Sysopt::global().reset_sysproxy().await?;
|
2025-08-29 23:51:09 +08:00
|
|
|
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Core, "Stopping core service");
|
2025-10-07 07:32:01 +08:00
|
|
|
CoreManager::global().stop_core().await?;
|
2025-08-29 23:51:09 +08:00
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
|
{
|
|
|
|
|
use dns::restore_public_dns;
|
|
|
|
|
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::System, "Restoring system DNS settings");
|
2025-08-29 23:51:09 +08:00
|
|
|
restore_public_dns().await;
|
|
|
|
|
}
|
2025-10-07 07:32:01 +08:00
|
|
|
|
|
|
|
|
Ok(())
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-08 12:32:40 +08:00
|
|
|
pub fn init_handle() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing app handle...");
|
2025-10-08 12:32:40 +08:00
|
|
|
handle::Handle::global().init();
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) fn init_scheme() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing custom URL scheme");
|
|
|
|
|
logging_error!(Type::Setup, init::init_scheme());
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-20 00:04:46 +08:00
|
|
|
#[cfg(not(feature = "tauri-dev"))]
|
|
|
|
|
pub(super) async fn resolve_setup_logger() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing global logger...");
|
|
|
|
|
logging_error!(Type::Setup, init::init_logger().await);
|
2025-09-20 00:04:46 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-30 17:22:52 +08:00
|
|
|
pub async fn resolve_scheme(param: String) -> Result<()> {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Resolving scheme for param: {}", param);
|
|
|
|
|
logging_error!(Type::Setup, scheme::resolve_scheme(param).await);
|
2025-08-30 17:22:52 +08:00
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-29 23:51:09 +08:00
|
|
|
pub(super) fn init_embed_server() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing embedded server...");
|
2025-08-29 23:51:09 +08:00
|
|
|
server::embed_server();
|
|
|
|
|
}
|
|
|
|
|
pub(super) async fn init_resources() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing resources...");
|
|
|
|
|
logging_error!(Type::Setup, init::init_resources().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_startup_script() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing startup script");
|
|
|
|
|
logging_error!(Type::Setup, init::startup_script().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_timer() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing timer...");
|
|
|
|
|
logging_error!(Type::Setup, Timer::global().init().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_hotkey() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing hotkey...");
|
|
|
|
|
logging_error!(Type::Setup, Hotkey::global().init().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-18 10:22:43 +08:00
|
|
|
pub(super) async fn init_once_auto_lightweight() {
|
|
|
|
|
logging!(
|
|
|
|
|
info,
|
|
|
|
|
Type::Lightweight,
|
|
|
|
|
"Running auto lightweight mode check..."
|
|
|
|
|
);
|
|
|
|
|
run_once_auto_lightweight().await;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-29 23:51:09 +08:00
|
|
|
pub(super) async fn init_auto_lightweight_mode() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing auto lightweight mode...");
|
|
|
|
|
logging_error!(Type::Setup, auto_lightweight_mode_init().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub async fn init_work_config() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing work configuration...");
|
|
|
|
|
logging_error!(Type::Setup, init::init_config().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_tray() {
|
2025-10-07 10:02:11 +08:00
|
|
|
// Check if tray should be disabled via environment variable
|
|
|
|
|
if std::env::var("CLASH_VERGE_DISABLE_TRAY").unwrap_or_default() == "1" {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "System tray disabled via --no-tray flag");
|
2025-10-07 10:02:11 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing system tray...");
|
|
|
|
|
logging_error!(Type::Setup, Tray::global().init().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_verge_config() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing verge configuration...");
|
|
|
|
|
logging_error!(Type::Setup, Config::init_config().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-17 22:59:02 +08:00
|
|
|
pub(super) async fn init_service_manager() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing service manager...");
|
2025-10-11 21:21:01 +08:00
|
|
|
logging_error!(Type::Setup, SERVICE_MANAGER.lock().await.refresh().await);
|
2025-09-17 22:59:02 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-29 23:51:09 +08:00
|
|
|
pub(super) async fn init_core_manager() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing core manager...");
|
|
|
|
|
logging_error!(Type::Setup, CoreManager::global().init().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_system_proxy() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing system proxy...");
|
2025-08-29 23:51:09 +08:00
|
|
|
logging_error!(
|
|
|
|
|
Type::Setup,
|
|
|
|
|
sysopt::Sysopt::global().update_sysproxy().await
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) fn init_system_proxy_guard() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing system proxy guard...");
|
|
|
|
|
logging_error!(Type::Setup, sysopt::Sysopt::global().init_guard_sysproxy());
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn refresh_tray_menu() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Refreshing tray menu...");
|
|
|
|
|
logging_error!(Type::Setup, Tray::global().update_part().await);
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(super) async fn init_window() {
|
Refactor logging macros to remove print control parameter
- Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
- Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
- Ensured consistent logging behavior across the application by standardizing the logging format.
2025-10-10 13:05:01 +08:00
|
|
|
logging!(info, Type::Setup, "Initializing main window...");
|
2025-08-29 23:51:09 +08:00
|
|
|
let is_silent_start =
|
|
|
|
|
{ Config::verge().await.latest_ref().enable_silent_start }.unwrap_or(false);
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
|
{
|
|
|
|
|
if is_silent_start {
|
|
|
|
|
use crate::core::handle::Handle;
|
|
|
|
|
|
|
|
|
|
Handle::global().set_activation_policy_accessory();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-09-18 10:22:43 +08:00
|
|
|
WindowManager::create_window(!is_silent_start).await;
|
2025-08-29 23:51:09 +08:00
|
|
|
}
|