Add update policy controls
This commit is contained in:
@@ -19,6 +19,7 @@ mod split;
|
||||
mod sync;
|
||||
mod tab;
|
||||
mod tab_group;
|
||||
mod update;
|
||||
mod url_text;
|
||||
|
||||
pub use archive::{ArchiveSource, ArchivedTab};
|
||||
@@ -57,4 +58,5 @@ pub use sync::{
|
||||
};
|
||||
pub use tab::{BrowserTab, TabFlags, TabState};
|
||||
pub use tab_group::TabGroup;
|
||||
pub use update::UpdatePolicy;
|
||||
pub use url_text::UrlText;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#[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