refactor(settings): remove the Updates page until an updater exists
This commit is contained in:
@@ -76,11 +76,6 @@ const NAV_GROUPS: &[NavGroup] = &[
|
|||||||
label: "POWER",
|
label: "POWER",
|
||||||
items: &[
|
items: &[
|
||||||
NavItem { icon: IconName::Asterisk, label: "Plugins", route: "ely://settings/plugins" },
|
NavItem { icon: IconName::Asterisk, label: "Plugins", route: "ely://settings/plugins" },
|
||||||
NavItem {
|
|
||||||
icon: IconName::LoaderCircle,
|
|
||||||
label: "Updates",
|
|
||||||
route: "ely://settings/updates",
|
|
||||||
},
|
|
||||||
NavItem {
|
NavItem {
|
||||||
icon: IconName::Inspector,
|
icon: IconName::Inspector,
|
||||||
label: "Advanced",
|
label: "Advanced",
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ mod sync;
|
|||||||
mod sync_controls;
|
mod sync_controls;
|
||||||
mod tab_context;
|
mod tab_context;
|
||||||
mod task_manager;
|
mod task_manager;
|
||||||
mod updates;
|
|
||||||
|
|
||||||
use ely_browser_core::BrowserSnapshot;
|
use ely_browser_core::BrowserSnapshot;
|
||||||
use ely_design_system::colors;
|
use ely_design_system::colors;
|
||||||
@@ -137,10 +136,6 @@ impl ElyShell {
|
|||||||
let content = self.render_sync_page(snapshot, cx);
|
let content = self.render_sync_page(snapshot, cx);
|
||||||
render_settings_shell(snapshot, url, content, cx)
|
render_settings_shell(snapshot, url, content, cx)
|
||||||
}
|
}
|
||||||
url @ "ely://settings/updates" => {
|
|
||||||
let content = self.render_updates_page(snapshot, cx);
|
|
||||||
render_settings_shell(snapshot, url, content, cx)
|
|
||||||
}
|
|
||||||
"ely://sync/status" => {
|
"ely://sync/status" => {
|
||||||
let content = self.render_sync_page(snapshot, cx);
|
let content = self.render_sync_page(snapshot, cx);
|
||||||
render_settings_shell(snapshot, "ely://settings/sync", content, cx)
|
render_settings_shell(snapshot, "ely://settings/sync", content, cx)
|
||||||
|
|||||||
@@ -1,143 +0,0 @@
|
|||||||
use ely_browser_core::BrowserSnapshot;
|
|
||||||
use ely_design_system::colors;
|
|
||||||
use ely_domain::UpdatePolicy;
|
|
||||||
use gpui::{AnyElement, IntoElement, ParentElement, Styled, div, px, rgb};
|
|
||||||
use gpui_component::{
|
|
||||||
IconName, Selectable, Sizable, StyledExt,
|
|
||||||
button::{Button, ButtonVariants},
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::{ElyShell, render_canvas_surface};
|
|
||||||
|
|
||||||
impl ElyShell {
|
|
||||||
pub(super) fn render_updates_page(
|
|
||||||
&mut self,
|
|
||||||
snapshot: &BrowserSnapshot,
|
|
||||||
cx: &mut gpui::Context<Self>,
|
|
||||||
) -> AnyElement {
|
|
||||||
render_canvas_surface(
|
|
||||||
div()
|
|
||||||
.size_full()
|
|
||||||
.p_8()
|
|
||||||
.flex()
|
|
||||||
.flex_col()
|
|
||||||
.gap_5()
|
|
||||||
.child(render_updates_header(cx))
|
|
||||||
.child(render_update_policy_rows(snapshot.update_policy, cx)),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_updates_header(cx: &mut gpui::Context<ElyShell>) -> AnyElement {
|
|
||||||
div()
|
|
||||||
.flex()
|
|
||||||
.items_center()
|
|
||||||
.justify_between()
|
|
||||||
.gap_4()
|
|
||||||
.child(div().text_size(px(26.0)).text_color(rgb(colors::ink())).child("Updates"))
|
|
||||||
.child(
|
|
||||||
Button::new("reset-update-settings")
|
|
||||||
.ghost()
|
|
||||||
.xsmall()
|
|
||||||
.icon(IconName::Undo2)
|
|
||||||
.label("Reset")
|
|
||||||
.tooltip("Restore Update Defaults")
|
|
||||||
.on_click(cx.listener(|shell, _, _, cx| {
|
|
||||||
shell.reset_update_settings(cx);
|
|
||||||
})),
|
|
||||||
)
|
|
||||||
.into_any_element()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_update_policy_rows(
|
|
||||||
active_policy: UpdatePolicy,
|
|
||||||
cx: &mut gpui::Context<ElyShell>,
|
|
||||||
) -> AnyElement {
|
|
||||||
div()
|
|
||||||
.flex()
|
|
||||||
.flex_col()
|
|
||||||
.border_t_1()
|
|
||||||
.border_color(rgb(colors::hairline()))
|
|
||||||
.children(
|
|
||||||
UpdatePolicy::ALL
|
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.enumerate()
|
|
||||||
.map(|(index, policy)| render_update_policy_row(index, policy, active_policy, cx)),
|
|
||||||
)
|
|
||||||
.into_any_element()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_update_policy_row(
|
|
||||||
index: usize,
|
|
||||||
policy: UpdatePolicy,
|
|
||||||
active_policy: UpdatePolicy,
|
|
||||||
cx: &mut gpui::Context<ElyShell>,
|
|
||||||
) -> AnyElement {
|
|
||||||
let selected = policy == active_policy;
|
|
||||||
|
|
||||||
div()
|
|
||||||
.py_3()
|
|
||||||
.border_b_1()
|
|
||||||
.border_color(rgb(colors::hairline()))
|
|
||||||
.flex()
|
|
||||||
.items_center()
|
|
||||||
.justify_between()
|
|
||||||
.gap_4()
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.min_w_0()
|
|
||||||
.flex()
|
|
||||||
.items_center()
|
|
||||||
.gap_3()
|
|
||||||
.child(
|
|
||||||
div().text_color(rgb(policy_icon_color(selected))).child(policy_icon(selected)),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.min_w_0()
|
|
||||||
.flex()
|
|
||||||
.flex_col()
|
|
||||||
.gap_1()
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.text_sm()
|
|
||||||
.font_semibold()
|
|
||||||
.truncate()
|
|
||||||
.text_color(rgb(colors::ink()))
|
|
||||||
.child(policy.name()),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
div()
|
|
||||||
.text_xs()
|
|
||||||
.truncate()
|
|
||||||
.text_color(rgb(colors::muted()))
|
|
||||||
.child(policy.detail()),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.child(
|
|
||||||
Button::new(("update-policy", index))
|
|
||||||
.ghost()
|
|
||||||
.xsmall()
|
|
||||||
.selected(selected)
|
|
||||||
.label(policy_button_label(selected))
|
|
||||||
.tooltip(policy.name())
|
|
||||||
.on_click(cx.listener(move |shell, _, _, cx| {
|
|
||||||
shell.set_update_policy(policy, cx);
|
|
||||||
})),
|
|
||||||
)
|
|
||||||
.into_any_element()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn policy_icon(selected: bool) -> IconName {
|
|
||||||
if selected { IconName::CircleCheck } else { IconName::LoaderCircle }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn policy_icon_color(selected: bool) -> u32 {
|
|
||||||
if selected { colors::primary() } else { colors::muted_soft() }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn policy_button_label(selected: bool) -> &'static str {
|
|
||||||
if selected { "Active" } else { "Select" }
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ use ely_browser_core::SyncEngine;
|
|||||||
use ely_domain::{
|
use ely_domain::{
|
||||||
ArchivePolicy, DEFAULT_TRANSLUCENCY_PCT, DiagnosticsReportingPolicy, DownloadPolicy,
|
ArchivePolicy, DEFAULT_TRANSLUCENCY_PCT, DiagnosticsReportingPolicy, DownloadPolicy,
|
||||||
FavoriteLimit, HistoryRecordingPolicy, NewTabDestination, ProfileId, ProfileSyncPolicy,
|
FavoriteLimit, HistoryRecordingPolicy, NewTabDestination, ProfileId, ProfileSyncPolicy,
|
||||||
SearchEngine, SyncObjectKind, SyncObjectPolicy, ThemeMode, UpdatePolicy, WallpaperTheme,
|
SearchEngine, SyncObjectKind, SyncObjectPolicy, ThemeMode, WallpaperTheme,
|
||||||
};
|
};
|
||||||
use gpui::Context;
|
use gpui::Context;
|
||||||
use gpui_component::slider::SliderValue;
|
use gpui_component::slider::SliderValue;
|
||||||
@@ -323,24 +323,6 @@ impl ElyShell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn set_update_policy(
|
|
||||||
&mut self,
|
|
||||||
update_policy: UpdatePolicy,
|
|
||||||
cx: &mut Context<Self>,
|
|
||||||
) {
|
|
||||||
if let ShellState::Ready(core) = &mut self.state {
|
|
||||||
core.set_update_policy(update_policy);
|
|
||||||
cx.notify();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn reset_update_settings(&mut self, cx: &mut Context<Self>) {
|
|
||||||
if let ShellState::Ready(core) = &mut self.state {
|
|
||||||
core.reset_update_settings();
|
|
||||||
cx.notify();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(super) fn archive_idle_tabs_now(&mut self, cx: &mut Context<Self>) {
|
pub(super) fn archive_idle_tabs_now(&mut self, cx: &mut Context<Self>) {
|
||||||
if let ShellState::Ready(core) = &mut self.state
|
if let ShellState::Ready(core) = &mut self.state
|
||||||
&& core.archive_idle_tabs(std::time::SystemTime::now()).is_ok()
|
&& core.archive_idle_tabs(std::time::SystemTime::now()).is_ok()
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ fn internal_page_title(url: &str) -> Option<&'static str> {
|
|||||||
"ely://settings/plugins" => Some("Plugin Settings"),
|
"ely://settings/plugins" => Some("Plugin Settings"),
|
||||||
"ely://settings/profiles" => Some("Profile Settings"),
|
"ely://settings/profiles" => Some("Profile Settings"),
|
||||||
"ely://settings/sync" => Some("Sync Settings"),
|
"ely://settings/sync" => Some("Sync Settings"),
|
||||||
"ely://settings/updates" => Some("Update Settings"),
|
|
||||||
"ely://sync/status" => Some("Sync Status"),
|
"ely://sync/status" => Some("Sync Status"),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
@@ -412,17 +411,6 @@ const SETTINGS_ROUTE_MATCHES: &[SettingsRouteMatch] = &[
|
|||||||
exact_terms: &["sync", "sync settings"],
|
exact_terms: &["sync", "sync settings"],
|
||||||
search_terms: &["Sync", "Local sync state and object scope.", "sync object scope"],
|
search_terms: &["Sync", "Local sync state and object scope.", "sync object scope"],
|
||||||
},
|
},
|
||||||
SettingsRouteMatch {
|
|
||||||
route: "ely://settings/updates",
|
|
||||||
exact_terms: &["update", "updates", "auto update", "auto updates", "release", "releases"],
|
|
||||||
search_terms: &[
|
|
||||||
"Updates",
|
|
||||||
"Build identity and Elydora release manifest contract.",
|
|
||||||
"build identity",
|
|
||||||
"release manifest",
|
|
||||||
"artifact integrity",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
SettingsRouteMatch {
|
SettingsRouteMatch {
|
||||||
route: "ely://settings/profiles",
|
route: "ely://settings/profiles",
|
||||||
exact_terms: &["profile", "profiles", "profile settings", "profiles settings"],
|
exact_terms: &["profile", "profiles", "profile settings", "profiles settings"],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use ely_domain::{
|
|||||||
DiagnosticsReportingPolicy, DomainError, DownloadEntry, DownloadPolicy, FavoriteLimit,
|
DiagnosticsReportingPolicy, DomainError, DownloadEntry, DownloadPolicy, FavoriteLimit,
|
||||||
HistoryEntry, HistoryRecordingPolicy, NewTabDestination, NoteEntry, Profile, ProfileId,
|
HistoryEntry, HistoryRecordingPolicy, NewTabDestination, NoteEntry, Profile, ProfileId,
|
||||||
ProfileKind, ReadingListEntry, SearchEngine, SitePermissionAuditEvent, SitePermissionEntry,
|
ProfileKind, ReadingListEntry, SearchEngine, SitePermissionAuditEvent, SitePermissionEntry,
|
||||||
Space, SpaceId, SplitLayout, SyncStatus, TabGroup, TabId, UpdatePolicy, UrlText,
|
Space, SpaceId, SplitLayout, SyncStatus, TabGroup, TabId, UrlText,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{CoreError, navigation::tab_title};
|
use crate::{CoreError, navigation::tab_title};
|
||||||
@@ -138,7 +138,6 @@ pub struct BrowserSnapshot {
|
|||||||
pub history_recording_policy: HistoryRecordingPolicy,
|
pub history_recording_policy: HistoryRecordingPolicy,
|
||||||
pub diagnostics_reporting_policy: DiagnosticsReportingPolicy,
|
pub diagnostics_reporting_policy: DiagnosticsReportingPolicy,
|
||||||
pub favorite_limit: FavoriteLimit,
|
pub favorite_limit: FavoriteLimit,
|
||||||
pub update_policy: UpdatePolicy,
|
|
||||||
pub appearance: AppearanceSettings,
|
pub appearance: AppearanceSettings,
|
||||||
pub command_query: String,
|
pub command_query: String,
|
||||||
}
|
}
|
||||||
@@ -180,7 +179,6 @@ pub struct BrowserCore {
|
|||||||
history_recording_policy: HistoryRecordingPolicy,
|
history_recording_policy: HistoryRecordingPolicy,
|
||||||
diagnostics_reporting_policy: DiagnosticsReportingPolicy,
|
diagnostics_reporting_policy: DiagnosticsReportingPolicy,
|
||||||
favorite_limit: FavoriteLimit,
|
favorite_limit: FavoriteLimit,
|
||||||
update_policy: UpdatePolicy,
|
|
||||||
appearance: AppearanceSettings,
|
appearance: AppearanceSettings,
|
||||||
sync_object_policies: SyncObjectPolicies,
|
sync_object_policies: SyncObjectPolicies,
|
||||||
sync_connection_state: ely_domain::SyncConnectionState,
|
sync_connection_state: ely_domain::SyncConnectionState,
|
||||||
@@ -233,7 +231,6 @@ impl BrowserCore {
|
|||||||
history_recording_policy: HistoryRecordingPolicy::default(),
|
history_recording_policy: HistoryRecordingPolicy::default(),
|
||||||
diagnostics_reporting_policy: DiagnosticsReportingPolicy::default(),
|
diagnostics_reporting_policy: DiagnosticsReportingPolicy::default(),
|
||||||
favorite_limit: FavoriteLimit::default(),
|
favorite_limit: FavoriteLimit::default(),
|
||||||
update_policy: UpdatePolicy::default(),
|
|
||||||
appearance: AppearanceSettings::default(),
|
appearance: AppearanceSettings::default(),
|
||||||
sync_object_policies: SyncObjectPolicies::default(),
|
sync_object_policies: SyncObjectPolicies::default(),
|
||||||
sync_connection_state: ely_domain::SyncConnectionState::SignedOut,
|
sync_connection_state: ely_domain::SyncConnectionState::SignedOut,
|
||||||
@@ -386,7 +383,6 @@ impl BrowserCore {
|
|||||||
history_recording_policy: self.history_recording_policy,
|
history_recording_policy: self.history_recording_policy,
|
||||||
diagnostics_reporting_policy: self.diagnostics_reporting_policy,
|
diagnostics_reporting_policy: self.diagnostics_reporting_policy,
|
||||||
favorite_limit: self.favorite_limit,
|
favorite_limit: self.favorite_limit,
|
||||||
update_policy: self.update_policy,
|
|
||||||
appearance: self.appearance,
|
appearance: self.appearance,
|
||||||
command_query: self.command_query.clone(),
|
command_query: self.command_query.clone(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use ely_domain::{
|
use ely_domain::{
|
||||||
AppearanceSettings, ArchivePolicy, DEFAULT_SIDEBAR_WIDTH_PX, FavoriteLimit, NewTabDestination,
|
AppearanceSettings, ArchivePolicy, DEFAULT_SIDEBAR_WIDTH_PX, FavoriteLimit, NewTabDestination,
|
||||||
SearchEngine, ThemeMode, UpdatePolicy, WallpaperTheme,
|
SearchEngine, ThemeMode, WallpaperTheme,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::BrowserCore;
|
use super::BrowserCore;
|
||||||
@@ -50,19 +50,6 @@ impl BrowserCore {
|
|||||||
self.favorite_limit
|
self.favorite_limit
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_update_policy(&mut self, update_policy: UpdatePolicy) {
|
|
||||||
self.update_policy = update_policy;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn reset_update_settings(&mut self) {
|
|
||||||
self.set_update_policy(UpdatePolicy::default());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
pub fn update_policy(&self) -> UpdatePolicy {
|
|
||||||
self.update_policy
|
|
||||||
}
|
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn appearance(&self) -> AppearanceSettings {
|
pub fn appearance(&self) -> AppearanceSettings {
|
||||||
self.appearance
|
self.appearance
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use ely_browser_core::{BrowserCore, InitialBrowserConfig};
|
|||||||
use ely_domain::{
|
use ely_domain::{
|
||||||
ArchivePolicy, DEFAULT_SIDEBAR_WIDTH_PX, DiagnosticsReportingPolicy, DownloadPolicy,
|
ArchivePolicy, DEFAULT_SIDEBAR_WIDTH_PX, DiagnosticsReportingPolicy, DownloadPolicy,
|
||||||
FavoriteLimit, HistoryRecordingPolicy, NewTabDestination, ProfileKind, ProfileSyncPolicy,
|
FavoriteLimit, HistoryRecordingPolicy, NewTabDestination, ProfileKind, ProfileSyncPolicy,
|
||||||
SearchEngine, SyncObjectKind, SyncObjectPolicy, UpdatePolicy,
|
SearchEngine, SyncObjectKind, SyncObjectPolicy,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -51,9 +51,6 @@ fn section_resets_restore_settings_defaults() -> Result<(), Box<dyn Error>> {
|
|||||||
core.reset_sync_settings();
|
core.reset_sync_settings();
|
||||||
assert_eq!(core.sync_object_policy(SyncObjectKind::Tabs), SyncObjectPolicy::Enabled);
|
assert_eq!(core.sync_object_policy(SyncObjectKind::Tabs), SyncObjectPolicy::Enabled);
|
||||||
|
|
||||||
core.set_update_policy(UpdatePolicy::Manual);
|
|
||||||
core.reset_update_settings();
|
|
||||||
assert_eq!(core.snapshot()?.update_policy, UpdatePolicy::Automatic);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -213,32 +213,11 @@ fn settings_scoped_search_opens_site_permissions_page() -> Result<(), Box<dyn Er
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn settings_scoped_search_opens_updates_page() -> Result<(), Box<dyn Error>> {
|
|
||||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
|
||||||
|
|
||||||
core.set_command_query("@settings updates");
|
|
||||||
let intent = core.submit_command()?;
|
|
||||||
let active_tab = core.active_tab()?;
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
intent,
|
|
||||||
Some(CommandIntent::ScopedSearch {
|
|
||||||
scope: CommandScope::Settings,
|
|
||||||
query: "updates".to_string(),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
assert_eq!(active_tab.title(), "Update Settings");
|
|
||||||
assert_eq!(active_tab.url().as_str(), "ely://settings/updates");
|
|
||||||
assert_eq!(core.snapshot()?.command_query, "");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn settings_scoped_search_matches_setting_description_terms() -> Result<(), Box<dyn Error>> {
|
fn settings_scoped_search_matches_setting_description_terms() -> Result<(), Box<dyn Error>> {
|
||||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||||
|
|
||||||
core.set_command_query("@settings build identity");
|
core.set_command_query("@settings sync object scope");
|
||||||
let intent = core.submit_command()?;
|
let intent = core.submit_command()?;
|
||||||
let active_tab = core.active_tab()?;
|
let active_tab = core.active_tab()?;
|
||||||
|
|
||||||
@@ -246,11 +225,11 @@ fn settings_scoped_search_matches_setting_description_terms() -> Result<(), Box<
|
|||||||
intent,
|
intent,
|
||||||
Some(CommandIntent::ScopedSearch {
|
Some(CommandIntent::ScopedSearch {
|
||||||
scope: CommandScope::Settings,
|
scope: CommandScope::Settings,
|
||||||
query: "build identity".to_string(),
|
query: "sync object scope".to_string(),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
assert_eq!(active_tab.title(), "Update Settings");
|
assert_eq!(active_tab.title(), "Sync Settings");
|
||||||
assert_eq!(active_tab.url().as_str(), "ely://settings/updates");
|
assert_eq!(active_tab.url().as_str(), "ely://settings/sync");
|
||||||
assert_eq!(core.snapshot()?.command_query, "");
|
assert_eq!(core.snapshot()?.command_query, "");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ mod split;
|
|||||||
mod sync;
|
mod sync;
|
||||||
mod tab;
|
mod tab;
|
||||||
mod tab_group;
|
mod tab_group;
|
||||||
mod update;
|
|
||||||
mod url_text;
|
mod url_text;
|
||||||
|
|
||||||
pub use appearance::{
|
pub use appearance::{
|
||||||
@@ -72,5 +71,4 @@ pub use tab::{
|
|||||||
ZOOM_PERCENT_STEP, parse_title_unread_count, validate_zoom_percent,
|
ZOOM_PERCENT_STEP, parse_title_unread_count, validate_zoom_percent,
|
||||||
};
|
};
|
||||||
pub use tab_group::TabGroup;
|
pub use tab_group::TabGroup;
|
||||||
pub use update::UpdatePolicy;
|
|
||||||
pub use url_text::UrlText;
|
pub use url_text::UrlText;
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
|
||||||
pub enum UpdatePolicy {
|
|
||||||
#[default]
|
|
||||||
Automatic,
|
|
||||||
Manual,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl UpdatePolicy {
|
|
||||||
pub const ALL: &[Self] = &[Self::Automatic, Self::Manual];
|
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
pub fn name(self) -> &'static str {
|
|
||||||
match self {
|
|
||||||
Self::Automatic => "Automatic",
|
|
||||||
Self::Manual => "Manual",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[must_use]
|
|
||||||
pub fn detail(self) -> &'static str {
|
|
||||||
match self {
|
|
||||||
Self::Automatic => "Use release manifests as the automatic update source.",
|
|
||||||
Self::Manual => "Keep release manifest checks user-initiated.",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user