pub struct DotfileSelectionScreen { /* private fields */ }Expand description
Dotfile selection screen controller.
Implementations§
Source§impl DotfileSelectionScreen
impl DotfileSelectionScreen
Sourcepub fn get_state(&self) -> &DotfileSelectionState
pub fn get_state(&self) -> &DotfileSelectionState
Get the current state.
Sourcepub fn get_state_mut(&mut self) -> &mut DotfileSelectionState
pub fn get_state_mut(&mut self) -> &mut DotfileSelectionState
Get mutable state.
Sourcepub fn set_backup_enabled(&mut self, enabled: bool)
pub fn set_backup_enabled(&mut self, enabled: bool)
Set backup enabled state.
Sourcepub fn process_action(
&mut self,
action: DotfileAction,
config: &mut Config,
config_path: &Path,
) -> Result<ActionResult>
pub fn process_action( &mut self, action: DotfileAction, config: &mut Config, config_path: &Path, ) -> Result<ActionResult>
Process a dotfile action and return the result.
This is the main dispatcher for all dotfile-related actions.
Sourcepub fn scan_dotfiles(&mut self, config: &Config) -> Result<()>
pub fn scan_dotfiles(&mut self, config: &Config) -> Result<()>
Scan for dotfiles and update the state.
Sourcepub fn refresh_file_browser(&mut self, _config: &Config) -> Result<()>
pub fn refresh_file_browser(&mut self, _config: &Config) -> Result<()>
Refresh the file browser entries.
Sourcepub fn toggle_file_sync(
&mut self,
config: &Config,
file_index: usize,
is_synced: bool,
) -> Result<ActionResult>
pub fn toggle_file_sync( &mut self, config: &Config, file_index: usize, is_synced: bool, ) -> Result<ActionResult>
Toggle file sync status (add or remove from sync).
Sourcepub fn add_custom_file_to_sync(
&mut self,
config: &mut Config,
config_path: &Path,
full_path: PathBuf,
relative_path: String,
) -> Result<ActionResult>
pub fn add_custom_file_to_sync( &mut self, config: &mut Config, config_path: &Path, full_path: PathBuf, relative_path: String, ) -> Result<ActionResult>
Add a custom file to sync.
Sourcepub fn move_to_common(
&mut self,
config: &Config,
file_index: usize,
is_common: bool,
profiles_to_cleanup: Vec<String>,
) -> Result<ActionResult>
pub fn move_to_common( &mut self, config: &Config, file_index: usize, is_common: bool, profiles_to_cleanup: Vec<String>, ) -> Result<ActionResult>
Move a file to/from common.
Trait Implementations§
Source§impl Default for DotfileSelectionScreen
impl Default for DotfileSelectionScreen
Source§impl Screen for DotfileSelectionScreen
impl Screen for DotfileSelectionScreen
Source§fn render(
&mut self,
frame: &mut Frame<'_>,
area: Rect,
ctx: &RenderContext<'_>,
) -> Result<()>
fn render( &mut self, frame: &mut Frame<'_>, area: Rect, ctx: &RenderContext<'_>, ) -> Result<()>
Render the screen. Read more
Source§fn handle_event(
&mut self,
event: Event,
ctx: &ScreenContext<'_>,
) -> Result<ScreenAction>
fn handle_event( &mut self, event: Event, ctx: &ScreenContext<'_>, ) -> Result<ScreenAction>
Handle an input event. Read more
Source§fn is_input_focused(&self) -> bool
fn is_input_focused(&self) -> bool
Check if a text input is currently focused. Read more
Auto Trait Implementations§
impl Forget for DotfileSelectionScreen
impl Freeze for DotfileSelectionScreen
impl Move for DotfileSelectionScreen
impl RefUnwindSafe for DotfileSelectionScreen
impl Send for DotfileSelectionScreen
impl Sync for DotfileSelectionScreen
impl Unpin for DotfileSelectionScreen
impl UnsafeUnpin for DotfileSelectionScreen
impl UnwindSafe for DotfileSelectionScreen
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
Mutably borrows from an owned value. Read more
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more