Files
imager/src-tauri/build.rs
SuperKali 8e99d25c8d feat: add settings panel with theme, language, and developer options
Implement comprehensive settings modal with:
- Theme switching (light/dark/auto) with system preference detection
- Language selection for 17 languages with native name sorting
- Developer mode with detailed logging and log viewer
- About section with app info and external links
- Update notification improvements with reduced log spam

Technical improvements:
- Added ThemeContext with persistent state management
- Implemented memory-safe log file reading (5MB limit)
- Fixed all ESLint, TypeScript, and Clippy warnings
- Added JSDoc documentation for public APIs
- Updated README.md and DEVELOPMENT.md with new features
2025-12-30 09:59:24 +01:00

40 lines
1.4 KiB
Rust

fn main() {
// Extract Tauri version from Cargo.toml and expose it as a compile-time env var
println!("cargo:rustc-env=TAURI_VERSION={}", tauri_version());
// On Windows, embed the manifest to request admin privileges at startup
#[cfg(windows)]
{
let mut windows = tauri_build::WindowsAttributes::new();
windows = windows.app_manifest(include_str!("app.manifest"));
tauri_build::try_build(tauri_build::Attributes::new().windows_attributes(windows))
.expect("failed to run build script");
}
#[cfg(not(windows))]
tauri_build::build();
}
/// Extract Tauri version from Cargo.toml dependencies
fn tauri_version() -> String {
let cargo_toml = std::path::PathBuf::from("Cargo.toml");
if let Ok(content) = std::fs::read_to_string(&cargo_toml) {
// Look for tauri dependency version
for line in content.lines() {
if line.contains("tauri =") || line.contains("tauri =") {
// Extract version from line like: tauri = { version = "2.x", ... }
if let Some(start) = line.find("version = \"") {
let after_version = &line[start + 11..];
if let Some(end) = after_version.find('"') {
return after_version[..end].to_string();
}
}
}
}
}
// Fallback to unknown if parsing fails
"unknown".to_string()
}