@@ -43,7 +43,7 @@ use std::{
|
||||
use theme::ActiveTheme;
|
||||
use util::{
|
||||
async_maybe,
|
||||
channel::{parse_zed_link, ReleaseChannel, RELEASE_CHANNEL},
|
||||
channel::{parse_zed_link, AppCommitSha, ReleaseChannel, RELEASE_CHANNEL},
|
||||
http::{self, HttpClient},
|
||||
paths, ResultExt,
|
||||
};
|
||||
@@ -113,6 +113,10 @@ fn main() {
|
||||
|
||||
app.run(move |cx| {
|
||||
cx.set_global(*RELEASE_CHANNEL);
|
||||
if let Some(build_sha) = option_env!("ZED_COMMIT_SHA") {
|
||||
cx.set_global(AppCommitSha(build_sha.into()))
|
||||
}
|
||||
|
||||
cx.set_global(listener.clone());
|
||||
|
||||
load_embedded_fonts(cx);
|
||||
@@ -183,7 +187,7 @@ fn main() {
|
||||
cx.set_global(Arc::downgrade(&app_state));
|
||||
|
||||
// audio::init(Assets, cx);
|
||||
// auto_update::init(http.clone(), client::ZED_SERVER_URL.clone(), cx);
|
||||
auto_update::init(http.clone(), client::ZED_SERVER_URL.clone(), cx);
|
||||
|
||||
workspace::init(app_state.clone(), cx);
|
||||
// recent_projects::init(cx);
|
||||
|
||||
@@ -17,6 +17,7 @@ fn address() -> SocketAddr {
|
||||
ReleaseChannel::Dev => 43737,
|
||||
ReleaseChannel::Preview => 43738,
|
||||
ReleaseChannel::Stable => 43739,
|
||||
ReleaseChannel::Nightly => 43740,
|
||||
};
|
||||
|
||||
SocketAddr::V4(SocketAddrV4::new(LOCALHOST, port))
|
||||
@@ -25,6 +26,7 @@ fn address() -> SocketAddr {
|
||||
fn instance_handshake() -> &'static str {
|
||||
match *util::channel::RELEASE_CHANNEL {
|
||||
ReleaseChannel::Dev => "Zed Editor Dev Instance Running",
|
||||
ReleaseChannel::Nightly => "Zed Editor Nightly Instance Running",
|
||||
ReleaseChannel::Preview => "Zed Editor Preview Instance Running",
|
||||
ReleaseChannel::Stable => "Zed Editor Stable Instance Running",
|
||||
}
|
||||
|
||||
+10
-3
@@ -23,7 +23,7 @@ use std::{borrow::Cow, ops::Deref, sync::Arc};
|
||||
use terminal_view::terminal_panel::TerminalPanel;
|
||||
use util::{
|
||||
asset_str,
|
||||
channel::ReleaseChannel,
|
||||
channel::{AppCommitSha, ReleaseChannel},
|
||||
paths::{self, LOCAL_SETTINGS_RELATIVE_PATH},
|
||||
ResultExt,
|
||||
};
|
||||
@@ -162,7 +162,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||
// status_bar.add_right_item(cursor_position, cx);
|
||||
});
|
||||
|
||||
// auto_update::notify_of_any_new_update(cx.weak_handle(), cx);
|
||||
auto_update::notify_of_any_new_update(cx);
|
||||
|
||||
// vim::observe_keystrokes(cx);
|
||||
|
||||
@@ -432,9 +432,16 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||
}
|
||||
|
||||
fn about(_: &mut Workspace, _: &About, cx: &mut gpui::ViewContext<Workspace>) {
|
||||
use std::fmt::Write as _;
|
||||
|
||||
let app_name = cx.global::<ReleaseChannel>().display_name();
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
let prompt = cx.prompt(PromptLevel::Info, &format!("{app_name} {version}"), &["OK"]);
|
||||
let mut message = format!("{app_name} {version}");
|
||||
if let Some(sha) = cx.try_global::<AppCommitSha>() {
|
||||
write!(&mut message, "\n\n{}", sha.0).unwrap();
|
||||
}
|
||||
|
||||
let prompt = cx.prompt(PromptLevel::Info, &message, &["OK"]);
|
||||
cx.foreground_executor()
|
||||
.spawn(async {
|
||||
prompt.await.ok();
|
||||
|
||||
Reference in New Issue
Block a user