pub struct CleanSysGui {Show 18 fields
pub categories: Vec<CleanerCategory>,
pub logs: Vec<String>,
pub total_bytes_cleaned: u64,
pub is_running: bool,
pub is_root: bool,
pub needs_password: bool,
pub password_input: String,
pub password_error: Option<String>,
pub pending_root_ops: Vec<(usize, usize)>,
pub active_tab: usize,
pub theme_index: usize,
pub confirm_run_pending: bool,
pub previewing: bool,
pub preview_open: bool,
pub preview_results: Vec<(String, CleaningResult)>,
pub operations_total: usize,
pub operations_completed: usize,
pub needs_admin_notice: bool,
}Expand description
Top-level state for the CleanSys GUI application.
Fields§
§categories: Vec<CleanerCategory>Cleaner categories and items (shared domain model from cleansys-core).
logs: Vec<String>Rolling log of operation messages shown in the activity panel.
total_bytes_cleaned: u64Total bytes freed across all completed operations in the current run.
is_running: boolWhether cleaners are currently running.
is_root: boolWhether the process is running with root/administrator privileges.
needs_password: boolWhether the sudo authentication dialog is visible.
password_input: StringThe password currently typed into the authentication dialog.
password_error: Option<String>Error message shown in the authentication dialog, if any.
pending_root_ops: Vec<(usize, usize)>Operations queued to run once sudo authentication succeeds.
active_tab: usizeIndex of the currently active category tab.
theme_index: usizeIndex of the currently selected UI theme (see cleansys_core::THEME_NAMES).
confirm_run_pending: boolWhether the “confirm this run” dialog is visible.
previewing: boolWhether a preview (dry-run) is currently being computed.
preview_open: boolWhether the preview results dialog is visible.
preview_results: Vec<(String, CleaningResult)>Results of the most recent preview run: (cleaner_name, result).
operations_total: usizeTotal number of operations in the current run (for the progress bar).
operations_completed: usizeNumber of operations completed so far in the current run.
needs_admin_notice: boolWhether the “needs Administrator” notice is visible (Windows only; Windows has no interactive sudo-password flow, so this replaces the password dialog when elevation is required there).
Implementations§
Source§impl CleanSysGui
impl CleanSysGui
Sourcepub fn selected_count(&self) -> usize
pub fn selected_count(&self) -> usize
Number of currently selected items across all categories.
Sourcepub fn selected_count_in(&self, cat_idx: usize) -> usize
pub fn selected_count_in(&self, cat_idx: usize) -> usize
Number of currently selected items within a specific category.
Sourcepub fn selection_needs_root(&self) -> bool
pub fn selection_needs_root(&self) -> bool
True if any selected item requires root and we don’t already have it.
Sourcepub fn selected_indices(&self) -> Vec<(usize, usize)>
pub fn selected_indices(&self) -> Vec<(usize, usize)>
(category_index, item_index) pairs of every currently-selected item.
Sourcepub fn progress_fraction(&self) -> f32
pub fn progress_fraction(&self) -> f32
Fraction of the current run’s operations completed so far, in
0.0..=1.0. 0.0 when no run is in progress.
Sourcepub fn supports_sudo_prompt(&self) -> bool
pub fn supports_sudo_prompt(&self) -> bool
Whether this platform supports the interactive sudo-password elevation flow (Unix). Windows uses UAC/Administrator tokens instead.
Sourcepub fn push_log(&mut self, line: impl Into<String>)
pub fn push_log(&mut self, line: impl Into<String>)
Push a line to the activity log, keeping only the most recent entries.
Sourcepub fn mark_selected_pending(&mut self)
pub fn mark_selected_pending(&mut self)
Mark every selected item as Status::Pending in preparation for a run.
Sourcepub fn colors(&self) -> ThemeColors
pub fn colors(&self) -> ThemeColors
Derive the full ThemeColors from the currently active core theme.
Call this at the top of view functions: let c = state.colors();
Sourcepub fn iced_theme(&self) -> Theme
pub fn iced_theme(&self) -> Theme
Return a custom iced::Theme derived from the active core theme, for
the top-level iced::application(...).theme(...) callback.
Sourcepub fn current_theme_name(&self) -> &'static str
pub fn current_theme_name(&self) -> &'static str
The display name of the currently active theme.
Sourcepub fn current_settings(&self) -> Settings
pub fn current_settings(&self) -> Settings
Build the full cleansys_core::Settings snapshot for the current
state (theme + selected cleaners), for persistence.
Sourcepub fn save_theme(&self)
pub fn save_theme(&self)
Persist the current theme and cleaner selections to settings.json
(best-effort; failures are logged but never surfaced to the UI).
A no-op under cfg(test) so unit tests never touch the real
~/.config/cleansys/settings.json (see the comment in Self::new).
Sourcepub fn save_selections(&self)
pub fn save_selections(&self)
Persist the current cleaner selections (and theme) to settings.json.
A no-op under cfg(test) — see Self::save_theme.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CleanSysGui
impl RefUnwindSafe for CleanSysGui
impl Send for CleanSysGui
impl Sync for CleanSysGui
impl Unpin for CleanSysGui
impl UnsafeUnpin for CleanSysGui
impl UnwindSafe for CleanSysGui
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.