mirror of
https://github.com/redstrate/Auracite.git
synced 2025-05-02 08:57:44 +00:00
Simplify features, Qt is now required on desktop
This commit is contained in:
parent
7c28e03d63
commit
eb14e13311
7 changed files with 20 additions and 28 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1871,7 +1871,7 @@ version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
20
Cargo.toml
20
Cargo.toml
|
@ -7,16 +7,8 @@ description = "Export your FFXIV character in portable, generic formats"
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "ui"
|
|
||||||
required-features = ["ui"]
|
|
||||||
|
|
||||||
[features]
|
|
||||||
# Builds the Qt UI for Auracite
|
|
||||||
ui = ["cxx", "cxx-qt-build", "cxx-qt", "cxx-qt-lib", "cxx-qt-lib-extras", "cxx-kde-frameworks"]
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cxx-qt-build = { git = "https://github.com/KDAB/cxx-qt", branch = "main", features = ["link_qt_object_files"], default-features = false, optional = true }
|
cxx-qt-build = { git = "https://github.com/KDAB/cxx-qt", branch = "main", features = ["link_qt_object_files"], default-features = false }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Used to scrape the Lodestone HTML pages
|
# Used to scrape the Lodestone HTML pages
|
||||||
|
@ -66,10 +58,10 @@ serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
|
||||||
tokio = { version = "1.41", features = ["rt", "rt-multi-thread", "macros"], default-features = false }
|
tokio = { version = "1.41", features = ["rt", "rt-multi-thread", "macros"], default-features = false }
|
||||||
|
|
||||||
# Used for the Qt UI
|
# Used for the Qt UI
|
||||||
cxx = { version = "1.0", default-features = false, optional = true }
|
cxx = { version = "1.0", default-features = false }
|
||||||
cxx-qt = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true }
|
cxx-qt = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false }
|
||||||
cxx-qt-lib = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true}
|
cxx-qt-lib = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false }
|
||||||
cxx-qt-lib-extras = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false, optional = true}
|
cxx-qt-lib-extras = { git = "https://github.com/KDAB/cxx-qt", branch = "main", default-features = false }
|
||||||
cxx-kde-frameworks = { git = "https://invent.kde.org/libraries/cxx-kde-frameworks", branch = "work/redstrate/kaboutdata-process-cmdline", default-features = false, optional = true }
|
cxx-kde-frameworks = { git = "https://invent.kde.org/libraries/cxx-kde-frameworks", branch = "work/redstrate/kaboutdata-process-cmdline", default-features = false }
|
||||||
|
|
||||||
serde_json = { version = "1.0", default-features = false, features = ["std"] }
|
serde_json = { version = "1.0", default-features = false, features = ["std"] }
|
22
build.rs
22
build.rs
|
@ -1,15 +1,15 @@
|
||||||
#[cfg(feature = "ui")]
|
|
||||||
use cxx_qt_build::{CxxQtBuilder, QmlModule};
|
use cxx_qt_build::{CxxQtBuilder, QmlModule};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(feature = "ui")]
|
if std::env::var("CARGO_CFG_TARGET_FAMILY").unwrap() != "wasm" {
|
||||||
CxxQtBuilder::new()
|
CxxQtBuilder::new()
|
||||||
.qt_module("Quick")
|
.qt_module("Quick")
|
||||||
.qml_module(QmlModule {
|
.qml_module(QmlModule {
|
||||||
uri: "zone.xiv.auracite",
|
uri: "zone.xiv.auracite",
|
||||||
rust_files: &["src/bin/ui/bridge.rs"],
|
rust_files: &["src/bin/auracite/bridge.rs"],
|
||||||
qml_files: &["src/bin/ui/Main.qml"],
|
qml_files: &["src/bin/auracite/Main.qml"],
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -69,7 +69,7 @@ fn main() {
|
||||||
if let Some(mut engine) = engine.as_mut() {
|
if let Some(mut engine) = engine.as_mut() {
|
||||||
KLocalizedContext::initialize_engine(engine.as_mut().as_qqmlengine());
|
KLocalizedContext::initialize_engine(engine.as_mut().as_qqmlengine());
|
||||||
// TODO: replace with loadModule (requires cxx-qt changes)
|
// TODO: replace with loadModule (requires cxx-qt changes)
|
||||||
engine.load(&QUrl::from("qrc:/qt/qml/zone/xiv/auracite/src/bin/ui/Main.qml"));
|
engine.load(&QUrl::from("qrc:/qt/qml/zone/xiv/auracite/src/bin/auracite/Main.qml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(app) = app.as_mut() {
|
if let Some(app) = app.as_mut() {
|
|
@ -63,7 +63,7 @@ impl Service for PackageService<'_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Archives the character named `character_name` and gives a ZIP file as bytes that can be written to disk.
|
/// Archives the character named `character_name` and gives a ZIP file as bytes that can be written to disk.
|
||||||
pub async extern fn archive_character(character_name: &str, use_dalamud: bool) -> Vec<u8> {
|
pub async fn archive_character(character_name: &str, use_dalamud: bool) -> Vec<u8> {
|
||||||
let search_page = download(&Url::parse_with_params(&format!("{LODESTONE_HOST}/lodestone/character?"), &[("q", character_name)]).unwrap())
|
let search_page = download(&Url::parse_with_params(&format!("{LODESTONE_HOST}/lodestone/character?"), &[("q", character_name)]).unwrap())
|
||||||
.await
|
.await
|
||||||
.expect("Failed to download the search page from the Lodestone.");
|
.expect("Failed to download the search page from the Lodestone.");
|
||||||
|
|
Loading…
Add table
Reference in a new issue