App

Struct App 

Source
pub struct App<'a> {
Show 36 fields pub storage: &'a Storage, pub settings: &'a Settings, pub paths: &'a EnvelopePaths, pub should_quit: bool, pub active_view: ActiveView, pub focused_panel: FocusedPanel, pub input_mode: InputMode, pub active_dialog: ActiveDialog, pub selected_account: Option<AccountId>, pub selected_account_index: usize, pub selected_transaction: Option<TransactionId>, pub selected_transaction_index: usize, pub selected_category: Option<CategoryId>, pub selected_category_index: usize, pub current_period: BudgetPeriod, pub budget_header_display: BudgetHeaderDisplay, pub show_archived: bool, pub multi_select_mode: bool, pub selected_transactions: Vec<TransactionId>, pub scroll_offset: usize, pub status_message: Option<String>, pub command_input: String, pub command_results: Vec<usize>, pub selected_command_index: usize, pub transaction_form: TransactionFormState, pub move_funds_state: MoveFundsState, pub bulk_categorize_state: BulkCategorizeState, pub reconciliation_state: ReconciliationState, pub reconcile_start_state: ReconcileStartState, pub adjustment_dialog_state: AdjustmentDialogState, pub account_form: AccountFormState, pub category_form: CategoryFormState, pub group_form: GroupFormState, pub budget_dialog_state: BudgetDialogState, pub income_form: IncomeFormState, pub pending_g: bool,
}
Expand description

Main application state

Fields§

§storage: &'a Storage

The storage layer

§settings: &'a Settings

Application settings

§paths: &'a EnvelopePaths

Paths configuration

§should_quit: bool

Whether the app should quit

§active_view: ActiveView

Currently active view

§focused_panel: FocusedPanel

Which panel is focused

§input_mode: InputMode

Current input mode

§active_dialog: ActiveDialog

Currently active dialog

§selected_account: Option<AccountId>

Selected account (if any)

§selected_account_index: usize

Selected account index in the list

§selected_transaction: Option<TransactionId>

Selected transaction (if any)

§selected_transaction_index: usize

Selected transaction index in the register

§selected_category: Option<CategoryId>

Selected category (for budget view)

§selected_category_index: usize

Selected category index

§current_period: BudgetPeriod

Current budget period being viewed

§budget_header_display: BudgetHeaderDisplay

What to display in the budget header (toggle between ATB and account balances)

§show_archived: bool

Show archived accounts

§multi_select_mode: bool

Multi-selection mode (for bulk operations)

§selected_transactions: Vec<TransactionId>

Selected transaction IDs for bulk operations

§scroll_offset: usize

Scroll offset for the main view

§status_message: Option<String>

Status message to display

§command_input: String

Command palette input

§command_results: Vec<usize>

Filtered commands for palette

§selected_command_index: usize

Selected command index in palette

§transaction_form: TransactionFormState

Transaction form state

§move_funds_state: MoveFundsState

Move funds dialog state

§bulk_categorize_state: BulkCategorizeState

Bulk categorize dialog state

§reconciliation_state: ReconciliationState

Reconciliation view state

§reconcile_start_state: ReconcileStartState

Reconcile start dialog state

§adjustment_dialog_state: AdjustmentDialogState

Adjustment dialog state

§account_form: AccountFormState

Account form dialog state

§category_form: CategoryFormState

Category form dialog state

§group_form: GroupFormState

Group form dialog state

§budget_dialog_state: BudgetDialogState

Unified budget dialog state (period budget + target)

§income_form: IncomeFormState

Income form dialog state

§pending_g: bool

Pending ‘g’ keypress for Vim-style gg (go to top)

Implementations§

Source§

impl<'a> App<'a>

Source

pub fn new( storage: &'a Storage, settings: &'a Settings, paths: &'a EnvelopePaths, ) -> Self

Create a new App instance

Source

pub fn quit(&mut self)

Request to quit the application

Source

pub fn set_status(&mut self, message: impl Into<String>)

Set a status message

Source

pub fn clear_status(&mut self)

Clear the status message

Source

pub fn switch_view(&mut self, view: ActiveView)

Switch to a different view

Source

pub fn toggle_panel_focus(&mut self)

Toggle focus between sidebar and main panel

Source

pub fn ensure_selection_initialized(&mut self)

Ensure selection is initialized for the current view

Source

pub fn open_dialog(&mut self, dialog: ActiveDialog)

Open a dialog

Source

pub fn close_dialog(&mut self)

Close the current dialog

Source

pub fn has_dialog(&self) -> bool

Check if a dialog is active

Source

pub fn move_up(&mut self)

Move selection up in the current view

Source

pub fn move_down(&mut self, max: usize)

Move selection down in the current view

Source

pub fn prev_period(&mut self)

Go to previous budget period

Source

pub fn next_period(&mut self)

Go to next budget period

Source

pub fn toggle_multi_select(&mut self)

Toggle multi-select mode

Source

pub fn toggle_transaction_selection(&mut self)

Toggle selection of current transaction in multi-select mode

Auto Trait Implementations§

§

impl<'a> Freeze for App<'a>

§

impl<'a> RefUnwindSafe for App<'a>

§

impl<'a> Send for App<'a>

§

impl<'a> Sync for App<'a>

§

impl<'a> Unpin for App<'a>

§

impl<'a> UnwindSafe for App<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.