@@ -13,6 +13,7 @@ use super::dialogs::budget::BudgetDialogState;
1313use super :: dialogs:: bulk_categorize:: BulkCategorizeState ;
1414use super :: dialogs:: category:: CategoryFormState ;
1515use super :: dialogs:: group:: GroupFormState ;
16+ use super :: dialogs:: income:: IncomeFormState ;
1617use super :: dialogs:: move_funds:: MoveFundsState ;
1718use super :: dialogs:: reconcile_start:: ReconcileStartState ;
1819use super :: dialogs:: transaction:: TransactionFormState ;
@@ -135,6 +136,7 @@ pub enum ActiveDialog {
135136 UnlockConfirm ( UnlockConfirmState ) ,
136137 Adjustment ,
137138 Budget ,
139+ Income ,
138140}
139141
140142/// Main application state
@@ -241,6 +243,9 @@ pub struct App<'a> {
241243 /// Unified budget dialog state (period budget + target)
242244 pub budget_dialog_state : BudgetDialogState ,
243245
246+ /// Income form dialog state
247+ pub income_form : IncomeFormState ,
248+
244249 /// Pending 'g' keypress for Vim-style gg (go to top)
245250 pub pending_g : bool ,
246251}
@@ -290,6 +295,7 @@ impl<'a> App<'a> {
290295 category_form : CategoryFormState :: new ( ) ,
291296 group_form : GroupFormState :: new ( ) ,
292297 budget_dialog_state : BudgetDialogState :: new ( ) ,
298+ income_form : IncomeFormState :: new ( ) ,
293299 pending_g : false ,
294300 }
295301 }
@@ -540,6 +546,12 @@ impl<'a> App<'a> {
540546 }
541547 }
542548 }
549+ ActiveDialog :: Income => {
550+ // Initialize income dialog for current period
551+ self . income_form
552+ . init_for_period ( & self . current_period , self . storage ) ;
553+ self . input_mode = InputMode :: Editing ;
554+ }
543555 _ => { }
544556 }
545557 }
0 commit comments