fix: restore wine configuration

This commit is contained in:
2025-03-14 15:16:49 +01:00
parent e1ff28d4e0
commit 62edcdae08
13 changed files with 97 additions and 72 deletions

View File

@ -4,7 +4,6 @@ use anyhow::Result;
use displayz::{query_displays, DisplaySet};
use tauri::{AppHandle, Listener};
#[cfg(target_os = "windows")]
#[derive(Clone)]
pub struct DisplayInfo {
pub primary: String,
@ -20,20 +19,6 @@ impl Default for DisplayInfo {
}
}
impl Default for Display {
fn default() -> Self {
Display {
target: "default".to_owned(),
rez: (1080, 1920),
mode: DisplayMode::Borderless,
rotation: 0,
frequency: 60,
borderless_fullscreen: true,
}
}
}
#[cfg(target_os = "windows")]
impl Display {
pub fn activate(&self, app: AppHandle) {
let display = self.clone();

View File

@ -1,5 +1,7 @@
pub mod display;
pub mod package;
pub mod segatools;
pub mod network;
pub mod bepinex;
pub mod bepinex;
#[cfg(target_os = "windows")]
pub mod display_windows;

View File

@ -27,7 +27,7 @@ impl Network {
if self.network_type == NetworkType::Artemis {
let network_path = PathBuf::from(&self.local_path);
let artemis_dir = network_path.parent()
.ok_or_else(|| anyhow!("Invalid ARTEMiS path {}", &self.local_path))?;
.ok_or_else(|| anyhow!("Invalid ARTEMiS path {:?}", &self.local_path))?;
let cfg_path = artemis_dir.join("config").join("core.yaml");
let cfg = std::fs::read_to_string(&cfg_path)
@ -41,15 +41,22 @@ impl Network {
if let Some(hostname) = hostname {
ini.with_section(Some("dns")).set("default", hostname);
#[cfg(target_os = "windows")]
let mut cmd = Command::new("cmd.exe");
cmd.arg("/C");
let mut cmd: Command;
if self.local_console == true {
cmd.arg("start");
if cfg!(target_os = "windows") {
cmd = Command::new("cmd.exe");
cmd.arg("/C");
if self.local_console == true {
cmd.arg("start");
}
} else {
cmd = Command::new("sh");
}
cmd.args(["python", &self.local_path]);
cmd.arg("python");
cmd.arg(&self.local_path);
cmd.current_dir(artemis_dir);
cmd.spawn()
.map_err(|e| anyhow!("Unable to spawn artemis: {}", e))?;

View File

@ -1,23 +1,7 @@
use std::path::PathBuf;
use anyhow::{anyhow, Result};
use ini::Ini;
use crate::{model::{config::Segatools, segatools_base::segatools_base}, profiles::ProfilePaths, util::{self, PathStr}};
impl Default for Segatools {
fn default() -> Self {
Segatools {
target: PathBuf::default(),
amfs: PathBuf::default(),
option: PathBuf::default(),
appdata: PathBuf::from("appdata"),
enable_aime: false,
intel: false
}
}
}
impl Segatools {
pub async fn line_up(&self, p: &impl ProfilePaths) -> Result<Ini> {
log::debug!("begin line-up: segatools");