Wire log view to database for transaction persistence
Initialize SQLite database at XDG data directory on app startup. Categories now load from database with emoji icons. Save button validates input, inserts transaction, shows toast notification, clears the form, and refreshes the recent transactions list.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
use adw::prelude::*;
|
||||
use outlay_core::db::Database;
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::log_view::LogView;
|
||||
|
||||
@@ -25,12 +27,12 @@ const SIDEBAR_ITEMS: &[SidebarItem] = &[
|
||||
];
|
||||
|
||||
impl MainWindow {
|
||||
pub fn new(app: &adw::Application) -> Self {
|
||||
pub fn new(app: &adw::Application, db: Rc<Database>) -> Self {
|
||||
let content_stack = gtk::Stack::new();
|
||||
content_stack.set_transition_type(gtk::StackTransitionType::Crossfade);
|
||||
|
||||
// Log view - real widget
|
||||
let log_view = LogView::new();
|
||||
let log_view = LogView::new(db);
|
||||
let log_scroll = gtk::ScrolledWindow::builder()
|
||||
.hscrollbar_policy(gtk::PolicyType::Never)
|
||||
.child(&log_view.container)
|
||||
|
||||
Reference in New Issue
Block a user