This commit is contained in:
ochibani 2025-01-01 04:09:32 +02:00
parent e421966915
commit bb5da46121
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4
5 changed files with 42 additions and 130 deletions

108
Cargo.lock generated
View File

@ -491,7 +491,6 @@ dependencies = [
"fluent-bundle", "fluent-bundle",
"glib 0.10.3", "glib 0.10.3",
"libadwaita", "libadwaita",
"rdev",
"regex", "regex",
"rust-ini 0.16.1", "rust-ini 0.16.1",
"secfmt", "secfmt",
@ -649,21 +648,6 @@ dependencies = [
"libloading", "libloading",
] ]
[[package]]
name = "cocoa"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "667fdc068627a2816b9ff831201dd9864249d6ee8d190b9532357f1fc0f61ea7"
dependencies = [
"bitflags 1.3.2",
"block",
"core-foundation 0.9.4",
"core-graphics 0.21.0",
"foreign-types 0.3.2",
"libc",
"objc",
]
[[package]] [[package]]
name = "cocoa" name = "cocoa"
version = "0.26.0" version = "0.26.0"
@ -719,23 +703,13 @@ dependencies = [
"crossbeam-utils", "crossbeam-utils",
] ]
[[package]]
name = "core-foundation"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
dependencies = [
"core-foundation-sys 0.7.0",
"libc",
]
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.4" version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.7", "core-foundation-sys",
"libc", "libc",
] ]
@ -745,46 +719,16 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.7", "core-foundation-sys",
"libc", "libc",
] ]
[[package]]
name = "core-foundation-sys"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]] [[package]]
name = "core-foundation-sys" name = "core-foundation-sys"
version = "0.8.7" version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core-graphics"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923"
dependencies = [
"bitflags 1.3.2",
"core-foundation 0.7.0",
"foreign-types 0.3.2",
"libc",
]
[[package]]
name = "core-graphics"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52a67c4378cf203eace8fb6567847eb641fd6ff933c1145a115c6ee820ebb978"
dependencies = [
"bitflags 1.3.2",
"core-foundation 0.9.4",
"foreign-types 0.3.2",
"libc",
]
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.23.2" version = "0.23.2"
@ -840,7 +784,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"core-foundation-sys 0.8.7", "core-foundation-sys",
"coreaudio-sys", "coreaudio-sys",
] ]
@ -860,7 +804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779"
dependencies = [ dependencies = [
"alsa", "alsa",
"core-foundation-sys 0.8.7", "core-foundation-sys",
"coreaudio-rs", "coreaudio-rs",
"dasp_sample", "dasp_sample",
"jni", "jni",
@ -2048,7 +1992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [ dependencies = [
"android_system_properties", "android_system_properties",
"core-foundation-sys 0.8.7", "core-foundation-sys",
"iana-time-zone-haiku", "iana-time-zone-haiku",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@ -2416,12 +2360,6 @@ dependencies = [
"log", "log",
] ]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]] [[package]]
name = "lebe" name = "lebe"
version = "0.5.2" version = "0.5.2"
@ -3290,22 +3228,6 @@ dependencies = [
"crossbeam-utils", "crossbeam-utils",
] ]
[[package]]
name = "rdev"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00552ca2dc2f93b84cd7b5581de49549411e4e41d89e1c691bcb93dc4be360c3"
dependencies = [
"cocoa 0.22.0",
"core-foundation 0.7.0",
"core-foundation-sys 0.7.0",
"core-graphics 0.19.2",
"lazy_static",
"libc",
"winapi",
"x11",
]
[[package]] [[package]]
name = "redox_users" name = "redox_users"
version = "0.4.6" version = "0.4.6"
@ -3563,7 +3485,7 @@ checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"core-foundation 0.9.4", "core-foundation 0.9.4",
"core-foundation-sys 0.8.7", "core-foundation-sys",
"libc", "libc",
"security-framework-sys", "security-framework-sys",
] ]
@ -3574,7 +3496,7 @@ version = "2.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.7", "core-foundation-sys",
"libc", "libc",
] ]
@ -3863,7 +3785,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
dependencies = [ dependencies = [
"core-foundation-sys 0.8.7", "core-foundation-sys",
"libc", "libc",
] ]
@ -4910,10 +4832,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2514eb851240a0b0a09d55765ebd4769e6f2f88a6a1f27267e2e3166bdf6d68b" checksum = "2514eb851240a0b0a09d55765ebd4769e6f2f88a6a1f27267e2e3166bdf6d68b"
dependencies = [ dependencies = [
"base64", "base64",
"cocoa 0.26.0", "cocoa",
"cocoa-foundation", "cocoa-foundation",
"core-foundation 0.10.0", "core-foundation 0.10.0",
"core-foundation-sys 0.8.7", "core-foundation-sys",
"core-graphics 0.24.0", "core-graphics 0.24.0",
"image", "image",
"libc", "libc",
@ -4926,16 +4848,6 @@ dependencies = [
"zbus 1.9.3", "zbus 1.9.3",
] ]
[[package]]
name = "x11"
version = "2.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e"
dependencies = [
"libc",
"pkg-config",
]
[[package]] [[package]]
name = "xcb" name = "xcb"
version = "1.5.0" version = "1.5.0"

View File

@ -14,7 +14,6 @@ dirs = "4.0.0"
fluent-bundle = "0.15.3" fluent-bundle = "0.15.3"
glib = "0.10.3" glib = "0.10.3"
adw = { version = "0.2.1", package = "libadwaita", features = ["gtk_v4_6"] } adw = { version = "0.2.1", package = "libadwaita", features = ["gtk_v4_6"] }
rdev = "0.5"
regex = "1.4.3" regex = "1.4.3"
rust-ini = "0.16" rust-ini = "0.16"
secfmt = "0.1.1" secfmt = "0.1.1"

View File

@ -1,14 +1,14 @@
extern crate regex; extern crate regex;
use adw::gtk::Label;
use adw::prelude::*;
use adw::Window;
#[cfg(any(target_os = "freebsd", target_os = "linux"))] #[cfg(any(target_os = "freebsd", target_os = "linux"))]
use anyhow::anyhow; use anyhow::anyhow;
use anyhow::Result; use anyhow::Result;
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
use display_info::DisplayInfo; use display_info::DisplayInfo;
use glib::Continue; use glib::Continue;
use adw::gtk::Label;
use adw::Window;
use adw::prelude::*;
#[cfg(any(target_os = "freebsd", target_os = "linux"))] #[cfg(any(target_os = "freebsd", target_os = "linux"))]
use regex::Regex; use regex::Regex;
use std::cell::RefCell; use std::cell::RefCell;

View File

@ -1,7 +1,7 @@
extern crate secfmt; extern crate secfmt;
use adw::gtk::glib;
use adw::gtk::{Button, ToggleButton, Label, SpinButton}; use adw::gtk::{Button, ToggleButton, Label, SpinButton};
use adw::gtk::glib;
use adw::gtk::prelude::*; use adw::gtk::prelude::*;
use adw::Window; use adw::Window;

View File

@ -1,3 +1,8 @@
use adw::{Application, Window};
use adw::gio::File;
use adw::gtk::{AboutDialog, Builder, Button, CheckButton, ComboBoxText, CssProvider, Entry, FileChooserNative,
FileChooserAction, Image, Label, MessageDialog, SpinButton, TextBuffer, TextView, ToggleButton};
use adw::prelude::*;
use anyhow::Result; use anyhow::Result;
#[cfg(any(target_os = "freebsd", target_os = "linux"))] #[cfg(any(target_os = "freebsd", target_os = "linux"))]
use blue_recorder_core::ffmpeg_linux::Ffmpeg; use blue_recorder_core::ffmpeg_linux::Ffmpeg;
@ -6,11 +11,6 @@ use blue_recorder_core::ffmpeg_windows::Ffmpeg;
use blue_recorder_core::utils::{is_wayland, play_record, RecordMode}; use blue_recorder_core::utils::{is_wayland, play_record, RecordMode};
use chrono::Utc; use chrono::Utc;
use cpal::traits::{DeviceTrait, HostTrait}; use cpal::traits::{DeviceTrait, HostTrait};
use adw::{Application, Window};
use adw::gio::File;
use adw::gtk::{AboutDialog, Builder, Button, CheckButton, ComboBoxText, CssProvider, Entry, FileChooserNative,
FileChooserAction, Image, Label, MessageDialog, SpinButton, TextBuffer, TextView, ToggleButton};
use adw::prelude::*;
use std::cell::RefCell; use std::cell::RefCell;
use std::ops::Add; use std::ops::Add;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -516,28 +516,29 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
folder_chooser_button.connect_clicked(glib::clone!(@strong folder_chooser_native => move |_| { folder_chooser_button.connect_clicked(glib::clone!(@strong folder_chooser_native => move |_| {
let error_dialog = _error_dialog.clone(); let error_dialog = _error_dialog.clone();
let error_message = _error_message.clone(); let error_message = _error_message.clone();
folder_chooser_native.connect_response folder_chooser_native.connect_response
(glib::clone!(@strong folder_chooser_native, @strong folder_chooser_label, (glib::clone!(@strong folder_chooser_native, @strong folder_chooser_label,
@strong folder_chooser_image => move |_, response| { @strong folder_chooser_image => move |_, response| {
let text_buffer = TextBuffer::new(None); let text_buffer = TextBuffer::new(None);
if response == adw::gtk::ResponseType::Accept { if response == adw::gtk::ResponseType::Accept {
if folder_chooser_native.file().is_none() { if folder_chooser_native.file().is_none() {
text_buffer.set_text("Failed to get save file path."); text_buffer.set_text("Failed to get save file path.");
error_message.set_buffer(Some(&text_buffer)); error_message.set_buffer(Some(&text_buffer));
error_dialog.show(); error_dialog.show();
} }
let folder_chooser = folder_chooser_native.file().unwrap_or_else let folder_chooser = folder_chooser_native.file().unwrap_or_else
(|| (||
File::for_path(&config_management::get( File::for_path(&config_management::get(
"default", "folder", "default", "folder",
))); // Default ))); // Default
let folder_chooser_name = folder_chooser.basename().unwrap();
folder_chooser_label.set_label(&folder_chooser_name.to_string_lossy()); let folder_chooser_name = folder_chooser.basename().unwrap();
let folder_chooser_icon = config_management::folder_icon(folder_chooser_name.to_str()); folder_chooser_label.set_label(&folder_chooser_name.to_string_lossy());
folder_chooser_image.set_icon_name(Some(folder_chooser_icon)); let folder_chooser_icon = config_management::folder_icon(folder_chooser_name.to_str());
}; folder_chooser_image.set_icon_name(Some(folder_chooser_icon));
folder_chooser_native.hide(); };
})); folder_chooser_native.hide();
}));
folder_chooser_native.show(); folder_chooser_native.show();
})); }));