mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-23 16:32:54 +10:00
156 refactor into workspaces (#157)
* 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> * fix: Remote tauri dependency from process Signed-off-by: quexeky <git@quexeky.dev> * refactor: Improvements to src-tauri Signed-off-by: quexeky <git@quexeky.dev> * refactor: Builds, but some logic still left to move back Signed-off-by: quexeky <git@quexeky.dev> * refactor: Finish refactor Signed-off-by: quexeky <git@quexeky.dev> * chore: Run cargo clippy && cargo fmt Signed-off-by: quexeky <git@quexeky.dev> * refactor: Move everything into src-tauri Signed-off-by: quexeky <git@quexeky.dev> --------- Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@@ -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));
|
||||
};
|
||||
}
|
||||
@@ -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)
|
||||
)
|
||||
})
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
mod app_emit;
|
||||
mod download_manager_send;
|
||||
mod lock;
|
||||
pub mod webbrowser_open;
|
||||
@@ -0,0 +1,8 @@
|
||||
#[macro_export]
|
||||
macro_rules! lock {
|
||||
($mutex:expr) => {
|
||||
$mutex
|
||||
.lock()
|
||||
.unwrap_or_else(|_| panic!("Failed to lock onto {}", stringify!($mutex)))
|
||||
};
|
||||
}
|
||||
@@ -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