Merge pull request #936 from zed-industries/about-window

Make the 'About Zed' menu item display Zed's version number
This commit is contained in:
Max Brunsfeld 2022-04-28 16:17:51 -07:00 committed by GitHub
commit d9735f312f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,7 @@ lazy_static! {
}
pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
cx.add_action(about);
cx.add_global_action(quit);
cx.add_global_action(move |_: &IncreaseBufferFontSize, cx| {
cx.update_global::<Settings, _, _>(|settings, cx| {
@ -210,6 +211,14 @@ fn quit(_: &Quit, cx: &mut gpui::MutableAppContext) {
cx.platform().quit();
}
fn about(_: &mut Workspace, _: &About, cx: &mut gpui::ViewContext<Workspace>) {
cx.prompt(
gpui::PromptLevel::Info,
&format!("Zed {}", env!("CARGO_PKG_VERSION")),
&["OK"],
);
}
async fn install_cli(cx: &AsyncAppContext) -> Result<()> {
let cli_path = cx.platform().path_for_auxiliary_executable("cli")?;
let link_path = Path::new("/usr/local/bin/zed");