Fix warnings
This commit is contained in:
parent
5cbe8deb50
commit
9590f253a9
7 changed files with 56 additions and 60 deletions
|
@ -18,7 +18,6 @@ use gpui::{
|
||||||
Subscription, Task, View, ViewContext, VisualContext, WeakModel, WeakView,
|
Subscription, Task, View, ViewContext, VisualContext, WeakModel, WeakView,
|
||||||
};
|
};
|
||||||
pub use participant::ParticipantLocation;
|
pub use participant::ParticipantLocation;
|
||||||
use participant::RemoteParticipant;
|
|
||||||
use postage::watch;
|
use postage::watch;
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use room::Event;
|
use room::Event;
|
||||||
|
@ -666,7 +665,7 @@ impl CallHandler for Call {
|
||||||
call.0.update(cx, |this, cx| {
|
call.0.update(cx, |this, cx| {
|
||||||
this.room().map(|room| {
|
this.room().map(|room| {
|
||||||
room.update(cx, |this, cx| {
|
room.update(cx, |this, cx| {
|
||||||
this.toggle_mute(cx);
|
this.toggle_mute(cx).log_err();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -678,12 +677,10 @@ impl CallHandler for Call {
|
||||||
this.room().map(|room| {
|
this.room().map(|room| {
|
||||||
room.update(cx, |this, cx| {
|
room.update(cx, |this, cx| {
|
||||||
if this.is_screen_sharing() {
|
if this.is_screen_sharing() {
|
||||||
dbg!("Unsharing");
|
this.unshare_screen(cx).log_err();
|
||||||
this.unshare_screen(cx);
|
|
||||||
} else {
|
} else {
|
||||||
dbg!("Sharing");
|
|
||||||
let t = this.share_screen(cx);
|
let t = this.share_screen(cx);
|
||||||
cx.spawn(move |_, cx| async move {
|
cx.spawn(move |_, _| async move {
|
||||||
t.await.log_err();
|
t.await.log_err();
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use crate::{
|
use crate::participant::{LocalParticipant, ParticipantLocation, RemoteParticipant};
|
||||||
call_settings::CallSettings,
|
|
||||||
participant::{LocalParticipant, ParticipantLocation, RemoteParticipant},
|
|
||||||
};
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use audio::{Audio, Sound};
|
use audio::{Audio, Sound};
|
||||||
use client::{
|
use client::{
|
||||||
|
@ -21,7 +18,6 @@ use live_kit_client::{
|
||||||
};
|
};
|
||||||
use postage::{sink::Sink, stream::Stream, watch};
|
use postage::{sink::Sink, stream::Stream, watch};
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use settings::Settings;
|
|
||||||
use std::{future::Future, mem, sync::Arc, time::Duration};
|
use std::{future::Future, mem, sync::Arc, time::Duration};
|
||||||
use util::{post_inc, ResultExt, TryFutureExt};
|
use util::{post_inc, ResultExt, TryFutureExt};
|
||||||
|
|
||||||
|
@ -332,7 +328,8 @@ impl Room {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mute_on_join(cx: &AppContext) -> bool {
|
pub fn mute_on_join(_cx: &AppContext) -> bool {
|
||||||
|
// todo!() po: This should be uncommented, though then unmuting does not work
|
||||||
false
|
false
|
||||||
//CallSettings::get_global(cx).mute_on_join || client::IMPERSONATE_LOGIN.is_some()
|
//CallSettings::get_global(cx).mute_on_join || client::IMPERSONATE_LOGIN.is_some()
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,19 +3,11 @@ use anyhow::Result;
|
||||||
use client::{proto::PeerId, User};
|
use client::{proto::PeerId, User};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
div, img, AppContext, Div, Element, Entity, EventEmitter, FocusHandle, FocusableView,
|
div, img, AppContext, Div, Element, EventEmitter, FocusHandle, FocusableView, ImageData,
|
||||||
ImageData, Img, MouseButton, ParentElement, Render, SharedString, Task, View, ViewContext,
|
ParentElement, Render, SharedString, Task, View, ViewContext, VisualContext, WindowContext,
|
||||||
VisualContext, WindowContext,
|
|
||||||
};
|
|
||||||
use smallvec::SmallVec;
|
|
||||||
use std::{
|
|
||||||
borrow::Cow,
|
|
||||||
sync::{Arc, Weak},
|
|
||||||
};
|
|
||||||
use workspace::{
|
|
||||||
item::{Item, ItemEvent},
|
|
||||||
ItemNavHistory, WorkspaceId,
|
|
||||||
};
|
};
|
||||||
|
use std::sync::{Arc, Weak};
|
||||||
|
use workspace::{item::Item, ItemNavHistory, WorkspaceId};
|
||||||
|
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
Close,
|
Close,
|
||||||
|
@ -65,13 +57,13 @@ impl EventEmitter<Event> for SharedScreen {}
|
||||||
impl EventEmitter<workspace::item::ItemEvent> for SharedScreen {}
|
impl EventEmitter<workspace::item::ItemEvent> for SharedScreen {}
|
||||||
|
|
||||||
impl FocusableView for SharedScreen {
|
impl FocusableView for SharedScreen {
|
||||||
fn focus_handle(&self, cx: &AppContext) -> FocusHandle {
|
fn focus_handle(&self, _: &AppContext) -> FocusHandle {
|
||||||
self.focus.clone()
|
self.focus.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Render for SharedScreen {
|
impl Render for SharedScreen {
|
||||||
type Element = Div;
|
type Element = Div;
|
||||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
fn render(&mut self, _: &mut ViewContext<Self>) -> Self::Element {
|
||||||
let frame = self.frame.clone();
|
let frame = self.frame.clone();
|
||||||
div().children(frame.map(|frame| {
|
div().children(frame.map(|frame| {
|
||||||
img().data(Arc::new(ImageData::new(image::ImageBuffer::new(
|
img().data(Arc::new(ImageData::new(image::ImageBuffer::new(
|
||||||
|
|
|
@ -302,7 +302,7 @@ pub struct CollabPanel {
|
||||||
// entries: Vec<ListEntry>,
|
// entries: Vec<ListEntry>,
|
||||||
// selection: Option<usize>,
|
// selection: Option<usize>,
|
||||||
user_store: Model<UserStore>,
|
user_store: Model<UserStore>,
|
||||||
client: Arc<Client>,
|
_client: Arc<Client>,
|
||||||
// channel_store: ModelHandle<ChannelStore>,
|
// channel_store: ModelHandle<ChannelStore>,
|
||||||
// project: ModelHandle<Project>,
|
// project: ModelHandle<Project>,
|
||||||
// match_candidates: Vec<StringMatchCandidate>,
|
// match_candidates: Vec<StringMatchCandidate>,
|
||||||
|
@ -605,7 +605,7 @@ impl CollabPanel {
|
||||||
// collapsed_sections: vec![Section::Offline],
|
// collapsed_sections: vec![Section::Offline],
|
||||||
// collapsed_channels: Vec::default(),
|
// collapsed_channels: Vec::default(),
|
||||||
_workspace: workspace.weak_handle(),
|
_workspace: workspace.weak_handle(),
|
||||||
client: workspace.app_state().client.clone(),
|
_client: workspace.app_state().client.clone(),
|
||||||
// context_menu_on_selected: true,
|
// context_menu_on_selected: true,
|
||||||
// drag_target_channel: ChannelDragTarget::None,
|
// drag_target_channel: ChannelDragTarget::None,
|
||||||
// list_state,
|
// list_state,
|
||||||
|
@ -3323,8 +3323,14 @@ impl Render for CollabPanel {
|
||||||
.child(Label::new(contact.user.github_login.clone()))
|
.child(Label::new(contact.user.github_login.clone()))
|
||||||
.on_mouse_down(gpui::MouseButton::Left, {
|
.on_mouse_down(gpui::MouseButton::Left, {
|
||||||
let workspace = workspace.clone();
|
let workspace = workspace.clone();
|
||||||
move |event, cx| {
|
move |_, cx| {
|
||||||
workspace.update(cx, |this, cx| this.call_state().invite(id, None, cx));
|
workspace
|
||||||
|
.update(cx, |this, cx| {
|
||||||
|
this.call_state()
|
||||||
|
.invite(id, None, cx)
|
||||||
|
.detach_and_log_err(cx)
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -37,7 +37,7 @@ use gpui::{
|
||||||
};
|
};
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
use ui::{h_stack, Avatar, Button, ButtonVariant, Color, IconButton, KeyBinding, Label, Tooltip};
|
use ui::{h_stack, Avatar, Button, ButtonVariant, Color, IconButton, KeyBinding, Tooltip};
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
use workspace::Workspace;
|
use workspace::Workspace;
|
||||||
|
|
||||||
|
@ -190,11 +190,12 @@ impl Render for CollabTitlebarItem {
|
||||||
.child(Avatar::data(avatar.clone()).into_element())
|
.child(Avatar::data(avatar.clone()).into_element())
|
||||||
.on_mouse_down(MouseButton::Left, {
|
.on_mouse_down(MouseButton::Left, {
|
||||||
let workspace = workspace.clone();
|
let workspace = workspace.clone();
|
||||||
let id = peer_id.clone();
|
|
||||||
move |_, cx| {
|
move |_, cx| {
|
||||||
workspace.update(cx, |this, cx| {
|
workspace
|
||||||
this.open_shared_screen(peer_id, cx);
|
.update(cx, |this, cx| {
|
||||||
});
|
this.open_shared_screen(peer_id, cx);
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -215,17 +216,21 @@ impl Render for CollabTitlebarItem {
|
||||||
.child(IconButton::new("mute-microphone", mic_icon).on_click({
|
.child(IconButton::new("mute-microphone", mic_icon).on_click({
|
||||||
let workspace = workspace.clone();
|
let workspace = workspace.clone();
|
||||||
move |_, cx| {
|
move |_, cx| {
|
||||||
workspace.update(cx, |this, cx| {
|
workspace
|
||||||
this.call_state().toggle_mute(cx);
|
.update(cx, |this, cx| {
|
||||||
});
|
this.call_state().toggle_mute(cx);
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.child(IconButton::new("mute-sound", ui::Icon::AudioOn))
|
.child(IconButton::new("mute-sound", ui::Icon::AudioOn))
|
||||||
.child(IconButton::new("screen-share", ui::Icon::Screen).on_click(
|
.child(IconButton::new("screen-share", ui::Icon::Screen).on_click(
|
||||||
move |_, cx| {
|
move |_, cx| {
|
||||||
workspace.update(cx, |this, cx| {
|
workspace
|
||||||
this.call_state().toggle_screen_share(cx);
|
.update(cx, |this, cx| {
|
||||||
});
|
this.call_state().toggle_screen_share(cx);
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
.pl_2(),
|
.pl_2(),
|
||||||
|
|
|
@ -12,8 +12,8 @@ use std::{rc::Rc, sync::Arc};
|
||||||
pub use collab_panel::CollabPanel;
|
pub use collab_panel::CollabPanel;
|
||||||
pub use collab_titlebar_item::CollabTitlebarItem;
|
pub use collab_titlebar_item::CollabTitlebarItem;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
point, px, AppContext, GlobalPixels, Pixels, PlatformDisplay, Point, Size, WindowBounds,
|
AppContext, GlobalPixels, Pixels, PlatformDisplay, Size, WindowBounds, WindowKind,
|
||||||
WindowKind, WindowOptions,
|
WindowOptions,
|
||||||
};
|
};
|
||||||
pub use panel_settings::{
|
pub use panel_settings::{
|
||||||
ChatPanelSettings, CollaborationPanelSettings, NotificationPanelSettings,
|
ChatPanelSettings, CollaborationPanelSettings, NotificationPanelSettings,
|
||||||
|
@ -102,10 +102,10 @@ fn notification_window_options(
|
||||||
screen: Rc<dyn PlatformDisplay>,
|
screen: Rc<dyn PlatformDisplay>,
|
||||||
window_size: Size<Pixels>,
|
window_size: Size<Pixels>,
|
||||||
) -> WindowOptions {
|
) -> WindowOptions {
|
||||||
let notification_padding = Pixels::from(16.);
|
let _notification_padding = Pixels::from(16.);
|
||||||
|
|
||||||
let screen_bounds = screen.bounds();
|
let screen_bounds = screen.bounds();
|
||||||
let size: Size<GlobalPixels> = window_size.into();
|
let _size: Size<GlobalPixels> = window_size.into();
|
||||||
|
|
||||||
let bounds = gpui::Bounds::<GlobalPixels> {
|
let bounds = gpui::Bounds::<GlobalPixels> {
|
||||||
origin: screen_bounds.origin,
|
origin: screen_bounds.origin,
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
use crate::notification_window_options;
|
use crate::notification_window_options;
|
||||||
use call::{ActiveCall, IncomingCall};
|
use call::{ActiveCall, IncomingCall};
|
||||||
use client::proto;
|
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
blue, div, green, px, red, AnyElement, AppContext, Component, Context, Div, Element, Entity,
|
div, green, px, red, AppContext, Div, Element, ParentElement, Render, RenderOnce,
|
||||||
EventEmitter, GlobalPixels, ParentElement, Render, RenderOnce, StatefulInteractiveElement,
|
StatefulInteractiveElement, Styled, ViewContext, VisualContext as _, WindowHandle,
|
||||||
Styled, View, ViewContext, VisualContext as _, WindowHandle,
|
|
||||||
};
|
};
|
||||||
use std::sync::{Arc, Weak};
|
use std::sync::{Arc, Weak};
|
||||||
use ui::{h_stack, v_stack, Avatar, Button, Label};
|
use ui::{h_stack, v_stack, Avatar, Button, Label};
|
||||||
|
@ -19,11 +17,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
|
||||||
let mut notification_windows: Vec<WindowHandle<IncomingCallNotification>> = Vec::new();
|
let mut notification_windows: Vec<WindowHandle<IncomingCallNotification>> = Vec::new();
|
||||||
while let Some(incoming_call) = incoming_call.next().await {
|
while let Some(incoming_call) = incoming_call.next().await {
|
||||||
for window in notification_windows.drain(..) {
|
for window in notification_windows.drain(..) {
|
||||||
window.update(&mut cx, |this, cx| {
|
window
|
||||||
//cx.remove_window();
|
.update(&mut cx, |_, _| {
|
||||||
});
|
// todo!()
|
||||||
//cx.update_window(window.into(), |this, cx| cx.remove_window());
|
//cx.remove_window();
|
||||||
//window.remove(&mut cx);
|
})
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(incoming_call) = incoming_call {
|
if let Some(incoming_call) = incoming_call {
|
||||||
|
@ -85,15 +84,14 @@ impl IncomingCallNotificationState {
|
||||||
let active_call = ActiveCall::global(cx);
|
let active_call = ActiveCall::global(cx);
|
||||||
if accept {
|
if accept {
|
||||||
let join = active_call.update(cx, |active_call, cx| active_call.accept_incoming(cx));
|
let join = active_call.update(cx, |active_call, cx| active_call.accept_incoming(cx));
|
||||||
let caller_user_id = self.call.calling_user.id;
|
|
||||||
let initial_project_id = self.call.initial_project.as_ref().map(|project| project.id);
|
let initial_project_id = self.call.initial_project.as_ref().map(|project| project.id);
|
||||||
let app_state = self.app_state.clone();
|
let app_state = self.app_state.clone();
|
||||||
let cx: &mut AppContext = cx;
|
let cx: &mut AppContext = cx;
|
||||||
cx.spawn(|mut cx| async move {
|
cx.spawn(|cx| async move {
|
||||||
join.await?;
|
join.await?;
|
||||||
if let Some(project_id) = initial_project_id {
|
if let Some(_project_id) = initial_project_id {
|
||||||
cx.update(|cx| {
|
cx.update(|_cx| {
|
||||||
if let Some(app_state) = app_state.upgrade() {
|
if let Some(_app_state) = app_state.upgrade() {
|
||||||
// workspace::join_remote_project(
|
// workspace::join_remote_project(
|
||||||
// project_id,
|
// project_id,
|
||||||
// caller_user_id,
|
// caller_user_id,
|
||||||
|
@ -102,7 +100,8 @@ impl IncomingCallNotificationState {
|
||||||
// )
|
// )
|
||||||
// .detach_and_log_err(cx);
|
// .detach_and_log_err(cx);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.log_err();
|
||||||
}
|
}
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue