qd: rename Introspect->Display

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2021-08-16 00:20:54 +04:00
parent 848cd7af0a
commit 458d9887d5
3 changed files with 11 additions and 9 deletions

View File

@ -6,12 +6,12 @@ use zvariant::OwnedObjectPath;
use crate::{Audio, Chardev, Result, UsbRedir};
pub struct Introspect {
pub struct Display {
conn: Connection,
objects: ManagedObjects,
}
impl Introspect {
impl Display {
pub async fn new(conn: &Connection) -> Result<Self> {
let objects = zbus::fdo::AsyncObjectManagerProxy::builder(&conn)
.destination("org.qemu")?

View File

@ -30,8 +30,8 @@ pub use keyboard::*;
mod mouse;
pub use mouse::*;
mod introspect;
pub use introspect::*;
mod display;
pub use display::*;
mod usbredir;
pub use usbredir::*;

View File

@ -2,7 +2,7 @@ use gio::ApplicationFlags;
use glib::{clone, MainContext};
use gtk::{gio, glib, prelude::*};
use once_cell::sync::OnceCell;
use qemu_display::{Chardev, Console, Introspect};
use qemu_display::{Chardev, Console, Display};
use std::os::unix::io::AsRawFd;
use std::os::unix::net::UnixStream;
use zbus::Connection;
@ -33,13 +33,15 @@ fn main() {
let audio_clone = audio.clone();
let clipboard_clone = clipboard.clone();
MainContext::default().spawn_local(clone!(@strong window => async move {
let intro = Introspect::new(&conn).await.unwrap();
let display = Display::new(&conn).await.unwrap();
let console = Console::new(&conn, 0).await.expect("Failed to get the QEMU console");
let display = display_qemu::DisplayQemu::new(console);
window.set_child(Some(&display));
let rdw = display_qemu::DisplayQemu::new(console);
window.set_child(Some(&rdw));
if let Ok(Some(audio)) = intro.audio().await {
let usbredir = display.usbredir().await;
if let Ok(Some(audio)) = display.audio().await {
match audio::Handler::new(audio).await {
Ok(handler) => audio_clone.set(handler).unwrap(),
Err(e) => log::warn!("Failed to setup audio: {}", e),