attempt to clean up warnings on build (#1037)
* attempt to clean up warnings on build * format * fix linux warning
This commit is contained in:
parent
85a8ed77b5
commit
46fd170d69
7 changed files with 25 additions and 14 deletions
|
|
@ -5,7 +5,7 @@ use crate::settings::{get_settings, write_settings};
|
|||
use log::warn;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
use std::{process::Command, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
use tauri::{AppHandle, Manager};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
@ -135,6 +135,7 @@ pub fn get_windows_microphone_permission_status() -> WindowsMicrophonePermission
|
|||
pub fn open_microphone_privacy_settings() -> Result<(), String> {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
use std::process::Command;
|
||||
Command::new("cmd")
|
||||
.args(["/C", "start", "", "ms-settings:privacy-microphone"])
|
||||
.spawn()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ mod tray_i18n;
|
|||
mod utils;
|
||||
|
||||
pub use cli::CliArgs;
|
||||
#[cfg(debug_assertions)]
|
||||
use specta_typescript::{BigIntExportBehavior, Typescript};
|
||||
use tauri_specta::{collect_commands, Builder};
|
||||
|
||||
|
|
@ -110,6 +111,7 @@ fn show_main_window(app: &AppHandle) {
|
|||
);
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn should_force_show_permissions_window(app: &AppHandle) -> bool {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
|
|
@ -401,6 +403,7 @@ pub fn run(cli_args: CliArgs) {
|
|||
)
|
||||
.expect("Failed to export typescript bindings");
|
||||
|
||||
#[allow(unused_mut)]
|
||||
let mut builder = tauri::Builder::default()
|
||||
.device_event_filter(tauri::DeviceEventFilter::Always)
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
|
|
@ -526,12 +529,11 @@ pub fn run(cli_args: CliArgs) {
|
|||
api.prevent_close();
|
||||
let _res = window.hide();
|
||||
|
||||
let settings = get_settings(&window.app_handle());
|
||||
let tray_visible =
|
||||
settings.show_tray_icon && !window.app_handle().state::<CliArgs>().no_tray;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let settings = get_settings(&window.app_handle());
|
||||
let tray_visible =
|
||||
settings.show_tray_icon && !window.app_handle().state::<CliArgs>().no_tray;
|
||||
if tray_visible {
|
||||
// Tray is available: hide the dock icon, app lives in the tray
|
||||
let res = window
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
|
|||
use specta::Type;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use tauri::{AppHandle, Emitter, Manager};
|
||||
use tauri::{AppHandle, Emitter};
|
||||
|
||||
use crate::audio_toolkit::save_wav_file;
|
||||
|
||||
|
|
|
|||
|
|
@ -218,14 +218,15 @@ fn calculate_overlay_position(app_handle: &AppHandle) -> Option<(f64, f64)> {
|
|||
/// Creates the recording overlay window and keeps it hidden by default
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
pub fn create_recording_overlay(app_handle: &AppHandle) {
|
||||
let position = calculate_overlay_position(app_handle);
|
||||
|
||||
// On Linux (Wayland), monitor detection often fails, but we don't need exact coordinates
|
||||
// for Layer Shell as we use anchors. On other platforms, we require a monitor.
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
if position.is_none() {
|
||||
debug!("Failed to determine overlay position, not creating overlay window");
|
||||
return;
|
||||
{
|
||||
let position = calculate_overlay_position(app_handle);
|
||||
if position.is_none() {
|
||||
debug!("Failed to determine overlay position, not creating overlay window");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Position starts unset — update_overlay_position() sets the correct
|
||||
|
|
@ -254,6 +255,7 @@ pub fn create_recording_overlay(app_handle: &AppHandle) {
|
|||
builder = builder.data_directory(data_dir.join("webview"));
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
match builder.build() {
|
||||
Ok(window) => {
|
||||
#[cfg(target_os = "linux")]
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@ use specta::Type;
|
|||
use tauri::{AppHandle, Emitter, Manager};
|
||||
use tauri_plugin_autostart::ManagerExt;
|
||||
|
||||
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
|
||||
use crate::settings::APPLE_INTELLIGENCE_DEFAULT_MODEL_ID;
|
||||
use crate::settings::{
|
||||
self, get_settings, AutoSubmitKey, ClipboardHandling, KeyboardImplementation, LLMPrompt,
|
||||
OverlayPosition, PasteMethod, ShortcutBinding, SoundTheme, TypingTool,
|
||||
APPLE_INTELLIGENCE_DEFAULT_MODEL_ID, APPLE_INTELLIGENCE_PROVIDER_ID,
|
||||
APPLE_INTELLIGENCE_PROVIDER_ID,
|
||||
};
|
||||
use crate::tray;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use log::{error, warn};
|
|||
use tauri::AppHandle;
|
||||
use tauri_plugin_global_shortcut::{GlobalShortcutExt, Shortcut, ShortcutState};
|
||||
|
||||
use crate::settings::{self, get_settings, ShortcutBinding};
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
use crate::settings::get_settings;
|
||||
use crate::settings::{self, ShortcutBinding};
|
||||
|
||||
use super::handler::handle_shortcut_event;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
use crate::TranscriptionCoordinator;
|
||||
use log::{debug, warn};
|
||||
#[cfg(unix)]
|
||||
use log::debug;
|
||||
use log::warn;
|
||||
use tauri::{AppHandle, Manager};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue