Rename settings::register_setting -> settings::register
This commit is contained in:
parent
2d5f03e148
commit
258723566f
12 changed files with 12 additions and 12 deletions
|
@ -77,7 +77,7 @@ impl Setting for AutoUpdateSetting {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppContext) {
|
pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppContext) {
|
||||||
settings::register_setting::<AutoUpdateSetting>(cx);
|
settings::register::<AutoUpdateSetting>(cx);
|
||||||
|
|
||||||
if let Some(version) = (*ZED_APP_VERSION).or_else(|| cx.platform().app_version().ok()) {
|
if let Some(version) = (*ZED_APP_VERSION).or_else(|| cx.platform().app_version().ok()) {
|
||||||
let auto_updater = cx.add_model(|cx| {
|
let auto_updater = cx.add_model(|cx| {
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub const CONNECTION_TIMEOUT: Duration = Duration::from_secs(5);
|
||||||
actions!(client, [SignIn, SignOut]);
|
actions!(client, [SignIn, SignOut]);
|
||||||
|
|
||||||
pub fn init_settings(cx: &mut AppContext) {
|
pub fn init_settings(cx: &mut AppContext) {
|
||||||
settings::register_setting::<TelemetrySettings>(cx);
|
settings::register::<TelemetrySettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
|
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
|
||||||
|
|
|
@ -290,7 +290,7 @@ pub enum Direction {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init_settings(cx: &mut AppContext) {
|
pub fn init_settings(cx: &mut AppContext) {
|
||||||
settings::register_setting::<EditorSettings>(cx);
|
settings::register::<EditorSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ impl settings::Setting for JournalSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
|
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||||
settings::register_setting::<JournalSettings>(cx);
|
settings::register::<JournalSettings>(cx);
|
||||||
|
|
||||||
cx.add_global_action(move |_: &NewJournalEntry, cx| new_journal_entry(app_state.clone(), cx));
|
cx.add_global_action(move |_: &NewJournalEntry, cx| new_journal_entry(app_state.clone(), cx));
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use std::{num::NonZeroU32, path::Path, sync::Arc};
|
use std::{num::NonZeroU32, path::Path, sync::Arc};
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
settings::register_setting::<AllLanguageSettings>(cx);
|
settings::register::<AllLanguageSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn language_settings<'a>(language: Option<&str>, cx: &'a AppContext) -> &'a LanguageSettings {
|
pub fn language_settings<'a>(language: Option<&str>, cx: &'a AppContext) -> &'a LanguageSettings {
|
||||||
|
|
|
@ -390,7 +390,7 @@ impl FormatTrigger {
|
||||||
|
|
||||||
impl Project {
|
impl Project {
|
||||||
pub fn init_settings(cx: &mut AppContext) {
|
pub fn init_settings(cx: &mut AppContext) {
|
||||||
settings::register_setting::<ProjectSettings>(cx);
|
settings::register::<ProjectSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
|
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ use gpui::{executor::Background, AppContext, AssetSource};
|
||||||
use std::{borrow::Cow, io::ErrorKind, path::PathBuf, str, sync::Arc, time::Duration};
|
use std::{borrow::Cow, io::ErrorKind, path::PathBuf, str, sync::Arc, time::Duration};
|
||||||
use util::{paths, ResultExt};
|
use util::{paths, ResultExt};
|
||||||
|
|
||||||
pub fn register_setting<T: Setting>(cx: &mut AppContext) {
|
pub fn register<T: Setting>(cx: &mut AppContext) {
|
||||||
cx.update_global::<SettingsStore, _, _>(|store, cx| {
|
cx.update_global::<SettingsStore, _, _>(|store, cx| {
|
||||||
store.register_setting::<T>(cx);
|
store.register_setting::<T>(cx);
|
||||||
});
|
});
|
||||||
|
|
|
@ -116,7 +116,7 @@ impl EventListener for ZedListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
settings::register_setting::<TerminalSettings>(cx);
|
settings::register::<TerminalSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub fn current(cx: &AppContext) -> Arc<Theme> {
|
||||||
|
|
||||||
pub fn init(source: impl AssetSource, cx: &mut AppContext) {
|
pub fn init(source: impl AssetSource, cx: &mut AppContext) {
|
||||||
cx.set_global(ThemeRegistry::new(source, cx.font_cache().clone()));
|
cx.set_global(ThemeRegistry::new(source, cx.font_cache().clone()));
|
||||||
settings::register_setting::<ThemeSettings>(cx);
|
settings::register::<ThemeSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
|
|
|
@ -42,7 +42,7 @@ actions!(vim, [Tab, Enter]);
|
||||||
impl_actions!(vim, [Number, SwitchMode, PushOperator]);
|
impl_actions!(vim, [Number, SwitchMode, PushOperator]);
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
settings::register_setting::<VimModeSetting>(cx);
|
settings::register::<VimModeSetting>(cx);
|
||||||
|
|
||||||
editor_events::init(cx);
|
editor_events::init(cx);
|
||||||
normal::init(cx);
|
normal::init(cx);
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub use base_keymap_setting::BaseKeymap;
|
||||||
pub const FIRST_OPEN: &str = "first_open";
|
pub const FIRST_OPEN: &str = "first_open";
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
settings::register_setting::<BaseKeymap>(cx);
|
settings::register::<BaseKeymap>(cx);
|
||||||
|
|
||||||
cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {
|
cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {
|
||||||
let welcome_page = cx.add_view(|cx| WelcomePage::new(workspace, cx));
|
let welcome_page = cx.add_view(|cx| WelcomePage::new(workspace, cx));
|
||||||
|
|
|
@ -185,7 +185,7 @@ pub type WorkspaceId = i64;
|
||||||
impl_actions!(workspace, [ActivatePane]);
|
impl_actions!(workspace, [ActivatePane]);
|
||||||
|
|
||||||
pub fn init_settings(cx: &mut AppContext) {
|
pub fn init_settings(cx: &mut AppContext) {
|
||||||
settings::register_setting::<WorkspaceSettings>(cx);
|
settings::register::<WorkspaceSettings>(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
|
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue