mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 00:51:20 -08:00
Merge branch 'main' of github.com:SlimeVR/SlimeVR-Server into llelievr/manual-proportions-rework
This commit is contained in:
commit
411fc4e60e
3 files changed
+17
-10
No files matched your search
@@ -58,6 +58,19 @@ fn warning(msg: String) {
|
||||
log::warn!(target: "webview", "{}", msg)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn open_config_folder(app_handle: tauri::AppHandle) {
|
||||
let path = app_handle
|
||||
.path()
|
||||
.app_config_dir()
|
||||
.unwrap_or_else(|_| Path::new(".").to_path_buf());
|
||||
let path_str = path.to_string_lossy().into_owned();
|
||||
|
||||
if let Err(err) = open::that(path_str) {
|
||||
eprintln!("Failed to open config folder: {}", err);
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn open_logs_folder(app_handle: tauri::AppHandle) {
|
||||
let config_dir = app_handle
|
||||
@@ -68,7 +81,7 @@ fn open_logs_folder(app_handle: tauri::AppHandle) {
|
||||
let path_str = path.to_string_lossy().into_owned();
|
||||
|
||||
if let Err(err) = open::that(path_str) {
|
||||
eprintln!("Failed to open config folder: {}", err);
|
||||
eprintln!("Failed to open logs folder: {}", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +259,7 @@ fn setup_tauri(
|
||||
logging,
|
||||
erroring,
|
||||
warning,
|
||||
open_config_folder,
|
||||
open_logs_folder,
|
||||
tray::update_translations,
|
||||
tray::update_tray_text,
|
||||
|
||||
@@ -61,11 +61,6 @@
|
||||
"shortDescription": "",
|
||||
"licenseFile": "../../LICENSE-MIT"
|
||||
},
|
||||
"plugins": {
|
||||
"shell": {
|
||||
"open": "^((https?://\\w+)|(file://)).+"
|
||||
}
|
||||
},
|
||||
"productName": "slimevr",
|
||||
"version": "../package.json",
|
||||
"identifier": "dev.slimevr.SlimeVR",
|
||||
|
||||
@@ -9,13 +9,12 @@ import { BugIcon } from '@/components/commons/icon/BugIcon';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { SettingsResetModal } from '@/components/settings/SettingsResetModal';
|
||||
|
||||
import { open } from '@tauri-apps/plugin-shell';
|
||||
import { error } from '@/utils/logging';
|
||||
import { appConfigDir } from '@tauri-apps/api/path';
|
||||
import { defaultConfig as defaultGUIConfig, useConfig } from '@/hooks/config';
|
||||
import { defaultValues as defaultDevConfig } from '@/components/widgets/DeveloperModeWidget';
|
||||
import { RpcMessage, SettingsResetRequestT } from 'solarxr-protocol';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
function guiDefaults() {
|
||||
// Destructure the properties to exclude "lang"
|
||||
@@ -40,8 +39,7 @@ export function AdvancedSettings() {
|
||||
|
||||
const openConfigFolder = async () => {
|
||||
try {
|
||||
const configPath = await appConfigDir();
|
||||
await open('file://' + configPath);
|
||||
await invoke<string | null>('open_config_folder');
|
||||
} catch (err) {
|
||||
error('Failed to open config folder:', err);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user