Add update policy controls
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use ely_domain::{
|
||||
ArchivePolicy, DownloadPolicy, FavoriteLimit, HistoryRecordingPolicy, NewTabDestination,
|
||||
ProfileId, ProfileSyncPolicy, SearchEngine, SyncObjectKind, SyncObjectPolicy,
|
||||
ProfileId, ProfileSyncPolicy, SearchEngine, SyncObjectKind, SyncObjectPolicy, UpdatePolicy,
|
||||
};
|
||||
use gpui::Context;
|
||||
|
||||
@@ -151,6 +151,24 @@ 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>) {
|
||||
if let ShellState::Ready(core) = &mut self.state
|
||||
&& core.archive_idle_tabs(std::time::SystemTime::now()).is_ok()
|
||||
|
||||
Reference in New Issue
Block a user