Wires real authentication. "Sign in via Browser" now runs the actual Qobuz OAuth flow with no Tauri and no WebView: opens the system browser, captures the authorization code on a one-shot localhost listener, exchanges it via QbzCore's Qobuz client, and activates a real per-user session through AppRuntime. - adapter.rs: SlintAdapter implements FrontendAdapter. - auth.rs: system-browser OAuth, mirrors v2_start_system_browser_oauth without Tauri. Includes a query-param parse test. - main.rs: tokio runtime; sign-in / offline callbacks run real async work and navigate to the shell on success. - Sidebar: placeholder playlist fixtures removed. qbz-slint now depends on qbz-app, qbz-core, and qbz-models. cc
34 lines
910 B
Rust
34 lines
910 B
Rust
//! Slint frontend adapter.
|
|
//!
|
|
//! `SlintAdapter` implements `FrontendAdapter` so `QbzCore` can emit events
|
|
//! toward the Slint UI. It holds a weak handle to the window to post updates
|
|
//! onto the Slint event loop. The auth milestone only logs events; later
|
|
//! milestones route them into UI models.
|
|
|
|
use async_trait::async_trait;
|
|
use qbz_core::{CoreEvent, FrontendAdapter};
|
|
|
|
use crate::AppWindow;
|
|
|
|
pub struct SlintAdapter {
|
|
#[allow(dead_code)] // used by later milestones to push UI model updates
|
|
window: slint::Weak<AppWindow>,
|
|
}
|
|
|
|
impl SlintAdapter {
|
|
pub fn new(window: slint::Weak<AppWindow>) -> Self {
|
|
Self { window }
|
|
}
|
|
}
|
|
|
|
#[async_trait]
|
|
impl FrontendAdapter for SlintAdapter {
|
|
async fn on_event(&self, event: CoreEvent) {
|
|
log::debug!("[qbz-slint] core event: {:?}", event);
|
|
}
|
|
|
|
async fn on_ready(&self) {
|
|
log::info!("[qbz-slint] core ready");
|
|
}
|
|
}
|