Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest GUI dependencies #905

Merged
merged 23 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,387 changes: 844 additions & 543 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"@formatjs/intl-localematcher": "^0.2.32",
"@react-three/drei": "^9.80.3",
"@react-three/fiber": "^8.13.6",
"@tauri-apps/api": "=2.0.0-alpha.8",
"@tauri-apps/api": "=2.0.0-alpha.11",
"@tauri-apps/plugin-app": "=2.0.0-alpha.1",
"@tauri-apps/plugin-dialog": "=2.0.0-alpha.1",
"@tauri-apps/plugin-fs": "=2.0.0-alpha.1",
"@tauri-apps/plugin-os": "=2.0.0-alpha.2",
"@tauri-apps/plugin-shell": "=2.0.0-alpha.1",
"@tauri-apps/plugin-dialog": "=2.0.0-alpha.3",
"@tauri-apps/plugin-fs": "=2.0.0-alpha.3",
"@tauri-apps/plugin-os": "=2.0.0-alpha.4",
"@tauri-apps/plugin-shell": "=2.0.0-alpha.3",
"@tauri-apps/plugin-window": "=2.0.0-alpha.1",
"@vitejs/plugin-react": "^3.0.0",
"browser-fs-access": "^0.34.1",
Expand Down Expand Up @@ -75,7 +75,7 @@
"devDependencies": {
"@dword-design/eslint-plugin-import-alias": "^4.0.8",
"@tailwindcss/forms": "^0.5.3",
"@tauri-apps/cli": "=2.0.0-alpha.17",
"@tauri-apps/cli": "=2.0.0-alpha.18",
"@types/file-saver": "^2.0.5",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.5",
Expand Down
18 changes: 9 additions & 9 deletions gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]

[build-dependencies]
tauri-build = { version = "2.0.0-alpha", features = [] }
tauri-build = { version = "=2.0.0-alpha.12", features = [] }
cfg_aliases = "0.1"
shadow-rs = "0.23"

[dependencies]
serde_json = "1"
serde = { version = "1", features = ["derive"] }
tauri = { version = "2.0.0-alpha", features = ["devtools"] }
tauri-runtime = "1.0.0-alpha"
tauri-plugin-dialog = "2.0.0-alpha"
tauri-plugin-fs = "2.0.0-alpha"
tauri-plugin-os = "2.0.0-alpha"
tauri-plugin-shell = "2.0.0-alpha"
tauri-plugin-window = { version = "2.0.0-alpha", features = ["devtools"] }
tauri = { version = "=2.0.0-alpha.18", features = ["devtools"] }
tauri-runtime = "=1.0.0-alpha.5"
tauri-plugin-dialog = "=2.0.0-alpha.4"
tauri-plugin-fs = "=2.0.0-alpha.4"
tauri-plugin-os = "=2.0.0-alpha.4"
tauri-plugin-shell = "=2.0.0-alpha.4"
tauri-plugin-window = { version = "=2.0.0-alpha.2", features = ["devtools"] }
flexi_logger = "0.25"
log-panics = { version = "2", features = ["with-backtrace"] }
log = "0.4"
Expand All @@ -49,7 +49,7 @@ shadow-rs = { version = "0.23", default-features = false }
const_format = "0.2.30"
cfg-if = "1"
color-eyre = "0.6"
rfd = "0.11.4"
rfd = "0.12.1"
dirs-next = "2.0.0"

[target.'cfg(windows)'.dependencies]
Expand Down
12 changes: 6 additions & 6 deletions gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ fn main() -> Result<()> {
if !webview2_exists() {
// This makes a dialog appear which let's you press Ok or Cancel
// If you press Ok it will open the SlimeVR installer documentation
use rfd::{MessageButtons, MessageDialog, MessageLevel};
use rfd::{MessageButtons, MessageDialog, MessageLevel, MessageDialogResult};

let confirm = MessageDialog::new()
.set_title("SlimeVR")
.set_description("Couldn't find WebView2 installed. You can install it with the SlimeVR installer")
.set_buttons(MessageButtons::OkCancel)
.set_level(MessageLevel::Error)
.show();
if confirm {
if confirm == MessageDialogResult::Ok {
open::that("https://docs.slimevr.dev/server-setup/installing-and-connecting.html#install-the-latest-slimevr-installer").unwrap();
}
return Ok(());
Expand Down Expand Up @@ -236,12 +236,12 @@ fn main() -> Result<()> {
_ => ("other", "".to_string()),
};
app_handle
.emit_all("server-status", emit_me)
.emit("server-status", emit_me)
.expect("Check server log files. \nFailed to emit");
}
log::error!("Java server receiver died");
app_handle
.emit_all("server-status", ("other", "receiver cancelled"))
.emit("server-status", ("other", "receiver cancelled"))
.expect("Failed to emit");
});
}
Expand Down Expand Up @@ -298,15 +298,15 @@ fn main() -> Result<()> {
// I should log this anyways, don't want to dig a grave by not logging the error.
log::error!("CreateWebview error {}", error);

use rfd::{MessageButtons, MessageDialog, MessageLevel};
use rfd::{MessageButtons, MessageDialog, MessageLevel, MessageDialogResult};

let confirm = MessageDialog::new()
.set_title("SlimeVR")
.set_description("You seem to have a faulty installation of WebView2. You can check a guide on how to fix that in the docs!")
.set_buttons(MessageButtons::OkCancel)
.set_level(MessageLevel::Error)
.show();
if confirm {
if confirm == MessageDialogResult::Ok {
open::that("https://docs.slimevr.dev/common-issues.html#webview2-is-missing--slimevr-gui-crashes-immediately--panicked-at--webview2error").unwrap();
}
}
Expand Down
4 changes: 2 additions & 2 deletions gui/src-tauri/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn spawn_java(java: &OsStr, java_version: &OsStr) -> std::io::Result<Child>
#[cfg(desktop)]
pub fn show_error(text: &str) -> bool {
use rand::{seq::SliceRandom, thread_rng};
use rfd::{MessageButtons, MessageDialog, MessageLevel};
use rfd::{MessageButtons, MessageDialog, MessageLevel, MessageDialogResult};

MessageDialog::new()
.set_title(&format!(
Expand All @@ -105,7 +105,7 @@ pub fn show_error(text: &str) -> bool {
.set_description(text)
.set_buttons(MessageButtons::Ok)
.set_level(MessageLevel::Error)
.show()
.show() == MessageDialogResult::Ok
}

#[cfg(mobile)]
Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import classNames from 'classnames';
import { QuestionIcon } from './commons/icon/QuestionIcon';
import { useBreakpoint, useIsTauri } from '@/hooks/breakpoint';
import { GearIcon } from './commons/icon/GearIcon';
import { invoke } from '@tauri-apps/api';
import { invoke } from '@tauri-apps/api/primitives';
import { useTrackers } from '@/hooks/tracker';
import { TrackersStillOnModal } from './TrackersStillOnModal';
import { useConfig } from '@/hooks/config';
Expand Down
2 changes: 1 addition & 1 deletion gui/src/utils/logging.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { invoke } from '@tauri-apps/api';
import { invoke } from '@tauri-apps/api/primitives';

export function log(...msgs: any[]) {
console.log(...msgs);
Expand Down
Loading
Loading