Show private projects in the contacts panel
Introduce a ProjectStore that lets you iterate through all open projects. Allow projects to be made public by clicking the lock.
This commit is contained in:
parent
a60fef52c4
commit
7ef9de32b1
14 changed files with 627 additions and 309 deletions
|
@ -23,7 +23,7 @@ use gpui::{executor::Background, App, AssetSource, AsyncAppContext, Task};
|
|||
use isahc::{config::Configurable, AsyncBody, Request};
|
||||
use log::LevelFilter;
|
||||
use parking_lot::Mutex;
|
||||
use project::Fs;
|
||||
use project::{Fs, ProjectStore};
|
||||
use serde_json::json;
|
||||
use settings::{self, KeymapFileContent, Settings, SettingsFileContent};
|
||||
use smol::process::Command;
|
||||
|
@ -136,6 +136,7 @@ fn main() {
|
|||
let client = client::Client::new(http.clone());
|
||||
let mut languages = languages::build_language_registry(login_shell_env_loaded);
|
||||
let user_store = cx.add_model(|cx| UserStore::new(client.clone(), http.clone(), cx));
|
||||
let project_store = cx.add_model(|_| ProjectStore::default());
|
||||
|
||||
context_menu::init(cx);
|
||||
auto_update::init(http, client::ZED_SERVER_URL.clone(), cx);
|
||||
|
@ -195,6 +196,7 @@ fn main() {
|
|||
themes,
|
||||
client: client.clone(),
|
||||
user_store,
|
||||
project_store,
|
||||
fs,
|
||||
build_window_options,
|
||||
initialize_workspace,
|
||||
|
|
|
@ -181,7 +181,12 @@ pub fn initialize_workspace(
|
|||
|
||||
let project_panel = ProjectPanel::new(workspace.project().clone(), cx);
|
||||
let contact_panel = cx.add_view(|cx| {
|
||||
ContactsPanel::new(app_state.user_store.clone(), workspace.weak_handle(), cx)
|
||||
ContactsPanel::new(
|
||||
app_state.user_store.clone(),
|
||||
app_state.project_store.clone(),
|
||||
workspace.weak_handle(),
|
||||
cx,
|
||||
)
|
||||
});
|
||||
|
||||
workspace.left_sidebar().update(cx, |sidebar, cx| {
|
||||
|
@ -298,6 +303,7 @@ fn open_config_file(
|
|||
false,
|
||||
app_state.client.clone(),
|
||||
app_state.user_store.clone(),
|
||||
app_state.project_store.clone(),
|
||||
app_state.languages.clone(),
|
||||
app_state.fs.clone(),
|
||||
cx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue