mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 16:51:18 +10:00
Squashed commit of the following:
commit3b09dcfb73Author: quexeky <git@quexeky.dev> Date: Mon Oct 13 08:10:52 2025 +1100 fix: #159 Signed-off-by: quexeky <git@quexeky.dev> commit2859a59622Author: quexeky <git@quexeky.dev> Date: Mon Oct 13 08:03:49 2025 +1100 Squashed commit of the following: commit0f48f3fb44Author: quexeky <git@quexeky.dev> Date: Sun Oct 12 19:35:04 2025 +1100 chore: Run cargo clippy && cargo fmt Signed-off-by: quexeky <git@quexeky.dev> commit974666efe2Author: quexeky <git@quexeky.dev> Date: Sun Oct 12 19:17:40 2025 +1100 refactor: Finish refactor Signed-off-by: quexeky <git@quexeky.dev> commit9e1bf9852fAuthor: quexeky <git@quexeky.dev> Date: Sun Oct 12 18:33:43 2025 +1100 refactor: Builds, but some logic still left to move back Signed-off-by: quexeky <git@quexeky.dev> commit5d22b883d5Author: quexeky <git@quexeky.dev> Date: Sun Oct 12 17:04:27 2025 +1100 refactor: Improvements to src-tauri Signed-off-by: quexeky <git@quexeky.dev> commit62a2561539Author: quexeky <git@quexeky.dev> Date: Sat Oct 11 09:51:04 2025 +1100 fix: Remote tauri dependency from process Signed-off-by: quexeky <git@quexeky.dev> commit59f040bc8bAuthor: quexeky <git@quexeky.dev> Date: Thu Oct 9 07:46:17 2025 +1100 chore: Major refactoring Still needs a massive go-over because there shouldn't be anything referencing tauri in any of the workspaces except the original one. Process manager has been refactored as an example Signed-off-by: quexeky <git@quexeky.dev> Signed-off-by: quexeky <git@quexeky.dev> Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
8
utils/Cargo.toml
Normal file
8
utils/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "utils"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4.28"
|
||||
webbrowser = "1.0.5"
|
||||
7
utils/src/app_emit.rs
Normal file
7
utils/src/app_emit.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[macro_export]
|
||||
macro_rules! app_emit {
|
||||
($app:expr, $event:expr, $p:expr) => {
|
||||
::tauri::Emitter::emit($app, $event, $p)
|
||||
.expect(&format!("Failed to emit event {}", $event));
|
||||
};
|
||||
}
|
||||
11
utils/src/download_manager_send.rs
Normal file
11
utils/src/download_manager_send.rs
Normal file
@ -0,0 +1,11 @@
|
||||
#[macro_export]
|
||||
macro_rules! send {
|
||||
($download_manager:expr, $signal:expr) => {
|
||||
$download_manager.send($signal).unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"Failed to send signal {} to the download manager",
|
||||
stringify!(signal)
|
||||
)
|
||||
})
|
||||
};
|
||||
}
|
||||
4
utils/src/lib.rs
Normal file
4
utils/src/lib.rs
Normal file
@ -0,0 +1,4 @@
|
||||
mod app_emit;
|
||||
mod download_manager_send;
|
||||
mod lock;
|
||||
pub mod webbrowser_open;
|
||||
8
utils/src/lock.rs
Normal file
8
utils/src/lock.rs
Normal file
@ -0,0 +1,8 @@
|
||||
#[macro_export]
|
||||
macro_rules! lock {
|
||||
($mutex:expr) => {
|
||||
$mutex
|
||||
.lock()
|
||||
.unwrap_or_else(|_| panic!("Failed to lock onto {}", stringify!($mutex)))
|
||||
};
|
||||
}
|
||||
11
utils/src/webbrowser_open.rs
Normal file
11
utils/src/webbrowser_open.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use log::warn;
|
||||
|
||||
pub fn webbrowser_open<T: AsRef<str>>(url: T) {
|
||||
if let Err(e) = webbrowser::open(url.as_ref()) {
|
||||
warn!(
|
||||
"Could not open web browser to url {} with error {}",
|
||||
url.as_ref(),
|
||||
e
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user